From df019df465999838f1ab2881bceb8f61aaa6c972 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 26 Nov 2025 16:49:32 +0100 Subject: [PATCH 1/2] fix(waterfall): Relax "next_trace" lookup to only the trace id --- .../traceLinksNavigation/useFindLinkedTraces.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts b/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts index b92342b6c53ac1..3215e54da842a3 100644 --- a/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts +++ b/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts @@ -30,7 +30,6 @@ export function useFindAdjacentTrace({ projectId, environment, currentTraceId, - currentSpanId, adjacentTraceId, adjacentTraceSpanId, hasAdjacentTraceLink, @@ -74,7 +73,6 @@ export function useFindAdjacentTrace({ projectId: _projectId, environment: _environment, currentTraceId: _currentTraceId, - currentSpanId: _currentSpanId, hasAdjacentTraceLink: _hasAdjacentTraceLink, adjacentTraceSampled: _adjacentTraceSampledFlag === '1', adjacentTraceId: _adjacentTraceId, @@ -84,7 +82,12 @@ export function useFindAdjacentTrace({ const searchQuery = direction === 'next' - ? `sentry.previous_trace:${currentTraceId}-${currentSpanId}-1` + ? // relaxed the next trace lookup to match spans containing only the + // traceId and not the spanId of the current trace root. We can't + // always be sure that the current trace root is indeed the span the + // next span would link towards, because sometimes the root might be a web + // vital span instead of the actual intial span from the SDK's perspective. + `sentry.previous_trace:${currentTraceId}-*-1` : `id:${adjacentTraceSpanId} trace:${adjacentTraceId}`; const enabled = From f09988317bc7f1cdfb268f6925427f99897c06f7 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 26 Nov 2025 16:57:15 +0100 Subject: [PATCH 2/2] rem unused code --- .../traceLinksNavigation/useFindLinkedTraces.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts b/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts index 3215e54da842a3..d4e995f1b230f5 100644 --- a/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts +++ b/static/app/views/performance/newTraceDetails/traceLinksNavigation/useFindLinkedTraces.ts @@ -38,7 +38,6 @@ export function useFindAdjacentTrace({ let _projectId: number | undefined = undefined; let _environment: string | undefined = undefined; let _currentTraceId: string | undefined; - let _currentSpanId: string | undefined; let _adjacentTraceAttribute: TraceItemResponseAttribute | undefined = undefined; for (const a of attributes ?? []) { @@ -48,8 +47,6 @@ export function useFindAdjacentTrace({ _environment = a.value; } else if (a.name === 'trace' && a.type === 'str') { _currentTraceId = a.value; - } else if (a.name === 'transaction.span_id' && a.type === 'str') { - _currentSpanId = a.value; } else if (a.name === 'previous_trace' && a.type === 'str') { _adjacentTraceAttribute = a; }