Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
squakez
left a comment
There was a problem hiding this comment.
Unfortunately this may patch the specific issue but it does not solve the context propagation root cause. We had recently deprecated the older tracing components in favor of the new ones based on a different more consistent context propagation design.
Instead of trying to patch the component (which would require instead to work on the root cause on the core modules) we strongly suggest to move to the new component (in this case camel-micrometer-observability, https://camel.apache.org/components/4.18.x/others/micrometer-observability.html).
I must be missing something here. This pull request is indeed for the new component (camel-micrometer-observability). The problem I reported manifests itself in both the old (camel-observability) and the new (camel-micrometer-observability) component. I only bothered to try to correct it in the new component. If this is not the appropriate place to solve the context propagation root cause, I would need some more guidance in finding it. |
|
Sorry, I mistakenly thought it was related to camel-observation. I will have a deeper look ASAP, however, the context propagation is something that for this component has to be managed by configuration via OTEL bridge, see https://camel.apache.org/components/4.18.x/others/micrometer-observability.html#_spring_boot_context_propagation - did you already tried that path? the goal of the component is to be agnostic to the specific telemetry technology. |
| from("direct:start") | ||
| .routeId("start") | ||
| .process(exchange -> { | ||
| capturedCurrentSpan.set(micrometerTracer.currentSpan()); |
There was a problem hiding this comment.
This is something you're not allowed to do by design. The point is that, for consistency reasons, Camel has to be seen as a black box and the only context propagation is via standard traceparent (see https://github.com/apache/camel/blob/main/proposals/tracing.adoc#context-propagation)
Yes, I already use the OTEL bridge. I have prepared a small example project (using SpringBoot, Micrometer and the OTEL bridge) to pinpoint the problems I experience. In doing so, I have also tried to be more precise in the problem report in https://issues.apache.org/jira/browse/CAMEL-23283. You can find the sample project here: https://issues.apache.org/jira/secure/attachment/13081632/jms-micrometer-observability.zip Thanks for your help, let me know what I can do to assist further! |
Description
Pull request to correct behavior reported in https://issues.apache.org/jira/browse/CAMEL-23283:
When using 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
mainbranch)Tracking
Apache Camel coding standards and style
I checked that each commit in the pull request has a meaningful subject line and body.
I have run
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.