-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nuxt): Automatically add BrowserTracing #13005
Conversation
packages/nuxt/src/client/sdk.ts
Outdated
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", | ||
// in which case everything inside will get tree-shaken away | ||
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { | ||
if (hasTracingEnabled(options)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I checked and this logic is identical to next, sveltekit and astro. So far so good but there is a flaw here that we probably were not aware of:
hasTracingEnabled
returns false if neither tracesSampleRate
, tracesSampler
nor enableTracing
are set. So in this case, we'd not add the integration here. However, the only way to enable "Tracing without Performance" in browser land is to add browserTracingIntegration
but not set any of the three options.
Before we merge this PR, let's discuss if we change this behaviour in all SDKs or continue with it.
packages/nuxt/src/client/sdk.ts
Outdated
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", | ||
// in which case everything inside will get tree-shaken away | ||
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { | ||
if (hasTracingEnabled(options)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed today, let's remove this guard and later, once we have a vite plugin setup, add an easy-to-use option to configure the __SENTRY_TRACING__
flag :)
Add
BrowserTracing
whentracesSampleRate
is set.