3 releases (breaking)

0.3.0 Mar 31, 2025
0.2.0 Sep 12, 2024
0.1.0 Apr 4, 2023

#1049 in HTTP server

Download history 68/week @ 2024-12-25 102/week @ 2025-01-01 464/week @ 2025-01-08 236/week @ 2025-01-15 397/week @ 2025-01-22 488/week @ 2025-01-29 217/week @ 2025-02-05 304/week @ 2025-02-12 532/week @ 2025-02-19 552/week @ 2025-02-26 449/week @ 2025-03-05 444/week @ 2025-03-12 303/week @ 2025-03-19 241/week @ 2025-03-26 463/week @ 2025-04-02 379/week @ 2025-04-09

1,402 downloads per month

MPL-2.0 license

15KB

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
~212K SLoC