#trillium #prometheus

trillium-prometheus

Trillium handler for Prometheus metrics scrapes

1 unstable release

0.1.0 Apr 4, 2023

#1237 in Text processing

Download history 678/week @ 2023-10-23 868/week @ 2023-10-30 158/week @ 2023-11-06 836/week @ 2023-11-13 304/week @ 2023-11-20 216/week @ 2023-11-27 360/week @ 2023-12-04 670/week @ 2023-12-11 443/week @ 2023-12-18 210/week @ 2023-12-25 918/week @ 2024-01-01 508/week @ 2024-01-08 505/week @ 2024-01-15 783/week @ 2024-01-22 735/week @ 2024-01-29 873/week @ 2024-02-05

2,896 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–14MB
~209K SLoC