Skip to content

Add SQL span data #6018

Description

@adinauer

Problem Statement

First-party JDBC and Android SQLite spans currently keep the SQL statement only in the span description and attach limited database metadata (db.system and db.name). They do not attach db.query.text or generate db.query.summary.

Solution Brainstorm

Attach database query semantic data to first-party JDBC and Android SQLite spans:

  • db.query.text: the parameterized or SDK-sanitized statement. We should run this through a sanitizer.
  • db.query.summary: a low-cardinality operation/target summary such as UPDATE users.
  • Consider attaching analyzer-derived operation, collection/table, and stored-procedure attributes where they match Sentry conventions.

Check sentry conventions for more (query derived) attributes we can attach.

There's currently no data collection option to gate sanitized/parameterized db.query.text or db.query.summary so we can just attach them. Best double check https://develop.sentry.dev/sdk/foundations/client/data-collection/ when implementing.

Closely related to #6019

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions