I have a query like:
sum by (city) (probe_success{job=~"dns.*"})
which returns the values of successful samples grouped by city. It`s OK, but I need to create vmalert rules with the next idea:
- If 1 city "down" -> alert severity low
- If 2 city "down" -> alert severity medium
- If 3 city "down" -> alert severity critical I know, what I can to set rule like this:
count((sum by (city) (probe_success{job=~"dns.*"}) == 0)) == 2
But this query doesn`t contains labels. A better solution would be if the query also returned a set of labels city1 city2. Can I preserve labels from aggregated promql vectors? I use VM by the way, I know it has extended query options