Skip to content

feat(remix): Instrument Remix 3 server requests via fetch-router - #24801

Draft
chargome wants to merge 1 commit into
developfrom
charlygomez/js-3766-instrument-remix-3-server-requests
Draft

chargome wants to merge 1 commit into
developfrom
charlygomez/js-3766-instrument-remix-3-server-requests

Conversation

@chargome

Copy link
Copy Markdown
Member

Patches createRouter through orchestrion to prepend a Sentry middleware to every router. The middleware opens no span: Remix 3 serves over node:http, so httpIntegration has already opened the http.server span. It only enriches that span with http.route, the response status and a low cardinality name.

The SDK supplies the router's matcher, because the router never exposes one and the request context carries no pattern at middleware entry. The route is resolved by re-running the match against that matcher.

Remix 3 has no build step, so no bundler plugin can apply the transform. The --import @sentry/remix/v3/node entry registers the module hook and subscribes before the app's own modules are imported, and replaces --import remix/node-tsx rather than adding a second flag.

Error handling is a separate pull request.

Patches `createRouter` through orchestrion to prepend a Sentry middleware
to every router. The middleware opens no span: Remix 3 serves over
`node:http`, so `httpIntegration` has already opened the `http.server`
span. It only enriches it with the route, the response status and a low
cardinality name.

The matcher has to be supplied by the SDK because the router never
exposes one, and the request context carries no pattern at middleware
entry. Matching happens after router middleware runs and only writes
back `params`, so the route is resolved by re-running the match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome chargome self-assigned this Sep 28, 2026
@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

JS-3766

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

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

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB -0.01% -1 B 🔽
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB -0.01% -1 B 🔽
@sentry/svelte 29.26 kB - -
CDN Bundle 31.02 kB - -
CDN Bundle (incl. Tracing) 51.77 kB - -
CDN Bundle (incl. Logs, Metrics) 33.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay) 89.36 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.5 kB - -
CDN Bundle - uncompressed 91.66 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.03 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.99 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.8 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.39 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 141.93 kB +0.04% +56 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.92 kB +0.06% +44 B 🔺
@sentry/node - without tracing 90.94 kB +0.06% +50 B 🔺
@sentry/node - without channel injection 120.26 kB +0.01% +7 B 🔺
@sentry/aws-serverless 99.19 kB +0.05% +49 B 🔺
@sentry/cloudflare (withSentry) - minified 206.62 kB - -
@sentry/cloudflare (withSentry) 514.02 kB - -

View base workflow run

@chargome
chargome added this pull request to stack #24803 September 28, 2026 16:48

This branch has not been deployed

No deployments
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