2 unstable releases

0.2.0 Sep 12, 2024
0.1.0 Apr 4, 2023

#9 in #scrape

Download history 439/week @ 2024-11-16 244/week @ 2024-11-23 440/week @ 2024-11-30 739/week @ 2024-12-07 211/week @ 2024-12-14 178/week @ 2024-12-21 68/week @ 2024-12-28 145/week @ 2025-01-04 444/week @ 2025-01-11 271/week @ 2025-01-18 375/week @ 2025-01-25 526/week @ 2025-02-01 154/week @ 2025-02-08 317/week @ 2025-02-15 555/week @ 2025-02-22 526/week @ 2025-03-01

1,581 downloads per month

MPL-2.0 license

8KB

This is a small utility crate that provides a Prometheus metrics endpoint as a Trillium handler. It responds to GET requests to "/metrics" with metrics from the provided registry, using text-format encoding.

Example:

let registry = prometheus::Registry::new();
let handler = trillium_prometheus::text_format_handler(registry);
trillium_smol::config()
    .with_host("0.0.0.0")
    .with_port(9464)
    .run(handler);

Dependencies

~7–13MB
~211K SLoC