prometheus-http-api-rs 0.2.0

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 = "0.2.0"

Use prometheus_http_api

```rust use prometheushttpapi::*;

[tokio::main]

async fn main() { let query = Query::Instant(InstantQuery::new("up")); let request = DataSourceBuilder::new("localhost:9090") .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: