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;

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

    assert!(response.is_ok());

    Ok(())
}