13 releases (breaking)

0.9.0 Jul 15, 2024
0.7.0 Apr 12, 2024
0.6.0 Feb 26, 2024
0.5.3 Dec 13, 2023
0.1.0 Mar 27, 2023

#1090 in HTTP server

Download history 555/week @ 2024-07-23 430/week @ 2024-07-30 360/week @ 2024-08-06 267/week @ 2024-08-13 187/week @ 2024-08-20 331/week @ 2024-08-27 302/week @ 2024-09-03 385/week @ 2024-09-10 119/week @ 2024-09-17 251/week @ 2024-09-24 236/week @ 2024-10-01 85/week @ 2024-10-08 327/week @ 2024-10-15 424/week @ 2024-10-22 260/week @ 2024-10-29 203/week @ 2024-11-05

1,259 downloads per month

MIT/Apache

35KB
642 lines

Trillium Opentelemetry!

This crate provides opentelemetry metrics conforming to semantic conventions for http and tracing semantic conventions.

Usage:

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;
}




Legal:

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~8MB
~197K SLoC