January 2020
Intermediate to advanced
640 pages
16h 56m
English
In order to use Prometheus as an alert-generating source, operators must define a collection of alert rules that Prometheus should monitor. The alert rule definitions live in external YAML files that are imported by the main Prometheus configuration file using a rule_files block, as follows:
# prometheus.yml global: scrape_interval: 15s rule_files: - 'alerts/*.yml'
Prometheus organizes multiple alert rules into groups. Rules within a group are always evaluated sequentially while each group is evaluated in parallel.
Let's take a look at the structure of a simple alert definition. The following snippet defines an alert group with the name example that contains a single alert definition:
groups: ...