Title: Node tracing silently disabled when the OTel API global pre-exists with a different @opentelemetry/api version · Issue #22338 · getsentry/sentry-javascript · GitHub
Open Graph Title: Node tracing silently disabled when the OTel API global pre-exists with a different @opentelemetry/api version · Issue #22338 · getsentry/sentry-javascript
X Title: Node tracing silently disabled when the OTel API global pre-exists with a different @opentelemetry/api version · Issue #22338 · getsentry/sentry-javascript
Description: Description When the OTel API global (Symbol.for('opentelemetry.js.api.1')) already exists with a version that differs from the SDK's @opentelemetry/api copy — even by a patch release — registerGlobal's exact-version check rejects trace....
Open Graph Description: Description When the OTel API global (Symbol.for('opentelemetry.js.api.1')) already exists with a version that differs from the SDK's @opentelemetry/api copy — even by a patch release — registerGlo...
X Description: Description When the OTel API global (Symbol.for('opentelemetry.js.api.1')) already exists with a version that differs from the SDK's @opentelemetry/api copy — even by a patch release —...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/22338
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Node tracing silently disabled when the OTel API global pre-exists with a different @opentelemetry/api version","articleBody":"### Description\n\nWhen the OTel API global (`Symbol.for('opentelemetry.js.api.1')`) already exists with a `version` that differs from the SDK's `@opentelemetry/api` copy — even by a patch release — `registerGlobal`'s exact-version check rejects `trace.setGlobalTracerProvider()`. [`setupSentryTracerProvider` returns `[undefined, undefined]`](https://github.com/getsentry/sentry-javascript/blob/3204ba5327/packages/node/src/sdk/initOtel.ts#L135) with only a debug-build warning, and every span — including `Sentry.startSpan()` — is silently non-recording. Errors and logs keep working, so nothing looks broken until you notice traces are missing.\n\n`trace.disable()` before init does not help: the rejection comes from the version gate, not an occupied `trace` slot.\n\nThis is the Node flavor of the Deno/Supabase issue fixed in #19723. Hit in production on Neon Functions, whose runtime pre-creates the global with api `1.9.0` while `@sentry/node@10.66.0` resolves `1.9.1`.\n\n### Reproduction\n\n```js\n// simulates a host runtime that created the global with a different api version\nglobalThis[Symbol.for('opentelemetry.js.api.1')] = { version: '1.9.0' };\n\nconst Sentry = await import('@sentry/node'); // resolves @opentelemetry/api 1.9.1\nSentry.init({ dsn: '\u003cdsn>', tracesSampleRate: 1 });\n\nSentry.startSpan({ name: 'test' }, (span) => span.isRecording()); // false\n// Sentry.getClient().traceProvider === undefined\n```\n\n### Expected\n\nEither the SDK claims the global (delete/recreate, as #19723 does for Deno, gated on `skipOpenTelemetrySetup`), or the failure is loud outside debug builds — today it is invisible.\n\nUserland workaround: `delete globalThis[Symbol.for('opentelemetry.js.api.1')]` before `Sentry.init()`.\n","author":{"url":"https://github.com/sergical","@type":"Person","name":"sergical"},"datePublished":"2026-07-16T21:19:36Z","url":"https://github.com/getsentry/sentry-javascript/issues/22338"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bf2ee453-8ee1-9ad2-8c7d-f2afda687494 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD8A:3ABDFB:9C65BF:D5362D:6B048219 |
| html-safe-nonce | c94d6654dd9896bc5336464d60556727f8b8096c3dc9a49ac2d12e8827674120 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDhBOjNBQkRGQjo5QzY1QkY6RDUzNjJEOjZCMDQ4MjE5IiwidmlzaXRvcl9pZCI6Ijg0OTQ2NzY1NTI3OTIxNzkyMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 58ded6238db84bafe8aab792cb923e7f3414a97ac2fca74ecfd1d3afde65e7b6 |
| hovercard-subject-tag | issue:4906080154 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/22338/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49c7ad37d9ee10fdbc72781707b724f5a2361cacc353f3472282c57130a14d2c/getsentry/sentry-javascript/issues/22338 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49c7ad37d9ee10fdbc72781707b724f5a2361cacc353f3472282c57130a14d2c/getsentry/sentry-javascript/issues/22338 |
| og:image:alt | Description When the OTel API global (Symbol.for('opentelemetry.js.api.1')) already exists with a version that differs from the SDK's @opentelemetry/api copy — even by a patch release — registerGlo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sergical |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width