Skip to content

Commit 02ef34e

Browse files
committed
fix(tracing): Don't send negative ttfb
1 parent 7e3207d commit 02ef34e

File tree

1 file changed

+1
-1
lines changed
  • packages/tracing-internal/src/browser/metrics

1 file changed

+1
-1
lines changed

packages/tracing-internal/src/browser/metrics/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
245245
if (typeof responseStartTimestamp === 'number' && transactionStartTime) {
246246
DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');
247247
_measurements['ttfb'] = {
248-
value: (responseStartTimestamp - transactionStartTime) * 1000,
248+
value: Math.max(responseStartTimestamp - transactionStartTime, 0) * 1000,
249249
unit: 'millisecond',
250250
};
251251

0 commit comments

Comments
 (0)