Skip to content

Commit 2d7bf69

Browse files
committed
docs: Note the soft navigation web vitals behaviour changes
Web vitals values shift on upgrade for apps that do client-side routing: page load vitals are now finalized at the first soft navigation instead of accumulating over the page lifetime, and CLS/LCP no longer report every intermediate update, which changes what Session Replay records.
1 parent d138028 commit 2d7bf69

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

MIGRATION.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,34 @@ Sentry.init({
575575
});
576576
```
577577

578+
### Web vitals are reported per soft navigation
579+
580+
Affected SDKs: All SDKs running in the browser.
581+
582+
`webVitalsIntegration` (auto-registered by `browserTracingIntegration`) now reports its own set of LCP, CLS and INP for every soft navigation the browser detects through the [Soft Navigations API](https://developer.chrome.com/docs/web-platform/soft-navigations-experiment), attributed to the navigation span it belongs to.
583+
584+
This also changes how the initial page load is measured. Previously a page reported a single set of vitals that accumulated over the whole page lifetime. Now the page load's vitals are finalized at the first soft navigation, so **expect the values reported for page loads to drop** on apps that do client-side routing, most noticeably for CLS and INP. Aggregates such as p75s will shift after upgrading.
585+
586+
Reporting per soft navigation requires span streaming (`traceLifecycle: 'stream'`, the default) and is ignored in browsers without support for the Soft Navigations API (Chromium 151+). Navigations the browser does not detect as soft navigations (programmatic navigations, navigations that never paint) report no vitals at all, so coverage is lower than for page loads.
587+
588+
To keep the previous behaviour of one set of vitals for the whole page lifetime:
589+
590+
```js
591+
Sentry.init({
592+
integrations: [Sentry.browserTracingIntegration({ webVitals: { softNavigations: false } })],
593+
});
594+
```
595+
596+
### CLS and LCP no longer report intermediate values
597+
598+
Affected SDKs: All SDKs running in the browser.
599+
600+
With soft navigation reporting enabled (the default, see above), the SDK no longer subscribes to every intermediate CLS and LCP update. `web-vitals` reports once per navigation, with the final value.
601+
602+
This is required for per-navigation values to be correct: `web-vitals` skips any report with a zero delta, including the forced report at a navigation boundary, so subscribing to all changes means the page load never receives its final value.
603+
604+
The visible effect is in Session Replay, which records `web-vital` breadcrumbs from the same instrumentation. Replays now contain one LCP and one CLS entry per navigation instead of one per intermediate update. Where soft navigation reporting is disabled or unsupported, the previous behaviour is unchanged.
605+
578606
### `DOMException.code` is no longer set as a tag
579607

580608
Affected SDKs: All SDKs running in the browser.

0 commit comments

Comments
 (0)