8000 ref(nextjs): Clean up browser tracing integration by mydea · Pull Request #11022 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

ref(nextjs): Clean up browser tracing integration #11022

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 4 commits into from
Mar 12, 2024
Merged

Conversation

mydea
Copy link
Member
@mydea mydea commented Mar 11, 2024

Updates the app & pages router instrumentation to avoid depreacted options & streamline it overall.

This required a change to browser tracing, which is to allow to provide a custom sentryTrace / baggage string value to continue a trace from. Before this, we always picked up the trace from meta tag, which meant that if we tried to continue a trace manually in nextjs, then called the default browser tracing integration, it would just overwrite it.

Now, you can optionally pass this like this:

startBrowserTracingPageLoadSpan(
    client,
    { name },
    { sentryTrace, baggage }
});

And this will take presedence over looking at the meta tags! This also means we don't need any custom scope/trace handling in nextjs there anymore, which is also nice!

@mydea mydea requested review from lforst and s1gr1d March 11, 2024 14:19
@mydea mydea self-assigned this Mar 11, 2024
@mydea mydea force-pushed the fn/next-browserTracing branch from 931a0f0 to 24c0287 Compare March 11, 2024 15:51
@mydea mydea force-pushed the fn/next-browserTracing branch from 24c0287 to 644da33 Compare March 12, 2024 13:36
@mydea mydea merged commit 6088078 into develop Mar 12, 2024
@mydea mydea deleted the fn/next-browserTracing branch March 12, 2024 13:59
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
0