Title: Generate low-cardinality SQL summaries for database spans · Issue #5981 · getsentry/sentry-java · GitHub
Open Graph Title: Generate low-cardinality SQL summaries for database spans · Issue #5981 · getsentry/sentry-java
X Title: Generate low-cardinality SQL summaries for database spans · Issue #5981 · getsentry/sentry-java
Description: Problem When dataCollection.databaseQueryData disables raw SQL collection, database spans lose their SQL description entirely. Keeping the raw statement is not safe because inline literals and other query values can contain sensitive dat...
Open Graph Description: Problem When dataCollection.databaseQueryData disables raw SQL collection, database spans lose their SQL description entirely. Keeping the raw statement is not safe because inline literals and othe...
X Description: Problem When dataCollection.databaseQueryData disables raw SQL collection, database spans lose their SQL description entirely. Keeping the raw statement is not safe because inline literals and othe...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/5981
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generate low-cardinality SQL summaries for database spans","articleBody":"## Problem\n\nWhen `dataCollection.databaseQueryData` disables raw SQL collection, database spans lose their SQL description entirely. Keeping the raw statement is not safe because inline literals and other query values can contain sensitive data and create high-cardinality span descriptions.\n\nWe should provide useful, low-cardinality descriptions without retaining query values, for example:\n\n- `SELECT users`\n- `UPDATE orders`\n- `INSERT products`\n\nThis is follow-up work from #5801 and supports #5666.\n\n## Proposed solution\n\nAdd a SQL summarizer that extracts only a safe operation and target from a statement. Use the summary for JDBC and Android SQLite span descriptions when raw database query data is disabled. Preserve the full statement only when the effective Data Collection policy allows it.\n\nConsider adapting OpenTelemetry Java's Apache-2.0 SQL query analyzer instead of depending on its incubating API. If code is adapted, include the required source attribution and update `THIRD_PARTY_NOTICES.md`.\n\nThe summarizer must fail closed: malformed or unsupported SQL must never fall back to the raw statement.\n\n## Acceptance criteria\n\n- JDBC and Android SQLite spans use low-cardinality summaries when raw query collection is disabled.\n- Summaries do not contain inline literals, bound values, comments, or other query values.\n- Parsing covers common operations such as `SELECT`, `INSERT`, `UPDATE`, and `DELETE`.\n- Malformed and unsupported SQL produces a generic description or no description, never the raw statement.\n- Tests cover inline literals, placeholders, mixed literal-and-bound queries, malformed SQL, and representative dialect-specific syntax.\n- Any adapted third-party code includes complete license attribution.\n","author":{"url":"https://github.com/adinauer","@type":"Person","name":"adinauer"},"datePublished":"2026-08-24T07:29:09Z","url":"https://github.com/getsentry/sentry-java/issues/5981"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ff52bdf1-1add-9a8c-a738-ba2ae76965a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E09C:2BF270:139A0:19BE7:6B0449C9 |
| html-safe-nonce | 40a899a58f3bd6309d0009e5c9bf52bca1dca29ba860e93afe83914356bfb88d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDlDOjJCRjI3MDoxMzlBMDoxOUJFNzo2QjA0NDlDOSIsInZpc2l0b3JfaWQiOiI2ODUyMzY2MzY1NDQyMTk3OTYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b334e35029c2587f64dba3743e2d851e29bdc466ba6fa7da843eb92bd2e8bce7 |
| hovercard-subject-tag | issue:5232193550 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/5981/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49428c8edee0afa4fab47e31ff63afcc845269ac1137a61524ba460b7b29760f/getsentry/sentry-java/issues/5981 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49428c8edee0afa4fab47e31ff63afcc845269ac1137a61524ba460b7b29760f/getsentry/sentry-java/issues/5981 |
| og:image:alt | Problem When dataCollection.databaseQueryData disables raw SQL collection, database spans lose their SQL description entirely. Keeping the raw statement is not safe because inline literals and othe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adinauer |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width