@@ -99,11 +99,13 @@ export function _instrumentEmberRouter(
9999 let activeRootSpan : Span | undefined ;
100100 let transitionSpan : Span | undefined ;
101101
102+ // Maintaining backwards compatibility with config.browserTracingOptions, but passing it with Sentry options is preferred.
103+ const browserTracingOptions = config . browserTracingOptions || config . sentry . browserTracingOptions || { } ;
102104 const url = getLocationURL ( location ) ;
103105
104- if ( url ) {
106+ if ( url && browserTracingOptions . startTransactionOnPageLoad !== false ) {
105107 const routeInfo = routerService . recognize ( url ) ;
106- Sentry . startBrowserTracingNavigationSpan ( {
108+ Sentry . startBrowserTracingPageLoadSpan ( {
107109 name : `route:${ routeInfo . name } ` ,
108110 op : 'pageload' ,
109111 origin : 'auto.pageload.ember' ,
@@ -124,6 +126,10 @@ export function _instrumentEmberRouter(
124126 getBackburner ( ) . off ( 'end' , finishActiveTransaction ) ;
125127 } ;
126128
129+ if ( browserTracingOptions . startTransactionOnLocationChange === false ) {
130+ return ;
131+ }
132+
127133 routerService . on ( 'routeWillChange' , ( transition : Transition ) => {
128134 const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
129135 activeRootSpan ?. end ( ) ;
@@ -405,11 +411,10 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
405411 const browserTracing = browserTracingIntegration ( {
406412 idleTimeout,
407413 ...browserTracingOptions ,
414+ instrumentNavigation : false ,
415+ instrumentPageLoad : false ,
408416 } ) ;
409417
410- Sentry . disableDefaultBrowserTracingNavigationSpan ( ) ;
411- Sentry . disableDefaultBrowserTracingPageLoadSpan ( ) ;
412-
413418 const client = Sentry . getClient < BrowserClient > ( ) ;
414419
415420 const isAlreadyInitialized = macroCondition ( isTesting ( ) ) ? ! ! client ?. getIntegrationByName ( 'BrowserTracing' ) : false ;
0 commit comments