12 releases (breaking)

new 0.8.0 May 17, 2024
0.6.0 Feb 26, 2024
0.5.3 Dec 13, 2023
0.3.0 Jul 31, 2023
0.1.0 Mar 27, 2023

#1286 in HTTP server

Download history 1068/week @ 2024-01-24 1101/week @ 2024-01-31 873/week @ 2024-02-07 858/week @ 2024-02-14 650/week @ 2024-02-21 744/week @ 2024-02-28 980/week @ 2024-03-06 1331/week @ 2024-03-13 1500/week @ 2024-03-20 1324/week @ 2024-03-27 1279/week @ 2024-04-03 998/week @ 2024-04-10 604/week @ 2024-04-17 432/week @ 2024-04-24 905/week @ 2024-05-01 433/week @ 2024-05-08

2,431 downloads per month

MIT/Apache

34KB
638 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

~7.5MB
~194K SLoC