Skip to content

Conflict between Otel-SDK and Sentry-SDK resulting in traces not being exported. #18178

@InterstellarStella

Description

@InterstellarStella

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nestjs

SDK Version

^10.19.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

SDKs and Versions Used:

"@opentelemetry/api": "^1.9.0",
"@opentelemetry/context-async-hooks": "^2.2.0",
"@opentelemetry/core": "^2.2.0",
"@opentelemetry/exporter-metrics-otlp-http": "^0.205.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.205.0",
"@opentelemetry/instrumentation": "^0.207.0",
"@opentelemetry/instrumentation-dataloader": "^0.23.3",
"@opentelemetry/instrumentation-express": "^0.54.3",
"@opentelemetry/instrumentation-graphql": "^0.53.3",
"@opentelemetry/instrumentation-grpc": "^0.205.0",
"@opentelemetry/instrumentation-http": "^0.205.0",
"@opentelemetry/instrumentation-ioredis": "^0.53.3",
"@opentelemetry/instrumentation-nestjs-core": "^0.52.2",
"@opentelemetry/instrumentation-pg": "^0.58.3",
"@opentelemetry/instrumentation-runtime-node": "^0.19.2",
"@opentelemetry/instrumentation-undici": "^0.18.0",
"@opentelemetry/resources": "^2.2.0",
"@opentelemetry/sdk-trace-base": "^2.1.0",
"@opentelemetry/semantic-conventions": "^1.37.0",
"@sentry/opentelemetry": "^10.19.0",
"@sentry/nestjs": "^10.19.0",
"@sentry/node": "^10.19.0",
"@sentry/profiling-node": "^10.19.0",
"form-data": "^4.0.4",
"graphql": "^16.10.0",
"graphql-depth-limit": "^1.1.0",
"graphql-subscriptions": "^3.0.0"

Setup provided in the Linear ticket.

Steps to Reproduce

We are facing an issue related to missing spans in our observability backend after enabling tracing using a combination of Sentry SDK and OpenTelemetry SDK.

After the integration, we started observing missing spans on random requests in our production systems. As part of our investigation, we also verified the dropped spans metric on the OpenTelemetry Collector to ensure that spans are not being dropped during collection or export. The metrics confirmed that no spans are being dropped by the collector, indicating that the issue likely lies in the instrumentation or context propagation layer rather than the collector itself.

This issue occurs more frequently in traces involving GraphQL requests and interactions with our PostgreSQL database.

Customer setup provided in the Linear ticket.

Expected Result

Actual Result

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions