@@ -322,7 +322,7 @@ export class Tracing implements Integration {
322
322
) ;
323
323
324
324
Tracing . _activeTransaction = span ;
325
- Tracing . _addOffsetToSpan ( `idleTransactionStarted- ${ Tracing . _currentIndex } ` , span as SpanClass ) ;
325
+ Tracing . _addOffsetToSpan ( span as SpanClass ) ;
326
326
327
327
// We need to do this workaround here and not use configureScope
328
328
// Reason being at the time we start the inital transaction we do not have a client bound on the hub yet
@@ -543,15 +543,9 @@ export class Tracing implements Integration {
543
543
* @param measureName name of the performance measure
544
544
* @param span Span to add data.offset to
545
545
*/
546
- private static _addOffsetToSpan ( measureName : string , span : SpanClass ) : void {
546
+ private static _addOffsetToSpan ( span : SpanClass ) : void {
547
547
if ( global . performance ) {
548
- const name = `#sentry-${ measureName } ` ;
549
- performance . measure ( name ) ;
550
- const measure = performance . getEntriesByName ( name ) . pop ( ) ;
551
- if ( measure ) {
552
- span . setData ( 'offset' , Tracing . _msToSec ( measure . duration ) ) ;
553
- }
554
- performance . clearMeasures ( name ) ;
548
+ span . setData ( 'offset' , Tracing . _msToSec ( performance . now ( ) ) ) ;
555
549
}
556
550
}
557
551
@@ -594,7 +588,7 @@ export class Tracing implements Integration {
594
588
const hub = _getCurrentHub ( ) ;
595
589
if ( hub ) {
596
590
const span = hub . startSpan ( spanContext ) ;
597
- Tracing . _addOffsetToSpan ( ` ${ name } ${ Tracing . _currentIndex } ` , span as SpanClass ) ;
591
+ Tracing . _addOffsetToSpan ( span as SpanClass ) ;
598
592
Tracing . _activities [ Tracing . _currentIndex ] = {
599
593
name,
600
594
span,
0 commit comments