Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions develop-docs/sdk/telemetry/traces/modules/db-transactions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Query Injection Detection Module
---

The SDK SHOULD auto-instrument all transactions for SQL databases like PostgreSQL and MySQL, as well as for MongoDB.
Each BEGIN, COMMIT, and ROLLBACK, or equivalent instruction in the database system MUST result in an individual span.
Transaction instructions SHOULD produce spans whether they are issued through a database driver or through an ORM.

### Span Data

Each database transaction instruction MUST have a `data` attribute.
`data` is itself a key-value lookup of attributes.
Refer to <Link to="https://getsentry.github.io/sentry-conventions/generated/attributes/code.html">Database Span Data Conventions</Link> for a full list of attributes that database spans should have.
The SDK SHOULD set the

- db.system.name
- db.operation.name

attributes for transaction instruction spans.
Equivalent deprecated attributes MAY be used for backward compatibility, but they SHOULD be marked for deprecation.

The operation names for BEGIN, COMMIT and ROLLBACK instructions MUST be "BEGIN", "COMMIT", and "ROLLBACK", respectively.
For other transaction-level instructions like MySQL's START TRANSACTION, the SDK SHOULD represent the literal statement as closely as possible, omitting control-flow characters like semicolons.
Loading