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

Thomas Gantenbein commented on CAMEL-21472:
-------------------------------------------

[~jpoth], thanks for the suggestion. No, the option synchronous=true doesn't 
resolve this.

[~squakez], I've made a draft PR: [https://github.com/apache/camel/pull/16386.]

Actually, with my reproducer it works better than expected: I tried `curl -H 
"traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" 
localhost:12345` and observed that traceId 4bf92f3577b34da6a3ce929d0e0e4736 was 
actually assigned to the trace and a new span was created. When not sending 
such a header, a new traceId would be generated. Same for the timer-route.

I don't like the fact that my "fix" is checking whether a new traceId should be 
assigned when a new exchange comes in – instead of just doing whatever is 
necessary when the exchange is done and no parent span exists. But this is what 
seems to work for me for the moment, without me having to touch more stuff that 
I don't _really_ understand.

> Opentelemetry is using the same traceId when exchange is fired from file or 
> timer component
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-21472
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21472
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-opentelemetry
>    Affects Versions: 4.8.1
>            Reporter: Thomas Gantenbein
>            Assignee: Pasquale Congiusti
>            Priority: Major
>             Fix For: 4.8.2, 4.9.0
>
>         Attachments: image-2024-11-26-09-59-35-555.png
>
>
> *Problem*
> When using a consumer like {{timer}} or {{{}file{}}}, the traceId remains the 
> same for all messages. When using a consumer like netty (or, I assume, any 
> other http/tcp-based consumer), every call gets its own traceId as expected.
> See also 
> https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/Same.20OTEL.20trace.20for.20all.20messages.20into.20IBM.20MQ
> *Reproducer*
> [https://github.com/thomas-gantenbein-tga/camel-opentelemetry/tree/main]
> [~pcongiusti], thanks for your answer on Zulip Chat. Let me know if I should 
> further explain or minimize that reproducer.



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

Reply via email to