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 in the Server-Timing header for self-hosted Next.js #24945
Meta tags inside the HTML have a timing problem: the browser SDK may start before the tag has arrived. HTTP response headers do not have that problem. They are sent before any HTML, and the browser SDK already reads a Server-Timing header to find the trace (added in #18673). Our Remix and Nitro SDKs already write this header. Next.js does not.
For a self-hosted Next.js app, next start sends the response headers at the moment the first piece of HTML is written. That happens inside the server request's span, so the correct trace is known at that point.
packages/node: add a small hook to the http integration that is called with the request and response for every incoming request, also when incoming request spans are disabled. It does nothing on its own.
packages/nextjs server init: use that hook to set the header right before the response headers are sent:
Activity
linear-code commentedon Oct 1, 2026
JS-3864
cacheComponents#24298