Skip to content

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

Merged
andreiborza merged 47 commits into
developfrom
ab/channel-based-default
Jul 27, 2026
Merged

feat(node)!: Make channel-based instrumentation the default#22501
andreiborza merged 47 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

Comment thread packages/aws-serverless/src/init.ts
Comment thread packages/node/src/sdk/index.ts
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.02 kB - -
@sentry/browser - with treeshaking flags 26.46 kB - -
@sentry/browser (incl. Tracing) 46.54 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.46 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.3 kB - -
@sentry/browser (incl. Tracing, Replay) 85.87 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.51 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.22 kB - -
@sentry/browser (incl. Feedback) 45.2 kB - -
@sentry/browser (incl. sendFeedback) 32.82 kB - -
@sentry/browser (incl. FeedbackAsync) 37.86 kB - -
@sentry/browser (incl. Metrics) 29.12 kB - -
@sentry/browser (incl. Logs) 29.34 kB - -
@sentry/browser (incl. Metrics & Logs) 30.05 kB - -
@sentry/react 29.8 kB - -
@sentry/react (incl. Tracing) 48.85 kB - -
@sentry/vue 33.97 kB - -
@sentry/vue (incl. Tracing) 48.53 kB - -
@sentry/svelte 28.04 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 47.71 kB - -
CDN Bundle (incl. Logs, Metrics) 31.9 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.08 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 71.17 kB - -
CDN Bundle (incl. Tracing, Replay) 85.31 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.12 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.39 kB - -
CDN Bundle - uncompressed 90.26 kB - -
CDN Bundle (incl. Tracing) - uncompressed 143.22 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.2 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.73 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.47 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.13 kB - -
@sentry/nextjs (client) 51.41 kB - -
@sentry/sveltekit (client) 47.01 kB - -
@sentry/core/server 79.57 kB - -
@sentry/core/browser 51.54 kB - -
@sentry/node 125.39 kB +11.49% +12.92 kB 🔺
⛔️ @sentry/node (incl. diagnostics channel injection) (max: null) 0 B removed removed
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 85.7 kB +38.2% +23.69 kB 🔺
@sentry/aws-serverless 93.7 kB +29.62% +21.41 kB 🔺
@sentry/cloudflare (withSentry) - minified 195.94 kB - -
@sentry/cloudflare (withSentry) 482.5 kB - -

View base workflow run

Comment thread packages/nextjs/src/server/index.ts Outdated
Comment thread packages/node/src/integrations/tracing/mysql/index.ts
Comment thread packages/node/src/integrations/tracing/express.ts
Comment thread packages/node/src/integrations/tracing/index.ts
Comment thread dev-packages/e2e-tests/test-applications/node-express/tests/trpc.test.ts Outdated
Comment thread packages/nextjs/src/server/index.ts Outdated
@andreiborza
andreiborza force-pushed the ab/channel-based-default branch from 921217b to e9cde04 Compare July 23, 2026 11:56
Comment thread packages/node/src/integrations/tracing/express.ts Outdated
Comment thread packages/nextjs/src/server/index.ts Outdated
Comment thread packages/node/src/integrations/tracing/index.ts Outdated
@andreiborza
andreiborza force-pushed the ab/channel-based-default branch from 404fb86 to c9a6733 Compare July 24, 2026 09:07
Comment thread packages/node/src/integrations/tracing/redis/index.ts Outdated
andreiborza and others added 5 commits July 24, 2026 19:24
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 added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry Google GenAI instrumentation
from `@sentry/node`.

## Why

The Google GenAI integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry GraphQL instrumentation from
`@sentry/node`.

## Why

The GraphQL integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry amqplib instrumentation from
`@sentry/node`.

## Why

The amqplib integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry generic-pool instrumentation
from `@sentry/node`.

## Why

The generic-pool integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry mysql instrumentation from
`@sentry/node`.

## Why

The mysql integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry mysql2 instrumentation from
`@sentry/node`.

## Why

The mysql2 integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry Vercel AI instrumentation from
`@sentry/node`.

## Why

The Vercel AI integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry tedious instrumentation from
`@sentry/node`.

## Why

The tedious integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead OpenTelemetry `HapiInstrumentation` (and
`instrumentHapi`) plus its vendored code from `@sentry/node`. Keeps
`setupHapiErrorHandler`.

## Why

The Hapi integration is now provided by the channel-based implementation
in `@sentry/server-utils` (the default since #22501). The vendored
instrumentation is no longer wired up; only the Sentry-specific error
handler remains user-facing.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry kafkajs instrumentation from
`@sentry/node`.

## Why

The kafkajs integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the vendored OpenTelemetry fallback from the node
`dataloaderIntegration` and `knexIntegration`. They are now re-exported
directly from `@sentry/server-utils`, matching the other channel-based
integrations.

## Why

These were the only two integrations still keeping a vendored OTel
instrumentation as a runtime fallback (used when diagnostics-channel
injection was unavailable). Making them channel-only removes the last
vendored DB instrumentation and aligns them with every other integration
since channel-based became the default (#22501).

Note: on runtimes without diagnostics-channel injection (e.g. Bun, Deno,
older Node, or when injection fails), these integrations no longer
produce spans, consistent with the other integrations.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead OpenTelemetry `KoaInstrumentation` (and
`instrumentKoa`) plus its vendored code from `@sentry/node`. Keeps
`setupKoaErrorHandler`.

## Why

The Koa integration is now provided by the channel-based implementation
in `@sentry/server-utils` (the default since #22501). The vendored
instrumentation is no longer wired up; only the Sentry-specific error
handler remains user-facing.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry `redis` and `ioredis`
instrumentations (and their shared `semconv.ts`) from `@sentry/node`.
Keeps the `redisIntegration` wrapper, `cache.ts`, and the
`vendored/types.ts` that `cache.ts` still imports.

## Why

The redis integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored OTel instrumentations are no longer wired into the SDK, so they
are pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead OpenTelemetry `ExpressInstrumentation` class (and
`instrumentExpress`) from `@sentry/node`. Keeps
`setupExpressErrorHandler` / `expressErrorHandler`.

## Why

The express integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation is no longer wired up; only the Sentry-specific
error handler remains user-facing.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry postgres (pg) instrumentation
from `@sentry/node`.

## Why

The postgres (pg) integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry LangGraph instrumentation from
`@sentry/node`.

## Why

The LangGraph integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry MongoDB instrumentation from
`@sentry/node`.

## Why

The MongoDB integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry lru-memoizer instrumentation
from `@sentry/node`.

## Why

The lru-memoizer integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry LangChain instrumentation from
`@sentry/node`.

## Why

The LangChain integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry Mongoose instrumentation from
`@sentry/node`.

## Why

The Mongoose integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry OpenAI instrumentation from
`@sentry/node`.

## Why

The OpenAI integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry Firebase instrumentation from
`@sentry/node`.

## Why

The Firebase integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry postgres.js (`postgres`)
instrumentation from `@sentry/node`.

## Why

The postgres.js integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since #22501). The
vendored instrumentation here is no longer wired into the SDK, so it is
pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Removes the dead vendored OpenTelemetry Anthropic AI instrumentation
from `@sentry/node`.

## Why

The Anthropic AI integration is now provided by the channel-based
implementation in `@sentry/server-utils` (the default since
#22501). The vendored instrumentation here is
no longer wired into the SDK, so it is pure dead code.

Ref: #22346

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
## What

Drops support for Fastify `<3.21.0` by removing
`FastifyInstrumentationV3` (and `instrumentFastifyV3`). The node
`fastifyIntegration` becomes a thin pass-through to the channel-based
integration in `@sentry/server-utils`.

## Why

The channel-based `fastifyIntegration` (default since #22501) covers
Fastify `>=3.21.0 <6`. The v3 OpenTelemetry instrumentation only existed
to fill the `>=3.0.0 <3.21.0` gap, and it was the last remaining
import-in-the-middle module-patcher in `@sentry/node`. Dropping the old
Fastify range lets us remove it.

Ref: #22346

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 28, 2026
…strumentation base (#22755)

## What

Final cleanup PR. Once the vendored OpenTelemetry instrumentations are
gone, `@sentry/node` has no import-in-the-middle module patchers left,
so this removes the remaining iitm plumbing:

* Remove the `registerEsmLoaderHooks` option from `NodeOptions` and drop
the `import-in-the-middle` dependency.
* Delete the shared `InstrumentationNodeModuleFile` helper,
`esmLoader.ts`, and the ESM-loader detection util.
* Remove the deprecated `SentryHttpInstrumentation` and
`SentryNodeFetchInstrumentation` classes. The live
diagnostics-channel-based `instrumentHttpOutgoingRequests` /
`instrumentUndici` functions are kept.
* Delete the now-obsolete `esm/import-in-the-middle` integration-test
suite and add the changelog entry.

## Why

These were the last pieces tying `@sentry/node` to import-in-the-middle.
All performance integrations are channel-based via
`@sentry/server-utils` (default since
#22501), so the ESM loader hook served
nothing.

> **Depends on the per-integration removal PRs.** This branch deletes
`InstrumentationNodeModuleFile`, which the vendored instrumentations
still import on `develop`, so CI here stays red until those PRs merge.
It should be merged last.

Closes: #22346

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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

3 participants