Skip to Main Content
Hands-On Infrastructure Monitoring with Prometheus
book

Hands-On Infrastructure Monitoring with Prometheus

by Joel Bastos, Pedro Araújo
May 2019
Intermediate to advanced content levelIntermediate to advanced
442 pages
11h 36m
English
Packt Publishing
Content preview from Hands-On Infrastructure Monitoring with Prometheus

Rule file configuration

Previously, we took a look at the Prometheus configuration file; we'll now move onto the provided alerting rules example, which we can see in the following snippet:

vagrant@prometheus:~$ cat /etc/prometheus/alerting_rules.yml groups:- name: alerting_rules rules: - alert: NodeExporterDown expr: up{job="node"} != 1 for: 1m labels: severity: "critical" annotations: description: "Node exporter {{ $labels.instance }} is down." link: "https://example.com"

Let's look at the NodeExporterDown alert definition more closely. We can split the configuration into five distinct sections: alert, expr, for, labels, and annotations. We'll now go over each one of these in the next table:

Section

Description

Mandatory

alert ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

How Fastly used Prometheus to improve infrastructure and application monitoring

How Fastly used Prometheus to improve infrastructure and application monitoring

Marcus Barczak

Publisher Resources

ISBN: 9781789612349Supplemental Content