@@ -6,14 +6,20 @@ import type RouterService from '@ember/routing/router-service';
66import { _backburner , run , scheduleOnce } from '@ember/runloop' ;
77import type { EmberRunQueues } from '@ember/runloop/-private/types' ;
88import { getOwnConfig , isTesting , macroCondition } from '@embroider/macros' ;
9- import * as Sentry from '@sentry/browser' ;
109import type { ExtendedBackburner } from '@sentry/ember/runloop' ;
1110import type { Span } from '@sentry/types' ;
1211import { GLOBAL_OBJ , browserPerformanceTimeOrigin , timestampInSeconds } from '@sentry/utils' ;
1312
14- import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core' ;
15- import type { BrowserClient } from '..' ;
16- import { getActiveSpan , startInactiveSpan } from '..' ;
13+ import type { BrowserClient } from '@sentry/browser' ;
14+ import {
15+ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
16+ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
17+ getActiveSpan ,
18+ getClient ,
19+ startBrowserTracingNavigationSpan ,
20+ startBrowserTracingPageLoadSpan ,
21+ startInactiveSpan ,
22+ } from '@sentry/browser' ;
1723import type { EmberRouterMain , EmberSentryConfig , GlobalConfig , OwnConfig } from '../types' ;
1824
1925function getSentryConfig ( ) : EmberSentryConfig {
@@ -103,7 +109,7 @@ export function _instrumentEmberRouter(
103109 const browserTracingOptions = config . browserTracingOptions || config . sentry . browserTracingOptions || { } ;
104110 const url = getLocationURL ( location ) ;
105111
106- const client = Sentry . getClient < BrowserClient > ( ) ;
112+ const client = getClient < BrowserClient > ( ) ;
107113
108114 if ( ! client ) {
109115 return ;
@@ -115,7 +121,7 @@ export function _instrumentEmberRouter(
115121 browserTracingOptions . instrumentPageLoad !== false
116122 ) {
117123 const routeInfo = routerService . recognize ( url ) ;
118- activeRootSpan = Sentry . startBrowserTracingPageLoadSpan ( client , {
124+ activeRootSpan = startBrowserTracingPageLoadSpan ( client , {
119125 name : `route:${ routeInfo . name } ` ,
120126 origin : 'auto.pageload.ember' ,
121127 attributes : {
@@ -148,7 +154,7 @@ export function _instrumentEmberRouter(
148154 const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
149155 activeRootSpan ?. end ( ) ;
150156
151- activeRootSpan = Sentry . startBrowserTracingNavigationSpan ( client , {
157+ activeRootSpan = startBrowserTracingNavigationSpan ( client , {
152158 name : `route:${ toRoute } ` ,
153159 origin : 'auto.navigation.ember' ,
154160 attributes : {
@@ -429,7 +435,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
429435 instrumentPageLoad : false ,
430436 } ) ;
431437
432- const client = Sentry . getClient < BrowserClient > ( ) ;
438+ const client = getClient < BrowserClient > ( ) ;
433439
434440 const isAlreadyInitialized = macroCondition ( isTesting ( ) ) ? ! ! client ?. getIntegrationByName ( 'BrowserTracing' ) : false ;
435441
0 commit comments