1
- import { getCurrentScope } from '@sentry/browser' ;
1
+ import { getActiveSpan , getCurrentScope , startInactiveSpan } from '@sentry/browser' ;
2
2
import type { Span , Transaction } from '@sentry/types' ;
3
3
import { logger , timestampInSeconds } from '@sentry/utils' ;
4
4
@@ -78,14 +78,12 @@ export const createTracingMixins = (options: TracingOptions): Mixins => {
78
78
const isRoot = this . $root === this ;
79
79
80
80
if ( isRoot ) {
81
- // eslint-disable-next-line deprecation/deprecation
82
- const activeTransaction = getActiveTransaction ( ) ;
83
- if ( activeTransaction ) {
81
+ const activeSpan = getActiveSpan ( ) ;
82
+ if ( activeSpan ) {
84
83
this . $_sentryRootSpan =
85
84
this . $_sentryRootSpan ||
86
- // eslint-disable-next-line deprecation/deprecation
87
- activeTransaction . startChild ( {
88
- description : 'Application Render' ,
85
+ startInactiveSpan ( {
86
+ name : 'Application Render' ,
89
87
op : `${ VUE_OP } .render` ,
90
88
origin : 'auto.ui.vue' ,
91
89
} ) ;
@@ -108,9 +106,8 @@ export const createTracingMixins = (options: TracingOptions): Mixins => {
108
106
// Start a new span if current hook is a 'before' hook.
109
107
// Otherwise, retrieve the current span and finish it.
110
108
if ( internalHook == internalHooks [ 0 ] ) {
111
- // eslint-disable-next-line deprecation/deprecation
112
- const activeTransaction = ( this . $root && this . $root . $_sentryRootSpan ) || getActiveTransaction ( ) ;
113
- if ( activeTransaction ) {
109
+ const activeSpan = ( this . $root && this . $root . $_sentryRootSpan ) || getActiveSpan ( ) ;
110
+ if ( activeSpan ) {
114
111
// Cancel old span for this hook operation in case it didn't get cleaned up. We're not actually sure if it
115
112
// will ever be the case that cleanup hooks re not called, but we had users report that spans didn't get
116
113
// finished so we finish the span before starting a new one, just to be sure.
@@ -119,9 +116,8 @@ export const createTracingMixins = (options: TracingOptions): Mixins => {
119
116
oldSpan . end ( ) ;
120
117
}
121
118
122
- // eslint-disable-next-line deprecation/deprecation
123
- this . $_sentrySpans [ operation ] = activeTransaction . startChild ( {
124
- description : `Vue <${ name } >` ,
119
+ this . $_sentrySpans [ operation ] = startInactiveSpan ( {
120
+ name : `Vue <${ name } >` ,
125
121
op : `${ VUE_OP } .${ operation } ` ,
126
122
origin : 'auto.ui.vue' ,
127
123
} ) ;
0 commit comments