11 releases (7 breaking)

0.7.0 Apr 12, 2024
0.6.0 Feb 26, 2024
0.5.3 Dec 13, 2023
0.4.0 Dec 7, 2023
0.0.1 Mar 22, 2023

#291 in HTTP server

Download history 584/week @ 2024-01-06 652/week @ 2024-01-13 924/week @ 2024-01-20 946/week @ 2024-01-27 1095/week @ 2024-02-03 857/week @ 2024-02-10 789/week @ 2024-02-17 684/week @ 2024-02-24 711/week @ 2024-03-02 1027/week @ 2024-03-09 1475/week @ 2024-03-16 1225/week @ 2024-03-23 1454/week @ 2024-03-30 1394/week @ 2024-04-06 888/week @ 2024-04-13 575/week @ 2024-04-20

4,375 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
~193K SLoC