Skip to content

ref(node)!: Remove @opentelemetry/instrumentation dependency - #22843

Draft
andreiborza wants to merge 1 commit into
developfrom
ab/js-3203-remove-otel-instrumentation-from-node
Draft

ref(node)!: Remove @opentelemetry/instrumentation dependency#22843
andreiborza wants to merge 1 commit into
developfrom
ab/js-3203-remove-otel-instrumentation-from-node

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

Removes the @opentelemetry/instrumentation dependency from @sentry/node, the last package that still declared it.

  • Delete the unused generateInstrumentOnce export (from @sentry/node and the framework SDKs that re-exported it).
  • Remove ensureIsWrapped and the missing_instrumentation context it set, plus the now-vestigial disableInstrumentationWarnings option and MissingInstrumentationContext type from @sentry/core.
  • Inline the trivial InstrumentationConfig type in the two files that used it.
  • Make @sentry/node/import an orchestrion-only diagnostics-channel hook and remove the legacy iitm @sentry/node/loader entry point.
  • Drop the otel variant of the makeOtelLoaders build util (node was its only user); the sentry-node variant is unchanged.

Why

All instrumentation is now channel-based via orchestrion, so nothing in @sentry/node uses @opentelemetry/instrumentation anymore. generateInstrumentOnce had no remaining call sites, and ensureIsWrapped's shimmer-based detection can no longer see channel-based express/koa/hapi, so its warning only produced false negatives. The @sentry/node/import hook already registered the orchestrion injection; the iitm register() call it also did instrumented nothing. This is a breaking change, made as part of the v11 major.

`@sentry/node` was the last package holding `@opentelemetry/instrumentation`.
All instrumentation is now channel-based via orchestrion, so the surface this
dependency backed is dead or a no-op:

- `generateInstrumentOnce` (and the framework re-exports) had no call sites.
- `ensureIsWrapped`'s shimmer-based check can no longer detect channel-based
  express/koa/hapi, so its warning and the `missing_instrumentation` context
  were removed, along with the `disableInstrumentationWarnings` option and the
  `MissingInstrumentationContext` type.
- The `@sentry/node/import` ESM hook now only registers the orchestrion
  diagnostics-channel injection; the legacy iitm `@sentry/node/loader` entry
  was removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

JS-3203

@andreiborza

andreiborza commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

batman begin

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5681acc. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.82 kB - -
@sentry/browser (incl. Tracing, Replay) 86.39 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.08 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB - -
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.27 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.18 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.59 kB - -
@sentry/core/browser 51.58 kB - -
@sentry/node 121.27 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B removed removed
@sentry/node - without tracing 84.77 kB - -
@sentry/aws-serverless 93.02 kB - -
@sentry/cloudflare (withSentry) - minified 197.59 kB - -
@sentry/cloudflare (withSentry) 485.77 kB - -

View base workflow run

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.

1 participant