@@ -87,11 +87,8 @@ function _trackLCP(reportAllChanges: boolean): void {
8787 return ;
8888 }
8989
90- const timeOrigin = msToSec ( browserPerformanceTimeOrigin as number ) ;
91- const startTime = msToSec ( entry . startTime ) ;
9290 __DEBUG_BUILD__ && logger . log ( '[Measurements] Adding LCP' ) ;
9391 _measurements [ 'lcp' ] = { value : metric . value , unit : 'millisecond' } ;
94- _measurements [ 'mark.lcp' ] = { value : timeOrigin + startTime , unit : 'second' } ;
9592 _lcpEntry = entry as LargestContentfulPaint ;
9693 } , reportAllChanges ) ;
9794}
@@ -147,7 +144,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
147144 case 'mark' :
148145 case 'paint' :
149146 case 'measure' : {
150- const startTimestamp = _addMeasureSpans ( transaction , entry , startTime , duration , timeOrigin ) ;
147+ _addMeasureSpans ( transaction , entry , startTime , duration , timeOrigin ) ;
151148
152149 // capture web vitals
153150 const firstHidden = getVisibilityWatcher ( ) ;
@@ -157,12 +154,10 @@ export function addPerformanceEntries(transaction: Transaction): void {
157154 if ( entry . name === 'first-paint' && shouldRecord ) {
158155 __DEBUG_BUILD__ && logger . log ( '[Measurements] Adding FP' ) ;
159156 _measurements [ 'fp' ] = { value : entry . startTime , unit : 'millisecond' } ;
160- _measurements [ 'mark.fp' ] = { value : startTimestamp , unit : 'second' } ;
161157 }
162158 if ( entry . name === 'first-contentful-paint' && shouldRecord ) {
163159 __DEBUG_BUILD__ && logger . log ( '[Measurements] Adding FCP' ) ;
164160 _measurements [ 'fcp' ] = { value : entry . startTime , unit : 'millisecond' } ;
165- _measurements [ 'mark.fcp' ] = { value : startTimestamp , unit : 'second' } ;
166161 }
167162 break ;
168163 }
@@ -220,14 +215,18 @@ export function addPerformanceEntries(transaction: Transaction): void {
220215 _measurements [ name ] . value = normalizedValue ;
221216 } ) ;
222217
223- if ( _measurements [ 'mark.fid' ] && _measurements [ 'fid' ] ) {
218+ const fidMark = _measurements [ 'mark.fid' ] ;
219+ if ( fidMark && _measurements [ 'fid' ] ) {
224220 // create span for FID
225221 _startChild ( transaction , {
226222 description : 'first input delay' ,
227- endTimestamp : _measurements [ 'mark.fid' ] . value + msToSec ( _measurements [ 'fid' ] . value ) ,
223+ endTimestamp : fidMark . value + msToSec ( _measurements [ 'fid' ] . value ) ,
228224 op : 'web.vitals' ,
229- startTimestamp : _measurements [ 'mark.fid' ] . value ,
225+ startTimestamp : fidMark . value ,
230226 } ) ;
227+
228+ // Delete mark.fid as we don't want it to be part of final payload
229+ delete _measurements [ 'mark.fid' ] ;
231230 }
232231
233232 // If FCP is not recorded we should not record the cls value
0 commit comments