ansible/roles/prometheus/templates/docker.rules.yml.j2
pz2891 9d18ebb7f1
Some checks failed
continuous-integration/drone/push Build is failing
Fix docker rules
2021-04-11 17:18:32 +02:00

50 lines
1.2 KiB
Django/Jinja

---
{{ ansible_managed | comment }}
{% macro raw(string) -%}
{{ "{{" }} {{ string }} {{ "}}" }}
{%- endmacro %}
groups:
- name: docker.rules
rules:
- alert: ContainerDown
expr: docker_container_running_state != 1
for: 0m
labels:
severity: critical
annotations:
summary: >-
Container Docker mort
(instance {{ raw('$labels.instance') }}, container {{ raw('$labels.name') }})
- alert: ContainerFailed
expr: sum(increase(docker_container_restart_count[5m])) > 2
for: 0m
labels:
severity: critical
annotations:
summary: >-
Container Docker redémarre souvent
(instance {{ raw('$labels.instance') }}, container {{ raw('$labels.name') }})
- alert: ContainerFailed
expr:
(
docker_container_cpu_used_total
/
docker_container_cpu_capacity_total
) * 100
> 30
for: 0m
labels:
severity: critical
annotations:
summary: >-
Container Docker utilise beaucoup de CPU
(instance {{ raw('$labels.instance') }}, container {{ raw('$labels.name') }},
value {{ raw('$value | printf "%.1f"') }})
...