From 8fbafbd05088be6a7893363739cad921a7ca59ea Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 8 Jan 2026 21:08:52 +0200 Subject: Add Prometheus NodePort and alert query targets to Justfile --- f3s/prometheus/Justfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'f3s') diff --git a/f3s/prometheus/Justfile b/f3s/prometheus/Justfile index 53338cb..1a63371 100644 --- a/f3s/prometheus/Justfile +++ b/f3s/prometheus/Justfile @@ -88,3 +88,15 @@ restart-alertmanager: kubectl rollout restart -n {{NAMESPACE}} statefulset/alertmanager-prometheus-kube-prometheus-alertmanager restart: restart-grafana + +# Query firing alerts via NodePort (default node: r0) +firing-alerts node="r0": + @curl -s "http://{{node}}:30090/api/v1/alerts" | jq -r '.data.alerts[] | select(.state=="firing") | "\(.labels.alertname) [\(.labels.severity // "unknown")]: \(.annotations.summary // .annotations.description // "no description")"' + +# Query all alerts (firing and pending) via NodePort +all-alerts node="r0": + @curl -s "http://{{node}}:30090/api/v1/alerts" | jq '.data.alerts' + +# Count of firing alerts +firing-count node="r0": + @curl -s "http://{{node}}:30090/api/v1/alerts" | jq '[.data.alerts[] | select(.state=="firing")] | length' -- cgit v1.2.3