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.
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.
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
BrowserTracingwhentracesSampleRateis set.