@@ -2,7 +2,7 @@ import { AfterViewInit, Directive, Injectable, Input, OnInit } from '@angular/co
2
2
import { Event , NavigationEnd , NavigationStart , Router } from '@angular/router' ;
3
3
import { getCurrentHub } from '@sentry/browser' ;
4
4
import { Span , Transaction , TransactionContext } from '@sentry/types' ;
5
- import { logger , timestampWithMs } from '@sentry/utils' ;
5
+ import { logger , stripUrlQueryAndFragment , timestampWithMs } from '@sentry/utils' ;
6
6
import { Observable } from 'rxjs' ;
7
7
import { filter , tap } from 'rxjs/operators' ;
8
8
@@ -61,11 +61,12 @@ export class TraceService {
61
61
}
62
62
63
63
const navigationEvent = event as NavigationStart ;
64
+ const strippedUrl = stripUrlQueryAndFragment ( navigationEvent . url ) ;
64
65
let activeTransaction = getActiveTransaction ( ) ;
65
66
66
67
if ( ! activeTransaction && stashedStartTransactionOnLocationChange ) {
67
68
activeTransaction = stashedStartTransaction ( {
68
- name : navigationEvent . url ,
69
+ name : strippedUrl ,
69
70
op : 'navigation' ,
70
71
} ) ;
71
72
}
@@ -76,7 +77,7 @@ export class TraceService {
76
77
op : `angular.routing` ,
77
78
tags : {
78
79
'routing.instrumentation' : '@sentry/angular' ,
79
- url : navigationEvent . url ,
80
+ url : strippedUrl ,
80
81
...( navigationEvent . navigationTrigger && {
81
82
navigationTrigger : navigationEvent . navigationTrigger ,
82
83
} ) ,
0 commit comments