ref(browser): remove web vital standalone span experiments - #21215
Conversation
size-limit report 📦
|
98a76d7 to
00cd99b
Compare
12da820 to
983fbac
Compare
|
Drafting this till we think about the implications of dropping v2 span path as well. |
dad441e to
4dda73e
Compare
CLS and LCP are now always recorded as measurements (on transaction pageload spans) or attributes (on streamed pageload spans), never as their own separate spans. Removes `_experiments.enableStandaloneClsSpans` and `_experiments.enableStandaloneLcpSpans` options from both `webVitalsIntegration` and `browserTracingIntegration`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When span streaming (v2) is enabled, LCP and CLS are now always emitted as standalone v2 spans (like INP) instead of being recorded as measurements or attributes on the pageload span. When span streaming is disabled, they continue to be recorded as measurements on the pageload span. This behavior is no longer user-configurable; the previously removed `_experiments.enableStandaloneClsSpans` / `enableStandaloneLcpSpans` options stay removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4dda73e to
0684e6b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 07d67f2. Configure here.
Lms24
left a comment
There was a problem hiding this comment.
last request: Can we drop a note in MIGRATION.md that these experimental options were removed and LCP/CLS are now always sent as spans by default, and as previously on the transaction if users opt out of span streaming.
|
👋 @mydea — Please review this PR when you get a chance! |
- Delete dead cls.ts stub (now that standalone CLS tracking is removed) - Keep asserting sentry.segment.name on streamed CLS/LCP spans (unit + integration) - Document removal of the experimental standalone options in MIGRATION.md
| setAttr('ttfb.requestTime', _measurements['ttfb.requestTime'].value, 'browser.web_vital.ttfb.request_time'); | ||
| } | ||
| } else { |
There was a problem hiding this comment.
Bug: The client parameter in StartTrackingWebVitalsOptions is passed to startTrackingWebVitals but is unused within the function.
Severity: LOW
Suggested Fix
Remove the client property from the StartTrackingWebVitalsOptions interface in browserMetrics.ts and stop passing it to startTrackingWebVitals from the call site in webVitals.ts to clean up the API surface.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/browser-utils/src/metrics/browserMetrics.ts#L448-L450
Potential issue: The `startTrackingWebVitals` function in
`packages/browser-utils/src/metrics/browserMetrics.ts` is defined to accept a `client`
parameter via its `StartTrackingWebVitalsOptions` interface. However, the function's
implementation only destructures and uses the `trackCls` and `trackLcp` properties. The
`client` parameter is passed at the call site in
`packages/browser/src/integrations/webVitals.ts` but is never used within the function
body. This is a remnant from a refactoring and does not cause any runtime errors or
incorrect behavior, but it makes the function's API misleading.
Also affects:
packages/browser/src/integrations/webVitals.ts:60~67
Did we get this right? 👍 / 👎 to inform future reviews.
|
nice to see some bytes being removed for a change :D |

Removes the standalone CLS/LCP web vital experiment options.
This means web vitals will behave as such:
In other words, it just drops the
experimentaloptions, and the user will no longer have control over how CLS/LCP are sent except by opting in to span streaming.Future work may include dropping v1 standalone spans entirely if we migrate INP off to v2