diff --git a/docker-compose/prometheus/promtheus/config/rules/container.yaml b/docker-compose/prometheus/promtheus/config/rules/container.yaml new file mode 100644 index 0000000..741d0d1 --- /dev/null +++ b/docker-compose/prometheus/promtheus/config/rules/container.yaml @@ -0,0 +1,28 @@ +groups: + - name: container + interval: 15s + rules: + - alert: ContainerKilled + expr: time() - container_last_seen > 60 + for: 0m + labels: + severity: warning + annotations: + summary: Container killed (instance {{ $labels.instance }}) + description: "A container has disappeared\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + - alert: ContainerHighCpuUtilization + expr: (sum(rate(container_cpu_usage_seconds_total{container!=""}[5m])) by (pod, container) / sum(container_spec_cpu_quota{container!=""}/container_spec_cpu_period{container!=""}) by (pod, container) * 100) > 80 + for: 2m + labels: + severity: warning + annotations: + summary: Container High CPU utilization (instance {{ $labels.instance }}) + description: "Container CPU utilization is above 80%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + - alert: ContainerHighMemoryUsage + expr: (sum(container_memory_working_set_bytes{name!=""}) BY (instance, name) / sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100) > 80 + for: 2m + labels: + severity: warning + annotations: + summary: Container High Memory usage (instance {{ $labels.instance }}) + description: "Container Memory usage is above 80%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" \ No newline at end of file