Skip to content

fix(fetch): preserve explicit trace context during propagation - #734

Open
mandar1045 wants to merge 2 commits into
supabase:mainfrom
mandar1045:fix/preserve-explicit-traceparent
Open

fix(fetch): preserve explicit trace context during propagation#734
mandar1045 wants to merge 2 commits into
supabase:mainfrom
mandar1045:fix/preserve-explicit-traceparent

Conversation

@mandar1045

@mandar1045 mandar1045 commented Sep 5, 2026

Copy link
Copy Markdown

Tl;dr

Fixes supabase/supabase#50006

Preserves caller-supplied traceparent and tracestate headers during function-to-function invocations.

What changed

  • In vendor/deno_fetch/26_fetch.js, skip injecting the trace context propagator if the request already contains an explicit traceparent header.
  • Keeps traceparent and tracestate paired together from the caller, preventing the runtime from appending a second trace context or attaching mismatched runtime tracestate.
  • Automatic trace propagation continues to work when no explicit header is provided.

Validation

  • cargo test -p base --test integration_tests test_fetch_preserves_explicit_trace_context (passed)
  • Added 3 regression tests checking exact traceparent matching, comma prevention, and tracestate pairing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

traceparent header rewritten on Edge Function-to-Edge Function invoke

1 participant