-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(astro): Parametrize routes on client-side #17133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
const routeNameFromMetaTags = getMetaContent('sentry-route-name'); | ||
|
||
if (routeNameFromMetaTags) { | ||
const decodedRouteName = decodeURIComponent(routeNameFromMetaTags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: can we try/catch the decoding? Chances are low that it fails but we had similar issues (#16251) before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also update the sentry.origin
here to reflect that this is coming from the custom browser instrumentation.
Yes, there is an E2E test for that in |
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
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