@@ -2,7 +2,7 @@ import { AfterViewInit, Directive, Injectable, Input, OnInit } from '@angular/co
22import { Event , NavigationEnd , NavigationStart , Router } from '@angular/router' ;
33import { getCurrentHub } from '@sentry/browser' ;
44import { Span , Transaction , TransactionContext } from '@sentry/types' ;
5- import { logger , timestampWithMs } from '@sentry/utils' ;
5+ import { logger , stripUrlQueryAndFragment , timestampWithMs } from '@sentry/utils' ;
66import { Observable } from 'rxjs' ;
77import { filter , tap } from 'rxjs/operators' ;
88
@@ -61,11 +61,12 @@ export class TraceService {
6161 }
6262
6363 const navigationEvent = event as NavigationStart ;
64+ const strippedUrl = stripUrlQueryAndFragment ( navigationEvent . url ) ;
6465 let activeTransaction = getActiveTransaction ( ) ;
6566
6667 if ( ! activeTransaction && stashedStartTransactionOnLocationChange ) {
6768 activeTransaction = stashedStartTransaction ( {
68- name : navigationEvent . url ,
69+ name : strippedUrl ,
6970 op : 'navigation' ,
7071 } ) ;
7172 }
@@ -76,7 +77,7 @@ export class TraceService {
7677 op : `angular.routing` ,
7778 tags : {
7879 'routing.instrumentation' : '@sentry/angular' ,
79- url : navigationEvent . url ,
80+ url : strippedUrl ,
8081 ...( navigationEvent . navigationTrigger && {
8182 navigationTrigger : navigationEvent . navigationTrigger ,
8283 } ) ,
0 commit comments