Suppress PeriodicMetricReader debug logging
MODIFY
conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts
conventions/src/main/kotlin/io.opentelemetry.instrumentation.javaagent-testing.gradle.kts
@@ -91,6 +91,9 @@ class JavaagentTestArgumentsProvider(
// in smoke tests instead.
"-Dotel.javaagent.add-thread-details=false",
"-Dotel.metrics.exporter=otlp",
+ // suppress repeated logging of "No metric data to export - skipping export."
+ // since PeriodicMetricReader is configured with a short interval
+ "-Dio.opentelemetry.javaagent.slf4j.simpleLogger.log.io.opentelemetry.sdk.metrics.export.PeriodicMetricReader=INFO",
// suppress a couple of verbose ClassNotFoundException stack traces logged at debug level
"-Dio.opentelemetry.javaagent.slf4j.simpleLogger.log.io.grpc.internal.ServerImplBuilder=INFO",
"-Dio.opentelemetry.javaagent.slf4j.simpleLogger.log.io.grpc.internal.ManagedChannelImplBuilder=INFO",

MODIFY
testing/agent-exporter/src/main/java/io/opentelemetry/javaagent/testing/exporter/AgentTestingCustomizer.java
testing/agent-exporter/src/main/java/io/opentelemetry/javaagent/testing/exporter/AgentTestingCustomizer.java
@@ -34,13 +34,6 @@ public class AgentTestingCustomizer implements AutoConfigurationCustomizerProvid
autoConfigurationCustomizer.addTracerProviderCustomizer(
(tracerProvider, config) -> tracerProvider.addSpanProcessor(spanProcessor));
- // as we configure PeriodicMetricReader with a short interval it repeatedly logs
- // No metric data to export - skipping export.
- // to get rid of these log lines we change PeriodicMetricReader log level from DEBUG to INFO
- System.setProperty(
- "io.opentelemetry.javaagent.slf4j.simpleLogger.log.io.opentelemetry.sdk.metrics.export.PeriodicMetricReader",
- "INFO");
-
autoConfigurationCustomizer.addMeterProviderCustomizer(
(meterProvider, config) -> meterProvider.registerMetricReader(metricReader));
}

Suppress PeriodicMetricReader debug logging (#5934)