pub async fn series(
    host: &str,
    selectors: &[Selector<'_>],
    start: Option<i64>,
    end: Option<i64>
) -> Result<Vec<HashMap<String, String>>, Error>
Expand description

Find time series that match certain label sets (Selectors).

This is just a convenience function for one-off requests, see Client::series.

use prometheus_http_query::{series, Error, Selector};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
    let select = Selector::new()
        .eq("handler", "/api/v1/query");

    let response = series("http://localhost:9090", &[select], None, None).await;

    assert!(response.is_ok());

    Ok(())
}