@@ -448,15 +448,11 @@ function _trackNavigator(transaction: Transaction): void {
448
448
const connection = navigator . connection ;
449
449
if ( connection ) {
450
450
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 ) ;
454
452
}
455
453
456
454
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 ) ;
460
456
}
461
457
462
458
if ( isMeasurementValue ( connection . rtt ) ) {
@@ -465,15 +461,11 @@ function _trackNavigator(transaction: Transaction): void {
465
461
}
466
462
467
463
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` ) ;
471
465
}
472
466
473
467
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 ) ) ;
477
469
}
478
470
}
479
471
@@ -485,36 +477,26 @@ function _tagMetricInfo(transaction: Transaction): void {
485
477
// Capture Properties of the LCP element that contributes to the LCP.
486
478
487
479
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 ) ) ;
491
481
}
492
482
493
483
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 ) ;
497
485
}
498
486
499
487
if ( _lcpEntry . url ) {
500
488
// 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 ) ) ;
504
490
}
505
491
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 ) ;
509
493
}
510
494
511
495
// See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift
512
496
if ( _clsEntry && _clsEntry . sources ) {
513
497
DEBUG_BUILD && logger . log ( '[Measurements] Adding CLS Data' ) ;
514
498
_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 ) ) ,
518
500
) ;
519
501
}
520
502
}
0 commit comments