From 7b98085955044ec9d661eddff9e30a41d7a4f474 Mon Sep 17 00:00:00 2001 From: Helen <56097766+heyams@users.noreply.github.com> Date: Thu, 18 May 2023 12:44:54 -0700 Subject: [PATCH] Add capability to turn off logback instrumentation (#3082) --- .../agent/internal/init/AiConfigCustomizer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java index df789a7b482..e1efbce07c0 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java @@ -25,7 +25,7 @@ public Map apply(ConfigProperties otelConfig) { "applicationinsights.internal.micrometer.step.millis", Long.toString(SECONDS.toMillis(configuration.metricIntervalSeconds))); - enableInstrumentations(configuration, properties); + enableInstrumentations(otelConfig, configuration, properties); if (!configuration.preview.captureControllerSpans) { properties.put( @@ -116,7 +116,8 @@ public Map apply(ConfigProperties otelConfig) { return properties; } - private static void enableInstrumentations(Configuration config, Map properties) { + private static void enableInstrumentations( + ConfigProperties otelConfig, Configuration config, Map properties) { properties.put("otel.instrumentation.common.default-enabled", "false"); properties.put("otel.instrumentation.experimental.span-suppression-strategy", "client"); @@ -148,7 +149,9 @@ private static void enableInstrumentations(Configuration config, Map