[package]
name = "sqlx-otel"
version = "0.3.0"
edition = "2024"
authors = ["Borislav Borisov <chmodas@astutebits.com>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/chmodas/sqlx-otel"
homepage = "https://github.com/chmodas/sqlx-otel"
documentation = "https://docs.rs/sqlx-otel/"
description = "Thin wrapper around SQLx that emits OpenTelemetry spans and metrics following the database client semantic conventions."
categories = ["database", "asynchronous", "development-tools::profiling"]
keywords = ["sqlx", "opentelemetry", "metrics", "database", "instrumentation"]
rust-version = "1.85.0"
exclude = [
".gitignore",
".github",
"README.md"
]
[lints.clippy]
pedantic = "warn"
[dependencies]
futures = "0.3"
opentelemetry = "0.31"
opentelemetry-semantic-conventions = { version = "0.31", features = ["semconv_experimental"] }
sqlx = { version = "0.8", default-features = false }
async-std = { version = "1", optional = true }
tokio = { version = "1", features = ["rt", "time"], optional = true }
[features]
sqlite = ["sqlx/sqlite"]
postgres = ["sqlx/postgres"]
mysql = ["sqlx/mysql"]
runtime-tokio = ["dep:tokio"]
runtime-async-std = ["dep:async-std"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dev-dependencies]
ctor = "0.10"
opentelemetry_sdk = { version = "0.31", features = ["testing", "rt-tokio"] }
proptest = "1"
serial_test = "3"
sqlx = { version = "0.8", features = ["macros", "sqlite", "postgres", "mysql", "runtime-tokio"] }
testcontainers = "0.27"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
[[example]]
name = "sqlite"
required-features = ["sqlite", "runtime-tokio"]