Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(database): Capture query data behind dataCollection

Đang mở
#6,021 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, java, sqlite
Lĩnh vực
databases, mobile

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ả

Feature Java Platform: Java Spans

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, or db.query.summary.
  • Use standardized structured span attributes for parameters where available, such as db.query.parameter.<key>.
  • databaseQueryData=false must 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: databaseQueryData controls bound query parameters, write-operation payloads, and returned result data.
  • SQL sanitization and db.query.summary generation 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-java

Tất cả issue của getsentry/sentry-java

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.