Skip to content

Commit 6c52130

Browse files
committed
ref(router): Save params aligning with semantic convention
1 parent 96e39c5 commit 6c52130

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/react/src/tanstackrouter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ function routeMatchToParamSpanAttributes(match: VendoredTanstackRouterRouteMatch
119119

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

125127
return paramAttributes;

packages/vue/src/router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export function instrumentVueRouter(
6161
const attributes: SpanAttributes = {};
6262

6363
for (const key of Object.keys(to.params)) {
64-
attributes[`params.${key}`] = to.params[key];
64+
attributes[`url.path.parameter.${key}`] = to.params[key];
65+
attributes[`params.${key}`] = to.params[key]; // params.[key] is an alias
6566
}
6667
for (const key of Object.keys(to.query)) {
6768
const value = to.query[key];

0 commit comments

Comments
 (0)