- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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
const config = await dynamicallyLoadConfigSomehow();
Sentry.init({
  tracesSampleRate: config.sentryTracesSampleRate ?? undefined
});Steps to Reproduce
- Add logs to import-in-the-middleso that you can tell when it's being imported.
- Initialize Sentry with tracesSampleRate: undefined.
- Observe that even though I don't want Sentry to enable any tracing instrumentation, import-in-the-middleis 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":
| return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); | 
I think that check should probably look more like this:
return !!options && (options.enableTracing || options.tracesSampleRate != undefined || options.tracesSampler != undefined);I'd be happy to open a PR with this if a maintainer can give the go-ahead!
Metadata
Metadata
Assignees
Labels
Projects
Status
No status