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

#351 in HTTP server

Download history 412/week @ 2024-10-23 250/week @ 2024-10-30 326/week @ 2024-11-06 630/week @ 2024-11-13 399/week @ 2024-11-20 588/week @ 2024-11-27 972/week @ 2024-12-04 287/week @ 2024-12-11 247/week @ 2024-12-18 65/week @ 2024-12-25 143/week @ 2025-01-01 651/week @ 2025-01-08 138/week @ 2025-01-15 479/week @ 2025-01-22 643/week @ 2025-01-29 250/week @ 2025-02-05

1,516 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
~195K SLoC