6 releases
0.2.5 | Dec 9, 2023 |
---|---|
0.2.4 | Mar 19, 2023 |
0.2.3 | Jun 17, 2022 |
0.2.2 | Oct 20, 2021 |
0.2.1 | Oct 5, 2020 |
#307 in Parser implementations
212,883 downloads per month
Used in 10 crates
27KB
651 lines
prometheus-parse
Simple but effective Rust parser for the Prometheus scrape format.
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())?;
Attribution
This crate is 99.99% lifted from prometheus-scrape with some minor API changes and a GitHub repo to encourage PRs.
License
Apache License 2.0 - same as original project
Dependencies
~4–11MB
~102K SLoC