Installation Prometheus-postgres-exporter #53
2 changed files with 51 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
||||||
mode: u=r,g=r,o=
|
mode: u=r,g=r,o=
|
||||||
loop:
|
loop:
|
||||||
- server.rules.yml
|
- server.rules.yml
|
||||||
|
- docker.rules.yml
|
||||||
- django.rules.yml
|
- django.rules.yml
|
||||||
- ups.rules.yml
|
- ups.rules.yml
|
||||||
- postgres.rules.yml
|
- postgres.rules.yml
|
||||||
|
|
50
roles/prometheus/templates/docker.rules.yml.j2
Normal file
50
roles/prometheus/templates/docker.rules.yml.j2
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
---
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
|
{% macro raw(string) -%}
|
||||||
|
{{ "{{" }} {{ string }} {{ "}}" }}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
groups:
|
||||||
|
|
||||||
|
- name: docker.rules
|
||||||
|
rules:
|
||||||
|
|
||||||
|
- alert: ContainerDown
|
||||||
|
expr: docker_container_running_state
|
||||||
|
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"'') }})
|
||||||
|
|
||||||
|
...
|
Loading…
Reference in a new issue