prometheus-http-client

Crates.ioprometheus-http-client
lib.rsprometheus-http-client
version0.1.0
created_at2025-12-18 22:38:29.573801+00
updated_at2025-12-18 22:38:29.573801+00
descriptionHTTP client for Prometheus query API with optional time-series plotting
homepage
repositoryhttps://github.com/cbeck88/signal-gateway
max_upload_size
id1993702
size92,058
Chris Beck (cbeck88)

documentation

README

prometheus-http-client

Makes requests to the prometheus query API. With plot feature, also provides a way to plot responses from prometheus.

Why a custom implementation?

There are several prometheus query clients for Rust, but none quite fit the requirements:

prometheus-http-query

The most complete and actively maintained option. However, it uses a structured Selector builder that doesn't support raw PromQL selector strings. This means queries like __name__=~"http_.*" or complex label matchers must be constructed programmatically rather than passed as strings. For use cases where selectors come from configuration files or user input, this is a significant limitation.

prometheus-http-api

Supports raw selector strings, which is great. However, it only implements instant and range queries (/api/v1/query and /api/v1/query_range). It lacks support for /api/v1/series, /api/v1/labels, /api/v1/label/.../values, and /api/v1/alerts endpoints that this crate uses.

proq / prometheus-query

Both are unmaintained (last updates 4+ years ago) and use outdated dependencies like tokio 0.1 and hyper 0.12.

This crate

This implementation supports both raw PromQL selector strings and the full set of API endpoints needed (query, query_range, series, labels, label values, alerts). The plot feature adds time-series visualization using plotters.

Commit count: 0

cargo fmt