Code review comment: It's unlikely that `tracerInstance.isResolvable()` would be false if the filter is present.  I'm probably being over cautious about a situation where `Tracer` has been replaced by an application developer and it has an issue.

Code before review:
public void handle(RoutingContext routingContext) {
QuarkusContextStorage.INSTANCE.setRoutingContext(routingContext);
if (!initialized) {
Instance<Tracer> tracerInstance = CDI.current().select(Tracer.class);
if (tracerInstance.isResolvable()) {
tracer = tracerInstance.get();
}
initialized = true;
}
if (tracer != null) {
Context parentContext = propagatedContext(routingContext);
SpanBuilder builder = tracer.spanBuilder(routingContext.request().uri().substring(1))
.setParent(parentContext)
.setSpanKind(SpanKind.SERVER);
builder.setAttribute(SemanticAttributes.HTTP_FLAVOR, convertHttpVersion(routingContext.request().version()));
builder.setAttribute(SemanticAttributes.HTTP_METHOD, routingContext.request().method().name());
builder.setAttribute(SemanticAttributes.HTTP_TARGET, routingContext.request().path());
builder.setAttribute(SemanticAttributes.HTTP_SCHEME, routingContext.request().scheme());
builder.setAttribute(SemanticAttributes.HTTP_HOST, routingContext.request().host());
builder.setAttribute(SemanticAttributes.HTTP_CLIENT_IP, routingContext.request().remoteAddress().host());
builder.setAttribute(SemanticAttributes.HTTP_USER_AGENT, routingContext.request().getHeader("User-Agent"));
String contentLength = routingContext.request().getHeader("Content-Length");
if (contentLength != null && contentLength.length() > 0 && Long.parseLong(contentLength) > 0) {
builder.setAttribute(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, Long.valueOf(contentLength));
} else {
builder.setAttribute(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, routingContext.request().bytesRead());
}
Span currentSpan = builder.startSpan();
Scope spanScope = currentSpan.makeCurrent();
HttpServerResponse response = routingContext.response();
routingContext.addHeadersEndHandler(new Handler<Void>() {
@Override
public void handle(Void event) {
currentSpan.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, response.getStatusCode());
if (routingContext.failed()) {
currentSpan.setStatus(StatusCode.ERROR);
currentSpan.recordException(routingContext.failure());
}
currentSpan.end();
spanScope.close();
QuarkusContextStorage.INSTANCE.clearRoutingContext(routingContext);
}
});
}
routingContext.next();
}

Line under review: tracer = tracerInstance.get();

Code after addressing the review:
public void handle(RoutingContext routingContext) {
QuarkusContextStorage.INSTANCE.setRoutingContext(routingContext);
if (!initialized) {
Instance<Tracer> tracerInstance = CDI.current().select(Tracer.class);
if (tracerInstance.isResolvable()) {
tracer = tracerInstance.get();
}
initialized = true;
}
if (tracer != null) {
Context parentContext = propagatedContext(routingContext);
SpanBuilder builder = tracer.spanBuilder(routingContext.request().uri().substring(1))
.setParent(parentContext)
.setSpanKind(SpanKind.SERVER);
builder.setAttribute(SemanticAttributes.HTTP_FLAVOR, convertHttpVersion(routingContext.request().version()));
builder.setAttribute(SemanticAttributes.HTTP_METHOD, routingContext.request().method().name());
builder.setAttribute(SemanticAttributes.HTTP_TARGET, routingContext.request().path());
builder.setAttribute(SemanticAttributes.HTTP_SCHEME, routingContext.request().scheme());
builder.setAttribute(SemanticAttributes.HTTP_HOST, routingContext.request().host());
builder.setAttribute(SemanticAttributes.HTTP_CLIENT_IP, routingContext.request().remoteAddress().host());
builder.setAttribute(SemanticAttributes.HTTP_USER_AGENT, routingContext.request().getHeader("User-Agent"));
String contentLength = routingContext.request().getHeader("Content-Length");
if (contentLength != null && contentLength.length() > 0 && Long.parseLong(contentLength) > 0) {
builder.setAttribute(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, Long.valueOf(contentLength));
} else {
builder.setAttribute(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, routingContext.request().bytesRead());
}
Span currentSpan = builder.startSpan();
Scope spanScope = currentSpan.makeCurrent();
HttpServerResponse response = routingContext.response();
routingContext.addHeadersEndHandler(new Handler<Void>() {
@Override
public void handle(Void event) {
currentSpan.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, response.getStatusCode());
if (routingContext.failed()) {
currentSpan.setStatus(StatusCode.ERROR);
currentSpan.recordException(routingContext.failure());
}
currentSpan.end();
spanScope.close();
QuarkusContextStorage.INSTANCE.clearRoutingContext(routingContext);
}
});
}
routingContext.next();
}