Camel-Zipkin does not report traces with root span id when there are multiple routes.
Root SpanId(TraceId) should be for service-name = direct:foo and the trace in UI should show all the 4 routes in one sequence. But it breaks. Check the attached screenshot: Traces Breaking.png
I looked into the code and figured out why its happening. Here is the code which is breaking the functionality.
Class Name: ZipkinTracer.ZipkinRoutePolicy
Inside onExchangeBegin() method
Using onAfterRoute() : if the exchange is being routed through multiple routes, there will be callbacks for each route.
I have fix for it:
If I use onExchangeDone() instead of above code. The traces are reported properly. Check screenshots.
Note This process must be repeated if the service makes multiple downstream calls. That is each subsequent span will have the same trace id and parent id, but a new and different span id.