improved container restart alert
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user