Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import static java.util.concurrent.TimeUnit.SECONDS;

import com.microsoft.applicationinsights.agent.internal.configuration.Configuration;
import com.microsoft.applicationinsights.agent.internal.legacyheaders.DelegatingPropagatorProvider;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -104,28 +103,6 @@ public Map<String, String> apply(ConfigProperties otelConfig) {
properties.put("applicationinsights.internal.methods.include", sb.toString());
}

properties.put("otel.propagators", DelegatingPropagatorProvider.NAME);

properties.put("otel.traces.sampler", DelegatingSamplerProvider.NAME);

String tracesExporter = otelConfig.getString("otel.traces.exporter");
if (tracesExporter == null) {
// this overrides the default "otlp" so the exporter can be configured later
properties.put("otel.traces.exporter", "none");
}

String metricsExporter = otelConfig.getString("otel.metrics.exporter");
if (metricsExporter == null) {
// this overrides the default "otlp" so the exporter can be configured later
properties.put("otel.metrics.exporter", "none");
}

String logsExporter = otelConfig.getString("otel.logs.exporter");
if (logsExporter == null) {
// this overrides the default "otlp" so the exporter can be configured later
properties.put("otel.logs.exporter", "none");
}

if (configuration.role.name != null) {
// in case using another exporter
properties.put("otel.service.name", configuration.role.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.microsoft.applicationinsights.agent.internal.exporter.AgentSpanExporter;
import com.microsoft.applicationinsights.agent.internal.httpclient.LazyHttpClient;
import com.microsoft.applicationinsights.agent.internal.legacyheaders.AiLegacyHeaderSpanProcessor;
import com.microsoft.applicationinsights.agent.internal.legacyheaders.DelegatingPropagatorProvider;
import com.microsoft.applicationinsights.agent.internal.processors.ExporterWithLogProcessor;
import com.microsoft.applicationinsights.agent.internal.processors.ExporterWithSpanProcessor;
import com.microsoft.applicationinsights.agent.internal.processors.LogExporterWithAttributeProcessor;
Expand Down Expand Up @@ -245,6 +246,8 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
.addPropertiesSupplier(
() -> {
Map<String, String> props = new HashMap<>();
props.put("otel.propagators", DelegatingPropagatorProvider.NAME);
props.put("otel.traces.sampler", DelegatingSamplerProvider.NAME);
props.put("otel.traces.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);
props.put("otel.metrics.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);
props.put("otel.logs.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);
Expand Down