Skip to content

feat(core): Emit low cardinality supabase db span names - #23606

Merged
Lms24 merged 4 commits into
developfrom
lms/feat-core-low-card-db-span-names7
Aug 28, 2026
Merged

feat(core): Emit low cardinality supabase db span names#23606
Lms24 merged 4 commits into
developfrom
lms/feat-core-low-card-db-span-names7

Conversation

@Lms24

@Lms24 Lms24 commented Aug 25, 2026

Copy link
Copy Markdown
Member

With span streaming enabled:

  • supabase query spans become {db.operation.name} {db.collection.name}
  • traceLifecycle: 'static' keeps the existing names
  • For supabase auth SDK calls, we emit a summary and operation-name adjacent low-cardinality name. See tests and code comment.

converted nextjs-supabase e2e test app from static to streaming spans to cover this change. Unit tests still cover the static path

Refs #23523

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 28.56 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.63 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.64 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.55 kB - -
@sentry/browser (incl. Tracing, Replay) 88.09 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.79 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.73 kB - -
@sentry/browser (incl. Feedback) 46.05 kB - -
@sentry/browser (incl. sendFeedback) 33.62 kB - -
@sentry/browser (incl. FeedbackAsync) 38.73 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.3 kB - -
@sentry/react (incl. Tracing) 50.83 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.86 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.35 kB - -
CDN Bundle (incl. Tracing) 49.23 kB - -
CDN Bundle (incl. Logs, Metrics) 32.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.12 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB - -
CDN Bundle (incl. Tracing, Replay) 86.72 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.6 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.62 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.5 kB - -
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.82 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.51 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.32 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.02 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.69 kB - -
@sentry/nextjs (client) 53.41 kB - -
@sentry/sveltekit (client) 49.07 kB - -
@sentry/core/server 65.19 kB +0.06% +34 B 🔺
@sentry/core/browser 51.84 kB +0.07% +33 B 🔺
@sentry/node 122.74 kB +0.02% +15 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.23 kB - -
@sentry/node - without tracing 87.74 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 102.4 kB +0.02% +15 B 🔺
@sentry/aws-serverless 95.9 kB +0.03% +23 B 🔺
@sentry/cloudflare (withSentry) - minified 199.69 kB - -
@sentry/cloudflare (withSentry) 496.19 kB - -

View base workflow run

@Lms24 Lms24 self-assigned this Aug 27, 2026
@Lms24 Lms24 changed the title feat(core)!: Emit low cardinality supabase db span names feat(core): Emit low cardinality supabase db span names Aug 27, 2026
Lms24 and others added 3 commits August 27, 2026 17:15
With span streaming, supabase query spans are named
`{db.operation.name} {db.collection.name}` (`update users`) instead of the
PostgREST description. The description embeds the translated filter list, which
carries user values (`eq(email, secret@example.com)`), so it cannot be a span
name. The filters stay on the `db.query` attribute, subject to the existing data
collection settings.

`auth` spans are unaffected: they have no collection to pair the operation with,
so the templates would reduce them to `postgresql`, which says less than the
name they already carry.

`traceLifecycle: 'static'` keeps the existing names.

Refs #23523
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the lms/feat-core-low-card-db-span-names7 branch from 784d2d2 to 4822c5b Compare August 28, 2026 10:42
@Lms24
Lms24 marked this pull request as ready for review August 28, 2026 10:42
@Lms24
Lms24 requested review from msonnb and s1gr1d August 28, 2026 10:43

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, just a few minor questions/comments

const descriptionMiddle = [mutationPart.trimEnd(), queryPart].filter(Boolean).join(' ');
const description = descriptionMiddle ? `${descriptionMiddle} from(${table})` : `from(${table})`;

const name = client && hasSpanStreamingEnabled(client) ? `${operation} ${table}` : description;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q/l: do we care about trailing spaces? table can be an empty string and then this would give e.g. select

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we probably should. Good catch, thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread packages/core/src/integrations/supabase.ts Outdated
@Lms24
Lms24 enabled auto-merge (squash) August 28, 2026 11:41
@Lms24
Lms24 merged commit d24bf6f into develop Aug 28, 2026
551 of 553 checks passed
@Lms24
Lms24 deleted the lms/feat-core-low-card-db-span-names7 branch August 28, 2026 12:25
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.

2 participants