Reputation: 233
I run a prometheus instance for a few teams and I would like to be able to add alerts for servers that various teams manage.
An example might clarify it much better than I can explain:
Say Team-A wants to add a few servers to be monitored by Prometheus. Additionally, they would like to have alerts go off on certain conditions (low memory, downtime, etc).
Currently, with my setup, all servers within all job names are being monitored and alerted on with the same set of rules. What I would like is something like:
Docker-Servers be alerted on group of alerts-A
Nginx-Servers be alerted on group of alerts-B
I'm not sure what to do within the Prometheus.yml, and alert.rules.yml files in order to achieve this.
Any help is appreciated.
Upvotes: 1
Views: 2131
Reputation: 233
I ended up figuring it out.
In the alertmanager's alert.rules.yml file, you can specify a regular expression within the 'expr' line.
For example if I wanted to monitor for downtime on servers 'test1', 'test2', 'test3', you could do something like:
expr: up{job=~"test1|test2|test3"} == 0
Upvotes: 5