Skip to content

Commit 6c0356e

Browse files
xiang17github-actions[bot]
authored andcommitted
remove setting env var and pass parameter instead
1 parent 53ef474 commit 6c0356e

File tree

1 file changed

+1
-4
lines changed
  • agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,9 @@ private static MetricExporter buildMetricExporter(
374374
boolean otlpEnabled = (otelMetricsExporter != null && !otelMetricsExporter.isEmpty()) &&
375375
(otelMetricsEndpoint != null && !otelMetricsEndpoint.isEmpty());
376376

377-
// Set system property that MetricDataMapper can read
378-
System.setProperty(SENT_TO_AMW, Boolean.toString(otlpEnabled));
379-
380377
MetricDataMapper mapper =
381378
new MetricDataMapper(
382-
telemetryClient::populateDefaults, configuration.preview.captureHttpServer4xxAsError);
379+
telemetryClient::populateDefaults, configuration.preview.captureHttpServer4xxAsError, otlpEnabled);
383380
return new AgentMetricExporter(
384381
metricFilters, mapper, telemetryClient.getMetricsBatchItemProcessor());
385382
}

0 commit comments

Comments
 (0)