Crate tide_prometheus

Crate tide_prometheus 

Source
Expand description

Tide middleware for prometheus with a few default metrics.

§Example

let mut server = tide::new();

server.with(tide_prometheus::Prometheus::new("tide"));

// Optionally serve these metrics on the same server:
server.at("/metrics").get(tide_prometheus::metrics_endpoint);

§Metrics

The {prefix} below is the string you put in Prometheus::new.

  • {prefix}_http_requests (prometheus::IntCounterVec) with labels:
    • method as the request method.
    • status as the response status.

§Features

  • process will enable the prometheus process feature, recording various metrics of the process.

Re-exports§

pub use prometheus;

Structs§

Prometheus
Tide middleware for prometheus with a few default metrics.

Functions§

metrics_endpoint
A convencience tide::Endpoint that gathers the metrics with prometheus::gather and then returns them inside the response body as specified by the Prometheus docs.