feat(attribute): Add browser performance attributes#321
Open
Conversation
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 🐛
Documentation 📚
Internal Changes 🔧Deps
Deps Dev
Other
Other
🤖 This preview updates automatically when you update the PR. |
performance attributes
cleptric
approved these changes
Apr 15, 2026
Lms24
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Apr 16, 2026
## Summary (Updated from @Lms24) Closes #17931 When span streaming is enabled (`traceLifecycle: 'stream'`), emit web vital values as non-standalone spans that flow through the v2 pipeline (`afterSpanEnd` → `captureSpan()` → `SpanBuffer`). - Emit LCP, CLS, INP as streamed spans when `hasSpanStreamingEnabled(client)` is `true` - LCP, CLS, INP v2 spans exclusively send new `browser.web_vital.<vitalName>.*` attributes - Disable standalone CLS/LCP spans when span streaming is enabled (`!spanStreamingEnabled && enableStandaloneClsSpans`) - Add `MAX_PLAUSIBLE_INP_DURATION` (60s) sanity check to streamed INP path, matching the existing standalone handler - TTFB, FCP, FP are **not** emitted as spans — they stay as pageload span attributes but get sent with the new `browser.web_vital.(ttfb|fcp|fp).value` attributes - Performance meta attributes are sent with better names (getsentry/sentry-conventions#321) - Added integration tests - LCP v2 spans now have a duration and are no longer point in time --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
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 browser performance attributes which previously were sent as
performance.*. While this is namespaced, the namespace is (besides browser) unprecedented, and I'd rather have it scoped underbrowser.performance, given the attributes are taken from the browser'sperformanceAPI.Deprecated -> New:
performance.timeOrigin->browser.performance.time_originperformance.activationStart->browser.performance.navigation.activation_startPR 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)pii(i.e.maybeortrue. Usefalseonly for values that should never be scrubbed such as IDs)If an attribute was deprecated: