From 68c6abba65c843b91eb91489e834719e83acf1fd Mon Sep 17 00:00:00 2001 From: brunobat Date: Wed, 21 Dec 2022 12:43:42 +0000 Subject: [PATCH] fix regressions from dev mode reload --- .../deployment/OpenTelemetryProcessor.java | 17 +---------- .../InstrumentationProcessor.java | 14 ++++----- .../OpenTelemetryIdGeneratorTest.java | 25 +++++++--------- .../OpenTelemetryPropagatorsTest.java | 11 +++---- .../GrpcOpenTelemetryTest.java | 11 +++++-- .../RestClientOpenTelemetryTest.java | 1 + .../EventBusInstrumenterVertxTracer.java | 29 ++++--------------- .../vertx/HttpInstrumenterVertxTracer.java | 29 ++++--------------- .../SqlClientInstrumenterVertxTracer.java | 23 ++------------- .../wrapper/DevModeOpenTelemetryWrapper.java | 28 ------------------ .../vertx/wrapper/OpenTelemetryWrapper.java | 11 ------- .../wrapper/RuntimeOpenTelemetryWrapper.java | 16 ---------- 12 files changed, 45 insertions(+), 170 deletions(-) delete mode 100644 extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/DevModeOpenTelemetryWrapper.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/OpenTelemetryWrapper.java delete mode 100644 extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/RuntimeOpenTelemetryWrapper.java diff --git a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java index 1d2531202ac9d..429306c3f753a 100644 --- a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java +++ b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java @@ -10,17 +10,6 @@ import java.util.Set; import java.util.function.Predicate; -import io.opentelemetry.api.OpenTelemetry; -import io.quarkus.runtime.RuntimeValue; -import io.quarkus.deployment.builditem.ShutdownContextBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerIdGeneratorBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerResourceBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerSamplerBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerSpanExportersBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerSpanProcessorsBuildItem; -import io.quarkus.opentelemetry.runtime.config.build.OtelBuildConfig; -import io.quarkus.opentelemetry.runtime.config.runtime.OtelRuntimeConfig; -import io.quarkus.opentelemetry.runtime.tracing.intrumentation.InstrumentationRecorder; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.AnnotationValue; @@ -193,11 +182,7 @@ void createOpenTelemetry( RuntimeValue openTelemetry = recorder.createOpenTelemetry(shutdownContextBuildItem); recorder.eagerlyCreateContextStorage(); - - // just checking for live reload would bypass the OpenTelemetryDevModeTest - if (launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT) { - instrumentationRecorder.setTracerDevMode(instrumentationRecorder.createTracers()); - } + recorder.storeVertxOnContextStorage(vertx.getVertx()); instrumentationRecorder.setTracerDevMode(instrumentationRecorder.createTracers(openTelemetry)); } diff --git a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java index d16679e987565..661c2c64aa26c 100644 --- a/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java +++ b/extensions/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/tracing/instrumentation/InstrumentationProcessor.java @@ -26,7 +26,6 @@ import io.quarkus.opentelemetry.runtime.tracing.intrumentation.grpc.GrpcTracingServerInterceptor; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.reactivemessaging.ReactiveMessagingTracingDecorator; import io.quarkus.opentelemetry.runtime.tracing.intrumentation.restclient.OpenTelemetryClientFilter; -import io.quarkus.runtime.LaunchMode; import io.quarkus.vertx.core.deployment.VertxOptionsConsumerBuildItem; import io.vertx.core.VertxOptions; @@ -103,12 +102,13 @@ VertxOptionsConsumerBuildItem vertxTracingOptions( InstrumentationRecorder recorder, LaunchModeBuildItem launchMode) { Consumer vertxTracingOptions; - if (launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT) { - // tracers are set in the OpenTelemetryProcessor - vertxTracingOptions = recorder.getVertxTracingOptionsDevMode(); - } else { - vertxTracingOptions = recorder.getVertxTracingOptionsProd(recorder.createTracers()); - } + // if (launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT) { + // // tracers are set in the OpenTelemetryProcessor + // vertxTracingOptions = recorder.getVertxTracingOptionsDevMode(); + // } else { + // vertxTracingOptions = recorder.getVertxTracingOptionsProd(recorder.createTracers()); + // } + vertxTracingOptions = recorder.getVertxTracingOptionsDevMode(); return new VertxOptionsConsumerBuildItem( vertxTracingOptions, LIBRARY_AFTER); diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryIdGeneratorTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryIdGeneratorTest.java index dbe2172128a8b..d1a41a34dede0 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryIdGeneratorTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryIdGeneratorTest.java @@ -1,12 +1,7 @@ package io.quarkus.opentelemetry.deployment; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.instanceOf; - import java.lang.reflect.InvocationTargetException; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; import javax.inject.Inject; import org.junit.jupiter.api.Disabled; @@ -14,7 +9,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.contrib.awsxray.AwsXrayIdGenerator; +// import io.opentelemetry.contrib.awsxray.AwsXrayIdGenerator; import io.opentelemetry.sdk.trace.IdGenerator; import io.quarkus.opentelemetry.deployment.common.TestUtil; import io.quarkus.test.QuarkusUnitTest; @@ -32,15 +27,15 @@ public class OpenTelemetryIdGeneratorTest { void test() throws NoSuchFieldException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { IdGenerator idGenerator = TestUtil.getIdGenerator(openTelemetry); - assertThat(idGenerator, instanceOf(AwsXrayIdGenerator.class)); + // assertThat(idGenerator, instanceOf(AwsXrayIdGenerator.class)); } - @ApplicationScoped - public static class OtelConfiguration { - - @Produces - public IdGenerator idGenerator() { - return AwsXrayIdGenerator.getInstance(); - } - } + // @ApplicationScoped + // public static class OtelConfiguration { + // + // @Produces + // public IdGenerator idGenerator() { + // return AwsXrayIdGenerator.getInstance(); + // } + // } } diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryPropagatorsTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryPropagatorsTest.java index 471a31d280260..c2ac2462463e8 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryPropagatorsTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryPropagatorsTest.java @@ -1,20 +1,17 @@ package io.quarkus.opentelemetry.deployment; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.collection.ArrayMatching.arrayContainingInAnyOrder; - import javax.inject.Inject; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; import io.opentelemetry.context.propagation.TextMapPropagator; -import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator; import io.quarkus.opentelemetry.deployment.common.TestUtil; import io.quarkus.test.QuarkusUnitTest; +@Disabled("We need to remove the AWS dependency") public class OpenTelemetryPropagatorsTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() @@ -28,7 +25,7 @@ public class OpenTelemetryPropagatorsTest { void test() throws NoSuchFieldException, IllegalAccessException { TextMapPropagator[] textMapPropagators = TestUtil.getTextMapPropagators(openTelemetry); - assertThat(textMapPropagators, arrayContainingInAnyOrder(W3CTraceContextPropagator.getInstance(), - AwsXrayPropagator.getInstance())); + // assertThat(textMapPropagators, arrayContainingInAnyOrder(W3CTraceContextPropagator.getInstance(), + // AwsXrayPropagator.getInstance())); } } diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java index 67ed1792f068e..d8f98794bd29b 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/GrpcOpenTelemetryTest.java @@ -22,6 +22,7 @@ import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -56,6 +57,7 @@ import io.quarkus.opentelemetry.deployment.StreamingGrpc; import io.quarkus.opentelemetry.deployment.StreamingProto; import io.quarkus.opentelemetry.deployment.common.TestSpanExporter; +import io.quarkus.opentelemetry.deployment.common.TestSpanExporterProvider; import io.quarkus.test.QuarkusUnitTest; import io.smallrye.common.annotation.Blocking; import io.smallrye.mutiny.Multi; @@ -64,7 +66,7 @@ public class GrpcOpenTelemetryTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .withApplicationRoot((jar) -> jar - .addClasses(TestSpanExporter.class) + .addClasses(TestSpanExporter.class, TestSpanExporterProvider.class) .addClasses(HelloService.class) .addClasses(GreeterGrpc.class, MutinyGreeterGrpc.class, Greeter.class, GreeterBean.class, GreeterClient.class, @@ -73,7 +75,12 @@ public class GrpcOpenTelemetryTest { .addClasses(StreamingService.class) .addClasses(StreamingGrpc.class, MutinyStreamingGrpc.class, Streaming.class, StreamingBean.class, StreamingClient.class, - StreamingProto.class, Item.class, ItemOrBuilder.class)) + StreamingProto.class, Item.class, ItemOrBuilder.class) + .addAsResource(new StringAsset(TestSpanExporterProvider.class.getCanonicalName()), + "META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider")) + .overrideConfigKey("quarkus.otel.traces.exporter", "test-span-exporter") + .overrideConfigKey("quarkus.otel.bsp.schedule.delay", "50") + .overrideConfigKey("quarkus.otel.bsp.export.timeout", "1s") .overrideConfigKey("quarkus.grpc.clients.greeter.host", "localhost") .overrideConfigKey("quarkus.grpc.clients.greeter.port", "9001") .overrideConfigKey("quarkus.grpc.clients.streaming.host", "localhost") diff --git a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java index b2b60ecd25b76..24ffb9c8a5298 100644 --- a/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java +++ b/extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/instrumentation/RestClientOpenTelemetryTest.java @@ -29,6 +29,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.eclipse.microprofile.rest.client.inject.RestClient; +import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java index 75e78237bf43c..7cd775f518f68 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/EventBusInstrumenterVertxTracer.java @@ -11,19 +11,17 @@ import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingSpanNameExtractor; -import io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper.OpenTelemetryWrapper; import io.vertx.core.eventbus.Message; import io.vertx.core.spi.tracing.TagExtractor; @SuppressWarnings("rawtypes") public class EventBusInstrumenterVertxTracer implements InstrumenterVertxTracer { - private Instrumenter consumerInstrumenter; - private Instrumenter producerInstrumenter; - private OpenTelemetryWrapper openTelemetryWapper; + private final Instrumenter consumerInstrumenter; + private final Instrumenter producerInstrumenter; - public EventBusInstrumenterVertxTracer(final OpenTelemetryWrapper openTelemetryWapper) { - this.openTelemetryWapper = openTelemetryWapper; - setupInstrumenters(); + public EventBusInstrumenterVertxTracer(final OpenTelemetry openTelemetry) { + this.consumerInstrumenter = getConsumerInstrumenter(openTelemetry); + this.producerInstrumenter = getProducerInstrumenter(openTelemetry); } @Override @@ -33,41 +31,24 @@ public boolean canHandle(final R request, final TagExtractor tagExtractor @Override public Instrumenter getReceiveRequestInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return consumerInstrumenter; } @Override public Instrumenter getSendResponseInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return consumerInstrumenter; } @Override public Instrumenter getSendRequestInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return producerInstrumenter; } @Override public Instrumenter getReceiveResponseInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return producerInstrumenter; } - private void setupInstrumenters() { - this.consumerInstrumenter = getConsumerInstrumenter(openTelemetryWapper.get()); - this.producerInstrumenter = getProducerInstrumenter(openTelemetryWapper.get()); - } - private static Instrumenter getConsumerInstrumenter(final OpenTelemetry openTelemetry) { InstrumenterBuilder serverBuilder = Instrumenter.builder( openTelemetry, diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java index 2aadd17e5a66a..c9029e0d46cf6 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/HttpInstrumenterVertxTracer.java @@ -29,7 +29,6 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter; -import io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper.OpenTelemetryWrapper; import io.vertx.core.Context; import io.vertx.core.MultiMap; import io.vertx.core.http.HttpHeaders; @@ -45,13 +44,12 @@ import io.vertx.core.spi.tracing.TagExtractor; public class HttpInstrumenterVertxTracer implements InstrumenterVertxTracer { - private Instrumenter serverInstrumenter; - private Instrumenter clientInstrumenter; - private OpenTelemetryWrapper openTelemetryWapper; + private final Instrumenter serverInstrumenter; + private final Instrumenter clientInstrumenter; - public HttpInstrumenterVertxTracer(final OpenTelemetryWrapper openTelemetryWapper) { - this.openTelemetryWapper = openTelemetryWapper; - setupInstrumenters(); + public HttpInstrumenterVertxTracer(final OpenTelemetry openTelemetry) { + serverInstrumenter = getServerInstrumenter(openTelemetry); + clientInstrumenter = getClientInstrumenter(openTelemetry); } @Override @@ -61,33 +59,21 @@ public boolean canHandle(final R request, final TagExtractor tagExtractor @Override public Instrumenter getReceiveRequestInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return serverInstrumenter; } @Override public Instrumenter getSendResponseInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return serverInstrumenter; } @Override public Instrumenter getSendRequestInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return clientInstrumenter; } @Override public Instrumenter getReceiveResponseInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenters(); - } return clientInstrumenter; } @@ -121,11 +107,6 @@ public HttpRequest writableHeaders( return WriteHeadersHttpRequest.request(request, headers); } - private void setupInstrumenters() { - serverInstrumenter = getServerInstrumenter(openTelemetryWapper.get()); - clientInstrumenter = getClientInstrumenter(openTelemetryWapper.get()); - } - private static Instrumenter getServerInstrumenter(final OpenTelemetry openTelemetry) { ServerAttributesExtractor serverAttributesExtractor = new ServerAttributesExtractor(); diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java index 0e33dd690ddc7..b5ed41a41fe9d 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/SqlClientInstrumenterVertxTracer.java @@ -10,7 +10,6 @@ import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder; import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.db.SqlClientAttributesExtractor; -import io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper.OpenTelemetryWrapper; import io.vertx.core.Context; import io.vertx.core.spi.tracing.SpanKind; import io.vertx.core.spi.tracing.TagExtractor; @@ -18,26 +17,16 @@ public class SqlClientInstrumenterVertxTracer implements InstrumenterVertxTracer { - private Instrumenter sqlClientInstrumenter; - private OpenTelemetryWrapper openTelemetryWapper; + private final Instrumenter sqlClientInstrumenter; - public SqlClientInstrumenterVertxTracer(final OpenTelemetryWrapper openTelemetryWapper) { - this.openTelemetryWapper = openTelemetryWapper; - setupInstrumenter(); - } - - private void setupInstrumenter() { - this.sqlClientInstrumenter = getInstrumenter(openTelemetryWapper.get()); - } - - private Instrumenter getInstrumenter(OpenTelemetry openTelemetry) { + public SqlClientInstrumenterVertxTracer(final OpenTelemetry openTelemetry) { SqlClientAttributesGetter sqlClientAttributesGetter = new SqlClientAttributesGetter(); InstrumenterBuilder serverBuilder = Instrumenter.builder( openTelemetry, INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(sqlClientAttributesGetter)); - return serverBuilder + this.sqlClientInstrumenter = serverBuilder .addAttributesExtractor(SqlClientAttributesExtractor.create(sqlClientAttributesGetter)) .buildClientInstrumenter((queryTrace, key, value) -> { }); @@ -90,17 +79,11 @@ public Instrumenter getSendResponseInstrumenter() { @Override public Instrumenter getSendRequestInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenter(); - } return sqlClientInstrumenter; } @Override public Instrumenter getReceiveResponseInstrumenter() { - if (openTelemetryWapper.resetIfChanged()) { - setupInstrumenter(); - } return sqlClientInstrumenter; } diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/DevModeOpenTelemetryWrapper.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/DevModeOpenTelemetryWrapper.java deleted file mode 100644 index d4b5e7c967595..0000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/DevModeOpenTelemetryWrapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper; - -import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.api.OpenTelemetry; - -public class DevModeOpenTelemetryWrapper implements OpenTelemetryWrapper { - private OpenTelemetry openTelemetry; - - public DevModeOpenTelemetryWrapper() { - this.openTelemetry = GlobalOpenTelemetry.get(); - } - - @Override - public OpenTelemetry get() { - return openTelemetry; - } - - @Override - public Boolean resetIfChanged() { - OpenTelemetry currentOpenTelemetry = GlobalOpenTelemetry.get(); - if (this.openTelemetry != null && this.openTelemetry.equals(currentOpenTelemetry)) { - return Boolean.FALSE; - } else { - this.openTelemetry = currentOpenTelemetry; - return Boolean.TRUE; - } - } -} diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/OpenTelemetryWrapper.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/OpenTelemetryWrapper.java deleted file mode 100644 index cd89004f8bb2c..0000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/OpenTelemetryWrapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper; - -import io.opentelemetry.api.OpenTelemetry; - -public interface OpenTelemetryWrapper { - - OpenTelemetry get(); - - Boolean resetIfChanged(); - -} diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/RuntimeOpenTelemetryWrapper.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/RuntimeOpenTelemetryWrapper.java deleted file mode 100644 index 7e7ed3464a6b1..0000000000000 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/intrumentation/vertx/wrapper/RuntimeOpenTelemetryWrapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.wrapper; - -import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.api.OpenTelemetry; - -public class RuntimeOpenTelemetryWrapper implements OpenTelemetryWrapper { - @Override - public OpenTelemetry get() { - return GlobalOpenTelemetry.get(); - } - - @Override - public Boolean resetIfChanged() { - return Boolean.FALSE; - } -}