sentry-javascript
sentry-javascript copied to clipboard
feat(browser): Record standalone LCP spans
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.enableStandaloneLcpSpansoption 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 thelcpmeasurement to the span
(depending on if we merge #16589 or this first, we might need to readjust size limit)
closes #13063
size-limit report 📦
| Path | Size | % Change | Change |
|---|---|---|---|
| @sentry/browser | 23.99 kB | - | - |
| @sentry/browser - with treeshaking flags | 23.76 kB | - | - |
| @sentry/browser (incl. Tracing) | 39.02 kB | +0.47% | +179 B 🔺 |
| @sentry/browser (incl. Tracing, Replay) | 77.16 kB | +0.23% | +174 B 🔺 |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags | 70.25 kB | +0.27% | +185 B 🔺 |
| @sentry/browser (incl. Tracing, Replay with Canvas) | 81.93 kB | +0.23% | +188 B 🔺 |
| @sentry/browser (incl. Tracing, Replay, Feedback) | 94.02 kB | +0.21% | +191 B 🔺 |
| @sentry/browser (incl. Feedback) | 40.75 kB | - | - |
| @sentry/browser (incl. sendFeedback) | 28.7 kB | - | - |
| @sentry/browser (incl. FeedbackAsync) | 33.59 kB | - | - |
| @sentry/react | 25.76 kB | - | - |
| @sentry/react (incl. Tracing) | 41 kB | +0.39% | +159 B 🔺 |
| @sentry/vue | 28.36 kB | - | - |
| @sentry/vue (incl. Tracing) | 40.86 kB | +0.39% | +155 B 🔺 |
| @sentry/svelte | 24.01 kB | - | - |
| CDN Bundle | 25.5 kB | - | - |
| CDN Bundle (incl. Tracing) | 39.11 kB | +0.5% | +191 B 🔺 |
| CDN Bundle (incl. Tracing, Replay) | 75 kB | +0.23% | +168 B 🔺 |
| CDN Bundle (incl. Tracing, Replay, Feedback) | 80.46 kB | +0.21% | +162 B 🔺 |
| CDN Bundle - uncompressed | 74.5 kB | - | - |
| CDN Bundle (incl. Tracing) - uncompressed | 116.63 kB | +1.05% | +1.21 kB 🔺 |
| CDN Bundle (incl. Tracing, Replay) - uncompressed | 230.68 kB | +0.53% | +1.21 kB 🔺 |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed | 243.5 kB | +0.5% | +1.21 kB 🔺 |
| @sentry/nextjs (client) | 42.63 kB | +0.38% | +161 B 🔺 |
| @sentry/sveltekit (client) | 39.49 kB | +0.4% | +155 B 🔺 |
| @sentry/node | 154.29 kB | - | - |
| @sentry/node - without tracing | 98.64 kB | - | - |
| @sentry/aws-serverless | 124.4 kB | - | - |