From the course: Prometheus Essential Training

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Alerting rules

Alerting rules

- [Instructor] The concept of alerting rules is similar to recording rules. They allow you to define alert conditions based on permitted expressions and to send those notifications to an external service. The criteria for an alert to fire for the expression is to return one or more vector elements and to be active for the specified alerting duration. An alert can be active but not fired until the specified duration is reached. You can define an alert using a rules file. This is what the syntax for an alerting rule looks like. The for clause is what causes Prometheus to wait for the alert duration after an alert becomes active before firing. In the example, Prometheus waits for the alert to be active for 10 minutes before firing. At this time, the alert is independent state. The labels clause defines what label should be added to the alert, and the annotations clause is for labels that are used to store additional information, which might be longer, such as wrong book URLs. There are…

Contents