Skip to content

Commit 63095df

Browse files
committed
docs
1 parent 886628a commit 63095df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/tracing/src/browser/metrics.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ export class MetricsInstrumentation {
139139
const timeOrigin = msToSec(performance.timeOrigin);
140140

141141
['fcp', 'fp', 'lcp', 'ttfb'].forEach(name => {
142-
if (!this._measurements[name]) {
142+
if (!this._measurements[name] || timeOrigin >= transaction.startTimestamp) {
143143
return;
144144
}
145145

146+
// The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.
147+
// Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need
148+
// to be adjusted to be relative to transaction.startTimestamp.
149+
146150
const oldValue = this._measurements[name].value;
147151
const measurementTimestamp = timeOrigin + msToSec(oldValue);
148152
// normalizedValue should be in milliseconds

0 commit comments

Comments
 (0)