feat(node)!: Make channel-based instrumentation the default#22501
Draft
andreiborza wants to merge 37 commits into
Draft
feat(node)!: Make channel-based instrumentation the default#22501andreiborza wants to merge 37 commits into
andreiborza wants to merge 37 commits into
Conversation
Contributor
size-limit report 📦
|
andreiborza
force-pushed
the
ab/channel-based-default
branch
from
July 23, 2026 11:56
921217b to
e9cde04
Compare
andreiborza
force-pushed
the
ab/channel-based-default
branch
from
July 24, 2026 09:07
404fb86 to
c9a6733
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 11d7697. Configure here.
andreiborza
force-pushed
the
ab/channel-based-default
branch
2 times, most recently
from
July 24, 2026 13:12
bd63462 to
3f9a563
Compare
andreiborza
force-pushed
the
ab/channel-based-default
branch
4 times, most recently
from
July 24, 2026 16:30
1028ca4 to
3c1a737
Compare
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>
andreiborza
force-pushed
the
ab/channel-based-default
branch
from
July 24, 2026 16:38
3c1a737 to
9808b49
Compare
Forward build-resolved tracingHooksDir in @sentry/nextjs server init so bundled pnpm apps load the channel-injection hook. Update span origins to orchestrion values (koa, hapi, nestjs, firebase functions) and add error.type to errored express request_handler spans. Skip preload and bring-your-own-OTel apps (node-express-cjs/esm-preload, node-otel-sdk-node, node-otel-custom-sampler); fixme AI (ai@v3), trpc, and firebase functions tests pending follow-ups.
node-koa: anonymous router middleware now resolves as 'middleware' via code.function.name under the channel path. Fixme trpc tests in tsx-express and node-express-v5 (same channel Express mount-path naming gap as node-express).
Same channel Vercel AI v3-unsupported gap as nextjs-16; the turbo/latest variants share this app dir so they're covered too.
…ress
The channel-based Express integration only resolved the route for
request_handler layers, so routes served through mounted middleware
(app.use('/trpc', handler)) never set http.route on the root span and their
transactions kept the raw URL name. Compute the matched route for every layer
type, mirroring the OTel Express integration's per-layer route resolution.
Re-enables the previously fixme'd trpc tests in node-express, tsx-express and
node-express-v5.
The aws-serverless `awsIntegration` still registered the vendored OTel `AwsInstrumentation`, emitting `auto.otel.aws` spans, while channel-based instrumentation is now the default everywhere else. Delegate to the channel `awsChannelIntegration` from @sentry/server-utils so aws-sdk spans carry the orchestrion origin, matching @sentry/node.
Channel-based instrumentation is bundled unconditionally now, growing the @sentry/node bundle. Bump the limits to match (131->141 KB, without-tracing 80->81 KB) and drop the stale `experimentalUseDiagnosticsChannelInjection` entry, whose export was removed.
Update hardcoded OpenTelemetry origins to the channel values now that channel-based instrumentation is the default (anthropic, apollo-graphql, aws-serverless graphql, postgres-streamed). Rename graphql.source to graphql.document to match the channel path, and guard the anthropic custom options error-event expectation behind isOrchestrionEnabled() like its sibling tests (the channel path marks the span errored but does not capture the handled rejection as an event).
…tion in nextjs hasSpansEnabled was called with unresolved options, so an app enabling tracing only via SENTRY_TRACES_SAMPLE_RATE skipped registering the build-resolved tracingHooksDir, while nodeInit still enabled channel injection with the bare specifier (which fails in bundled Next server builds). Resolve the env var first, matching @sentry/node's init.
…hooks parseFloat of an invalid env value yields NaN, which is not nullish, so hasSpansEnabled would treat tracing as enabled and disagree with @sentry/node. Mirror node's getTracesSampleRate and drop non-finite env values.
develop's hook-registration rework (#22443) resolves the bundled-pnpm specifier via absolute-path webpack externals and dropped the tracingHooksDir option from registerDiagnosticsChannelInjection and the _sentryOrchestrionTracingHooksDir build var. Remove the now-broken nextjs workaround that relied on them; node's init registers the hooks and the externals keep them resolvable.
After rebasing onto develop, the orchestrion runtime chain is bundled into the node builds (no longer lazy-loaded), growing @sentry/node (141->158 KB), @sentry/node without tracing (81->97 KB), and @sentry/aws-serverless (89->106 KB).
CI-measured @sentry/node without tracing (97032B) edged just over the 97 KB limit; CI gzip runs slightly larger than local. Bump without-tracing to 98 KB and @sentry/node to 159 KB for margin.
getAutoPerformanceIntegrations now uses the channel integrations from @sentry/server-utils/orchestrion directly instead of routing through the thin @sentry/node wrappers. Redis and Fastify keep their node wrappers (cache responseHook wiring; Fastify v3/v4 coverage). The wrapper files and their public exports are unchanged; removing them and the vendored OTel is tracked in JS-3074.
andreiborza
force-pushed
the
ab/channel-based-default
branch
2 times, most recently
from
July 24, 2026 17:05
9808b49 to
9bd4d80
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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