1- import { getCurrentScope } from '@sentry/browser' ;
1+ import { getActiveSpan , getCurrentScope , startInactiveSpan } from '@sentry/browser' ;
22import type { Span , Transaction } from '@sentry/types' ;
33import { logger , timestampInSeconds } from '@sentry/utils' ;
44
@@ -78,14 +78,12 @@ export const createTracingMixins = (options: TracingOptions): Mixins => {
7878 const isRoot = this . $root === this ;
7979
8080 if ( isRoot ) {
81- // eslint-disable-next-line deprecation/deprecation
82- const activeTransaction = getActiveTransaction ( ) ;
83- if ( activeTransaction ) {
81+ const activeSpan = getActiveSpan ( ) ;
82+ if ( activeSpan ) {
8483 this . $_sentryRootSpan =
8584 this . $_sentryRootSpan ||
86- // eslint-disable-next-line deprecation/deprecation
87- activeTransaction . startChild ( {
88- description : 'Application Render' ,
85+ startInactiveSpan ( {
86+ name : 'Application Render' ,
8987 op : `${ VUE_OP } .render` ,
9088 origin : 'auto.ui.vue' ,
9189 } ) ;
@@ -108,9 +106,8 @@ export const createTracingMixins = (options: TracingOptions): Mixins => {
108106 // Start a new span if current hook is a 'before' hook.
109107 // Otherwise, retrieve the current span and finish it.
110108 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 ) {
114111 // Cancel old span for this hook operation in case it didn't get cleaned up. We're not actually sure if it
115112 // will ever be the case that cleanup hooks re not called, but we had users report that spans didn't get
116113 // 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 => {
119116 oldSpan . end ( ) ;
120117 }
121118
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 } >` ,
125121 op : `${ VUE_OP } .${ operation } ` ,
126122 origin : 'auto.ui.vue' ,
127123 } ) ;
0 commit comments