Skip to content

docs: update client-side tracing and Edge Function CORS guides - #48924

Merged
mandarini merged 6 commits into
masterfrom
docs/tracing-cors-and-sampling
Aug 11, 2026
Merged

mandarini merged 6 commits into
masterfrom
docs/tracing-cors-and-sampling

Conversation

@mandarini

@mandarini mandarini commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Updates the client-side tracing and Edge Function CORS docs for changes shipping in @supabase/supabase-js v2.112.3 (supabase/supabase-js#2603, supabase/supabase-js#2604). The tracing guide gains a vendor compatibility table (plain OpenTelemetry works as is, Sentry needs propagateTraceparent: true, Datadog RUM needs allowedTracingUrls), the new respectSamplingDecision semantics (non-sampled requests now carry traceparent only, so logs stay correlatable), a troubleshooting entry for the SDK's new propagator warning, and a note that browser calls to Edge Functions need the trace headers in the function's CORS allow-list. The CORS guide now states explicitly that trace headers are sent only when trace propagation is opted in (never by default), adds a table of when each SDK header is actually sent, and the hardcoded corsHeaders examples are updated to the full header list. Should merge after the v2.112.3 release is published, since it documents that version's behavior.

Summary by CodeRabbit

  • Documentation

    • Expanded CORS guidance with trace-propagation requirements and SDK version considerations.
    • Added browser and Edge Function setup guidance for client-side tracing.
    • Documented updated sampling behavior, advanced configuration, vendor setup examples, and troubleshooting.
  • Bug Fixes

    • Updated CORS configurations to allow retry and tracing headers required for supported requests.
    • Improved compatibility for browser requests that transmit distributed tracing context.

@mandarini
mandarini requested review from a team as code owners August 11, 2026 06:33
@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, v0 Aug 11, 2026 7:01am
zone-www-dot-com Ready Ready Preview, v0 Aug 11, 2026 7:01am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 11, 2026 7:01am
design-system Skipped Skipped Aug 11, 2026 7:01am
studio-self-hosted Skipped Skipped Aug 11, 2026 7:01am
studio-staging Skipped Skipped Aug 11, 2026 7:01am
ui-library Skipped Skipped Aug 11, 2026 7:01am

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e0a90f2-f351-4105-b381-3b3b51fae880

📥 Commits

Reviewing files that changed from the base of the PR and between fb2f90f and aac47c5.

📒 Files selected for processing (1)
  • apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx

📝 Walkthrough

Walkthrough

The changes expand Edge Function CORS allow-lists for retry and trace context headers. Documentation now covers SDK synchronization, browser trace propagation, sampling behavior, vendor setup, warnings, and troubleshooting.

Changes

CORS and client tracing

Layer / File(s) Summary
Tracing headers in CORS configuration
apps/www/supabase/functions/_shared/cors.ts, examples/edge-functions/supabase/functions/_shared/cors.ts
Shared and example configurations now allow x-retry-count, traceparent, tracestate, and baggage.
CORS synchronization guidance
apps/docs/content/guides/functions/cors.mdx
The guide documents SDK version synchronization, redeployment, trace propagation conditions, and the expanded legacy header list.
Client-side trace propagation guidance
apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx
The guide documents vendor setup, Edge Function CORS requirements, sampling behavior, propagator warnings, and version-specific troubleshooting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main documentation changes for client-side tracing and Edge Function CORS.
Description check ✅ Passed The description clearly explains the behavior changes, affected documentation, release dependency, and related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/tracing-cors-and-sampling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mandarini mandarini self-assigned this Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/guides/functions/cors.mdx`:
- Around line 58-59: The CORS guidance in the SDK import paragraph cites an
unpublished version and incorrectly attributes trace headers to v2.112.2.
Replace it with the published SDK version whose cors export includes
traceparent, tracestate, and baggage, and add instructions for refreshing the
lock-file resolution when upgrading before redeploying.

In `@apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx`:
- Around line 111-112: Update the Sentry browser row’s CORS guidance to require
allowing sentry-trace, baggage, and traceparent in Access-Control-Allow-Headers
when targeting an Edge Function, while preserving the existing
tracePropagationTargets and propagateTraceparent guidance.
- Around line 74-79: Update the CORS guidance in the note to use the Deno Edge
Function import specifier `npm:`@supabase/supabase-js`@^2.112.3/cors` when
importing `corsHeaders`; retain the alternative of adding `traceparent`,
`tracestate`, and `baggage` to a custom allow-list.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 34bbc90c-c441-470f-9e15-6eef9183e44b

📥 Commits

Reviewing files that changed from the base of the PR and between b648db2 and d18f693.

📒 Files selected for processing (4)
  • apps/docs/content/guides/functions/cors.mdx
  • apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx
  • apps/www/supabase/functions/_shared/cors.ts
  • examples/edge-functions/supabase/functions/_shared/cors.ts

@mandarini mandarini changed the title docs: update tracing docs docs: update client-side tracing and Edge Function CORS guides Aug 11, 2026
@mandarini
mandarini force-pushed the docs/tracing-cors-and-sampling branch from a2a8a91 to fb2f90f Compare August 11, 2026 06:52
@mandarini mandarini added the do-not-merge Not ready to be merged yet; pending other dependencies label Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/guides/functions/cors.mdx`:
- Line 62: Update the trace-header table in the CORS guide to document the
sampling condition: state that tracestate and baggage are sent for sampled
traces or whenever respectSamplingDecision is false, while an active non-sampled
trace with respectSamplingDecision true sends only traceparent.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a388009-c556-41bc-9c45-bb28f4c1e0fd

📥 Commits

Reviewing files that changed from the base of the PR and between a2a8a91 and fb2f90f.

📒 Files selected for processing (2)
  • apps/docs/content/guides/functions/cors.mdx
  • apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/content/guides/monitoring-and-debugging/client-side-tracing.mdx

@mandarini mandarini removed the do-not-merge Not ready to be merged yet; pending other dependencies label Aug 11, 2026
@mandarini
mandarini merged commit fc5db9b into master Aug 11, 2026
37 of 38 checks passed
@mandarini
mandarini deleted the docs/tracing-cors-and-sampling branch August 11, 2026 13:43
@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1786455998)

