Skip to content

feat(capability-matrix): add database.observability.client_spans - #380

Draft
grdsdev wants to merge 4 commits into
mainfrom
guilhermesouza/sdk-3168-postgrest-client-spans-spec
Draft

grdsdev wants to merge 4 commits into
mainfrom
guilhermesouza/sdk-3168-postgrest-client-spans-spec

Conversation

@grdsdev

@grdsdev grdsdev commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the capability database.observability.client_spans (new observability group in database.yaml) and its spec, specs/database/observability/client_spans.md.

With an OpenTelemetry tracer and meter, each PostgREST call emits:

  • one HTTP client span, named {method} {path}, with the standard HTTP client attributes plus supabase.postgrest.operation, supabase.postgrest.table and supabase.postgrest.function;
  • one http.client.request.duration measurement, in seconds, from the supabase.postgrest meter, with the same attributes and no url.full.

url.full keeps the values of select, order, limit and offset and replaces every other query value with REDACTED, because PostgREST filters carry the app's data. Retries stay inside one span and one measurement. When the span records, traceparent names it as the parent of the server's spans. When it does not record, traceparent is the app's own active span, or none.

Why

No spec covers client spans yet. The first implementation is in supabase-swift (Linear SDK-3168), behind its OpenTelemetry package trait. Other SDKs can then implement the same contract.

How it was checked

  • bun run validate in packages/capability-matrix: valid.
  • The supabase-swift implementation passes its unit tests and an integration suite against a local stack. That suite covers the live status codes for select and rpc (200), upsert (201), delete (204) and a missing table (404).

Draft until the supabase-swift PR is up.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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.

1 participant