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
Send trace context from middleware so pageloads connect on Vercel #24947
On Vercel the cached shell is served by the CDN without running app code. The server function only renders the fresh part, and response headers were already sent with the shell. So a Server-Timing header set by the function never reaches the browser.
Middleware runs before the CDN cache on every request, so it is the one place on Vercel that can add a header to every response.
What this ticket does
Spike on a real Vercel deployment. Confirm that:
a Server-Timing header set by middleware reaches the browser when the shell comes from the CDN
a sentry-trace request header set by middleware reaches the server function (via NextResponse.next({ request: { headers } }))
If both hold, extend wrapMiddlewareWithSentry to add the Server-Timing response header and forward sentry-trace and baggage to the downstream request.
The middleware span starts the trace, the server render joins it through the forwarded header, and the pageload joins it through the response header.
Caveat
Only works for apps with a proxy.ts file. Document a one-line empty proxy as the opt-in.
If the spike fails, write down what was tested and why, and close the ticket.
Activity
linear-code commentedon Oct 1, 2026
JS-3866
cacheComponents#24298