pub async fn alerts(host: &str) -> Result<Vec<Alert>, Error>
Expand description

Retrieve a list of active alerts.

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

use prometheus_http_query::{alerts, Error};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
    let response = alerts("http://localhost:9090").await;

    assert!(response.is_ok());

    Ok(())
}