File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/nextjs/src/client/routing Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,9 @@ const GLOBAL_OBJ_WITH_NEXT_ROUTER = GLOBAL_OBJ as typeof GLOBAL_OBJ & {
87
87
/** Instruments the Next.js app router for navigation. */
88
88
export function appRouterInstrumentNavigation ( client : Client ) : void {
89
89
routerTransitionHandler = ( href , navigationType ) => {
90
- const parameterizedPathname = maybeParameterizeRoute ( href ) ;
91
- const pathname = parameterizedPathname ?? new URL ( href , WINDOW . location . href ) . pathname ;
90
+ const unparameterizedPathname = new URL ( href , WINDOW . location . href ) . pathname ;
91
+ const parameterizedPathname = maybeParameterizeRoute ( unparameterizedPathname ) ;
92
+ const pathname = parameterizedPathname ?? unparameterizedPathname ;
92
93
93
94
if ( navigationRoutingMode === 'router-patch' ) {
94
95
navigationRoutingMode = 'transition-start-hook' ;
@@ -99,6 +100,7 @@ export function appRouterInstrumentNavigation(client: Client): void {
99
100
currentNavigationSpan . updateName ( pathname ) ;
100
101
currentNavigationSpan . setAttributes ( {
101
102
'navigation.type' : `router.${ navigationType } ` ,
103
+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : parameterizedPathname ? 'route' : 'url' ,
102
104
} ) ;
103
105
currentRouterPatchingNavigationSpanRef . current = undefined ;
104
106
} else {
You can’t perform that action at this time.
0 commit comments