owiwi
Opinionated tracing subscriber with OpenTelemetry export.
Install
[]
= { = "1.1.0", = ["console"] }
= "0.1"
Usage
use Owiwi;
Hold the returned OwiwiGuard until shutdown. Dropping it stops export.
OTLP export
use Duration;
use ;
CLI integration
Flatten Owiwi into your CLI struct. Requires the clap feature.
[]
= { = "4", = ["derive"] }
= { = "1.1.0", = ["clap", "honeycomb"] }
= "0.1"
use Parser;
use ;
Backends
| Backend | Config type | Feature |
|---|---|---|
| Any OTLP collector | OtlpConfig |
(default) |
| Console (stdout) | — | console |
| Honeycomb | HoneycombConfig |
honeycomb |
Environment variables
Per the OpenTelemetry spec. With clap, each has a CLI flag.
| Variable | Flag | |
|---|---|---|
OTEL_SERVICE_NAME |
--otel-service-name |
Service name |
OTEL_SDK_DISABLED |
--otel-sdk-disabled |
Disable telemetry |
OTEL_RESOURCE_ATTRIBUTES |
--otel-resource-attributes |
key=value,key=value |
OTEL_EXPORTER_OTLP_ENDPOINT |
--otlp-endpoint |
Exporter endpoint |
OTEL_EXPORTER_OTLP_HEADERS |
--otlp-headers |
Extra gRPC headers |
OTEL_EXPORTER_OTLP_TIMEOUT |
--otlp-timeout |
Export timeout |
RUST_LOG |
--trace-directive |
info · my_crate=debug |
Features
| Feature | Default | |
|---|---|---|
clap |
CLI flags via clap::Args |
yes |
serde |
Deserialize on config types |
yes |
console |
Stdout exporters | no |
honeycomb |
Honeycomb exporter | no |
metrics |
Metrics via SdkMeterProvider |
no |
prometheus |
Prometheus OTLP export (implies metrics) |
no |
MSRV
1.94.0
Acknowledgments
Inspired by Instrumenting Axum.