From a1de943d16455c5361eefa2ca2a8573e30674b14 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Tue, 15 Sep 2026 15:53:13 +0200 Subject: [PATCH] chore: Retarget sentry.previous_trace TODOs to v12 The Sentry trace view still reads `sentry.previous_trace` to navigate between linked traces, so the attribute cannot be removed in v11. Co-Authored-By: Claude Opus 5 --- packages/browser/src/tracing/linkedTraces.ts | 6 ++---- packages/cloudflare/src/wrapMethodWithSentry.ts | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/browser/src/tracing/linkedTraces.ts b/packages/browser/src/tracing/linkedTraces.ts index ccd4eae2a767..178305da0016 100644 --- a/packages/browser/src/tracing/linkedTraces.ts +++ b/packages/browser/src/tracing/linkedTraces.ts @@ -192,10 +192,8 @@ export function addPreviousTraceSpanLink( }, }); - // TODO: Remove this once EAP can store span links. We currently only set this attribute so that we - // can obtain the previous trace information from the EAP store. Long-term, EAP will handle - // span links and then we should remove this again. Also throwing in a TODO(v11), to remind us - // to check this at v11 time :) + // TODO(v12): Remove this once the Sentry trace view finds linked traces via span links. EAP stores + // span links, but the trace view still reads this attribute to navigate to the previous/next trace. span.setAttribute( PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE, `${previousTraceSpanCtx.traceId}-${previousTraceSpanCtx.spanId}-${ diff --git a/packages/cloudflare/src/wrapMethodWithSentry.ts b/packages/cloudflare/src/wrapMethodWithSentry.ts index d20fd184d100..c6ff06393d6a 100644 --- a/packages/cloudflare/src/wrapMethodWithSentry.ts +++ b/packages/cloudflare/src/wrapMethodWithSentry.ts @@ -217,10 +217,9 @@ export function wrapMethodWithSentry( if (storedContext) { span.addLinks(buildSpanLinks(storedContext)); - // TODO: Remove this once EAP can store span links. We currently only set this attribute so that we - // can obtain the previous trace information from the EAP store. Long-term, EAP will handle - // span links and then we should remove this again. Also throwing in a TODO(v11), to remind us - // to check this at v11 time :) + // TODO(v12): Remove this once the Sentry trace view finds linked traces via span links. + // EAP stores span links, but the trace view still reads this attribute to navigate to the + // previous/next trace. const sampledFlag = storedContext.sampled ? '1' : '0'; span.setAttribute( 'sentry.previous_trace',