Repository navigation
Closed
Labels
Node.jsOpenTelemetryTaskTech DebtjavascriptPull requests that update javascript codePull requests that update javascript code
Description
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). 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
- Reimplement or vendor
registerInstrumentations+ theInstrumentationtype behindgenerateInstrumentOnce(or evaluate whethergenerateInstrumentOncestill needs to exist at all now that nothing internal calls it — it only remains as a public export). - Reimplement/vendor
isWrapped(small shimmer helper). - Inline the two
InstrumentationConfigtype usages. - Drop
@opentelemetry/instrumentationfrompackages/node/package.json.
Notes
- Gated on Remove iitm-based instrumentations from
@sentry/node#22346 (iitm instrumentation removal) landing first. - Overlaps with ensureIsWrapped emits false "not instrumented" warnings for channel-based Express/Koa/Hapi #22555: removing/replacing
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. - Sibling of the
@opentelemetry/coreremoval (Remove@opentelemetry/coredependency #21674); same vendor-then-drop shape. - Related: Remove iitm-based instrumentations from
@sentry/core#22489 (remove iitm-based instrumentations from@sentry/core).
Metadata
Metadata
Assignees
Labels
Node.jsOpenTelemetryTaskTech DebtjavascriptPull requests that update javascript codePull requests that update javascript code
Activity
linear-code commentedon Jul 28, 2026
JS-3203