Skip to content

Commit 8367a00

Browse files
committed
ref: changes to browser tracing
1 parent 3b10f4e commit 8367a00

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

packages/angular/src/tracing.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';
1010
import {
1111
WINDOW,
1212
browserTracingIntegration as originalBrowserTracingIntegration,
13-
disableDefaultBrowserTracingNavigationSpan,
1413
getCurrentScope,
1514
startBrowserTracingNavigationSpan,
1615
} from '@sentry/browser';
@@ -71,14 +70,19 @@ export const instrumentAngularRouting = routingInstrumentation;
7170
* Use this integration in combination with `TraceService`
7271
*/
7372
export function browserTracingIntegration(
74-
options?: Parameters<typeof originalBrowserTracingIntegration>[0],
73+
options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},
7574
): 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+
}
8081

81-
return originalBrowserTracingIntegration(options);
82+
return originalBrowserTracingIntegration({
83+
...options,
84+
instrumentNavigation: false,
85+
});
8286
}
8387

8488
/**

0 commit comments

Comments
 (0)