Skip to content

Commit

Permalink
Disable jaxws annotation instrumentation when controller telemetry is…
Browse files Browse the repository at this point in the history
… not enabled (#10193)
  • Loading branch information
laurit authored Jan 9, 2024
1 parent 7864847 commit 9c1de50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {
library("javax.jws:javax.jws-api:1.1")
implementation(project(":instrumentation:jaxws:jaxws-common:javaagent"))
}

tasks.withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
package io.opentelemetry.javaagent.instrumentation.jaxws.jws.v1_1;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.bootstrap.internal.ExperimentalConfig;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import java.util.Collections;
import java.util.List;

Expand All @@ -22,4 +24,10 @@ public JwsInstrumentationModule() {
public List<TypeInstrumentation> typeInstrumentations() {
return Collections.singletonList(new JwsAnnotationsInstrumentation());
}

@Override
public boolean defaultEnabled(ConfigProperties config) {
// this instrumentation only produces controller telemetry
return ExperimentalConfig.get().controllerTelemetryEnabled();
}
}

0 comments on commit 9c1de50

Please sign in to comment.