summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-08 21:08:52 +0200
committerPaul Buetow <paul@buetow.org>2026-01-08 21:08:52 +0200
commit8fbafbd05088be6a7893363739cad921a7ca59ea (patch)
tree0dc32217b7bc05cd652e06493356e072a627b1d5
parent68a3f29646a868b2f652dbcfdf59d85e93887b99 (diff)
Add Prometheus NodePort and alert query targets to Justfile
-rw-r--r--f3s/prometheus/Justfile12
1 files changed, 12 insertions, 0 deletions
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'