9 releases (5 breaking)

0.5.3 Dec 13, 2023
0.5.2 Dec 13, 2023
0.4.0 Dec 7, 2023
0.3.0 Jul 31, 2023
0.0.1 Mar 22, 2023

#14 in #meter

Download history 196/week @ 2023-11-03 608/week @ 2023-11-10 462/week @ 2023-11-17 156/week @ 2023-11-24 349/week @ 2023-12-01 720/week @ 2023-12-08 516/week @ 2023-12-15 254/week @ 2023-12-22 874/week @ 2023-12-29 594/week @ 2024-01-05 775/week @ 2024-01-12 869/week @ 2024-01-19 1078/week @ 2024-01-26 1174/week @ 2024-02-02 887/week @ 2024-02-09 982/week @ 2024-02-16

4,141 downloads per month

MIT/Apache

31KB
611 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
~198K SLoC