You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): Only start spans in trace if tracing is enabled (#8357)
In our (still internal) `trace` function, we don't yet check if
`hasTracingEnabled` returns `true` before trying to start a span or a
transaction. This leads to the following problematic UX path that was
discovered
[here](#5838 (reply in thread)):
1. Users don't set `tracesSampleRate` (or `tracesSampler`), causing some
SDKs (NextJS, SvelteKit) to **not** add the `BrowserTracing`
integration, which in turn means that tracing extension methods are not
added/registered.
2. Users or, more likely, other parts of our SDK (e.g. SvelteKit's
wrappers/handlers) call `trace` which will still try to start a
span/txn.
3. Users will get a console warning that tracing extension methods were
not installed and they should manually call `addExtensionMethods` which
is completely misleading in this case.
This fix makes `trace` check for `hasTracingEnabled()` in which case it
will not start a span but just invoke the error callback if an error
occurred.
0 commit comments