@@ -12,7 +12,7 @@ import type { Span, Transaction } from '@sentry/types';
12
12
import { GLOBAL_OBJ , browserPerformanceTimeOrigin , timestampInSeconds } from '@sentry/utils' ;
13
13
14
14
import type { BrowserClient } from '..' ;
15
- import { getActiveTransaction } from '..' ;
15
+ import { getActiveSpan , startInactiveSpan } from '..' ;
16
16
import type { EmberRouterMain , EmberSentryConfig , GlobalConfig , OwnConfig , StartTransactionFunction } from '../types' ;
17
17
18
18
type SentryTestRouterService = RouterService & {
@@ -149,10 +149,9 @@ export function _instrumentEmberRouter(
149
149
'routing.instrumentation' : '@sentry/ember' ,
150
150
} ,
151
151
} ) ;
152
- // eslint-disable-next-line deprecation/deprecation
153
- transitionSpan = activeTransaction ?. startChild ( {
152
+ transitionSpan = startInactiveSpan ( {
154
153
op : 'ui.ember.transition' ,
155
- description : `route:${ fromRoute } -> route:${ toRoute } ` ,
154
+ name : `route:${ fromRoute } -> route:${ toRoute } ` ,
156
155
origin : 'auto.ui.ember' ,
157
156
} ) ;
158
157
} ) ;
@@ -196,9 +195,8 @@ function _instrumentEmberRunloop(config: EmberSentryConfig): void {
196
195
if ( previousInstance ) {
197
196
return ;
198
197
}
199
- // eslint-disable-next-line deprecation/deprecation
200
- const activeTransaction = getActiveTransaction ( ) ;
201
- if ( ! activeTransaction ) {
198
+ const activeSpan = getActiveSpan ( ) ;
199
+ if ( ! activeSpan ) {
202
200
return ;
203
201
}
204
202
if ( currentQueueSpan ) {
@@ -213,24 +211,20 @@ function _instrumentEmberRunloop(config: EmberSentryConfig): void {
213
211
const minQueueDuration = minimumRunloopQueueDuration ?? 5 ;
214
212
215
213
if ( ( now - currentQueueStart ) * 1000 >= minQueueDuration ) {
216
- activeTransaction
217
- // eslint-disable-next-line deprecation/deprecation
218
- ?. startChild ( {
219
- op : `ui.ember.runloop.${ queue } ` ,
220
- origin : 'auto.ui.ember' ,
221
- startTimestamp : currentQueueStart ,
222
- endTimestamp : now ,
223
- } )
224
- . end ( ) ;
214
+ startInactiveSpan ( {
215
+ name : 'runloop' ,
216
+ op : `ui.ember.runloop.${ queue } ` ,
217
+ origin : 'auto.ui.ember' ,
218
+ startTimestamp : currentQueueStart ,
219
+ } ) ?. end ( now ) ;
225
220
}
226
221
currentQueueStart = undefined ;
227
222
}
228
223
229
224
// Setup for next queue
230
225
231
- // eslint-disable-next-line deprecation/deprecation
232
- const stillActiveTransaction = getActiveTransaction ( ) ;
233
- if ( ! stillActiveTransaction ) {
226
+ const stillActiveSpan = getActiveSpan ( ) ;
227
+ if ( ! stillActiveSpan ) {
234
228
return ;
235
229
}
236
230
currentQueueStart = timestampInSeconds ( ) ;
@@ -290,16 +284,12 @@ function processComponentRenderAfter(
290
284
const componentRenderDuration = now - begin . now ;
291
285
292
286
if ( componentRenderDuration * 1000 >= minComponentDuration ) {
293
- // eslint-disable-next-line deprecation/deprecation
294
- const activeTransaction = getActiveTransaction ( ) ;
295
- // eslint-disable-next-line deprecation/deprecation
296
- activeTransaction ?. startChild ( {
287
+ startInactiveSpan ( {
288
+ name : payload . containerKey || payload . object ,
297
289
op,
298
- description : payload . containerKey || payload . object ,
299
290
origin : 'auto.ui.ember' ,
300
291
startTimestamp : begin . now ,
301
- endTimestamp : now ,
302
- } ) ;
292
+ } ) ?. end ( now ) ;
303
293
}
304
294
}
305
295
@@ -377,15 +367,12 @@ function _instrumentInitialLoad(config: EmberSentryConfig): void {
377
367
const startTimestamp = ( measure . startTime + browserPerformanceTimeOrigin ) / 1000 ;
378
368
const endTimestamp = startTimestamp + measure . duration / 1000 ;
379
369
380
- // eslint-disable-next-line deprecation/deprecation
381
- const transaction = getActiveTransaction ( ) ;
382
- // eslint-disable-next-line deprecation/deprecation
383
- const span = transaction ?. startChild ( {
370
+ startInactiveSpan ( {
384
371
op : 'ui.ember.init' ,
372
+ name : 'init' ,
385
373
origin : 'auto.ui.ember' ,
386
374
startTimestamp,
387
- } ) ;
388
- span ?. end ( endTimestamp ) ;
375
+ } ) ?. end ( endTimestamp ) ;
389
376
performance . clearMarks ( startName ) ;
390
377
performance . clearMarks ( endName ) ;
391
378
0 commit comments