feat(database): Capture query data behind dataCollection
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu từ đường dẫn JDBC P6Spy StatementInformation.getSql() và các tích hợp Android SupportSQLite và SQLiteDriver, theo dõi nơi databaseQueryData khả dụng. Sử dụng các trường hợp được liệt kê về bật/tắt, dạng tham số, kích thước, batch và đối số bind của Android để xác định phạm vi bao phủ; hoàn tất nghĩa là thu thập có giới hạn tại thời điểm nguồn mà không thay đổi các trường truy vấn đã được làm sạch, đồng thời tài liệu hóa các danh mục được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 P6Spy's
StatementInformation.getSql(), not bound parameter values. - Android SQLite receives bind arguments but does not attach them to spans.
- Neither integration captures write payloads or returned result data.
As a result, databaseQueryData currently has no production consumer in these integrations.
Sanitized or parameterized db.query.text, db.query.summary, and structural database metadata are intentionally outside this option and should continue to be collected independently.
Proposal
In the next major version, add source-time collection of supported database query data and guard it with dataCollection.databaseQueryData.
Start with the value-bearing data already available to first-party instrumentation:
- JDBC prepared/callable statement bind values, where P6Spy exposes them safely.
- Android SQLite bind arguments in the SupportSQLite and SQLiteDriver integrations.
Evaluate write-operation payloads and returned result data separately; only add them where useful, bounded, and supported by established Sentry span conventions.
Requirements
- Apply the policy when first-party instrumentation writes the data, not later during serialization or export.
- Do not put bound values into span descriptions, span names,
db.query.text, ordb.query.summary. - Use standardized structured span attributes for parameters where available, such as
db.query.parameter.<key>. databaseQueryData=falsemust prevent value-bearing query data from being attached.- Query text must remain sanitized/parameterized independently of this option.
- Add size/count limits and fail-closed handling for unsupported or malformed values.
- Preserve explicitly supplied customer span data.
- Add tests for enabled/disabled behavior, positional and named parameters, null/binary/large values, batch operations, and Android bind arguments.
- Document which integrations and database data categories are supported.
Related
- Data Collection specification:
databaseQueryDatacontrols bound query parameters, write-operation payloads, and returned result data. - SQL sanitization and
db.query.summarygeneration are separate concerns and should not be made conditional on this option.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 478
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 70
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Improvement Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
getsentry/sentry-java#6145 · 1 bình luận ·
-
Bug Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
Feature Java Platform: Java Spans
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5984 · 1 bình luận ·
-
Android Task Traces
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-java#5376 · 1 bình luận ·
-
Android Docs Errors
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
getsentry/sentry-java#5375 · 1 bình luận ·
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
johanhaleby/occurrent#1120 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
2 rename bugs Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ankidroid/Anki-Android#21999 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwallet-foundation/multipaz#2028 ·