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) <noreply@anthropic.com>
This commit is contained in:
parent
15f5c267e7
commit
92427291e6
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue