Span Trace Propagation

To continue a trace from an upstream service, the SDK must expose a method to extract the traceparent and baggage information and apply these to the applicable scope.

Copied
scope.setPropagationContext({
    traceparent: request.headers.SENTRY_TRACE,
    baggage: request.headers.SENTRY_BAGGAGE,
})

Newly created root spans should now contain these properties, such as trace_id and parent_span_id.

To propagate a trace to a downstream service, the SDK must expose methods to fetch the required information to allow the next service to continue the trace.

Copied
traceparent = scope.getTraceparent()
baggage = scope.getBaggage()
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").