Overview
Propagation involves:- Extracting trace context from incoming requests
- Injecting trace context into outgoing requests
- Maintaining parent-child relationships across services
- Preserving sampling decisions
Trace Headers
sentry-trace
The primary header for Sentry tracing: Format:{trace_id}-{span_id}-{sampled}
trace_id: 32 hex characters (128 bits)span_id: 16 hex characters (64 bits)sampled:1(sampled) or0(not sampled)
baggage
Contains dynamic sampling context: Format: Key-value pairs separated by commastraceparent (W3C)
Optional W3C Trace Context standard: Format:{version}-{trace_id}-{parent_id}-{flags}
Automatic Propagation
Sentry automatically propagates traces for HTTP requests:tracePropagationTargets
Control which outgoing requests receive tracing headers:- Node.js: All outgoing requests
- Browser: Same-origin requests only
Manual Propagation
Outgoing Requests
Incoming Requests
continueTrace
Continue a trace from incoming headers:string
The
sentry-trace header value.string | string[]
The
baggage header value(s).function
required
Function to execute with the continued trace.
Cross-Service Tracing
Service A (Origin)
Service B (Receiver)
W3C Trace Context
Enable W3Ctraceparent header:
traceparent, ensure your server allows it: