Skip to content

fix(browser): Ensure standalone CLS and LCP spans have traceId of pageload span #16864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 9, 2025

builds on top of #16863

this PR fixes a bug in standalone web vital spans where, if they were sent because of a navigation, they would incorrectly be added to the navigation span's trace instead of the initial pageload span's trace. This surfaced while dogfooding these spans on sentry and inspecting them in the EAP traceview.

To fix this, I added a lifecycle hook in #16863 that triggers right before we start preparing the navigation span and hence, right before we recycle the propagation context to the new traceId. This PR now makes use of the new hook for CLS and LCP spans and it also makes the integration tests stricter to check for the correct trace ids.

@Lms24 Lms24 changed the base branch from develop to lms/feat-core-beforeStartNavigationSpan July 9, 2025 15:09
@Lms24 Lms24 requested review from edwardgou-sentry and s1gr1d July 9, 2025 15:11
@Lms24 Lms24 self-assigned this Jul 9, 2025
Copy link
Contributor

github-actions bot commented Jul 9, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.81 kB - -
@sentry/browser - with treeshaking flags 22.53 kB - -
@sentry/browser (incl. Tracing) 39.66 kB - -
@sentry/browser (incl. Tracing, Replay) 77.79 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.73 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.49 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 94.61 kB - -
@sentry/browser (incl. Feedback) 40.48 kB - -
@sentry/browser (incl. sendFeedback) 28.49 kB - -
@sentry/browser (incl. FeedbackAsync) 33.38 kB - -
@sentry/react 25.58 kB - -
@sentry/react (incl. Tracing) 41.64 kB +0.01% +2 B 🔺
@sentry/vue 28.26 kB - -
@sentry/vue (incl. Tracing) 41.46 kB +0.01% +2 B 🔺
@sentry/svelte 23.83 kB - -
CDN Bundle 25.36 kB - -
CDN Bundle (incl. Tracing) 39.63 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay) 75.57 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 81.02 kB +0.01% +3 B 🔺
CDN Bundle - uncompressed 74.08 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.7 kB +0.02% +12 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.62 kB +0.01% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.44 kB +0.01% +12 B 🔺
@sentry/nextjs (client) 43.28 kB +0.01% +2 B 🔺
@sentry/sveltekit (client) 40.11 kB - -
@sentry/node 167.85 kB +0.01% +1 B 🔺
@sentry/node - without tracing 100.59 kB - -
@sentry/aws-serverless 128.69 kB - -

View base workflow run

@Lms24 Lms24 force-pushed the lms/fix-browser-standalone-wv-pageload-traceid branch 2 times, most recently from bfbe6a6 to 7b61e1b Compare July 9, 2025 15:45
@Lms24 Lms24 force-pushed the lms/feat-core-beforeStartNavigationSpan branch from 768d7ce to ed3c762 Compare July 10, 2025 08:32
@Lms24 Lms24 force-pushed the lms/fix-browser-standalone-wv-pageload-traceid branch from 7b61e1b to 3454549 Compare July 10, 2025 10:57
Base automatically changed from lms/feat-core-beforeStartNavigationSpan to develop July 10, 2025 11:06
@Lms24 Lms24 force-pushed the lms/fix-browser-standalone-wv-pageload-traceid branch from 3454549 to 5cc3c90 Compare July 10, 2025 11:24
@Lms24 Lms24 enabled auto-merge (squash) July 10, 2025 11:24
@Lms24 Lms24 merged commit 1ad6d58 into develop Jul 10, 2025
131 checks passed
@Lms24 Lms24 deleted the lms/fix-browser-standalone-wv-pageload-traceid branch July 10, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants