Open nwalters512 opened 4 months ago
Hey,
the background for this is based on browser-land, where we want to do certain things only if performance is set in any way.
We may revisit this, but for now I will fix this specifically in the node init check for performance integrations, and only load those if this is not undefined
!
Hey,
we have updated this in the SDK, so that even if this is set to undefined
, performance instrumentation will not be added by default.
(FWIW, we have not updated the hasTracingEnabled()
check yet, because we need to double check to make sure there are no other effects there, but we changed this for the perf instrumentation check itself).
I will leave the issue open still because I think the fundamental problem it poses remains valid!
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.0.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
import-in-the-middle
so that you can tell when it's being imported.tracesSampleRate: undefined
.import-in-the-middle
is still loaded by Sentry and instrumentation is still added.Expected Result
I would expect that an undefined value for
tracesSampleRate
would be interpreted as "don't enable tracing".Actual Result
The mere existence of a
tracesSampleRate
value in the Sentry init options, regardless of what the value is, is interpreted as "enable tracing instrumentation":https://github.com/getsentry/sentry-javascript/blob/d5568d8efe799dc99b35c21f027898d29a29071e/packages/core/src/utils/hasTracingEnabled.ts#L21
I think that check should probably look more like this:
I'd be happy to open a PR with this if a maintainer can give the go-ahead!