Generate low-cardinality SQL summaries for database spans

オープン
#5,981 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
android, java, kotlin, sqlite

調査の方向性

まず JDBC と Android SQLite の span-description エントリーポイントを特定し、実効的な dataCollection.databaseQueryData ポリシーがどのように適用されるかを追跡します。既存のテストを確認し、サポート対象の操作、リテラル、プレースホルダー、不正な SQL、方言固有の構文についてのカバレッジを追加します。完了の条件は、両方のインテグレーションが raw collection が無効な場合に安全なサマリーを使用し、失敗時に raw 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
平均マージ
3日 2時間
マージ済み PR(30日)
70

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-java のほかの issue

getsentry/sentry-java の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。