@@ -6,14 +6,20 @@ import type RouterService from '@ember/routing/router-service';
6
6
import { _backburner , run , scheduleOnce } from '@ember/runloop' ;
7
7
import type { EmberRunQueues } from '@ember/runloop/-private/types' ;
8
8
import { getOwnConfig , isTesting , macroCondition } from '@embroider/macros' ;
9
- import * as Sentry from '@sentry/browser' ;
10
9
import type { ExtendedBackburner } from '@sentry/ember/runloop' ;
11
10
import type { Span } from '@sentry/types' ;
12
11
import { GLOBAL_OBJ , browserPerformanceTimeOrigin , timestampInSeconds } from '@sentry/utils' ;
13
12
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' ;
17
23
import type { EmberRouterMain , EmberSentryConfig , GlobalConfig , OwnConfig } from '../types' ;
18
24
19
25
function getSentryConfig ( ) : EmberSentryConfig {
@@ -103,15 +109,15 @@ export function _instrumentEmberRouter(
103
109
const browserTracingOptions = config . browserTracingOptions || config . sentry . browserTracingOptions || { } ;
104
110
const url = getLocationURL ( location ) ;
105
111
106
- const client = Sentry . getClient < BrowserClient > ( ) ;
112
+ const client = getClient < BrowserClient > ( ) ;
107
113
108
114
if ( ! client ) {
109
115
return ;
110
116
}
111
117
112
118
if ( url && browserTracingOptions . instrumentPageLoad !== false ) {
113
119
const routeInfo = routerService . recognize ( url ) ;
114
- activeRootSpan = Sentry . startBrowserTracingPageLoadSpan ( client , {
120
+ activeRootSpan = startBrowserTracingPageLoadSpan ( client , {
115
121
name : `route:${ routeInfo . name } ` ,
116
122
origin : 'auto.pageload.ember' ,
117
123
attributes : {
@@ -138,7 +144,7 @@ export function _instrumentEmberRouter(
138
144
const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
139
145
activeRootSpan ?. end ( ) ;
140
146
141
- activeRootSpan = Sentry . startBrowserTracingNavigationSpan ( client , {
147
+ activeRootSpan = startBrowserTracingNavigationSpan ( client , {
142
148
name : `route:${ toRoute } ` ,
143
149
origin : 'auto.navigation.ember' ,
144
150
attributes : {
@@ -416,7 +422,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
416
422
instrumentPageLoad : false ,
417
423
} ) ;
418
424
419
- const client = Sentry . getClient < BrowserClient > ( ) ;
425
+ const client = getClient < BrowserClient > ( ) ;
420
426
421
427
const isAlreadyInitialized = macroCondition ( isTesting ( ) ) ? ! ! client ?. getIntegrationByName ( 'BrowserTracing' ) : false ;
422
428
0 commit comments