#prometheus #parser #text-format #scrape

prometheus-parse

用于Prometheus文本格式的一个简单解析器

6个版本

0.2.5 2023年12月9日
0.2.4 2023年3月19日
0.2.3 2022年6月17日
0.2.2 2021年10月20日
0.2.1 2020年10月5日

#3 in #scrape

Download history · Rust 包仓库 32762/week @ 2024-04-20 · Rust 包仓库 29409/week @ 2024-04-27 · Rust 包仓库 28602/week @ 2024-05-04 · Rust 包仓库 35443/week @ 2024-05-11 · Rust 包仓库 31080/week @ 2024-05-18 · Rust 包仓库 39142/week @ 2024-05-25 · Rust 包仓库 36849/week @ 2024-06-01 · Rust 包仓库 30049/week @ 2024-06-08 · Rust 包仓库 32224/week @ 2024-06-15 · Rust 包仓库 36296/week @ 2024-06-22 · Rust 包仓库 31343/week @ 2024-06-29 · Rust 包仓库 33673/week @ 2024-07-06 · Rust 包仓库 38785/week @ 2024-07-13 · Rust 包仓库 41676/week @ 2024-07-20 · Rust 包仓库 37434/week @ 2024-07-27 · Rust 包仓库 41756/week @ 2024-08-03 · Rust 包仓库

166,308 每月下载量
10 crates 中使用

Apache-2.0

27KB
651

prometheus-parse

简单但有效的Rust解析器,用于Prometheus抓取格式。

let body = reqwest::get("https://prometheus.example.com/metrics")?
    .text()?;
let lines: Vec<_> = body.lines().map(|s| Ok(s.to_owned)).collect();

let metrics = prometheus_parse::Scrape::parse(lines.into_iter())?;

归属

此crate有99.99%是从prometheus-scrape复制而来,进行了一些API更改,并创建了一个GitHub仓库以鼓励提交PR。

许可证

Apache License 2.0 - 与原始项目相同

依赖项

~4–11MB
~101K SLoC