Score Average Improvements Regressions
Completeness 95.3% (+1pp) 4 🟢 3 🔴
Conciseness 43% (-1pp) 7 🟢 10 🔴
Docs Faithfulness 64.3% (-3pp) 5 🟢 7 🔴
Goal Completion 80.2% (+1pp) 6 🟢 5 🔴
Knowledge Usage 100% (+3pp) 1 🟢 -
Tool Usage 74.5% (+1pp) 2 🟢 1 🔴
Correctness 73.9% (+5pp) 4 🟢 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 92.9% (+5pp) 2 🟢 1 🔴
URL Validity 100% (+0pp) - -
Time_to_first_token 2.57tok (-0.73tok) 22 🟢 7 🔴
Llm_calls 7.26 (-0.53) 7 🟢 18 🔴
Tool_calls 3.06 (-0.2) 10 🟢 12 🔴
Errors 0.1 (+0.1) - 3 🔴
Llm_errors 0.02 (+0.02) - 2 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24155.64tok (-815.6tok) 14 🟢 11 🔴
Prompt_cached_tokens 8115.49tok (+559.08tok) 10 🟢 12 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 596.59tok (-9.94tok) 15 🟢 14 🔴
Completion_reasoning_tokens 98.44tok (+1.51tok) 10 🟢 16 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24752.23tok (-825.54tok) 18 🟢 11 🔴
Estimated_cost 0$ (0$) 16 🟢 11 🔴
Duration 15.93s (-2.03s) 22 🟢 7 🔴
Llm_duration 10.92s (-2.88s) 22 🟢 7 🔴

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants