Repository navigation
Conversation
…responses Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
bugbot run |
Contributor
size-limit report 📦Compared: e6172de (PR test merge using develop at c491307) Against: c491307 (develop) · base run #65764 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 53 successful. See the run.
Successful checks
|
… is sent Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
bugbot run |
…h Next.js Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
bugbot run |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
bugbot run |
…js-server-timing-header
…js-server-timing-header # Conflicts: # packages/nextjs/src/server/index.ts
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2091a1e. Configure here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Under
cacheComponentsthesentry-tracemeta tag arrives with the resumed part of the document, usually after the browser SDK started, so the pageload has to wait for it (#25142). AServer-Timingheader reaches the browser before any HTML. The browser SDK already reads it, and Remix and Nitro already send it. On a self-hosted server Next.js flushes the headers with the first chunk, inside the request span, so the header is set inwriteHeadrather than when the request comes in.Before, with the meta tag only:
sequenceDiagram participant B as Browser participant S as Next.js server B->>S: GET /page Note over S: request span starts, shell comes from cache S-->>B: headers + shell (no trace context) Note over B: SDK starts, pageload has to wait Note over S: dynamic part renders S-->>B: resumed part with sentry-trace meta tag Note over B: pageload starts late, fetches and errors before it are unattachedAfter, with the header:
sequenceDiagram participant B as Browser participant S as Next.js server B->>S: GET /page Note over S: request span starts, shell comes from cache Note over S: writeHead on the first chunk: Server-Timing carries the active trace S-->>B: headers + shell (Server-Timing: sentry-trace, baggage) Note over B: SDK starts, pageload continues the trace at once Note over S: dynamic part renders S-->>B: resumed part with sentry-trace meta tag Note over B: tag only settles page.server_rendering.typeThe header is left off responses a shared cache may store, which is what Next.js sends for static and ISR app router documents. A CDN in front of the server would otherwise replay one visitor's trace and sampling decision to everyone. The check is the one the Remix 3 middleware already had, now shared as
isSharedCacheablein core. Non-document responses get no header either.Since the pageload no longer waits for the tag,
page.server_rendering.typeis settled after span start for a runtime shell with a dynamic part, sotracesSamplerdoes not see it in that case.Closes #24945
Refs JS-3864