diff --git a/docs/contributing/using-instrumenter-api.md b/docs/contributing/using-instrumenter-api.md index e3f86eb0ebd4..779c5cd4f773 100644 --- a/docs/contributing/using-instrumenter-api.md +++ b/docs/contributing/using-instrumenter-api.md @@ -420,8 +420,8 @@ method. ### Disable the instrumentation In some rare cases it may be useful to completely disable the constructed `Instrumenter`, for -example, based on a configuration property. The `InstrumenterBuilder` exposes a `setDisabled()` -method for that: passing `true` will turn the newly created `Instrumenter` into a no-op instance. +example, based on a configuration property. The `InstrumenterBuilder` exposes a `setEnabled()` +method for that: passing `false` will turn the newly created `Instrumenter` into a no-op instance. ### Finally, set the span kind with the `SpanKindExtractor` and get a new `Instrumenter`! diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java index 6c70542ce84b..f3a89bab13d4 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java @@ -23,13 +23,22 @@ public ExperimentalConfig(Config config) { this.config = config; } - public boolean suppressControllerSpans() { + public boolean controllerTelemetryEnabled() { + // TODO: remove that `suppress...` flag after 1.13 release + boolean suppressControllerSpans = + config.getBoolean( + "otel.instrumentation.common.experimental.suppress-controller-spans", false); return config.getBoolean( - "otel.instrumentation.common.experimental.suppress-controller-spans", false); + "otel.instrumentation.common.experimental.controller-telemetry.enabled", + !suppressControllerSpans); } - public boolean suppressViewSpans() { - return config.getBoolean("otel.instrumentation.common.experimental.suppress-view-spans", false); + public boolean viewTelemetryEnabled() { + // TODO: remove that `suppress...` flag after 1.13 release + boolean suppressViewSpans = + config.getBoolean("otel.instrumentation.common.experimental.suppress-view-spans", false); + return config.getBoolean( + "otel.instrumentation.common.experimental.view-telemetry.enabled", !suppressViewSpans); } public boolean messagingReceiveInstrumentationEnabled() { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/Instrumenter.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/Instrumenter.java index 8d2fe5b55ac5..b69bed631c53 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/Instrumenter.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/Instrumenter.java @@ -107,7 +107,7 @@ public static InstrumenterBuilder builder private final List requestListeners; private final ErrorCauseExtractor errorCauseExtractor; @Nullable private final TimeExtractor timeExtractor; - private final boolean disabled; + private final boolean enabled; private final SpanSuppressionStrategy spanSuppressionStrategy; Instrumenter(InstrumenterBuilder builder) { @@ -123,7 +123,7 @@ public static InstrumenterBuilder builder this.requestListeners = new ArrayList<>(builder.requestListeners); this.errorCauseExtractor = builder.errorCauseExtractor; this.timeExtractor = builder.timeExtractor; - this.disabled = builder.disabled; + this.enabled = builder.enabled; this.spanSuppressionStrategy = builder.getSpanSuppressionStrategy(); } @@ -134,7 +134,7 @@ public static InstrumenterBuilder builder * without calling those methods. */ public boolean shouldStart(Context parentContext, REQUEST request) { - if (disabled) { + if (!enabled) { return false; } SpanKind spanKind = spanKindExtractor.extract(request); diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java index bd9c5d5475b3..1edae5faca8d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java @@ -55,7 +55,7 @@ public final class InstrumenterBuilder { SpanStatusExtractor.getDefault(); ErrorCauseExtractor errorCauseExtractor = ErrorCauseExtractor.jdk(); @Nullable TimeExtractor timeExtractor = null; - boolean disabled = false; + boolean enabled = true; private boolean enableSpanSuppressionByType = ENABLE_SPAN_SUPPRESSION_BY_TYPE; @@ -159,11 +159,25 @@ public InstrumenterBuilder setTimeExtractor( return this; } - public InstrumenterBuilder setDisabled(boolean disabled) { - this.disabled = disabled; + /** + * Allows enabling/disabling the {@link Instrumenter} based on the {@code enabled} value passed as + * parameter. All instrumenters are enabled by default. + */ + public InstrumenterBuilder setEnabled(boolean enabled) { + this.enabled = enabled; return this; } + /** + * Allows to disable the {@link Instrumenter}. + * + * @deprecated Use {@link #setEnabled(boolean)} instead. + */ + @Deprecated + public InstrumenterBuilder setDisabled(boolean disabled) { + return setEnabled(!disabled); + } + // visible for tests /** * Enables CLIENT nested span suppression based on the instrumentation type. diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java index c03823cf1018..bb0eb3afc097 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java @@ -518,6 +518,17 @@ void shouldUseContextCustomizer() { assertThat(context.get(testKey)).isEqualTo("testVal"); } + @Test + void shouldDisableInstrumenter() { + Instrumenter instrumenter = + Instrumenter.builder( + otelTesting.getOpenTelemetry(), "test", request -> "test span") + .setEnabled(false) + .newInstrumenter(); + + assertThat(instrumenter.shouldStart(Context.root(), "request")).isFalse(); + } + @Test void clientNestedSpansSuppressed_whenInstrumentationTypeDisabled() { // this test depends on default config option for InstrumentationType diff --git a/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java b/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java index bacd2c3c534f..9d00a3a946ab 100644 --- a/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java +++ b/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java @@ -17,7 +17,7 @@ public final class DropwizardSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, DropwizardSingletons::spanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); private static String spanName(View view) { diff --git a/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java b/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java index 6446e2fa213a..d68191f99a05 100644 --- a/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java +++ b/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java @@ -18,7 +18,7 @@ public final class GrailsSingletons { INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, HandlerData::spanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java b/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java index 52350e8f6c43..fae85492e008 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java +++ b/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java @@ -31,7 +31,7 @@ public final class JaxrsSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxrsSingletons.java b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxrsSingletons.java index 4f532376bf1d..c8fa75022ba6 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxrsSingletons.java +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxrsSingletons.java @@ -31,7 +31,7 @@ public final class JaxrsSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java index 3341260d3d71..a4713e3e48e4 100644 --- a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java +++ b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java @@ -18,7 +18,7 @@ public class Axis2Singletons { INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, Axis2Request::spanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java b/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java index 85ee8d45e290..2ae2b90251e5 100644 --- a/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java +++ b/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java @@ -18,7 +18,7 @@ public class CxfSingletons { INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, CxfRequest::spanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java index 1687af1836bc..de4c3824ade7 100644 --- a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java +++ b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java @@ -18,7 +18,7 @@ public class MetroSingletons { INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, MetroRequest::spanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jaxws/jaxws-common/library/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsSingletons.java b/instrumentation/jaxws/jaxws-common/library/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsSingletons.java index 5b97d5681990..f35b80c3ed1b 100644 --- a/instrumentation/jaxws/jaxws-common/library/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsSingletons.java +++ b/instrumentation/jaxws/jaxws-common/library/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsSingletons.java @@ -25,7 +25,7 @@ public class JaxWsSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java b/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java index 86dfa5296033..a2441437d269 100644 --- a/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java +++ b/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java @@ -46,7 +46,7 @@ private static Instrumenter buildConsumerInstrumen MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) .setTimeExtractor(new JmsMessageTimeExtractor()) - .setDisabled(!ExperimentalConfig.get().messagingReceiveInstrumentationEnabled()) + .setEnabled(ExperimentalConfig.get().messagingReceiveInstrumentationEnabled()) .newInstrumenter(SpanKindExtractor.alwaysConsumer()); } diff --git a/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java b/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java index 2fa14640ef2a..63028f8e2f06 100644 --- a/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java +++ b/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java @@ -21,7 +21,7 @@ public class MojarraSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, JsfRequest::spanName) .setErrorCauseExtractor(new JsfErrorCauseExtractor()) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java b/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java index 49e45646d037..61c6f9e2af36 100644 --- a/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java +++ b/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java @@ -20,7 +20,7 @@ public class MyFacesSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, JsfRequest::spanName) .setErrorCauseExtractor(new MyFacesErrorCauseExtractor()) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java index c5ddeac9ec97..581352e44993 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java @@ -71,7 +71,7 @@ public static Instrumenter createConsumerReceiveInstrumen .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) .addAttributesExtractors(extractors) .setTimeExtractor(new KafkaConsumerTimeExtractor()) - .setDisabled(!ExperimentalConfig.get().messagingReceiveInstrumentationEnabled()) + .setEnabled(ExperimentalConfig.get().messagingReceiveInstrumentationEnabled()) .newInstrumenter(SpanKindExtractor.alwaysConsumer()); } diff --git a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java index 5037a3801a9f..42f4c85a3b27 100644 --- a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java +++ b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java @@ -30,7 +30,7 @@ public final class WebfluxSingletons { } INSTRUMENTER = - builder.setDisabled(ExperimentalConfig.get().suppressControllerSpans()).newInstrumenter(); + builder.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()).newInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java b/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java index b64eb2e595d6..bcadaf0f963e 100644 --- a/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java +++ b/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java @@ -21,7 +21,7 @@ public final class SpringWebMvcSingletons { HANDLER_INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, new HandlerSpanNameExtractor()) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); MODEL_AND_VIEW_INSTRUMENTER = @@ -30,7 +30,7 @@ public final class SpringWebMvcSingletons { INSTRUMENTATION_NAME, new ModelAndViewSpanNameExtractor()) .addAttributesExtractor(new ModelAndViewAttributesExtractor()) - .setDisabled(ExperimentalConfig.get().suppressViewSpans()) + .setEnabled(ExperimentalConfig.get().viewTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java b/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java index a0c643fbde49..3d44ab4df9ef 100644 --- a/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java +++ b/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java @@ -25,7 +25,7 @@ public class SpringWsSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java b/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java index 105ad3ce1f88..6a65b13ca1e4 100644 --- a/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java +++ b/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java @@ -26,7 +26,7 @@ public class StrutsSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java b/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java index 29ad24784d7a..0860921fc261 100644 --- a/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java +++ b/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java @@ -27,7 +27,7 @@ public class TapestrySingletons { } return ErrorCauseExtractor.jdk().extractCause(error); }) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); } diff --git a/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java b/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java index 9e61a29b34bf..067230c8b50c 100644 --- a/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java +++ b/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java @@ -36,14 +36,14 @@ public class VaadinSingletons { GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(clientCallableAttributesGetter)) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .addAttributesExtractor(CodeAttributesExtractor.create(clientCallableAttributesGetter)) .newInstrumenter(); REQUEST_HANDLER_INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, VaadinHandlerRequest::getSpanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) // add context for tracking nested request handler calls .addContextCustomizer( (context, vaadinHandlerRequest, startAttributes) -> @@ -53,13 +53,13 @@ public class VaadinSingletons { RPC_INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, VaadinSingletons::rpcSpanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .newInstrumenter(); SERVICE_INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, VaadinServiceRequest::getSpanName) - .setDisabled(ExperimentalConfig.get().suppressControllerSpans()) + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) // add context for tracking whether any request handler handled the request .addContextCustomizer( (context, vaadinServiceRequest, startAttributes) ->