May 2019
Intermediate to advanced
442 pages
11h 36m
English
Unit tests for alerting rules are quite similar to the ones used for recording rules. We'll be using the example alert provided earlier in this chapter to perform a walkthrough on how to configure alerting tests and how to validate them. As mentioned before, the test environment for this chapter comes with a suite of tests for the rules presented here, including the alert rule we're interested in. Once again, you can have a look at the test file using the following command:
vagrant@prometheus:~$ cat /etc/prometheus/tests.yml
Focusing solely on the alerting component, we can see that we first define where the alerting rules are located:
rule_files: - /etc/prometheus/alerting_rules.yml
The default rule evaluation interval ...
Read now
Unlock full access