Repository navigation
feat(attributes): Add page.server_rendering.age attribute - #799
Merged
Merged
Conversation
A pageload of a reused page links the render with a cache_origin link, but the link has no timestamp. Sentry finds a trace only within about 1.5 days of the time it gets, so it cannot open renders that are older. The age gives the time of the render: pageload start minus age. It is an integer in seconds and clamped to 0, as cache.item_age.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
s1gr1d
marked this pull request as ready for review
November 13, 2026 14:37
s1gr1d
requested review from
a team,
Lms24,
alexander-alderman-webb,
andreiborza,
cleptric,
giortzisg,
mjq and
nsdeschenes
as code owners
November 13, 2026 14:37
nsdeschenes
approved these changes
Nov 13, 2026
chargome
approved these changes
Nov 16, 2026
s1gr1d
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Nov 16, 2026
…26397) ## What Next.js now writes a `sentry-render-start` meta tag (whole UNIX seconds) next to `sentry-cache-origin`. The browser uses it to set `page.server_rendering.age` on the pageload span, so the UI can show how old the cached HTML was. The browser side is in `@sentry/core`, so SvelteKit and Nuxt only need to write the tag. They follow in stacked PRs. ## Why The `cache_origin` link tells you which render produced a cached page, but not how old that page is. That linked span is often not sampled or already gone, so the browser needs the start time itself. The tag holds the start of the linked render span. Without a recording span, it holds the current time, which is the render start, because Next.js computes the meta tags at the start of `prerenderToStream`. The attribute comes from getsentry/sentry-conventions#799, which is not merged yet, so the name is a local constant with a TODO. A `Server-Timing` header (#26107) does not replace the tag: shared-cacheable responses and Vercel do not send it, and it cannot hold the render time of a cached shell.
4 tasks done
s1gr1d
added a commit
to getsentry/sentry
that referenced
this pull request
Nov 19, 2026
"Open trace" in the Server rendering section of the pageload drawer now opens the trace of a reused render, also when the render is more than 1.5 days older than the pageload. Before, the link sent the pageload start as `timestamp`. The trace query searches only 1.5 days around that time, so the link opened an empty trace for old pre-rendered pages. The SDKs now set `page.server_rendering.age` on the pageload span: the seconds from the start of the reused render to the start of the pageload (getsentry/sentry-conventions#799, getsentry/sentry-javascript#26397). The link sends `pageload start − age`, which is the start of the linked render span. If the age is missing (older SDKs) or negative, the link sends the pageload start, as before. The request render (`server_request` link) does not change. When the render start is older than the span retention, the section shows "Past N-day retention" instead of a link. This uses the same check as the Cache Lifecycle section.
This branch was successfully 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.
Description
Adds
page.server_rendering.agefor pageload spans. It's the time in seconds from the start of the server render of the reused part of the page to the start of the pageload span. Integer, clamped to 0, likecache.item_age.Mentioned here: getsentry/sentry#130769 (comment)
Why "age":
cache.item_ageand the HTTPAgeheader (RFC 9111) use the word for the same kind of value, in seconds.Why an age and not a timestamp: Sentry can aggregate and filter an age, for example p75 per route or "older than one day". The age mixes the server clock and the browser clock, but an error of a few minutes doesn't matter in a 1.5 day window.
PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)apply_scrubbing(i.e.manualorauto. Useneveronly for values that should never be scrubbed such as IDs)If an attribute was deprecated: