Simply logging test configuration
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
@@ -8,6 +8,7 @@ package io.opentelemetry.javaagent.testing.exporter;
import com.google.auto.service.AutoService;
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer;
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider;
+import io.opentelemetry.sdk.logs.export.SimpleLogProcessor;
import io.opentelemetry.sdk.metrics.export.MetricReader;
import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader;
import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor;
@@ -36,5 +37,10 @@ public class AgentTestingCustomizer implements AutoConfigurationCustomizerProvid
autoConfigurationCustomizer.addMeterProviderCustomizer(
(meterProvider, config) -> meterProvider.registerMetricReader(metricReader));
+
+ autoConfigurationCustomizer.addLogEmitterProviderCustomizer(
+ (logProvider, config) ->
+ logProvider.addLogProcessor(
+ SimpleLogProcessor.create(AgentTestingExporterFactory.logExporter)));
}
}

DELETE
testing/agent-exporter/src/main/java/io/opentelemetry/javaagent/testing/exporter/AgentTestingLogsCustomizer.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.javaagent.testing.exporter;
-
-import com.google.auto.service.AutoService;
-import io.opentelemetry.instrumentation.api.config.Config;
-import io.opentelemetry.instrumentation.sdk.appender.internal.DelegatingLogEmitterProvider;
-import io.opentelemetry.javaagent.bootstrap.AgentLogEmitterProvider;
-import io.opentelemetry.javaagent.extension.AgentListener;
-import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
-import io.opentelemetry.sdk.logs.SdkLogEmitterProvider;
-import io.opentelemetry.sdk.logs.export.SimpleLogProcessor;
-
-@AutoService(AgentListener.class)
-public class AgentTestingLogsCustomizer implements AgentListener {
-
- @Override
- public void beforeAgent(
- Config config, AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
-
- SdkLogEmitterProvider logEmitterProvider =
- SdkLogEmitterProvider.builder()
- .setResource(autoConfiguredOpenTelemetrySdk.getResource())
- .addLogProcessor(SimpleLogProcessor.create(AgentTestingExporterFactory.logExporter))
- .build();
-
- AgentLogEmitterProvider.resetForTest();
- AgentLogEmitterProvider.set(DelegatingLogEmitterProvider.from(logEmitterProvider));
- }
-}

Simply logging test configuration (#5996)