Skip to main content

Crate sqlx_otel

Crate sqlx_otel 

Source
Expand description

Lightweight SQLx wrapper that emits OpenTelemetry-native spans and metrics following the database client semantic conventions.

Structs§

Annotated
A shared-reference annotation wrapper that carries per-query attributes alongside a borrowed executor. Returned by Pool::with_annotations and Pool::with_operation.
AnnotatedMut
A mutable-reference annotation wrapper that carries per-query attributes alongside a mutably borrowed executor. Returned by PoolConnection::with_annotations, Transaction::with_annotations, and their with_operation shorthands.
Pool
An instrumented wrapper around sqlx::Pool that emits OpenTelemetry spans and metrics for every database operation.
PoolBuilder
Builder for constructing an instrumented Pool from a raw sqlx::Pool.
PoolConnection
A pooled connection instrumented for OpenTelemetry.
QueryAnnotations
Per-query annotation values that enrich OpenTelemetry spans with semantic convention attributes the library cannot derive automatically (because it does not parse SQL).
Transaction
An in-progress database transaction instrumented for OpenTelemetry.

Enums§

QueryTextMode
Controls whether and how db.query.text is captured on spans.

Traits§

Database
Per-backend contract providing the database system name and a method to extract connection-level attributes from the backend’s connect options.