Deploy Prometheus monitoring system
An Ansible role that installs Prometheus Monitoring server.
None
Have a look at the defaults/main.yml for variables that can be overridden.
---
- hosts: all
gather_facts: yes
- hosts: all
become: yes
become_user: root
roles:
- role:
- SoInteractive.prometheus
vars:
prometheus_external_labels:
monitoring: a
prometheus_tgroup:
- port: 9100
labels:
env: {{ system_domain }}
job: node
targets_group: all
Put the rules files to rules folder
Alerting rules are defined in the following syntax:
ALERT <alert name>
IF <expression>
[ FOR <duration> ]
[ LABELS <label set> ]
[ ANNOTATIONS <label set> ]
Example Alertmanager rules files:
# Alert for any instance that is unreachable for >5 minutes.
ALERT InstanceDown
IF up == 0
FOR 5m
LABELS { severity = "page" }
ANNOTATIONS {
summary = "Instance {{ $labels.instance }} down",
description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.",
}