trillium-opentelemetry

Crates.iotrillium-opentelemetry
lib.rstrillium-opentelemetry
version0.8.0
sourcesrc
created_at2023-03-22 05:58:53.593747
updated_at2024-07-15 22:57:45.701392
descriptionopentelemetry for trillium.rs
homepage
repositoryhttps://github.com/trillium-rs/trillium-opentelemetry
max_upload_size
id816740
size107,521
Jacob Rothstein (jbr)

documentation

README

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.

Commit count: 78

cargo fmt