From 744f8e243b1a2a7673c58053cea03ed5b8c3abde Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Tue, 6 Oct 2026 20:35:47 +0200 Subject: [PATCH] feat(openclaw): add PrometheusRule for pod readiness, crashlooping, and PVC storage --- k8s/openclaw/monitoring.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 k8s/openclaw/monitoring.yaml diff --git a/k8s/openclaw/monitoring.yaml b/k8s/openclaw/monitoring.yaml new file mode 100644 index 0000000..6e9be21 --- /dev/null +++ b/k8s/openclaw/monitoring.yaml @@ -0,0 +1,36 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: openclaw-alerts + namespace: openclaw + labels: + release: prometheus-operator + app.kubernetes.io/name: openclaw +spec: + groups: + - name: openclaw.rules + rules: + - alert: OpenClawPodNotReady + expr: kube_pod_status_ready{namespace="openclaw", pod="openclaw-0", condition="true"} == 0 + for: 5m + labels: + severity: critical + annotations: + summary: "OpenClaw pod openclaw-0 is not ready" + description: "Pod openclaw-0 in namespace openclaw has been unready for more than 5 minutes. Telegram and background agents may be offline." + - alert: OpenClawCrashLooping + expr: increase(kube_pod_container_status_restarts_total{namespace="openclaw", pod="openclaw-0"}[15m]) >= 2 + for: 2m + labels: + severity: warning + annotations: + summary: "OpenClaw container restart detected" + description: "Container {{ $labels.container }} in pod openclaw-0 has restarted {{ $value }} times in the last 15 minutes." + - alert: OpenClawDataVolumeLow + expr: kubelet_volume_stats_available_bytes{namespace="openclaw", persistentvolumeclaim="openclaw-data"} / kubelet_volume_stats_capacity_bytes{namespace="openclaw", persistentvolumeclaim="openclaw-data"} < 0.15 + for: 15m + labels: + severity: warning + annotations: + summary: "OpenClaw PVC data volume is low on space" + description: "PersistentVolumeClaim openclaw-data has less than 15% space available."