Add the orchestrion config and server middleware that produce spans for Remix 3 requests.
- Patch
createRouter in @remix-run/fetch-router and prepend the Sentry middleware. Supply the matcher too, since the router does not expose the matched route pattern on the request context.
- Resolve the route at middleware entry, so errors thrown downstream already carry it.
- Set
http.route, response status and a low cardinality span name. router.mount() prefixes must be included.
- Ship the
--import @sentry/remix/v3/node entry, which registers Remix's TypeScript loader and Sentry's module hook together, so the start command keeps one flag.
The middleware does not open a span. It enriches the one @sentry/node already opened for node:http. That is what keeps it working on other runtimes later.
Channel subscription happens in the --import entry, not in Sentry.init(). createRouter() runs while app modules are being imported, which is before any init() call in the server entry.
Done when e2e covers parameterised routes, mounted routes and response status, and the raw id never appears in a span name.
Add the orchestrion config and server middleware that produce spans for Remix 3 requests.
createRouterin@remix-run/fetch-routerand prepend the Sentry middleware. Supply the matcher too, since the router does not expose the matched route pattern on the request context.http.route, response status and a low cardinality span name.router.mount()prefixes must be included.--import @sentry/remix/v3/nodeentry, which registers Remix's TypeScript loader and Sentry's module hook together, so the start command keeps one flag.The middleware does not open a span. It enriches the one
@sentry/nodealready opened fornode:http. That is what keeps it working on other runtimes later.Channel subscription happens in the
--importentry, not inSentry.init().createRouter()runs while app modules are being imported, which is before anyinit()call in the server entry.Done when e2e covers parameterised routes, mounted routes and response status, and the raw id never appears in a span name.