1 unstable release
0.1.0 | Aug 21, 2021 |
---|
#46 in #tide
8KB
53 lines
tide-prometheus
Tide middleware for Prometheus with a few default metrics.
Documentation
See docs.rs for documentation.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
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.
Dependencies
~13–23MB
~343K SLoC