22import type { IdleTransaction , Transaction } from '@sentry/core' ;
33import { getActiveTransaction } from '@sentry/core' ;
44import type { Measurements } from '@sentry/types' ;
5- import { browserPerformanceTimeOrigin , htmlTreeAsString , logger } from '@sentry/utils' ;
5+ import { browserPerformanceTimeOrigin , getElementIdentifier , logger } from '@sentry/utils' ;
66
77import {
88 addClsInstrumentationHandler ,
@@ -100,7 +100,7 @@ export function startTrackingInteractions(): void {
100100 const duration = msToSec ( entry . duration ) ;
101101
102102 transaction . startChild ( {
103- description : htmlTreeAsString ( entry . target ) ,
103+ description : getElementIdentifier ( entry . target ) ,
104104 op : `ui.interaction.${ entry . name } ` ,
105105 origin : 'auto.ui.browser.metrics' ,
106106 startTimestamp : startTime ,
@@ -470,7 +470,7 @@ function _tagMetricInfo(transaction: Transaction): void {
470470 // Capture Properties of the LCP element that contributes to the LCP.
471471
472472 if ( _lcpEntry . element ) {
473- transaction . setTag ( 'lcp.element' , htmlTreeAsString ( _lcpEntry . element ) ) ;
473+ transaction . setTag ( 'lcp.element' , getElementIdentifier ( _lcpEntry . element ) ) ;
474474 }
475475
476476 if ( _lcpEntry . id ) {
@@ -489,7 +489,7 @@ function _tagMetricInfo(transaction: Transaction): void {
489489 if ( _clsEntry && _clsEntry . sources ) {
490490 __DEBUG_BUILD__ && logger . log ( '[Measurements] Adding CLS Data' ) ;
491491 _clsEntry . sources . forEach ( ( source , index ) =>
492- transaction . setTag ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
492+ transaction . setTag ( `cls.source.${ index + 1 } ` , getElementIdentifier ( source . node ) ) ,
493493 ) ;
494494 }
495495}
0 commit comments