# Trillium Opentelemetry!
This crate provides opentelemetry metrics conforming to [semantic conventions for http][http-metrics] and [tracing semantic conventions][http-spans].
## Usage:
```rust
use trillium_opentelemetry::global::{instrument, instrument_handler};
use trillium_router::router;
#[tokio::main]
async fn main() {
// configure a global meter provider and tracer provider here
// see examples/with_global.rs for a functional example
trillium_tokio::run_async((
instrument().with_route(|conn| conn.route().map(|r| r.to_string().into())),
instrument_handler(router().get("/some/:path", instrument_handler("ok")),
))
.await;
}
```
[http-metrics]: https://opentelemetry.io/docs/specs/semconv/http/http-metrics/
[http-spans]: https://opentelemetry.io/docs/specs/semconv/http/http-spans/