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.26.0
Framework Version
Node 20.12.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
Sentry.init({dsn: process.env.SENTRY_DSN,skipOpenTelemetrySetup: true});// We want 100% sample rate but without telling sentry to init tracing (rolling our own tracing, using sentry for errors only).exportclassCustomSentrySamplerimplementsSampler{shouldSample(context: Context,_traceId: string,_spanName: string,_spanKind: SpanKind,attributes: SpanAttributes,_links: Link[],){constdecision=SamplingDecision.RECORD_AND_SAMPLED;// wrap the result, necessary for sentryreturnSentryOtel.wrapSamplingDecision({
decision,
context,spanAttributes: attributes,});}toString(){returnCustomSentrySampler.name;}}// can use SentrySampler if you init sentry with sample rate insteadconstprovider=newNodeTracerProvider({sampler: newCustomSentrySampler(),});// Only required if you are sending traces up to sentry// provider.addSpanProcessor(new SentrySpanProcessor());// an alternative exporter if you don't want to send traces to sentryprovider.addSpanProcessor(newOTLPTraceExporter({url: TRACING_EXPORTER_URL,}));constpropagator=SentryPropagator();constcontextManager=SentryContextManager();// register additional instrumentations outside of what sentry uses by default.// For this bug report, just adding net/dns instrumentations.registerInstrumentations({tracerProvider: provider,instrumentations: [newNetInstrumentation(),newDnsInstrumentation(),],});provider.register({ propagator, contextManager });Steps to Reproduce
- Setup SDK as above
- Run the app, hit an endpoint that triggers a captureException or captureMessage
- Check the trace for this request
Expected Result
The trace should NOT have any sentry related spans in it
Actual Result
Despite the @opentelemetry/instrumentation-http ignoring (not creating spans for) the sentry outgoing requests, the dns and net instrumentations still appear in the trace:


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.26.0
Framework Version
Node 20.12.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
Expected Result
The trace should NOT have any sentry related spans in it
Actual Result
Despite the @opentelemetry/instrumentation-http ignoring (not creating spans for) the sentry outgoing requests, the dns and net instrumentations still appear in the trace:

