feat(node)!: Remove iitm-based instrumentations from @sentry/node - #22728
feat(node)!: Remove iitm-based instrumentations from @sentry/node#22728andreiborza wants to merge 1 commit into
@sentry/node#22728Conversation
All performance integrations are now channel-based via `@sentry/server-utils`, so the old import-in-the-middle / OpenTelemetry vendored instrumentations are removed: - Remove the `registerEsmLoaderHooks` option and the `import-in-the-middle` dependency; the SDK no longer registers ESM loader hooks. - Make `knexIntegration` and `dataloaderIntegration` channel-only (no OTel fallback on runtimes without diagnostics-channel injection). - Drop support for Fastify `<3.21.0`. - Remove the deprecated `SentryHttpInstrumentation` and `SentryNodeFetchInstrumentation` classes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 b988ec5. Configure here.
| - `DenoMysql` => `Mysql` | ||
| - `DenoPostgres` => `Postgres` | ||
| - feat(node)!: Remove `import-in-the-middle`-based instrumentations from `@sentry/node`. All performance integrations are now channel-based via `@sentry/server-utils`. As part of this: | ||
| - The `registerEsmLoaderHooks` option was removed from `NodeOptions`. The SDK no longer registers `import-in-the-middle` ESM loader hooks, and `import-in-the-middle` is no longer a dependency. |
There was a problem hiding this comment.
Missing migration note for option
Medium Severity
Removing the public registerEsmLoaderHooks option from NodeOptions is a breaking API change. It is called out in the changelog, but MIGRATION.md’s @sentry/node removals section does not mention it, unlike other public removals in that guide. Flagged because the review rules require proper notices for public API removals.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit b988ec5. Configure here.
size-limit report 📦
|
|
Splitting this into one PR per instrumentation removal for easier review, with a final PR for the shared iitm plumbing (InstrumentationBase-based classes, esmLoader, import-in-the-middle). Superseded. |


What
Removes the
import-in-the-middle/ OpenTelemetry vendored instrumentations from@sentry/node. Performance integrations are now channel-based via@sentry/server-utils(default since #22501), so the old iitm code is dead and gets deleted here.registerEsmLoaderHooksoption and drop theimport-in-the-middledependency; the SDK no longer registers ESM loader hooks.knexIntegrationanddataloaderIntegrationchannel-only (drop the OTel fallback).<3.21.0(removesFastifyInstrumentationV3).SentryHttpInstrumentationandSentryNodeFetchInstrumentationclasses (the liveinstrumentHttpOutgoingRequests/instrumentUndicifunctions stay).Dropping Fastify
<3.21.0removes the last live iitm module-patcher, which is what makes the full ESM-loader teardown possible.@opentelemetry/instrumentationstays as a dependency (still used bygenerateInstrumentOnceandensureIsWrapped).Why
These instrumentations were replaced by the channel-based ones in
@sentry/server-utils. Keeping the iitm code around meant shipping ~12k lines of dead vendored instrumentation plus the ESM-loader plumbing that nothing used anymore.Closes: #22346