Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: Reuse existing tools from core
  • Loading branch information
JPeer264 committed Apr 13, 2026
commit bc843f1d0326a3dfb475f9ef4259b49163ddabf6
6 changes: 3 additions & 3 deletions packages/cloudflare/src/utils/traceLinks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { DurableObjectStorage } from '@cloudflare/workers-types';
import { TraceFlags } from '@opentelemetry/api';
import type { SpanLink } from '@sentry/core';
import { debug, getActiveSpan } from '@sentry/core';
import { debug, getActiveSpan, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE, spanIsSampled } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build';

/** Storage key prefix for the span context that links consecutive method invocations */
Expand Down Expand Up @@ -34,7 +34,7 @@ export async function storeSpanContext(originalStorage: DurableObjectStorage, me
const storedContext: StoredSpanContext = {
traceId: spanContext.traceId,
spanId: spanContext.spanId,
sampled: spanContext.traceFlags === TraceFlags.SAMPLED,
sampled: spanIsSampled(activeSpan),
};
await originalStorage.put(getTraceLinkKey(methodName), storedContext);
}
Expand Down Expand Up @@ -70,7 +70,7 @@ export function buildSpanLinks(storedContext: StoredSpanContext): SpanLink[] {
traceFlags: storedContext.sampled ? TraceFlags.SAMPLED : TraceFlags.NONE,
},
attributes: {
'sentry.link.type': 'previous_trace',
[SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]: 'previous_trace',
},
},
];
Expand Down
Loading