Skip to content

fix(browser): Ensure pageload & navigation spans have correct data #16279

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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mydea
Copy link
Member

@mydea mydea commented May 13, 2025

This PR fixes two things about our idle spans emitted from browserTracingIntegration:

  1. The navigation name was sometimes incorrect. This is because we look at window.location.pathname at the time when the popstate event is emitted - but at this point, this may not be updated yet. So a navigation transaction would possibly have the pathname of the previous page as transaction name.
  2. The request data is also possibly incorrect - this is set by HttpContext integration at event processing time. However, at this time the window.location data is also usually already of the following navigation, so the pageload would often have wrong request data associated to it. Now, we store this on the current scope at span creation time to ensure it is actually correct.

WIP on top of #16277 for tests

@mydea mydea self-assigned this May 13, 2025
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.97 kB added added
@sentry/browser - with treeshaking flags 23.63 kB added added
@sentry/browser (incl. Tracing) 38.27 kB added added
@sentry/browser (incl. Tracing, Replay) 76.38 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.41 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 81.14 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 93.23 kB added added
@sentry/browser (incl. Feedback) 40.77 kB added added
@sentry/browser (incl. sendFeedback) 28.71 kB added added
@sentry/browser (incl. FeedbackAsync) 33.6 kB added added
@sentry/react 25.79 kB added added
@sentry/react (incl. Tracing) 40.28 kB added added
@sentry/vue 28.36 kB added added
@sentry/vue (incl. Tracing) 40.08 kB added added
@sentry/svelte 24 kB added added
CDN Bundle 25.19 kB added added
CDN Bundle (incl. Tracing) 38.27 kB added added
CDN Bundle (incl. Tracing, Replay) 74.18 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 79.59 kB added added
CDN Bundle - uncompressed 73.5 kB added added
CDN Bundle (incl. Tracing) - uncompressed 113.36 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 227.31 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.14 kB added added
@sentry/nextjs (client) 41.92 kB added added
@sentry/sveltekit (client) 38.74 kB added added
@sentry/node 159.15 kB added added
@sentry/node - without tracing 97.9 kB added added
@sentry/aws-serverless 124.41 kB added added

Base automatically changed from fn/idleSpanCancelled to develop May 14, 2025 07:04
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.

1 participant