Skip to content

Commit

Permalink
Merge pull request quarkusio#22615 from geoand/quarkusio#22597
Browse files Browse the repository at this point in the history
Guard against CCE in OTel Vert.x integration
  • Loading branch information
geoand authored Jan 4, 2022
2 parents 6ffebe7 + ca59966 commit 077ea2f
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public <R> SpanOperation receiveRequest(
final Iterable<Map.Entry<String, String>> headers,
final TagExtractor<R> 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();
Expand All @@ -107,6 +111,10 @@ public <R> void sendResponse(
return;
}

if (!(response instanceof HttpResponse)) {
return;
}

Scope scope = spanOperation.getScope();
if (scope == null) {
return;
Expand All @@ -130,6 +138,10 @@ public <R> SpanOperation sendRequest(
final BiConsumer<String, String> headers,
final TagExtractor<R> 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();
Expand Down Expand Up @@ -157,6 +169,10 @@ public <R> void receiveResponse(
return;
}

if (!(response instanceof HttpResponse)) {
return;
}

Scope scope = spanOperation.getScope();
if (scope == null) {
return;
Expand Down

0 comments on commit 077ea2f

Please sign in to comment.