feat(astro): Parametrize routes on client-side#17133
Merged
Conversation
Contributor
size-limit report 📦
|
Lms24
approved these changes
Jul 24, 2025
| const routeNameFromMetaTags = getMetaContent('sentry-route-name'); | ||
|
|
||
| if (routeNameFromMetaTags) { | ||
| const decodedRouteName = decodeURIComponent(routeNameFromMetaTags); |
Member
There was a problem hiding this comment.
l: can we try/catch the decoding? Chances are low that it fails but we had similar issues (#16251) before.
chargome
approved these changes
Jul 24, 2025
Member
chargome
left a comment
There was a problem hiding this comment.
Nice! Did you double check that e.g. catch-all/[...path] and catch-all/static in the same app get parameterized correctly?
| DEBUG_BUILD && debug.log(`[Tracing] Using route name from Sentry HTML meta-tag: ${decodedRouteName}`); | ||
|
|
||
| pageLoadSpan.updateName(decodedRouteName); | ||
| pageLoadSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route' as TransactionSource); |
Member
There was a problem hiding this comment.
We could also update the sentry.origin here to reflect that this is coming from the custom browser instrumentation.
Member
Author
Yes, there is an E2E test for that in |
s1gr1d
added a commit
that referenced
this pull request
Jul 24, 2025
Route Parametrization for Server Requests in Astro. The route is stored in a meta tag so the client can receive the parametrized information. Last part of this issue and closes #16686
s1gr1d
added a commit
that referenced
this pull request
Jul 24, 2025
3 tasks
This was referenced Sep 29, 2025
This was referenced Oct 7, 2025
This was referenced Oct 15, 2025
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.
Route Parametrization for Server Requests in Astro.
The route is stored in a meta tag so the client can receive the parametrized information.
Last part of this issue and closes #16686