prometheus alert manager - ghdrako/doc_snipets GitHub Wiki

Prometheus evaluates alerting rules in a constant loop and sends them to one or more Alertmanager instances once they meet a specified for duration in the alert. From there, Alertmanager determines where the alert information should be sent.

Routing

Routing is the core of what the Alertmanager does; it processes an alert by walking a tree structure of routes to determine what receiver(s) an alert should be sent to. The only requirements for a valid Alertmanager configuration file are a route and a receiver; everything else is optional. A route—in its simplest form—is a set of one or more matchers and a receiver. Below is an example of a simple, valid route:

- receiver: "default"
matchers:
- "environment = production"

Matchers

Matchers are a list of strings that correspond roughly to how PromQL matchers work. Each entry in the list contains a matcher for a label attached to an alert and its value. The primary difference vs. PromQL is that you do not need to quote a label’s value. However, it’s still valid if you do. This route would do the same thing as the one above:

- receiver: "default"
matchers:
- environment = "production"