prometheus-http-api-rs 0.0.1

A simple library to pull data from prometheus using its API

Rust Crates.io Documentation

Upcoming docs crate documentation.

Usage

Add dependency in Cargo.toml:

toml [dependencies] prometheus-http-api-rs = "0.0.1"

Use prometheus_http_api_rs

```rust use prometheushttpapi_rs::*;

[tokio::main]

async fn main() { let query = PrometheusQuery::Instant(PrometheusInstantQuery::new("up".tostring())); let request = PrometheusDataSourceBuilder::new("localhost:9090".tostring()) .withquery(query) .build() .unwrap(); let resjson = request.get().await; tracing::info!("{:?}", res_json); } ```

License

TODO

To be addressed soon

Not stable endpoints:

Admin endpoints

Since prometheus v2.18, require -web.enable-admin-api

Write endpoint

Requires --web.enable-remote-write-receiver.

NOTES: