Skip to content

feat(react-router)!: Remove server OTel instrumentation#22551

Open
chargome wants to merge 2 commits into
developfrom
feat/rr-remove-server-otel
Open

feat(react-router)!: Remove server OTel instrumentation#22551
chargome wants to merge 2 commits into
developfrom
feat/rr-remove-server-otel

Conversation

@chargome

@chargome chargome commented Jul 23, 2026

Copy link
Copy Markdown
Member

Removes the server-side OTel instrumentation from @sentry/react-router, now that the instrumentation API is the default and the minimum React Router version is 7.15.

Deletes the InstrumentationBase proxy that patched createRequestHandler, the OTel data-loader span-creation path with its Node-version gate, and the related flags/wiring.

Local e2e verification showed the bogus http.route: '*' placeholder no longer occurs once the proxy is gone — the underlying HTTP instrumentation resolves the real route. The processEvent/processSegmentSpan cleanup that stripped '*' is therefore dead code and is removed; an e2e assertion on a loader-less route (/performance/ssr) guards that a real http.route is still set.

Also deletes the react-router-7-framework-node-20-18 e2e app: it existed only to exercise the removed OTel data-loader path on old Node and pinned react-router 7.13 (below the 7.15 floor). Its remaining coverage is a subset of react-router-7-framework.

ServerBuild capture continues via the Vite plugin (SSR build). Dev-mode HMR capture is a known gap (see TODO) to be handled separately.

Fixes #22531
Ref #22290

Remove the server-side OTel instrumentation now that the instrumentation API is
the default and the minimum React Router version is 7.15. Deletes the
`InstrumentationBase` `createRequestHandler` proxy and the OTel data-loader
span-creation path (plus its Node-version gate).

The `http.route: '*'` cleanup in `processEvent`/`processSegmentSpan` stays
(simplified) - the bogus wildcard comes from the `@sentry/node` HTTP root span,
not our proxy, and routes without a loader/action still need it stripped.

Ref #22290

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Jul 23, 2026
@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 6633ca7. Configure here.

…-18 e2e app

Local e2e verification showed the `http.route: '*'` placeholder no longer occurs
after the OTel proxy removal - the underlying HTTP instrumentation resolves the
real route (e.g. `/performance/ssr`). Remove the now-dead `processEvent`/
`processSegmentSpan` cleanup and repurpose the e2e assertion to guard that a real
`http.route` is set on loader-less routes.

Delete the `react-router-7-framework-node-20-18` e2e app: it existed only to test
the removed OTel data-loader path on old Node, and pinned react-router 7.13 (below
the 7.15 floor). Its remaining coverage is a subset of `react-router-7-framework`.

Ref #22290

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chargome

chargome commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

buglitzer 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 8f98a8b. Configure here.

@chargome
chargome marked this pull request as ready for review July 23, 2026 13:42
@chargome
chargome requested a review from a team as a code owner July 23, 2026 13:42
@chargome
chargome requested review from mydea and nicohrubec and removed request for a team July 23, 2026 13:42
@chargome

Copy link
Copy Markdown
Member Author

Didn't add a migration entry here as is does not add much value to the existing one. I have one more follow up where I clarify the new setup in the migration file.

},

transform(code, id) {
// TODO: This only captures the server build for production SSR builds. Dev mode

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.

do you have an issue for this?

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.

Remove server OTel instrumentation from react-router

2 participants