@@ -10,7 +10,6 @@ import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
10
10
import {
11
11
WINDOW ,
12
12
browserTracingIntegration as originalBrowserTracingIntegration ,
13
- disableDefaultBrowserTracingNavigationSpan ,
14
13
getCurrentScope ,
15
14
startBrowserTracingNavigationSpan ,
16
15
} from '@sentry/browser' ;
@@ -71,14 +70,19 @@ export const instrumentAngularRouting = routingInstrumentation;
71
70
* Use this integration in combination with `TraceService`
72
71
*/
73
72
export function browserTracingIntegration (
74
- options ? : Parameters < typeof originalBrowserTracingIntegration > [ 0 ] ,
73
+ options : Parameters < typeof originalBrowserTracingIntegration > [ 0 ] = { } ,
75
74
) : Integration {
76
- instrumentationInitialized = true ;
77
- hooksBasedInstrumentation = true ;
78
-
79
- disableDefaultBrowserTracingNavigationSpan ( ) ;
75
+ // If the user opts out to set this up, we just don't initialize this.
76
+ // That way, the TraceService will not actually do anything, functionally disabling this.
77
+ if ( options . instrumentNavigation === false ) {
78
+ instrumentationInitialized = true ;
79
+ hooksBasedInstrumentation = true ;
80
+ }
80
81
81
- return originalBrowserTracingIntegration ( options ) ;
82
+ return originalBrowserTracingIntegration ( {
83
+ ...options ,
84
+ instrumentNavigation : false ,
85
+ } ) ;
82
86
}
83
87
84
88
/**
0 commit comments