sqlx-otel 0.3.0

Thin wrapper around SQLx that emits OpenTelemetry spans and metrics following the database client semantic conventions.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.85.0"
name = "sqlx-otel"
version = "0.3.0"
authors = ["Borislav Borisov <chmodas@astutebits.com>"]
build = false
exclude = [
    ".gitignore",
    ".github",
    "README.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Thin wrapper around SQLx that emits OpenTelemetry spans and metrics following the database client semantic conventions."
homepage = "https://github.com/chmodas/sqlx-otel"
documentation = "https://docs.rs/sqlx-otel/"
readme = "README.md"
keywords = [
    "sqlx",
    "opentelemetry",
    "metrics",
    "database",
    "instrumentation",
]
categories = [
    "database",
    "asynchronous",
    "development-tools::profiling",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/chmodas/sqlx-otel"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
mysql = ["sqlx/mysql"]
postgres = ["sqlx/postgres"]
runtime-async-std = ["dep:async-std"]
runtime-tokio = ["dep:tokio"]
sqlite = ["sqlx/sqlite"]

[lib]
name = "sqlx_otel"
path = "src/lib.rs"

[[example]]
name = "sqlite"
path = "examples/sqlite.rs"
required-features = [
    "sqlite",
    "runtime-tokio",
]

[[test]]
name = "common"
path = "tests/common.rs"

[[test]]
name = "mysql"
path = "tests/mysql.rs"

[[test]]
name = "pool_metrics"
path = "tests/pool_metrics.rs"

[[test]]
name = "postgres"
path = "tests/postgres.rs"

[[test]]
name = "sqlite"
path = "tests/sqlite.rs"

[dependencies.async-std]
version = "1"
optional = true

[dependencies.futures]
version = "0.3"

[dependencies.opentelemetry]
version = "0.31"

[dependencies.opentelemetry-semantic-conventions]
version = "0.31"
features = ["semconv_experimental"]

[dependencies.sqlx]
version = "0.8"
default-features = false

[dependencies.tokio]
version = "1"
features = [
    "rt",
    "time",
]
optional = true

[dev-dependencies.ctor]
version = "0.10"

[dev-dependencies.opentelemetry_sdk]
version = "0.31"
features = [
    "testing",
    "rt-tokio",
]

[dev-dependencies.proptest]
version = "1"

[dev-dependencies.serial_test]
version = "3"

[dev-dependencies.sqlx]
version = "0.8"
features = [
    "macros",
    "sqlite",
    "postgres",
    "mysql",
    "runtime-tokio",
]

[dev-dependencies.testcontainers]
version = "0.27"

[dev-dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt-multi-thread",
]

[lints.clippy]
pedantic = "warn"