5个版本 (重大更新)

0.5.0 2021年10月18日
0.4.0 2021年4月14日
0.3.0 2021年4月13日
0.2.0 2021年4月13日
0.1.0 2021年4月7日

HTTP服务器中排名第996

Download history 205/week @ 2024-04-07 258/week @ 2024-04-14 234/week @ 2024-04-21 325/week @ 2024-04-28 62/week @ 2024-05-05 213/week @ 2024-05-12 237/week @ 2024-05-19 190/week @ 2024-05-26 106/week @ 2024-06-02 206/week @ 2024-06-09 279/week @ 2024-06-16 245/week @ 2024-06-23 152/week @ 2024-06-30 159/week @ 2024-07-07 255/week @ 2024-07-14 402/week @ 2024-07-21

每月下载量976

Apache-2.0

8KB
91

warp-prometheus

Warp的Prometheus指标的扩展 Warp 文档 Apache-2许可 CI

示例

use prometheus::Registry;
use warp_prometheus::Metrics;
use warp::Filter;

let registry: Registry = Registry::new();
let path_includes: Vec<String> = vec![String::from("hello")];

let route_one = warp::path("hello")
    .and(warp::path::param())
    .and(warp::header("user-agent"))
    .map(|param: String, agent: String| {
    format!("Hello {}, whose agent is {}", param, agent)
    });

    let metrics = Metrics::new(&registry, &path_includes);

    let test_routes = route_one.with(warp::log::custom(move |log| {
        metrics.http_metrics(log)
    }));

依赖

~11–20MB
~292K SLoC