| Crates.io | prometheus-http-client |
| lib.rs | prometheus-http-client |
| version | 0.1.0 |
| created_at | 2025-12-18 22:38:29.573801+00 |
| updated_at | 2025-12-18 22:38:29.573801+00 |
| description | HTTP client for Prometheus query API with optional time-series plotting |
| homepage | |
| repository | https://github.com/cbeck88/signal-gateway |
| max_upload_size | |
| id | 1993702 |
| size | 92,058 |
Makes requests to the prometheus query API. With plot feature, also provides
a way to plot responses from prometheus.
There are several prometheus query clients for Rust, but none quite fit the requirements:
prometheus-http-queryThe 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-apiSupports 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-queryBoth are unmaintained (last updates 4+ years ago) and use outdated dependencies
like tokio 0.1 and hyper 0.12.
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.