[ 
https://issues.apache.org/jira/browse/CAMEL-22648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035891#comment-18035891
 ] 

Pasquale Congiusti commented on CAMEL-22648:
--------------------------------------------

The problem is not Camel. The design is consistent. The problem is that the 
upstream libraries are missing to propagate the traceparent, assuming that the 
downstream usage is going to use the thread local context propagation. This was 
the reason why we have changed model, as such model could not work when async 
calls. Now, I've located the place where this is happening (at least in log):

{code}
[1b3bd06b5cf442fcbe2ff83a1252b740 9d07dfe868abe5c0] 2025-11-06 17:08:26.799 
TRACE 1058802 --- [ntloop-thread-0] io.vertx.ext.web.impl.RouterImpl         : 
Router: 1094278250 accepting request GET http://localhost:8080/bar
[1b3bd06b5cf442fcbe2ff83a1252b740 9d07dfe868abe5c0] 2025-11-06 17:08:26.810 
TRACE 1058802 --- [ntloop-thread-0] io.vertx.ext.web.RoutingContext          : 
Route matches: RouteState{metadata=null, path='/', name=null, order=1, 
enabled=true, methods=null, consumes=null, 
emptyBodyPermittedWithConsumes=false, produces=null, 
contextHandlers=[io.opentelemetry.javaagent.instrumentation.vertx.RoutingContextHandlerWrapper@317a6446],
 
failureHandlers=[io.vertx.ext.web.impl.RouteImpl$$Lambda$843/0x00000008016f3530@5d839d88],
 added=true, pattern=null, groups=null, useNormalizedPath=true, 
namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=true, 
exclusive=true, exactPath=false}
[1b3bd06b5cf442fcbe2ff83a1252b740 9d07dfe868abe5c0] 2025-11-06 17:08:26.810 
TRACE 1058802 --- [ntloop-thread-0] io.vertx.ext.web.RoutingContext          : 
Calling the  handler
[1b3bd06b5cf442fcbe2ff83a1252b740 9d07dfe868abe5c0] 2025-11-06 17:08:26.815 
TRACE 1058802 --- [ntloop-thread-0] io.vertx.ext.web.RoutingContext          : 
Route matches: RouteState{metadata=null, path='/bar', name=null, order=6, 
enabled=true, methods=null, consumes=null, 
emptyBodyPermittedWithConsumes=false, produces=null, 
contextHandlers=[io.opentelemetry.javaagent.instrumentation.vertx.RoutingContextHandlerWrapper@3b87cce7,
 
io.opentelemetry.javaagent.instrumentation.vertx.RoutingContextHandlerWrapper@7d2cca67],
 failureHandlers=null, added=true, pattern=null, groups=null, 
useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, 
pathEndsWithSlash=false, exclusive=false, exactPath=true}
[1b3bd06b5cf442fcbe2ff83a1252b740 9d07dfe868abe5c0] 2025-11-06 17:08:26.815 
TRACE 1058802 --- [ntloop-thread-0] io.vertx.ext.web.RoutingContext          : 
Calling the  handler

Trace parent ... GET null

[4ba6d07f14a720f64b01ef789ef00436 3eb3d7ee8a8a0264] 2025-11-06 17:08:26.853 
DEBUG 1058802 --- [worker-thread-0] org.apache.camel.telemetry.Tracer        : 
Started event span: OpenTelemetrySpanAdapter 
[span=ApplicationSpan{agentSpan=SdkSpan{traceId=4ba6d07f14a720f64b01ef789ef00436,
 spanId=3eb3d7ee8a8a0264, 
parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000,
 spanId=0000000000000000, traceFlags=00, 
traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, 
name=GET, kind=INTERNAL, 
attributes=AttributesMap{data={camel.uri=platform-http:///bar, 
op=EVENT_RECEIVED, thread.id=30, exchangeId=EBA8D1A0FAD1769-0000000000000001, 
server.address=http://0.0.0.0:8080, url.path=bar, 
component=camel-platform-http, server.protocol=http, http.method=GET, 
thread.name=vert.x-worker-thread-0, url.scheme=platform-http, 
http.url=http://localhost:8080/bar}, capacity=128, totalAddedValues=12}, 
status=ImmutableStatusData{statusCode=UNSET, description=}, 
totalRecordedEvents=0, totalRecordedLinks=0, 
startEpochNanos=1762445306849893418, endEpochNanos=0}}, baggage={}]
...
{code}

As we can see in the MDC traces, the vertx libs are not propagating the 
generated traceparent in the downstream header, which is where we expect, as 
defined in the otel specification. I am checking the source code of vertx to 
understand if this is something configurable or fixable somehow.

> [camel-opentelemetry2] don't propagate headers when creating a new trace
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-22648
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22648
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Pasquale Congiusti
>            Assignee: Pasquale Congiusti
>            Priority: Major
>             Fix For: 4.17.0
>
>
> Originally reported in https://github.com/apache/camel-quarkus/issues/7801
> We're missing to propagate traceparent header when we start a new trace.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to