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.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).
export class CustomSentrySampler implements Sampler {
shouldSample(
context: Context,
_traceId: string,
_spanName: string,
_spanKind: SpanKind,
attributes: SpanAttributes,
_links: Link[],
) {
const decision = SamplingDecision.RECORD_AND_SAMPLED;
// wrap the result, necessary for sentry
return SentryOtel.wrapSamplingDecision({
decision,
context,
spanAttributes: attributes,
});
}
toString() {
return CustomSentrySampler.name;
}
}
// can use SentrySampler if you init sentry with sample rate instead
const provider = new NodeTracerProvider({ sampler: new CustomSentrySampler(), });
// 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 sentry
provider.addSpanProcessor(new OTLPTraceExporter({
url: TRACING_EXPORTER_URL,
}));
const propagator = SentryPropagator();
const contextManager = SentryContextManager();
// register additional instrumentations outside of what sentry uses by default.
// For this bug report, just adding net/dns instrumentations.
registerInstrumentations({
tracerProvider: provider,
instrumentations: [
new NetInstrumentation(),
new DnsInstrumentation(),
],
});
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:
Metadata
Metadata
Assignees
Type
Projects
Status
No status