After removing the iitm-based instrumentations (#22346) and the deprecated InstrumentationBase-derived classes, @sentry/node no longer registers any OpenTelemetry/import-in-the-middle module patchers. But it still depends on @opentelemetry/instrumentation for a handful of live imports. This ticket tracks vendoring/reimplementing those so we can drop the dependency, mirroring the @opentelemetry/core removal effort in #21674.
Remaining consumers (as of #22346 end state)
Live code imports:
packages/node/src/otel/instrument.ts — registerInstrumentations, Instrumentation (type). Backs generateInstrumentOnce, which is a public export (src/index.ts).
packages/node/src/utils/ensureIsWrapped.ts — isWrapped. Used by the Express/Koa/Hapi/Fastify error-handler setup to warn if the app object wasn't wrapped.
Type-only imports (trivial to inline):
packages/node/src/integrations/http/SentryHttpInstrumentation.ts — InstrumentationConfig, base of the public SentryHttpInstrumentationOptions.
packages/node/src/integrations/tracing/redis/vendored/types.ts — InstrumentationConfig, base of the redis cache option types used by cache.ts.
Work
Notes
After removing the iitm-based instrumentations (#22346) and the deprecated
InstrumentationBase-derived classes,@sentry/nodeno longer registers any OpenTelemetry/import-in-the-middle module patchers. But it still depends on@opentelemetry/instrumentationfor a handful of live imports. This ticket tracks vendoring/reimplementing those so we can drop the dependency, mirroring the@opentelemetry/coreremoval effort in #21674.Remaining consumers (as of #22346 end state)
Live code imports:
packages/node/src/otel/instrument.ts—registerInstrumentations,Instrumentation(type). BacksgenerateInstrumentOnce, which is a public export (src/index.ts).packages/node/src/utils/ensureIsWrapped.ts—isWrapped. Used by the Express/Koa/Hapi/Fastify error-handler setup to warn if the app object wasn't wrapped.Type-only imports (trivial to inline):
packages/node/src/integrations/http/SentryHttpInstrumentation.ts—InstrumentationConfig, base of the publicSentryHttpInstrumentationOptions.packages/node/src/integrations/tracing/redis/vendored/types.ts—InstrumentationConfig, base of the redis cache option types used bycache.ts.Work
registerInstrumentations+ theInstrumentationtype behindgenerateInstrumentOnce(or evaluate whethergenerateInstrumentOncestill needs to exist at all now that nothing internal calls it — it only remains as a public export).isWrapped(small shimmer helper).InstrumentationConfigtype usages.@opentelemetry/instrumentationfrompackages/node/package.json.Notes
@sentry/node#22346 (iitm instrumentation removal) landing first.isWrappedis a chance to also fix the false "not instrumented" warnings thatensureIsWrappednow emits for channel-based Express/Koa/Hapi. Consider folding that fix in here.@opentelemetry/coreremoval (Remove@opentelemetry/coredependency #21674); same vendor-then-drop shape.@sentry/core#22489 (remove iitm-based instrumentations from@sentry/core).