Skip to content

Commit 5cfb5ad

Browse files
d-csclaude
andcommitted
docs(webapp): clarify Sentry trace_id override is intentional
Adds a code comment on addOtelTraceContextToEvent explaining that overwriting Sentry's contexts.trace.trace_id is the design intent — with skipOpenTelemetrySetup: true, Sentry's auto-generated trace_id is unrelated to OTel, and replacing it is the whole point of the processor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 02a8fc0 commit 5cfb5ad

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/webapp/sentry.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export function getActiveTraceIds():
2222
export function addOtelTraceContextToEvent(event: Event, _hint: EventHint): Event {
2323
const ids = getActiveTraceIds();
2424
if (!ids) return event;
25+
// We intentionally overwrite Sentry's own trace_id/span_id on contexts.trace.
26+
// With skipOpenTelemetrySetup: true, Sentry generates an internal trace_id
27+
// unrelated to OTel; replacing it with the active OTel ids is the whole
28+
// point of this processor — it makes Sentry issues navigable to the
29+
// corresponding OTel trace in any backend.
2530
return {
2631
...event,
2732
contexts: {

0 commit comments

Comments
 (0)