Function prometheus_http_query::targets
source · [−]Expand description
Query the current state of target discovery.
This is just a convenience function for one-off requests, see Client::targets.
use prometheus_http_query::{targets, Error, TargetState};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
let response = targets("http://localhost:9090", Some(TargetState::Active)).await;
assert!(response.is_ok());
Ok(())
}