From 2281ebcb6d58edcc0b0a09905d14432bb3d7d538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Gra=CC=88fenstein?= Date: Sun, 22 Mar 2026 23:56:27 +0100 Subject: [PATCH] improved container restart alert --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 349b983..fb2131c 100644 --- a/README.md +++ b/README.md @@ -357,13 +357,16 @@ Fires when any filesystem drops below 20% free space. #### Container restarting -Fires when any container's start time changes more than 3 times in 10 minutes, indicating repeated restarts. +Fires when any container restarts more than 3 times in 10 minutes, indicating a crash loop. +Detects both in-place restarts (`docker restart`) and ID-changing restarts (`docker compose down/up`). Requires cAdvisor (included in the monitoring stack). - **Data source:** Prometheus - **Query (A):** ```promql - changes(container_start_time_seconds{name!=""}[10m]) + sum by (name) (changes(container_start_time_seconds{name!=""}[10m])) + + + count by (name) (count_over_time(container_start_time_seconds{name!=""}[10m])) - 1 ``` - **Expression (B):** Threshold — `A IS ABOVE 3` - **Evaluate every:** `1m`