Title: Revisit diagnostics-channel injection span-enabled gate once node-core is removed · Issue #22294 · getsentry/sentry-javascript · GitHub
Open Graph Title: Revisit diagnostics-channel injection span-enabled gate once node-core is removed · Issue #22294 · getsentry/sentry-javascript
X Title: Revisit diagnostics-channel injection span-enabled gate once node-core is removed · Issue #22294 · getsentry/sentry-javascript
Description: What When node-core is removed in v11, revisit how the diagnostics-channel-injection gate in packages/node/src/sdk/index.ts decides whether tracing is enabled (isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)). During t...
Open Graph Description: What When node-core is removed in v11, revisit how the diagnostics-channel-injection gate in packages/node/src/sdk/index.ts decides whether tracing is enabled (isDiagnosticsChannelInjectionEnabled(...
X Description: What When node-core is removed in v11, revisit how the diagnostics-channel-injection gate in packages/node/src/sdk/index.ts decides whether tracing is enabled (isDiagnosticsChannelInjectionEnabled(...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/22294
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Revisit diagnostics-channel injection span-enabled gate once node-core is removed","articleBody":"## What\n\nWhen node-core is removed in v11, revisit how the diagnostics-channel-injection gate in `packages/node/src/sdk/index.ts` decides whether tracing is enabled (`isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)`).\n\nDuring the aws-sdk orchestrion work (PR #22143) we hit a case where the DC-injection gate runs in `_init` *before* node-core resolves `SENTRY_TRACES_SAMPLE_RATE`. On the `@sentry/aws-serverless` Lambda auto-init path (`awslambda-auto.ts`), the sample rate is split across two options objects: it's passed into `getDefaultIntegrations({ tracesSampleRate })` but NOT into the `init({ integrations: [...] })` call. So at the `_init` gate `hasSpansEnabled(options)` returns `false` even though tracing will be on, `register()` is skipped, the module hooks never install, and spans silently never emit.\n\nA local `hasSpansEnabledIncludingEnv` helper was added to compensate (peek at the env var at gate time), then **removed as a code smell**: it duplicated node-core's private `getTracesSampleRate` env parsing (which also exists in `node-core/src/light/sdk.ts`), and its name implied a general predicate when it was really a gate-timing shim.\n\n## Why\n\nThe root cause is architectural and specific to the node → node-core split: the sample rate is resolved late (inside node-core) and split across two options objects on the auto-init path. This disappears when orchestrion becomes the default and node-core goes away in v11, so fixing it now is churn on code with a known expiry. Tracking it here instead.\n\n## Options to evaluate in v11\n\n* Decouple `register()` from the span gate entirely (installing module hooks is near-free with no subscribers), so the gate no longer needs to predict node-core's env resolution; or\n* Expose a single shared \"tracing enabled (including env)\" resolver and dedupe the triplicated `SENTRY_TRACES_SAMPLE_RATE` parsing.\n\n## Note\n\nThe same env blind spot also affects the `getAutoPerformanceIntegrations()` gate on the auto-init path (it uses plain `hasSpansEnabled(options)` too), so whatever fix lands should cover both gates. This is currently only reachable via the experimental `experimentalUseDiagnosticsChannelInjection()` opt-in, so there is no impact on default users today.","author":{"url":"https://github.com/andreiborza","@type":"Person","name":"andreiborza"},"datePublished":"2026-07-15T13:00:07Z","url":"https://github.com/getsentry/sentry-javascript/issues/22294"}
| 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:fa2be0e3-8f98-231c-d44d-37713cf874be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8262:DDFD6:315BB0C:4028806:6B04248D |
| html-safe-nonce | 43a793fcd7e9237db6481c6e4f708ec4a6949310b5336f59a44a605e1b886132 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjYyOkRERkQ2OjMxNUJCMEM6NDAyODgwNjo2QjA0MjQ4RCIsInZpc2l0b3JfaWQiOiI3MjgxMjE4NDAzMjcxMTg5NjQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d23d3691ee040aa60076addffff50245546b7023a74f8ef996e0c928882153ec |
| hovercard-subject-tag | issue:4892679345 |
| 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/22294/issue_layout |
| twitter:image | https://opengraph.githubassets.com/945f961c0588d54b3953a9bed85a96184837b2ebc333cbfa4f750a23dd9b2287/getsentry/sentry-javascript/issues/22294 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/945f961c0588d54b3953a9bed85a96184837b2ebc333cbfa4f750a23dd9b2287/getsentry/sentry-javascript/issues/22294 |
| og:image:alt | What When node-core is removed in v11, revisit how the diagnostics-channel-injection gate in packages/node/src/sdk/index.ts decides whether tracing is enabled (isDiagnosticsChannelInjectionEnabled(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreiborza |
| hostname | github.com |
| expected-hostname | github.com |
| None | f8d9f404447ab5df341c8a92cf5fc927730ad1321e64ac57656444d2438097f1 |
| 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 | f7edccce04851591ee529948701779ce6819bc53 |
| 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