Title: feat(database): Capture query data behind dataCollection · Issue #6021 · getsentry/sentry-java · GitHub
Open Graph Title: feat(database): Capture query data behind dataCollection · Issue #6021 · getsentry/sentry-java
X Title: feat(database): Capture query data behind dataCollection · Issue #6021 · getsentry/sentry-java
Description: Problem The Java SDK exposes dataCollection.databaseQueryData, but the current first-party database integrations do not collect any of the value-bearing data controlled by that option: JDBC records the original statement text through P6S...
Open Graph Description: Problem The Java SDK exposes dataCollection.databaseQueryData, but the current first-party database integrations do not collect any of the value-bearing data controlled by that option: JDBC records...
X Description: Problem The Java SDK exposes dataCollection.databaseQueryData, but the current first-party database integrations do not collect any of the value-bearing data controlled by that option: JDBC records...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6021
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(database): Capture query data behind dataCollection","articleBody":"## Problem\n\nThe Java SDK exposes `dataCollection.databaseQueryData`, but the current first-party database integrations do not collect any of the value-bearing data controlled by that option:\n\n- JDBC records the original statement text through P6Spy's `StatementInformation.getSql()`, not bound parameter values.\n- Android SQLite receives bind arguments but does not attach them to spans.\n- Neither integration captures write payloads or returned result data.\n\nAs a result, `databaseQueryData` currently has no production consumer in these integrations.\n\nSanitized or parameterized `db.query.text`, `db.query.summary`, and structural database metadata are intentionally outside this option and should continue to be collected independently.\n\n## Proposal\n\nIn the next major version, add source-time collection of supported database query data and guard it with `dataCollection.databaseQueryData`.\n\nStart with the value-bearing data already available to first-party instrumentation:\n\n- JDBC prepared/callable statement bind values, where P6Spy exposes them safely.\n- Android SQLite bind arguments in the SupportSQLite and SQLiteDriver integrations.\n\nEvaluate write-operation payloads and returned result data separately; only add them where useful, bounded, and supported by established Sentry span conventions.\n\n## Requirements\n\n- Apply the policy when first-party instrumentation writes the data, not later during serialization or export.\n- Do not put bound values into span descriptions, span names, `db.query.text`, or `db.query.summary`.\n- Use standardized structured span attributes for parameters where available, such as `db.query.parameter.\u003ckey>`.\n- `databaseQueryData=false` must prevent value-bearing query data from being attached.\n- Query text must remain sanitized/parameterized independently of this option.\n- Add size/count limits and fail-closed handling for unsupported or malformed values.\n- Preserve explicitly supplied customer span data.\n- Add tests for enabled/disabled behavior, positional and named parameters, null/binary/large values, batch operations, and Android bind arguments.\n- Document which integrations and database data categories are supported.\n\n## Related\n\n- Data Collection specification: `databaseQueryData` controls bound query parameters, write-operation payloads, and returned result data.\n- SQL sanitization and `db.query.summary` generation are separate concerns and should not be made conditional on this option.\n","author":{"url":"https://github.com/adinauer","@type":"Person","name":"adinauer"},"datePublished":"2026-08-28T07:40:03Z","url":"https://github.com/getsentry/sentry-java/issues/6021"}
| 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:582657d7-8940-3ac1-ee46-8f37eef5ae43 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0F0:169A35:67F5D8:91DB98:6B0449D1 |
| html-safe-nonce | 2782753a3e1a3285d273919e29810ecf36437b8345f83d92b2edcf048ed5a077 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEYwOjE2OUEzNTo2N0Y1RDg6OTFEQjk4OjZCMDQ0OUQxIiwidmlzaXRvcl9pZCI6IjEzNjA0NjU1OTE4NDQyMjc1MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7e58f398fb98a26f6595c61dfac83087dbc1964e72997be03996b8ed5567e090 |
| hovercard-subject-tag | issue:5275902701 |
| 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/6021/issue_layout |
| twitter:image | https://opengraph.githubassets.com/306eceb3f7cfca684b1bc22db7ca6ebdc406e92beca91ed1509f7c801febfab7/getsentry/sentry-java/issues/6021 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/306eceb3f7cfca684b1bc22db7ca6ebdc406e92beca91ed1509f7c801febfab7/getsentry/sentry-java/issues/6021 |
| og:image:alt | Problem The Java SDK exposes dataCollection.databaseQueryData, but the current first-party database integrations do not collect any of the value-bearing data controlled by that option: JDBC records... |
| 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