Crate tide_prometheus[−][src]
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 theprometheus
process
feature, recording various metrics of the process.
Re-exports
pub use prometheus;
Structs
Tide middleware for prometheus
with a few default metrics.
Functions
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.