{"id":"ef22698a-d05b-4c36-86ae-2b074b14746b","task":"Use OTel span links to connect causally related spans across asynchronous message queue boundaries","domain":"opentelemetry.io","steps":["When producing a message, extract the current span context and serialize it into the message headers or attributes using the W3C TraceContext propagator","When consuming the message, extract the producer's span context from the headers using propagator.extract()","Create the consumer span as a new root (do not use the producer context as parent) to keep producer and consumer traces independent and correctly timed","Add a SpanLink from the consumer span to the producer span context: span.addLink({context: producerSpanContext}) with an optional attributes map","In the trace backend (Jaeger, Tempo), use the span link to navigate between the producer and consumer traces for end-to-end request correlation"],"gotchas":["Using the producer span as the parent rather than a link causes the consumer span to extend the producer trace duration, producing misleading latency numbers","Span links are a relatively new OTel concept; not all trace backends render or query them; confirm backend support before relying on links for on-call workflows","Message headers have size limits; serialized span context (trace parent + tracestate + baggage) can exceed these limits when baggage entries accumulate"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/ef22698a-d05b-4c36-86ae-2b074b14746b"}