feat(node)!: Make channel-based instrumentation the default#22501
feat(node)!: Make channel-based instrumentation the default#22501andreiborza wants to merge 23 commits into
Conversation
Make orchestrion diagnostics-channel injection the default in `@sentry/node` and remove the `experimentalUseDiagnosticsChannelInjection()` opt-in. `Sentry.init()` now installs the channel-injection module hooks unconditionally when span recording is enabled, so the opt-in function, its loader indirection, and the name-based OTel->channel integration swap are gone. The self-selecting `dataloader` and `knex` integrations pick the channel path automatically now that `isOrchestrionInjected()` is true by default. Redis stays a composite integration: the native diagnostics-channel subscribers (node-redis >=5.12, ioredis >=5.11, batches) plus the orchestrion subscribers for the older ranges, all sharing the node cache `responseHook`. The vendored OTel patchers only run on runtimes without `tracingChannel` (Node <18.19). BREAKING CHANGE: `experimentalUseDiagnosticsChannelInjection()`, `diagnosticsChannelInjectionIntegrations()`, `isDiagnosticsChannelInjectionEnabled()` and `applyDiagnosticsChannelInjectionIntegrations()` are removed from `@sentry/node`. Channel-based instrumentation is now always on; no opt-in call is needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 89607ae. Configure here.
| // No-op otherwise. | ||
| return applyDiagnosticsChannelInjectionIntegrations(integrations, options); | ||
| export function getDefaultIntegrations(_options: Options): Integration[] { | ||
| return [...getDefaultIntegrationsWithoutPerformance(), awsIntegration(), awsLambdaIntegration()]; |
There was a problem hiding this comment.
AWS serverless drops performance integrations
High Severity
Removing applyDiagnosticsChannelInjectionIntegrations from getDefaultIntegrations leaves @sentry/aws-serverless defaults without any auto-performance integrations when tracing is on. Sentry.init() still registers orchestrion hooks, but the slim default list never includes channel subscribers such as postgresIntegration() or expressIntegration(), so Lambda apps lose DB and framework spans that the opt-in path used to append.
Reviewed by Cursor Bugbot for commit 89607ae. Configure here.
| // as possible, before the app imports its instrumented modules. | ||
| const useChannelInjection = hasSpansEnabled(optionsWithResolvedTracing); | ||
| if (useChannelInjection) { | ||
| registerDiagnosticsChannelInjection(); |
There was a problem hiding this comment.
Next.js tracing hooks path omitted
Medium Severity
Sentry.init() now calls registerDiagnosticsChannelInjection() with no options, but bundled Next.js apps still inject process.env._sentryOrchestrionTracingHooksDir at build time so the runtime hook can load @apm-js-collab/tracing-hooks under pnpm. The Next-specific wrapper that forwarded that directory was removed and nothing in @sentry/node reads the env var, so registration can fail silently and channel-based DB spans never appear despite the build flag.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 89607ae. Configure here.
size-limit report 📦
|


What
Make orchestrion diagnostics-channel instrumentation the default in
@sentry/nodeand remove theexperimentalUseDiagnosticsChannelInjection()opt-in.Why
The channel-based instrumentations shipped opt-in in v10. Making them the default in v11 unlocks instrumentation at run and build time.
Removal of the vendored OTel/IITM code is intentionally out of scope; it is tracked separately as follow-up.
Closes: #22345