Skip to content

feat(remix)!: Remove import-in-the-middle instrumentation - #22815

Merged
andreiborza merged 2 commits into
developfrom
ab/js-3207-remix-channel-based
Jul 29, 2026
Merged

feat(remix)!: Remove import-in-the-middle instrumentation#22815
andreiborza merged 2 commits into
developfrom
ab/js-3207-remix-channel-based

Conversation

@andreiborza

@andreiborza andreiborza commented Jul 29, 2026

Copy link
Copy Markdown
Member

What

Migrate @sentry/remix server instrumentation fully to the channel-based path.

  • Make the diagnostics-channel subscriber the only path in remixIntegration, removing the OpenTelemetry fallback and the spanStart hook that post-processed OTel spans.
  • Delete the vendored OTel RemixInstrumentation and the instrumentRemixWithOpenTelemetry / addRemixSpanAttributes helpers.
  • Drop the unused @opentelemetry/instrumentation and @opentelemetry/api dependencies.
  • Repoint the setupOnce form-data unit test onto the channel path.

Why

Channel-based instrumentation is the default in v11 and node no longer registers the import-in-the-middle ESM loader hook. The OTel path in Remix was already unreachable at runtime, so removing it drops dead code and two unused OpenTelemetry dependencies.

Closes: #22774

Migrate `@sentry/remix` server instrumentation fully to the channel-based
path and drop the OpenTelemetry `RemixInstrumentation` module patcher, so the
package no longer relies on the import-in-the-middle ESM loader hook.

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

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

JS-3207

@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 368b96e. Configure here.

@andreiborza
andreiborza marked this pull request as ready for review July 29, 2026 12:40
@andreiborza
andreiborza requested a review from a team as a code owner July 29, 2026 12:40
@andreiborza
andreiborza requested review from nicohrubec and s1gr1d and removed request for a team July 29, 2026 12:40

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

Comment on lines +29 to +30
// `match.route.id` / `match.params.*` mirror `RemixSemanticAttributes` from the OpenTelemetry
// `RemixInstrumentation` this integration replaced.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this comment can go?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gone in d685c8a

Comment on lines +106 to +107
* matched route (used to derive the `http.server` transaction name), mirroring the OpenTelemetry
* instrumentation's patch it replaced.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gone in d685c8a

@andreiborza
andreiborza enabled auto-merge (squash) July 29, 2026 13:08
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.82 kB +0.01% +2 B 🔺
@sentry/browser - with treeshaking flags 28.02 kB +0.02% +3 B 🔺
@sentry/browser (incl. Tracing) 47.1 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.1 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.81 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay) 86.4 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.84 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 91.13 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB -0.01% -1 B 🔽
@sentry/browser (incl. Feedback) 47.13 kB -0.01% -1 B 🔽
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB -0.01% -2 B 🔽
@sentry/browser (incl. Metrics) 30.89 kB -0.01% -3 B 🔽
@sentry/browser (incl. Logs) 31.12 kB -0.01% -2 B 🔽
@sentry/browser (incl. Metrics & Logs) 31.8 kB +0.02% +4 B 🔺
@sentry/react 31.61 kB +0.03% +8 B 🔺
@sentry/react (incl. Tracing) 49.33 kB +0.01% +3 B 🔺
@sentry/vue 34.74 kB -0.01% -3 B 🔽
@sentry/vue (incl. Tracing) 49.05 kB -0.01% -2 B 🔽
@sentry/svelte 29.85 kB -0.02% -4 B 🔽
CDN Bundle 31.86 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing) 47.45 kB -0.02% -6 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.41 kB -0.03% -8 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB -0.02% -8 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay) 85.09 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB -0.01% -8 B 🔽
CDN Bundle - uncompressed 95.06 kB +0.03% +26 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 142.28 kB +0.02% +28 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.78 kB +0.03% +26 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.26 kB +0.02% +28 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.53 kB +0.02% +26 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.54 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.5 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.24 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.2 kB +0.02% +28 B 🔺
@sentry/nextjs (client) 51.92 kB +0.01% +1 B 🔺
@sentry/sveltekit (client) 47.51 kB +0.01% +3 B 🔺
@sentry/core/server 79.59 kB -0.01% -2 B 🔽
@sentry/core/browser 51.6 kB - -
@sentry/node 121.69 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 85.26 kB +0.03% +25 B 🔺
@sentry/aws-serverless 93.48 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 197.59 kB +0.03% +40 B 🔺
@sentry/cloudflare (withSentry) 485.72 kB +0.01% +32 B 🔺

View base workflow run

@andreiborza
andreiborza merged commit 072eb9c into develop Jul 29, 2026
63 checks passed
@andreiborza
andreiborza deleted the ab/js-3207-remix-channel-based branch July 29, 2026 13:19
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.

Migrate @sentry/remix off import-in-the-middle to channel-based instrumentation

2 participants