Crate trillium_prometheus
source ·Expand description
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);
Functions§
- Creates a handler that responds to GET requests for “/metrics”.