Skip to content

feat(node)!: Make channel-based instrumentation the default#22501

Draft
andreiborza wants to merge 23 commits into
developfrom
ab/channel-based-default
Draft

feat(node)!: Make channel-based instrumentation the default#22501
andreiborza wants to merge 23 commits into
developfrom
ab/channel-based-default

Conversation

@andreiborza

@andreiborza andreiborza commented Jul 22, 2026

Copy link
Copy Markdown
Member

What

Make orchestrion diagnostics-channel instrumentation the default in @sentry/node and remove the experimentalUseDiagnosticsChannelInjection() 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

andreiborza and others added 23 commits July 22, 2026 16:35
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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()];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 89607ae. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 27.76 kB - -
@sentry/browser - with treeshaking flags 26.2 kB - -
@sentry/browser (incl. Tracing) 46.59 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.4 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.39 kB - -
@sentry/browser (incl. Tracing, Replay) 85.83 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.47 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.56 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.22 kB - -
@sentry/browser (incl. Feedback) 44.95 kB - -
@sentry/browser (incl. sendFeedback) 32.56 kB - -
@sentry/browser (incl. FeedbackAsync) 37.62 kB - -
@sentry/browser (incl. Metrics) 28.84 kB - -
@sentry/browser (incl. Logs) 29.06 kB - -
@sentry/browser (incl. Metrics & Logs) 29.76 kB - -
@sentry/react 29.55 kB - -
@sentry/react (incl. Tracing) 48.87 kB - -
@sentry/vue 33.18 kB - -
@sentry/vue (incl. Tracing) 48.56 kB - -
@sentry/svelte 27.78 kB - -
CDN Bundle 30.1 kB - -
CDN Bundle (incl. Tracing) 48.48 kB - -
CDN Bundle (incl. Logs, Metrics) 31.68 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.78 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.94 kB - -
CDN Bundle (incl. Tracing, Replay) 85.99 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.31 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.07 kB - -
CDN Bundle - uncompressed 89.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.59 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.43 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.57 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.19 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.83 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.49 kB - -
@sentry/nextjs (client) 51.38 kB - -
@sentry/sveltekit (client) 47 kB - -
@sentry/core/server 80.13 kB - -
@sentry/core/browser 51.97 kB - -
⛔️ @sentry/node (max: 131 kB) 140.45 kB +13.08% +16.24 kB 🔺
@sentry/node (incl. diagnostics channel injection) 140.4 kB -6.19% -9.26 kB 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB -0.01% -2 B 🔽
@sentry/node - without tracing 79.8 kB +7.3% +5.43 kB 🔺
⛔️ @sentry/aws-serverless (max: 89 kB) 89.31 kB +6.5% +5.45 kB 🔺
@sentry/cloudflare (withSentry) - minified 196.59 kB - -
@sentry/cloudflare (withSentry) 483.84 kB - -

View base workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make channel-based instrumentations the default in v11

1 participant