You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Next.js: Connect proxy and render by emitting and accepting traceparent in the trace handover #27064
Since Next.js 16.4.3 the proxy hands its trace context to the render (vercel/next.js#100294). With the Sentry SDK this handover does nothing, so a document request still produces two traces: one for the proxy and one for the render and pageload.
Why
The proxy adapter calls propagation.inject() and keeps only traceparent and tracestate. It forwards them to the render as request header overrides.
SentryPropagator.inject writes traceparent only when propagateTraceparent is enabled. By default Next.js gets nothing to forward.
SentryPropagator.extract reads only sentry-trace and baggage. A forwarded traceparent would be ignored.
In a production app on Next.js 16.4.5, every sampled trace that starts at a Next.request root contains exactly one segment. The render never joins.
To do
Emit traceparent when Next.js asks for the trace context. Limit it to the case where the active span is a Next.js request span (Next.request, BaseServer.handleRequest), so outgoing requests are not affected.
Accept traceparent on extract when no sentry-trace header is present. sentryTraceFromTraceparent in @sentry/core already does the conversion.
On next start, Next.js writes the context onto the request in its middleware pass, using the same getTraceContextHeaders call. The same fix should apply, but this was not measured.
Activity
linear-code commentedon Dec 2, 2026
JS-4205