diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v4_8/RocketMqClientHooks.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v4_8/RocketMqClientHooks.java index 097c9ff64e61..0528fdd52191 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v4_8/RocketMqClientHooks.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v4_8/RocketMqClientHooks.java @@ -9,39 +9,21 @@ import io.opentelemetry.instrumentation.rocketmqclient.v4_8.RocketMqTelemetry; import io.opentelemetry.javaagent.bootstrap.internal.ExperimentalConfig; import io.opentelemetry.javaagent.bootstrap.internal.InstrumentationConfig; -import java.util.logging.Logger; import org.apache.rocketmq.client.hook.ConsumeMessageHook; import org.apache.rocketmq.client.hook.SendMessageHook; public final class RocketMqClientHooks { - private static final Logger logger = Logger.getLogger(RocketMqClientHooks.class.getName()); - @SuppressWarnings("deprecation") // call to deprecated method will be removed in the future private static final RocketMqTelemetry TELEMETRY = RocketMqTelemetry.builder(GlobalOpenTelemetry.get()) .setCapturedHeaders(ExperimentalConfig.get().getMessagingHeaders()) - .setPropagationEnabled( - InstrumentationConfig.get() - .getBoolean("otel.instrumentation.rocketmq-client.propagation", true)) .setCaptureExperimentalSpanAttributes( InstrumentationConfig.get() .getBoolean( "otel.instrumentation.rocketmq-client.experimental-span-attributes", false)) .build(); - static { - if (InstrumentationConfig.get().getString("otel.instrumentation.rocketmq-client.propagation") - != null) { - logger.warning( - "The \"otel.instrumentation.rocketmq-client.propagation\" configuration property has" - + " been deprecated and will be removed in a future version." - + " If you have a need for this configuration property, please open an issue in the" - + " opentelemetry-java-instrumentation repository:" - + " https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues"); - } - } - public static final ConsumeMessageHook CONSUME_MESSAGE_HOOK = TELEMETRY.newTracingConsumeMessageHook(); diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java index 7807a67f58f6..d3a96e0647e6 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java @@ -31,8 +31,7 @@ class RocketMqInstrumenterFactory { static Instrumenter createProducerInstrumenter( OpenTelemetry openTelemetry, List capturedHeaders, - boolean captureExperimentalSpanAttributes, - boolean propagationEnabled) { + boolean captureExperimentalSpanAttributes) { RocketMqProducerAttributeGetter getter = RocketMqProducerAttributeGetter.INSTANCE; MessageOperation operation = MessageOperation.PUBLISH; @@ -49,18 +48,13 @@ static Instrumenter createProducerInstrumenter( RocketMqProducerExperimentalAttributeExtractor.INSTANCE); } - if (propagationEnabled) { - return instrumenterBuilder.buildProducerInstrumenter(MapSetter.INSTANCE); - } else { - return instrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysProducer()); - } + return instrumenterBuilder.buildProducerInstrumenter(MapSetter.INSTANCE); } static RocketMqConsumerInstrumenter createConsumerInstrumenter( OpenTelemetry openTelemetry, List capturedHeaders, - boolean captureExperimentalSpanAttributes, - boolean propagationEnabled) { + boolean captureExperimentalSpanAttributes) { InstrumenterBuilder batchReceiveInstrumenterBuilder = Instrumenter.builder( @@ -70,17 +64,9 @@ static RocketMqConsumerInstrumenter createConsumerInstrumenter( return new RocketMqConsumerInstrumenter( createProcessInstrumenter( - openTelemetry, - capturedHeaders, - captureExperimentalSpanAttributes, - propagationEnabled, - false), + openTelemetry, capturedHeaders, captureExperimentalSpanAttributes, false), createProcessInstrumenter( - openTelemetry, - capturedHeaders, - captureExperimentalSpanAttributes, - propagationEnabled, - true), + openTelemetry, capturedHeaders, captureExperimentalSpanAttributes, true), batchReceiveInstrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysConsumer())); } @@ -88,7 +74,6 @@ private static Instrumenter createProcessInstrumenter( OpenTelemetry openTelemetry, List capturedHeaders, boolean captureExperimentalSpanAttributes, - boolean propagationEnabled, boolean batch) { RocketMqConsumerAttributeGetter getter = RocketMqConsumerAttributeGetter.INSTANCE; @@ -106,10 +91,6 @@ private static Instrumenter createProcessInstrumenter( builder.addAttributesExtractor(RocketMqConsumerExperimentalAttributeExtractor.INSTANCE); } - if (!propagationEnabled) { - return builder.buildInstrumenter(SpanKindExtractor.alwaysConsumer()); - } - if (batch) { SpanLinksExtractor spanLinksExtractor = new PropagatorBasedSpanLinksExtractor<>( diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetry.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetry.java index 750054563d03..e13f8eb2225e 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetry.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetry.java @@ -33,14 +33,13 @@ public static RocketMqTelemetryBuilder builder(OpenTelemetry openTelemetry) { RocketMqTelemetry( OpenTelemetry openTelemetry, List capturedHeaders, - boolean captureExperimentalSpanAttributes, - boolean propagationEnabled) { + boolean captureExperimentalSpanAttributes) { rocketMqConsumerInstrumenter = RocketMqInstrumenterFactory.createConsumerInstrumenter( - openTelemetry, capturedHeaders, captureExperimentalSpanAttributes, propagationEnabled); + openTelemetry, capturedHeaders, captureExperimentalSpanAttributes); rocketMqProducerInstrumenter = RocketMqInstrumenterFactory.createProducerInstrumenter( - openTelemetry, capturedHeaders, captureExperimentalSpanAttributes, propagationEnabled); + openTelemetry, capturedHeaders, captureExperimentalSpanAttributes); } /** diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetryBuilder.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetryBuilder.java index 264b564f5f0a..856969aa8ade 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetryBuilder.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqTelemetryBuilder.java @@ -18,7 +18,6 @@ public final class RocketMqTelemetryBuilder { private List capturedHeaders = emptyList(); private boolean captureExperimentalSpanAttributes; - private boolean propagationEnabled = true; RocketMqTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; @@ -36,21 +35,6 @@ public RocketMqTelemetryBuilder setCaptureExperimentalSpanAttributes( return this; } - /** - * Sets whether the trace context should be written from producers / read from consumers for - * propagating through messaging. - * - * @deprecated if you have a need for this configuration option please open an issue in the opentelemetry-java-instrumentation - * repository. - */ - @Deprecated - @CanIgnoreReturnValue - public RocketMqTelemetryBuilder setPropagationEnabled(boolean propagationEnabled) { - this.propagationEnabled = propagationEnabled; - return this; - } - /** * Configures the messaging headers that will be captured as span attributes. * @@ -67,7 +51,6 @@ public RocketMqTelemetryBuilder setCapturedHeaders(List capturedHeaders) * RocketMqTelemetryBuilder}. */ public RocketMqTelemetry build() { - return new RocketMqTelemetry( - openTelemetry, capturedHeaders, captureExperimentalSpanAttributes, propagationEnabled); + return new RocketMqTelemetry(openTelemetry, capturedHeaders, captureExperimentalSpanAttributes); } }