Skip to content

ref(browser-utils): Align standalone LCP span attribute setting with pageload span LCP attributes #16844

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 3 commits into from
Jul 9, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 8, 2025

Small follow-up from #16591: As identified by cursor (lol), our way of setting the lcp.* attributes wasn't 100% aligned with how and when we set these attributes on the pageload span. This PR changes two things:

  • only set attributes if the respective LCP entry values are defined
  • truncate lcp.url if it is longer than 200 characters
  • re-added comments, since we'll likely remove the pageload-based logic at some point
  • also add lcp.size if entry.size === 0 (which previously was falsy and hence not added)

cursor[bot]

This comment was marked as outdated.

@Lms24 Lms24 requested review from s1gr1d and edwardgou-sentry July 8, 2025 15:08
@Lms24 Lms24 self-assigned this Jul 8, 2025
Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

github-actions bot commented Jul 8, 2025

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.62 kB +0.07% +24 B 🔺
@sentry/browser (incl. Tracing, Replay) 77.82 kB +0.05% +38 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.9 kB +0.06% +39 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 82.54 kB +0.06% +46 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 94.7 kB +0.04% +36 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.61 kB +0.06% +22 B 🔺
@sentry/vue 28.37 kB - -
@sentry/vue (incl. Tracing) 41.41 kB +0.07% +25 B 🔺
@sentry/svelte 24.01 kB - -
CDN Bundle 25.5 kB - -
CDN Bundle (incl. Tracing) 39.63 kB +0.07% +24 B 🔺
CDN Bundle (incl. Tracing, Replay) 75.61 kB +0.03% +21 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 81.07 kB +0.03% +19 B 🔺
CDN Bundle - uncompressed 74.5 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.77 kB +0.1% +108 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 232.07 kB +0.05% +108 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.89 kB +0.05% +108 B 🔺
@sentry/nextjs (client) 43.26 kB +0.07% +30 B 🔺
@sentry/sveltekit (client) 40.08 kB +0.07% +27 B 🔺
@sentry/node 162.02 kB - -
@sentry/node - without tracing 98.64 kB - -
@sentry/aws-serverless 124.4 kB - -

View base workflow run

@Lms24 Lms24 merged commit 0727988 into develop Jul 9, 2025
163 checks passed
@Lms24 Lms24 deleted the lms/ref-browser-standalone-lcp-attributes branch July 9, 2025 07:33
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