Skip to content

Telemetry for Rust, without the ceremony

Structured logs with one line of setup. OpenTelemetry traces, metrics and logs when you want them, without changing your code.
Cargo.toml
[dependencies]
oxtel = "0.3"
tracing = "0.1"
examples/logs.rs
fn main() -> Result<(), oxtel::Error> {
// Text on a terminal, JSON anywhere else. Keep the guard alive.
let _logs = oxtel::init()?;
// Fields are structured: in JSON, each is a key of its own.
tracing::info!(user.id = 42, plan = "team", "signed in");
// Lines inside a span carry its fields and its trace id, so every line
// about one request can be found together.
let request = tracing::info_span!("request", http.route = "/orders", order.id = 7);
let _entered = request.enter();
tracing::warn!(attempt = 2, "payment provider slow; retrying");
Ok(())
}

On a terminal you get readable text. Anywhere else, such as a container whose output goes to a log shipper, you get one JSON object per line, with each field as a key of its own. Lines inside a span carry its fields and its trace id, so you can find everything one request did.

Your code doesn't change

Rust code already records spans, logs and metrics with tracing and metrics. oxtel turns them into log lines, OTLP for collectors and backends, and Prometheus scrapes. There’s no second API to learn, and no bridge between two.

Nothing is sent until you say so

With no settings, you get log lines and nothing else. Set OTEL_EXPORTER_OTLP_ENDPOINT and traces, metrics and logs go there, with no rebuild.

It tells you what it did

When it starts, one line says where each kind of telemetry goes. If sending fails, it says so, and what to check.

Built to the standards

The OpenTelemetry settings, protocol and naming conventions. CI checks the output against a real OpenTelemetry Collector and Prometheus’s own checker.