Generate low-cardinality SQL summaries for database spans
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
研究方向
首先定位 JDBC 和 Android SQLite 的 span-description 入口,並追蹤有效的 dataCollection.databaseQueryData policy 如何套用。追蹤現有測試,接著為支援的操作、常值、預留位置、格式錯誤的 SQL,以及特定方言的語法新增涵蓋範圍。完成標準是:停用原始資料收集時,兩個整合都使用安全摘要;失敗時絕不暴露原始 SQL;任何改編的 analyzer 程式碼都在 THIRD_PARTY_NOTICES.md 中標註歸屬。
由索引模型根據 Issue 內容生成。
描述
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 data and create high-cardinality span descriptions.
We should provide useful, low-cardinality descriptions without retaining query values, for example:
SELECT usersUPDATE ordersINSERT products
This is follow-up work from #5801 and supports #5666.
Proposed solution
Add 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.
Consider 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.
The summarizer must fail closed: malformed or unsupported SQL must never fall back to the raw statement.
Acceptance criteria
- JDBC and Android SQLite spans use low-cardinality summaries when raw query collection is disabled.
- Summaries do not contain inline literals, bound values, comments, or other query values.
- Parsing covers common operations such as
SELECT,INSERT,UPDATE, andDELETE. - Malformed and unsupported SQL produces a generic description or no description, never the raw statement.
- Tests cover inline literals, placeholders, mixed literal-and-bound queries, malformed SQL, and representative dialect-specific syntax.
- Any adapted third-party code includes complete license attribution.
- 主要語言
- Kotlin
- 星號
- 1.4k
- 分支
- 478
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 65
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-java 的其他 Issue
-
Platform: Java
難度 2/5 半天 新手友好度 76/100
getsentry/sentry-java#6161 · 1 則留言 ·
維護者通常 1 天內回覆
-
Bug Java Platform: Android Platform: Java
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-java#6138 · 1 則留言 ·
維護者通常 1 天內回覆
-
Feature Java Platform: Java Spans
難度 2/5 1-3 小時 新手友好度 68/100
getsentry/sentry-java#5984 · 1 則留言 ·
維護者通常 1 天內回覆
-
Android Task Traces
難度 2/5 1-3 小時 新手友好度 68/100
getsentry/sentry-java#5376 · 1 則留言 ·
維護者通常 1 天內回覆
-
Android Docs Errors
難度 2/5 1-3 小時 新手友好度 64/100
getsentry/sentry-java#5375 · 1 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
T31n/YagniLauncher#1051 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
-
Accepted Needs Triage
難度 2/5 1-3 小時 新手友好度 84/100
ankidroid/Anki-Android#22114 · 5 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
solana-foundation/pay-kit#341 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100