Skip to content

Commit 24b7be6

Browse files
committed
Small config story cleanup
1 parent ff1b24d commit 24b7be6

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,6 @@ public Map<String, String> apply(ConfigProperties otelConfig) {
104104
properties.put("applicationinsights.internal.methods.include", sb.toString());
105105
}
106106

107-
properties.put("otel.propagators", DelegatingPropagatorProvider.NAME);
108-
109-
properties.put("otel.traces.sampler", DelegatingSamplerProvider.NAME);
110-
111-
String tracesExporter = otelConfig.getString("otel.traces.exporter");
112-
if (tracesExporter == null) {
113-
// this overrides the default "otlp" so the exporter can be configured later
114-
properties.put("otel.traces.exporter", "none");
115-
}
116-
117-
String metricsExporter = otelConfig.getString("otel.metrics.exporter");
118-
if (metricsExporter == null) {
119-
// this overrides the default "otlp" so the exporter can be configured later
120-
properties.put("otel.metrics.exporter", "none");
121-
}
122-
123-
String logsExporter = otelConfig.getString("otel.logs.exporter");
124-
if (logsExporter == null) {
125-
// this overrides the default "otlp" so the exporter can be configured later
126-
properties.put("otel.logs.exporter", "none");
127-
}
128107

129108
if (configuration.role.name != null) {
130109
// in case using another exporter

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/SecondEntryPoint.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
245245
.addPropertiesSupplier(
246246
() -> {
247247
Map<String, String> props = new HashMap<>();
248+
props.put("otel.propagators", DelegatingPropagatorProvider.NAME);
249+
props.put("otel.traces.sampler", DelegatingSamplerProvider.NAME);
248250
props.put("otel.traces.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);
249251
props.put("otel.metrics.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);
250252
props.put("otel.logs.exporter", AzureMonitorExporterProviderKeys.EXPORTER_NAME);

0 commit comments

Comments
 (0)