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 • Rust 包仓库 205/week @ 2024-04-07 • Rust 包仓库 258/week @ 2024-04-14 • Rust 包仓库 234/week @ 2024-04-21 • Rust 包仓库 325/week @ 2024-04-28 • Rust 包仓库 62/week @ 2024-05-05 • Rust 包仓库 213/week @ 2024-05-12 • Rust 包仓库 237/week @ 2024-05-19 • Rust 包仓库 190/week @ 2024-05-26 • Rust 包仓库 106/week @ 2024-06-02 • Rust 包仓库 206/week @ 2024-06-09 • Rust 包仓库 279/week @ 2024-06-16 • Rust 包仓库 245/week @ 2024-06-23 • Rust 包仓库 152/week @ 2024-06-30 • Rust 包仓库 159/week @ 2024-07-07 • Rust 包仓库 255/week @ 2024-07-14 • Rust 包仓库 402/week @ 2024-07-21 • Rust 包仓库

每月下载量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