1 个不稳定版本
| 0.1.0 | 2021 年 8 月 21 日 |
|---|
#50 in #tide
8KB
53 行
tide-prometheus
Tide 中间件,用于 Prometheus,附带一些默认指标。
文档
请参阅 docs.rs 获取文档。
许可证
许可协议为以下之一:
- Apache 许可协议 2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可协议 (LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)
任选其一。
贡献
除非你明确声明,否则根据 Apache-2.0 许可协议定义,你故意提交给作品包含的贡献,将按照上述方式双许可,不附加任何额外条款或条件。
lib.rs:
Tide 中间件,用于 prometheus,附带一些默认指标。
示例
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);
指标
以下 {prefix} 是你在 Prometheus::new 中放置的字符串。
{prefix}_http_requests(prometheus::IntCounterVec),带有标签method作为请求方法。status作为响应状态。
功能
process将启用prometheus的process功能,记录进程的各种指标。
依赖项
~11–22MB
~350K SLoC