Skip to content

Commit be5b526

Browse files
committed
add comment for max duratio
1 parent 5e8300b commit be5b526

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/browser/src/tracing/previousTrace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export function addPreviousTraceSpanLink(
4848
return previousTraceInfo;
4949
}
5050

51+
// Only add the link if the startTimeStamp of the previous trace's root span is within
52+
// PREVIOUS_TRACE_MAX_DURATION (1h) of the current root span's startTimestamp
53+
// This is done to
54+
// - avoid adding links to "stale" traces
55+
// - enable more efficient querying for previous/next traces in Sentry
5156
if (Date.now() / 1000 - previousTraceInfo.startTimestamp <= PREVIOUS_TRACE_MAX_DURATION) {
5257
if (DEBUG_BUILD) {
5358
logger.info(

0 commit comments

Comments
 (0)