File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0
jaxrs-2.0/jaxrs-2.0-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0
jaxrs-3.0/jaxrs-3.0-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v3_0 Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ dependencies {
2525 testImplementation(" io.dropwizard:dropwizard-testing:0.7.1" )
2626 testImplementation(" javax.xml.bind:jaxb-api:2.2.3" )
2727}
28+
2829tasks.withType<Test >().configureEach {
2930 jvmArgs(" -Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true" )
3031}
Original file line number Diff line number Diff line change 1010import static net .bytebuddy .matcher .ElementMatchers .not ;
1111
1212import com .google .auto .service .AutoService ;
13+ import io .opentelemetry .javaagent .bootstrap .internal .ExperimentalConfig ;
1314import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1415import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
16+ import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
1517import java .util .List ;
1618import net .bytebuddy .matcher .ElementMatcher ;
1719
@@ -31,4 +33,12 @@ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
3133 public List <TypeInstrumentation > typeInstrumentations () {
3234 return singletonList (new JaxrsAnnotationsInstrumentation ());
3335 }
36+
37+ @ Override
38+ public boolean defaultEnabled (ConfigProperties config ) {
39+ // This instrumentation produces controller telemetry and sets http route. Http route is set by
40+ // this instrumentation only when it was not already set by a jax-rs framework instrumentation.
41+ // This instrumentation uses complex type matcher, disabling it can improve startup performance.
42+ return ExperimentalConfig .get ().controllerTelemetryEnabled ();
43+ }
3444}
Original file line number Diff line number Diff line change 99import static java .util .Arrays .asList ;
1010
1111import com .google .auto .service .AutoService ;
12+ import io .opentelemetry .javaagent .bootstrap .internal .ExperimentalConfig ;
1213import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1314import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
15+ import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
1416import java .util .List ;
1517import net .bytebuddy .matcher .ElementMatcher ;
1618
@@ -34,4 +36,12 @@ public List<TypeInstrumentation> typeInstrumentations() {
3436 new JaxrsAnnotationsInstrumentation (),
3537 new JaxrsAsyncResponseInstrumentation ());
3638 }
39+
40+ @ Override
41+ public boolean defaultEnabled (ConfigProperties config ) {
42+ // This instrumentation produces controller telemetry and sets http route. Http route is set by
43+ // this instrumentation only when it was not already set by a jax-rs framework instrumentation.
44+ // This instrumentation uses complex type matcher, disabling it can improve startup performance.
45+ return ExperimentalConfig .get ().controllerTelemetryEnabled ();
46+ }
3747}
Original file line number Diff line number Diff line change 99import static java .util .Arrays .asList ;
1010
1111import com .google .auto .service .AutoService ;
12+ import io .opentelemetry .javaagent .bootstrap .internal .ExperimentalConfig ;
1213import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1314import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
15+ import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
1416import java .util .List ;
1517import net .bytebuddy .matcher .ElementMatcher ;
1618
@@ -34,4 +36,12 @@ public List<TypeInstrumentation> typeInstrumentations() {
3436 new JaxrsAnnotationsInstrumentation (),
3537 new JaxrsAsyncResponseInstrumentation ());
3638 }
39+
40+ @ Override
41+ public boolean defaultEnabled (ConfigProperties config ) {
42+ // This instrumentation produces controller telemetry and sets http route. Http route is set by
43+ // this instrumentation only when it was not already set by a jax-rs framework instrumentation.
44+ // This instrumentation uses complex type matcher, disabling it can improve startup performance.
45+ return ExperimentalConfig .get ().controllerTelemetryEnabled ();
46+ }
3747}
You can’t perform that action at this time.
0 commit comments