feat(remix): Rewrite RemixInstrumentation to orchestrion#22244
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8d64ae5. Configure here.
| subscribeCallRouteLoader(); | ||
| if (actionFormDataAttributes) { | ||
| subscribeCallRouteAction(actionFormDataAttributes); | ||
| } |
There was a problem hiding this comment.
Action spans gated on form data
High Severity
instrumentRemix only calls subscribeCallRouteAction when actionFormDataAttributes is truthy, so ACTION spans are never created unless form-data capture is configured. The old OTel instrumentation always patched callRouteAction and only used those keys for optional attribute extraction.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8d64ae5. Configure here.
| MATCH_SERVER_ROUTES: 'orchestrion:@remix-run/server-runtime:matchServerRoutes', | ||
| CALL_ROUTE_LOADER: 'orchestrion:@remix-run/server-runtime:callRouteLoader', | ||
| CALL_ROUTE_ACTION: 'orchestrion:@remix-run/server-runtime:callRouteAction', | ||
| } as const; |
There was a problem hiding this comment.
Duplicated remix channel names
Low Severity
Channel name strings are duplicated locally even though remixChannels already exists in @sentry/server-utils, and NestJS already exports nestjsChannels from @sentry/server-utils/orchestrion for the same purpose. Drift between the two copies would silently stop Remix channel spans from firing.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8d64ae5. Configure here.
size-limit report 📦
|


Rewrites the vendored
RemixInstrumentation(an OpenTelemetryInstrumentationBasethat patched@remix-run/server-runtime) to a diagnostics-channel listener, with orchestrion injecting the channels into the instrumented module at build time — mirroring the mysql/mysql2/kafkajs ports.SDK changes
@sentry/server-utils— populated the orchestrion config for@remix-run/server-runtime(orchestrion/config/remix.ts): one channel each forrequestHandler,matchServerRoutes,callRouteLoader, andcallRouteAction(the pre-2.9…RRnames collapse onto the same channels), across the CJS and ESM builds.requestHandleris a named function expression returned bycreateRequestHandler, which name-based matching can't target, so it uses theastQueryescape hatch.@sentry/remix— addedremixChannelIntegration, a diagnostics-channel subscriber that reproduces the old instrumentation:requestHandler→ theremix.requesthttp.serverserver span,matchServerRoutes→ enriches the active request span with the matched route (http.route, name,match.route.id) — no span of its own,callRouteLoader/callRouteAction→LOADER/ACTIONspans (the action path awaits form-data extraction from a pre-consumption request clone).remixChannelIntegrationfrom@sentry/remix. The OTelremixIntegrationstays the default; the channel integration replaces it (sameRemixname) when diagnostics-channel injection is enabled.E2E changes
remix-orchestriontest app intocreate-remix-app-v2as anINJECT_ORCHESTRION-gatedsentryTestvariant, so one codebase runs both the OpenTelemetry and orchestrion paths (build-time injection via the orchestrion Vite plugin, DB routes + docker for mysql/ioredis, and a build-injection assertion). The base transaction tests run in both variants as a parity check.@remix-run/server-runtimereachable by the build-time transform,@remix-run/nodeis force-bundled (it re-exports server-runtime, which otherwise stays external and is loaded byremix-serveat runtime, outside the Vite bundle).Fixes #20910