Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Generate low-cardinality SQL summaries for database spans

未關閉
#5,981 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
android, java, kotlin, sqlite

研究方向

首先定位 JDBC 和 Android SQLite 的 span-description 入口,並追蹤有效的 dataCollection.databaseQueryData policy 如何套用。追蹤現有測試,接著為支援的操作、常值、預留位置、格式錯誤的 SQL,以及特定方言的語法新增涵蓋範圍。完成標準是:停用原始資料收集時,兩個整合都使用安全摘要;失敗時絕不暴露原始 SQL;任何改編的 analyzer 程式碼都在 THIRD_PARTY_NOTICES.md 中標註歸屬。

由索引模型根據 Issue 內容生成。

描述

Feature Java Platform: Java Spans

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 users
  • UPDATE orders
  • INSERT 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, and DELETE.
  • 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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-java 的其他 Issue

查看 getsentry/sentry-java 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。