initial commit

This commit is contained in:
Bartal Læarsson
2025-03-08 23:09:54 +00:00
commit 54b6198f14
8 changed files with 14433 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
groups:
- name: host_alerts
rules:
- alert: HostHighCPULoad
expr: 100 - (avg by(instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 80
for: 5m
labels:
severity: warning
annotations:
summary: "High CPU load on {{ $labels.instance }}"
description: "CPU load is > 80% for 5 minutes"
- alert: HostOutOfMemory
expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10
for: 5m
labels:
severity: warning
annotations:
summary: "Host out of memory on {{ $labels.instance }}"
description: "Node memory is filling up (< 10% left)"
- alert: HostOutOfDiskSpace
expr: (node_filesystem_avail_bytes / node_filesystem_size_bytes * 100) < 10
for: 5m
labels:
severity: warning
annotations:
summary: "Host out of disk space on {{ $labels.instance }}"
description: "Disk is almost full (< 10% left)"
- name: container_alerts
rules:
- alert: ContainerHighCPU
expr: (sum(rate(container_cpu_usage_seconds_total{name!=""}[3m])) by (name) * 100) > 80
for: 5m
labels:
severity: warning
annotations:
summary: "High CPU usage in container {{ $labels.name }}"
description: "Container {{ $labels.name }} CPU usage is > 80% for 5 minutes"
- alert: ContainerHighMemory
expr: (container_memory_usage_bytes{name!=""} / container_spec_memory_limit_bytes{name!=""} * 100) > 80
for: 5m
labels:
severity: warning
annotations:
summary: "High memory usage in container {{ $labels.name }}"
description: "Container {{ $labels.name }} memory usage is > 80% for 5 minutes"
- alert: ContainerDown
expr: absent(container_last_seen{name!=""})
for: 1m
labels:
severity: critical
annotations:
summary: "Container {{ $labels.name }} down"
description: "Container {{ $labels.name }} has been down for more than 1 minute"
- alert: ContainerRestarting
expr: changes(container_start_time_seconds{name!=""}[15m]) > 2
for: 5m
labels:
severity: warning
annotations:
summary: "Container {{ $labels.name }} restarting frequently"
description: "Container {{ $labels.name }} has restarted more than 2 times in the last 15 minutes"