Skip to content

Commit 43ca719

Browse files
authored
Allow disabling spring-webmvc instrumentation (#4109)
1 parent b589a5e commit 43ca719

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ private static void enableInstrumentations(
203203
properties.put("otel.instrumentation.servlet.enabled", "true");
204204
properties.put("otel.instrumentation.spring-core.enabled", "true");
205205
properties.put("otel.instrumentation.spring-web.enabled", "true");
206-
properties.put("otel.instrumentation.spring-webmvc.enabled", "true");
206+
if (otelConfig.getBoolean("otel.instrumentation.spring-webmvc.enabled", true)) {
207+
// as a workaround for
208+
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/13249
209+
properties.put("otel.instrumentation.spring-webmvc.enabled", "true");
210+
}
207211
properties.put("otel.instrumentation.spring-webflux.enabled", "true");
208212
properties.put("otel.instrumentation.tomcat.enabled", "true");
209213
properties.put("otel.instrumentation.undertow.enabled", "true");

0 commit comments

Comments
 (0)