14 releases (breaking)

0.10.0 Jan 24, 2025
0.9.0 Jul 15, 2024
0.8.0 May 17, 2024
0.6.0 Feb 26, 2024
0.1.0 Mar 27, 2023

#358 in HTTP server

Download history 260/week @ 2024-10-29 219/week @ 2024-11-05 717/week @ 2024-11-12 413/week @ 2024-11-19 596/week @ 2024-11-26 930/week @ 2024-12-03 329/week @ 2024-12-10 250/week @ 2024-12-17 65/week @ 2024-12-24 143/week @ 2024-12-31 645/week @ 2025-01-07 139/week @ 2025-01-14 346/week @ 2025-01-21 777/week @ 2025-01-28 234/week @ 2025-02-04 402/week @ 2025-02-11

1,876 downloads per month

MIT/Apache

41KB
785 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
~196K SLoC