@@ -448,15 +448,11 @@ function _trackNavigator(transaction: Transaction): void {
448448 const connection = navigator . connection ;
449449 if ( connection ) {
450450 if ( connection . effectiveType ) {
451- // TODO: Can we rewrite this to an attribute?
452- // eslint-disable-next-line deprecation/deprecation
453- transaction . setTag ( 'effectiveConnectionType' , connection . effectiveType ) ;
451+ transaction . setAttribute ( 'effectiveConnectionType' , connection . effectiveType ) ;
454452 }
455453
456454 if ( connection . type ) {
457- // TODO: Can we rewrite this to an attribute?
458- // eslint-disable-next-line deprecation/deprecation
459- transaction . setTag ( 'connectionType' , connection . type ) ;
455+ transaction . setAttribute ( 'connectionType' , connection . type ) ;
460456 }
461457
462458 if ( isMeasurementValue ( connection . rtt ) ) {
@@ -465,15 +461,11 @@ function _trackNavigator(transaction: Transaction): void {
465461 }
466462
467463 if ( isMeasurementValue ( navigator . deviceMemory ) ) {
468- // TODO: Can we rewrite this to an attribute?
469- // eslint-disable-next-line deprecation/deprecation
470- transaction . setTag ( 'deviceMemory' , `${ navigator . deviceMemory } GB` ) ;
464+ transaction . setAttribute ( 'deviceMemory' , `${ navigator . deviceMemory } GB` ) ;
471465 }
472466
473467 if ( isMeasurementValue ( navigator . hardwareConcurrency ) ) {
474- // TODO: Can we rewrite this to an attribute?
475- // eslint-disable-next-line deprecation/deprecation
476- transaction . setTag ( 'hardwareConcurrency' , String ( navigator . hardwareConcurrency ) ) ;
468+ transaction . setAttribute ( 'hardwareConcurrency' , String ( navigator . hardwareConcurrency ) ) ;
477469 }
478470}
479471
@@ -485,36 +477,26 @@ function _tagMetricInfo(transaction: Transaction): void {
485477 // Capture Properties of the LCP element that contributes to the LCP.
486478
487479 if ( _lcpEntry . element ) {
488- // TODO: Can we rewrite this to an attribute?
489- // eslint-disable-next-line deprecation/deprecation
490- transaction . setTag ( 'lcp.element' , htmlTreeAsString ( _lcpEntry . element ) ) ;
480+ transaction . setAttribute ( 'lcp.element' , htmlTreeAsString ( _lcpEntry . element ) ) ;
491481 }
492482
493483 if ( _lcpEntry . id ) {
494- // TODO: Can we rewrite this to an attribute?
495- // eslint-disable-next-line deprecation/deprecation
496- transaction . setTag ( 'lcp.id' , _lcpEntry . id ) ;
484+ transaction . setAttribute ( 'lcp.id' , _lcpEntry . id ) ;
497485 }
498486
499487 if ( _lcpEntry . url ) {
500488 // Trim URL to the first 200 characters.
501- // TODO: Can we rewrite this to an attribute?
502- // eslint-disable-next-line deprecation/deprecation
503- transaction . setTag ( 'lcp.url' , _lcpEntry . url . trim ( ) . slice ( 0 , 200 ) ) ;
489+ transaction . setAttribute ( 'lcp.url' , _lcpEntry . url . trim ( ) . slice ( 0 , 200 ) ) ;
504490 }
505491
506- // TODO: Can we rewrite this to an attribute?
507- // eslint-disable-next-line deprecation/deprecation
508- transaction . setTag ( 'lcp.size' , _lcpEntry . size ) ;
492+ transaction . setAttribute ( 'lcp.size' , _lcpEntry . size ) ;
509493 }
510494
511495 // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift
512496 if ( _clsEntry && _clsEntry . sources ) {
513497 DEBUG_BUILD && logger . log ( '[Measurements] Adding CLS Data' ) ;
514498 _clsEntry . sources . forEach ( ( source , index ) =>
515- // TODO: Can we rewrite this to an attribute?
516- // eslint-disable-next-line deprecation/deprecation
517- transaction . setTag ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
499+ transaction . setAttribute ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
518500 ) ;
519501 }
520502}
0 commit comments