Skip to content

Commit 14d7479

Browse files
authored
Merge pull request #1099 from stackhpc/fix-zero-denominator
Add condition to ensure swap is not zero for swap alert
2 parents 9a5cc9e + e7b97b2 commit 14d7479

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

etc/kayobe/kolla/config/prometheus/system.rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ groups:
2525
description: "Available memory is {{ $value }} GiB."
2626

2727
- alert: LowSwapSpace
28-
expr: (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_warning_threshold_ratio }}{% raw %}
28+
expr: node_memory_SwapTotal_bytes > 0 and (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_warning_threshold_ratio }}{% raw %}
2929
for: 1m
3030
labels:
3131
severity: warning
@@ -34,7 +34,7 @@ groups:
3434
description: "Available swap space is {{ $value | humanizePercentage }}. Running out of swap space causes OOM Kills."
3535

3636
- alert: LowSwapSpace
37-
expr: (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_critical_threshold_ratio }}{% raw %}
37+
expr: node_memory_SwapTotal_bytes > 0 and (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_critical_threshold_ratio }}{% raw %}
3838
for: 1m
3939
labels:
4040
severity: critical

0 commit comments

Comments
 (0)