beskow opened a new pull request, #22410:
URL: https://github.com/apache/camel/pull/22410

   # Description
   
   Pull request to correct behavior reported in 
https://issues.apache.org/jira/browse/CAMEL-23283:
   
   When using camel-observability or camel-micrometer-observability, traces and 
spans are correctly created and exported for routes triggered by other, 
tracing-aware framework components (e.g. http). If a route is triggered by a 
jms message, no trace or span is exported however.
   
   This seems to be caused by missing scope management: 
MicrometerObservabilitySpanAdapter::activate() only calls span.start() but 
doesn't put the
   span into the tracer's thread-local scope. This means tracer.currentSpan() 
returns null during route execution, hence the span is invisible to downstream 
instrumentation that relies on tracer.currentSpan() to find a parent span.
   
   The first commit adds a test to highlight the problem.
   The second commit corrects the root cause of the problem, but cause side 
effects for other tests (the async test cases) which leaks trace information 
between test execution.
   The third commit prevents leaked trace information from being propagated.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to