@@ -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,7 +109,7 @@ 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 ;
@@ -115,7 +121,7 @@ export function _instrumentEmberRouter(
115
121
browserTracingOptions . instrumentPageLoad !== false
116
122
) {
117
123
const routeInfo = routerService . recognize ( url ) ;
118
- activeRootSpan = Sentry . startBrowserTracingPageLoadSpan ( client , {
124
+ activeRootSpan = startBrowserTracingPageLoadSpan ( client , {
119
125
name : `route:${ routeInfo . name } ` ,
120
126
origin : 'auto.pageload.ember' ,
121
127
attributes : {
@@ -148,7 +154,7 @@ export function _instrumentEmberRouter(
148
154
const { fromRoute, toRoute } = getTransitionInformation ( transition , routerService ) ;
149
155
activeRootSpan ?. end ( ) ;
150
156
151
- activeRootSpan = Sentry . startBrowserTracingNavigationSpan ( client , {
157
+ activeRootSpan = startBrowserTracingNavigationSpan ( client , {
152
158
name : `route:${ toRoute } ` ,
153
159
origin : 'auto.navigation.ember' ,
154
160
attributes : {
@@ -429,7 +435,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
429
435
instrumentPageLoad : false ,
430
436
} ) ;
431
437
432
- const client = Sentry . getClient < BrowserClient > ( ) ;
438
+ const client = getClient < BrowserClient > ( ) ;
433
439
434
440
const isAlreadyInitialized = macroCondition ( isTesting ( ) ) ? ! ! client ?. getIntegrationByName ( 'BrowserTracing' ) : false ;
435
441
0 commit comments