Skip to content

Commit e8ec93c

Browse files
committed
Optimization
1 parent e8e2711 commit e8ec93c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public void configure(SdkTracerProviderBuilder tracerProvider) {
121121
// it is used to pass legacy attributes from the context (extracted by the AiLegacyPropagator)
122122
// to the span attributes (since there is no way to update attributes on span directly from
123123
// propagator)
124-
tracerProvider.addSpanProcessor(new AiLegacyHeaderSpanProcessor());
124+
if (config.preview.legacyRequestIdPropagation.enabled) {
125+
tracerProvider.addSpanProcessor(new AiLegacyHeaderSpanProcessor());
126+
}
125127
// using BatchSpanProcessor in order to get off of the application thread as soon as possible
126128
// using batch size 1 because need to convert to SpanData as soon as possible to grab data for
127129
// live metrics. the real batching is done at a lower level

0 commit comments

Comments
 (0)