Reputation: 3869
Is there any way to join multiple traces with different trace ids into a single trace? In my case I have something like the following which I would like to join together into a single trace.
|--- UI Trace ---------------------------------|
|- UI Span -|
|-- Backend Trace -----------|
|- Backend Span --| |--|
Yes, I could refactor so that my Backend Trace
is span within the UI Trace
. But I'm working with some existing code where the the backend services already have an ID per request passed around via http headers. I would like to re-use the existing Backend ID instead of adding a new trace ID header to all existing requests.
Upvotes: 2
Views: 1946
Reputation: 373
In general, 'joining traces' in the way you're describing would be part of your trace analyzer (Jaeger, LightStep, etc.) and I don't believe any of them allow for this sort of query. TraceID
is simply a way for the analyzer to associate disparate spans into a single, logical trace.
Some options to address this would be the following -
SpanContext
trace id, assuming your backend will propagate this as well if it's given to it.SpanContext
with the trace id generated by the backend. You don't necessarily have to pass unfinished or malformed spans down - you could simply send the required pieces of data down the wire to your backend and create new spans for the UI at that point.Upvotes: 2