feat(react-router): Emit low-cardinality names for function spans - #24567
Merged
Merged
Conversation
The loader, action and fetcher spans from the instrumentation API still
named themselves after the value they had at hand: the route pattern,
which falls back to the raw request path when React Router matches no
pattern, or the fetcher key, which is unique per fetcher instance. Under
span streaming both are high cardinality.
Name these spans after the function they wrap, matching the
`code.function.name` they already set. The `function` op's description
template is `{{code.function.name}}` and nothing else, so Relay cannot
infer the route from any attribute we could add - the previous name is
kept on `sentry.description` instead.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
function spansfunction spans
Lms24
marked this pull request as ready for review
September 22, 2026 11:14
Lms24
requested review from
nicohrubec and
s1gr1d
and removed request for
a team
September 22, 2026 11:14
function spansfunction spans
s1gr1d
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The loader, action and fetcher spans started by the instrumentation API named themselves after whatever value was at hand: the route pattern, which falls back to the raw request path whenever React Router matches no pattern, or the fetcher key, which is unique per fetcher instance. Under span streaming both are high cardinality. They now use the function they wrap: the
code.function.namethese spans already set, so the name matches what thefunctionop's convention asks for.The previous name is kept on
sentry.descriptioninstead, to override span description inference in Relay that doesn't apply to the previous naming pattern.ref #23954