prometheus-parse

Crates.ioprometheus-parse
lib.rsprometheus-parse
version0.2.5
sourcesrc
created_at2020-10-05 07:58:22.000761
updated_at2023-12-09 22:28:45.159935
descriptionA simple parser for the Prometheus text format
homepagehttps://github.com/ccakes/prometheus-parse-rs
repositoryhttps://github.com/ccakes/prometheus-parse-rs
max_upload_size
id296237
size37,986
Cameron Daniel (ccakes)

documentation

README

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

Commit count: 31

cargo fmt