Like unpackTraceContext, but instead of resuming the enqueuer's trace as the active
parent, it returns the enqueuer's SpanContext for use as a span LINK and a
baggageContext that carries any cross-boundary baggage WITHOUT an active parent span.
Activating baggageContext and starting the consumer's span as a linked root keeps the
worker in its own trace (so a fan-out doesn't collapse into one unbounded trace) while
still correlating it back to the enqueuer via the link. Baggage (e.g. patient.id) is
preserved because trace.deleteSpan only strips the active span, not baggage.
Falls back gracefully for legacy/unpacked messages: parentSpanContext is undefined
and baggageContext is the active context.
Like
unpackTraceContext, but instead of resuming the enqueuer's trace as the active parent, it returns the enqueuer'sSpanContextfor use as a span LINK and abaggageContextthat carries any cross-boundary baggage WITHOUT an active parent span.Activating
baggageContextand starting the consumer's span as a linked root keeps the worker in its own trace (so a fan-out doesn't collapse into one unbounded trace) while still correlating it back to the enqueuer via the link. Baggage (e.g.patient.id) is preserved becausetrace.deleteSpanonly strips the active span, not baggage.Falls back gracefully for legacy/unpacked messages:
parentSpanContextisundefinedandbaggageContextis the active context.