You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7aca628
Browse filesBrowse the repository at this point in the historyBrowse files
feat(server-utils): Move to new getSqlQueryAttributes helper for consistency (#25927)
**Why:** `sanitizeSqlQueryWithSummary` grew a third value with
`db.operation.name`, and every SQL integration copied the result into
the same three attributes by hand. `getSqlQueryAttributes` returns them
keyed by attribute name, so integrations spread it and the keys can't
drift. The mysql2 diagnostics-channel subscriber and postgres.js drop
their own operation regexes for the shared helper, so their
`db.operation.name` keeps the statement's case and resolves CTEs like
the other integrations (postgres.js still prefers the server-reported
command once a query succeeds). postgres.js also no longer reports the
sanitizer's `Unknown SQL Query` placeholder as `db.query.text` when
there is no query; its public `requestHook` gets `''` in that case.
**How to review:** Start with `utils/sql.ts`, then the Prisma tracing
helper. Prisma keeps its own `db.query.text`/`db.operation.name` and
only falls back to ours; `db.query.summary` is always ours, so the
streamed span name stays dialect-aware across Prisma versions. Prisma 5
only reports `db.statement`, so its spans now also get a sanitized
`db.query.text` (see the v5 test). Tedious clears the summary and
operation name for procedure calls, as before.
**Unsure about:** `@sentry/server-utils` exports the renamed helper, but
the package is internal (no SemVer guarantee) and Nuxt pins it exactly,
so I didn't keep an alias.
Stacked on #25850.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments