Skip to content

Commit f214c72

Browse files
committed
create span for FID
1 parent 5026ce0 commit f214c72

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/tracing/src/browser/metrics.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ export class MetricsInstrumentation {
160160
this._measurements[name] = { value: normalizedValue };
161161
});
162162

163+
if (this._measurements['mark.fid'] && this._measurements['fid']) {
164+
// create span for FID
165+
166+
_startChild(transaction, {
167+
description: 'first input delay',
168+
endTimestamp: this._measurements['mark.fid'].value + msToSec(this._measurements['fid'].value),
169+
op: 'web vitals',
170+
startTimestamp: this._measurements['mark.fid'].value,
171+
});
172+
}
173+
163174
transaction.setMeasurements(this._measurements);
164175
}
165176
}

0 commit comments

Comments
 (0)