Skip to main content

metrics_handler

Function metrics_handler 

Source
pub fn metrics_handler(
    handle: PrometheusHandle,
) -> impl Fn() -> Ready<Response> + Clone + Send + 'static
Expand description

Returns a clone-safe handler closure that renders Prometheus metrics as an HTTP response with the correct Content-Type.

Mount the returned closure at /metrics. The response Content-Type is text/plain; version=0.0.4; charset=utf-8 as required by the Prometheus exposition format specification.