diff --git a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/OpenTelemetryVertxTracer.java b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/OpenTelemetryVertxTracer.java index 5e30cce13e71a..10c9dc8af9244 100644 --- a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/OpenTelemetryVertxTracer.java +++ b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/OpenTelemetryVertxTracer.java @@ -81,6 +81,10 @@ public SpanOperation receiveRequest( final Iterable> headers, final TagExtractor tagExtractor) { + if (!(request instanceof HttpRequest)) { + return null; + } + io.opentelemetry.context.Context parentContext = context.getLocal(ACTIVE_CONTEXT); if (parentContext == null) { parentContext = io.opentelemetry.context.Context.root(); @@ -107,6 +111,10 @@ public void sendResponse( return; } + if (!(response instanceof HttpResponse)) { + return; + } + Scope scope = spanOperation.getScope(); if (scope == null) { return; @@ -130,6 +138,10 @@ public SpanOperation sendRequest( final BiConsumer headers, final TagExtractor tagExtractor) { + if (!(request instanceof HttpRequest)) { + return null; + } + io.opentelemetry.context.Context parentContext = context.getLocal(ACTIVE_CONTEXT); if (parentContext == null) { parentContext = io.opentelemetry.context.Context.root(); @@ -157,6 +169,10 @@ public void receiveResponse( return; } + if (!(response instanceof HttpResponse)) { + return; + } + Scope scope = spanOperation.getScope(); if (scope == null) { return;