From 92427291e6fa7517b3c081fa0e9032617526dc4b Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 1 May 2026 03:54:16 -0500 Subject: [PATCH] Fix ContainerHighMemory alert: skip containers with no memory limit Containers without a memory limit have spec_memory_limit_bytes=0, causing division to produce +Inf which always fires. Added guard: only alert when a limit is actually set (> 0). Co-Authored-By: Claude Opus 4.6 (1M context) --- monitoring/alert_rules.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monitoring/alert_rules.yml b/monitoring/alert_rules.yml index 5a637d9..64faa13 100644 --- a/monitoring/alert_rules.yml +++ b/monitoring/alert_rules.yml @@ -151,7 +151,10 @@ groups: description: "Container CPU usage above 80% for 10 minutes." - alert: ContainerHighMemory - expr: container_memory_usage_bytes{name=~"performancewest-.*"} / container_spec_memory_limit_bytes{name=~"performancewest-.*"} * 100 > 85 + expr: | + (container_memory_usage_bytes{name=~"performancewest-.*"} + / container_spec_memory_limit_bytes{name=~"performancewest-.*"} * 100 > 85) + and container_spec_memory_limit_bytes{name=~"performancewest-.*"} > 0 for: 5m labels: severity: warning