Skip to content

feat(nuxt)!: Emit low cardinality db span names - #23605

Draft
Lms24 wants to merge 1 commit into
developfrom
lms/feat-nuxt-low-card-db-span-names6
Draft

feat(nuxt)!: Emit low cardinality db span names#23605
Lms24 wants to merge 1 commit into
developfrom
lms/feat-nuxt-low-card-db-span-names6

Conversation

@Lms24

@Lms24 Lms24 commented Aug 25, 2026

Copy link
Copy Markdown
Member

With span streaming enabled:

  • db0 query spans are named after db.query.summary
  • e.g. SELECT * FROM users WHERE id = ? becomes SELECT users
  • falls back to db.namespace, then to Database operation
  • new db.query.summary attribute, set in both trace lifecycles
  • statement is sanitized before summarizing, so literals cannot leak
  • traceLifecycle: 'static' keeps the existing names

Refs #23523

With span streaming, `db0` query spans are named after their `db.query.summary`
(`SELECT users`) instead of the full SQL statement, and report that summary as a
new `db.query.summary` attribute. The statement is sanitized before it is
summarized, so a string literal containing `from`/`join` cannot leak a value
into the name.

db0 reports no db system, so a statement that cannot be summarized falls back to
`db.namespace` and then to the static `Database operation`.

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

Refs #23523
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8524d24. Configure here.

name: streamedName ?? query,
attributes: {
'db.query.text': query,
'db.query.summary': querySummary,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing tests for new behavior

Medium Severity

This feat PR changes streamed db.query span names and always sets db.query.summary, but the diff adds no integration or E2E coverage for that behavior. Existing Nuxt DB E2E suites stay on traceLifecycle: 'static' and never assert db.query.summary, so the new path is untested.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 8524d24. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 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.55 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.57 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.47 kB - -
@sentry/browser (incl. Tracing, Replay) 88 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.44 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.69 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.41 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.76 kB - -
@sentry/vue 35.64 kB - -
@sentry/vue (incl. Tracing) 50.78 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 49.07 kB - -
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.94 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.96 kB - -
CDN Bundle (incl. Tracing, Replay) 86.57 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.27 kB - -
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.74 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.3 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.14 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.82 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.84 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.51 kB - -
@sentry/nextjs (client) 53.27 kB - -
@sentry/sveltekit (client) 48.97 kB - -
@sentry/core/server 65.11 kB - -
@sentry/core/browser 52.27 kB - -
@sentry/node 121.58 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 87.46 kB +0.03% +24 B 🔺
@sentry/aws-serverless 95.86 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 199.28 kB - -
@sentry/cloudflare (withSentry) 495.43 kB - -

View base workflow run

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