Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.20.5, 4.0-M3
-
None
-
None
-
Unknown
Description
OpenTelemetry enables you to trace arbitrary method invocations by tagging them with the @WithSpan annotation:
For some scenarios, the tracing context does not seem to get propagated and the resulting spans end up being disassociated. For example:
from("timer:tick?period=5s)
.process("myProcessor");
public class MyProcessor implements Processor { @WithSpan @Override public void process(Exchange exchange) { // Useful work here... } }
This results in 2 spans. One for timer:tick & another for MyProcessor. The problem is that the parent span for MyProcessor is not set, so they appear as 2 distinct traces.
There is a workaround where you can configure the route like this and the span hierarchy ends up being correct:
from("timer:tick?period=5s") .to("direct:start"); from("direct:start") .process("myProcessor");
There's some more background in the original issue reported on Camel Quarkus:
https://github.com/apache/camel-quarkus/issues/4981
There's also a reproducer project here:
Attachments
Issue Links
- is related to
-
CAMEL-19667 camel-tracing: Context is not propagated from exchange header to OpenTelemetry Context
- Open