@@ -445,15 +445,11 @@ function _trackNavigator(span: Span): void {
445445 const connection = navigator . connection ;
446446 if ( connection ) {
447447 if ( connection . effectiveType ) {
448- // TODO: Can we rewrite this to an attribute?
449- // eslint-disable-next-line deprecation/deprecation
450- ( span as SentrySpan ) . setTag ( 'effectiveConnectionType' , connection . effectiveType ) ;
448+ transaction . setAttribute ( 'effectiveConnectionType' , connection . effectiveType ) ;
451449 }
452450
453451 if ( connection . type ) {
454- // TODO: Can we rewrite this to an attribute?
455- // eslint-disable-next-line deprecation/deprecation
456- ( span as SentrySpan ) . setTag ( 'connectionType' , connection . type ) ;
452+ transaction . setAttribute ( 'connectionType' , connection . type ) ;
457453 }
458454
459455 if ( isMeasurementValue ( connection . rtt ) ) {
@@ -462,15 +458,11 @@ function _trackNavigator(span: Span): void {
462458 }
463459
464460 if ( isMeasurementValue ( navigator . deviceMemory ) ) {
465- // TODO: Can we rewrite this to an attribute?
466- // eslint-disable-next-line deprecation/deprecation
467- ( span as SentrySpan ) . setTag ( 'deviceMemory' , `${ navigator . deviceMemory } GB` ) ;
461+ transaction . setAttribute ( 'deviceMemory' , `${ navigator . deviceMemory } GB` ) ;
468462 }
469463
470464 if ( isMeasurementValue ( navigator . hardwareConcurrency ) ) {
471- // TODO: Can we rewrite this to an attribute?
472- // eslint-disable-next-line deprecation/deprecation
473- ( span as SentrySpan ) . setTag ( 'hardwareConcurrency' , String ( navigator . hardwareConcurrency ) ) ;
465+ transaction . setAttribute ( 'hardwareConcurrency' , String ( navigator . hardwareConcurrency ) ) ;
474466 }
475467}
476468
@@ -482,36 +474,26 @@ function _tagMetricInfo(span: Span): void {
482474 // Capture Properties of the LCP element that contributes to the LCP.
483475
484476 if ( _lcpEntry . element ) {
485- // TODO: Can we rewrite this to an attribute?
486- // eslint-disable-next-line deprecation/deprecation
487- ( span as SentrySpan ) . setTag ( 'lcp.element' , htmlTreeAsString ( _lcpEntry . element ) ) ;
477+ transaction . setAttribute ( 'lcp.element' , htmlTreeAsString ( _lcpEntry . element ) ) ;
488478 }
489479
490480 if ( _lcpEntry . id ) {
491- // TODO: Can we rewrite this to an attribute?
492- // eslint-disable-next-line deprecation/deprecation
493- ( span as SentrySpan ) . setTag ( 'lcp.id' , _lcpEntry . id ) ;
481+ transaction . setAttribute ( 'lcp.id' , _lcpEntry . id ) ;
494482 }
495483
496484 if ( _lcpEntry . url ) {
497485 // Trim URL to the first 200 characters.
498- // TODO: Can we rewrite this to an attribute?
499- // eslint-disable-next-line deprecation/deprecation
500- ( span as SentrySpan ) . setTag ( 'lcp.url' , _lcpEntry . url . trim ( ) . slice ( 0 , 200 ) ) ;
486+ transaction . setAttribute ( 'lcp.url' , _lcpEntry . url . trim ( ) . slice ( 0 , 200 ) ) ;
501487 }
502488
503- // TODO: Can we rewrite this to an attribute?
504- // eslint-disable-next-line deprecation/deprecation
505- ( span as SentrySpan ) . setTag ( 'lcp.size' , _lcpEntry . size ) ;
489+ transaction . setAttribute ( 'lcp.size' , _lcpEntry . size ) ;
506490 }
507491
508492 // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift
509493 if ( _clsEntry && _clsEntry . sources ) {
510494 DEBUG_BUILD && logger . log ( '[Measurements] Adding CLS Data' ) ;
511495 _clsEntry . sources . forEach ( ( source , index ) =>
512- // TODO: Can we rewrite this to an attribute?
513- // eslint-disable-next-line deprecation/deprecation
514- ( span as SentrySpan ) . setTag ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
496+ transaction . setAttribute ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
515497 ) ;
516498 }
517499}
0 commit comments