Conversation

Lms24

This PR implements sending standalone LCP spans as an opt-in feature.

Behaviour-wise, it's mostly aligned with our prior implementation of sending CLS standalone spans (#13056):

  • add an _experiments.enableStandaloneLcpSpans option and treat it as opt-in
  • keep collecting LCP values until users soft-navigate or the page is hidden
  • then, send the LCP span once
  • adds all lcp.* span attributes as well as the lcp measurement to the span

(depending on if we merge #16589 or this first, we might need to readjust size limit)

closes #13063

@github-actionsGitHub Actions

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.99 kB--
@sentry/browser - with treeshaking flags23.76 kB--
@sentry/browser (incl. Tracing)39 kB+0.54%+208 B 🔺
⛔️ @sentry/browser (incl. Tracing, Replay) (max: 77 kB)77.08 kB+0.25%+192 B 🔺
⛔️ @sentry/browser (incl. Tracing, Replay) - with treeshaking flags (max: 70.1 kB)70.17 kB+0.29%+200 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)81.86 kB+0.26%+206 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)93.93 kB+0.22%+204 B 🔺
@sentry/browser (incl. Feedback)40.73 kB--
@sentry/browser (incl. sendFeedback)28.7 kB--
@sentry/browser (incl. FeedbackAsync)33.59 kB--
@sentry/react25.76 kB--
@sentry/react (incl. Tracing)40.97 kB+0.46%+186 B 🔺
@sentry/vue28.36 kB--
@sentry/vue (incl. Tracing)40.84 kB+0.46%+183 B 🔺
@sentry/svelte24.01 kB--
CDN Bundle25.48 kB--
⛔️ CDN Bundle (incl. Tracing) (max: 39 kB)39.16 kB+0.51%+195 B 🔺
CDN Bundle (incl. Tracing, Replay)74.97 kB+0.26%+190 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)80.39 kB+0.24%+189 B 🔺
CDN Bundle - uncompressed74.48 kB--
CDN Bundle (incl. Tracing) - uncompressed116.51 kB+1.05%+1.21 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed230.48 kB+0.53%+1.21 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed243.3 kB+0.5%+1.21 kB 🔺
@sentry/nextjs (client)42.62 kB+0.42%+178 B 🔺
@sentry/sveltekit (client)39.46 kB+0.46%+179 B 🔺
@sentry/node150.65 kB+0.01%+1 B 🔺
@sentry/node - without tracing98.4 kB+0.01%+1 B 🔺
@sentry/aws-serverless124.16 kB--

View base workflow run

@Lms24Lms24 self-assigned this Jun 16, 2025
Comment on lines -61 to -62
// TODO: Figure out if we can switch to using whenIdleOrHidden instead of onHidden
// use pagehide event from web-vitals
Copy link
Member Author

@Lms24 Lms24 Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we most definitely don't want to switch to this, because idle fires too early. Removed the comment I added in #16310

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Send Standalone LCP spans