Skip to content

ref(router): Align route params with semantic conventions #16828

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

Merged
merged 2 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/react/src/tanstackrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ function routeMatchToParamSpanAttributes(match: VendoredTanstackRouterRouteMatch

const paramAttributes: Record<string, string> = {};
Object.entries(match.params).forEach(([key, value]) => {
paramAttributes[`url.path.params.${key}`] = value;
paramAttributes[`url.path.params.${key}`] = value; // todo(v10): remove attribute which does not adhere to Sentry's semantic convention
paramAttributes[`url.path.parameter.${key}`] = value;
paramAttributes[`params.${key}`] = value; // params.[key] is an alias
});

return paramAttributes;
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export function instrumentVueRouter(
const attributes: SpanAttributes = {};

for (const key of Object.keys(to.params)) {
attributes[`params.${key}`] = to.params[key];
attributes[`url.path.parameter.${key}`] = to.params[key];
attributes[`params.${key}`] = to.params[key]; // params.[key] is an alias
}
for (const key of Object.keys(to.query)) {
const value = to.query[key];
Expand Down
Loading