1
0
Fork 0

Fix prometheus query

This commit is contained in:
clerie 2023-02-04 00:01:26 +01:00
parent c0cb8db954
commit b89910f649
1 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ async fn check(State(app_state): State<AppState>, Query(params): Query<HashMap<S
let client = reqwest::Client::new();
let prometheus_req = match client.get(format!("{}/api/v1/query?query=nixos_nixos_current_system_hash{{{}}}", app_state.prometheus_url, app_state.prometheus_query_tag_template.clone().replace("{}", target)))
let prometheus_req = match client.get(format!("{}/api/v1/query?query=nixos_current_system_hash{{{}}}", app_state.prometheus_url, app_state.prometheus_query_tag_template.clone().replace("{}", target)))
.header("Accept", "application/json")
.send().await {
Ok(req) => req,
@ -260,6 +260,6 @@ async fn check(State(app_state): State<AppState>, Query(params): Query<HashMap<S
return (
StatusCode::OK,
format!("nixos_current_system_valid{{{}}} {}\n", app_state.prometheus_query_tag_template.clone().replace("{}", target), status)
format!("nixos_current_system_valid{{}} {}\n", status)
).into_response();
}