#prometheus #text-format #parser

prometheus-parse

A simple parser for the Prometheus text format

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

#278 in Parser implementations

Download history 86996/week @ 2025-09-26 98848/week @ 2025-10-03 84770/week @ 2025-10-10 95510/week @ 2025-10-17 90566/week @ 2025-10-24 81251/week @ 2025-10-31 92360/week @ 2025-11-07 91702/week @ 2025-11-14 100007/week @ 2025-11-21 102031/week @ 2025-11-28 121762/week @ 2025-12-05 104926/week @ 2025-12-12 65955/week @ 2025-12-19 45715/week @ 2025-12-26 88130/week @ 2026-01-02 112984/week @ 2026-01-09

331,946 downloads per month
Used in 28 crates (20 directly)

Apache-2.0

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–6MB
~99K SLoC