Separate alert threshold for each alert instance in multi-dimensional alerts


If an alert produces 3 alert instances in a single query and I want to set different alert thresholds for each of these 3 instances, is it possible to do so in grafana? I am using 9.5.3.

For example, if my query produces 3 alert instances for cpu0, cpu1 and cpu2. And I want alerts if cpu0 > 70%, cpu1 > 80% and cpu2 > 90%.

If this is not possible, then what are the best practices to handle such cases? I would appreciate it very much if someone can share their approach to such scenarios.

Right now, the only way I can think of is, create separate alert for each instance which is not that scalable.

EDIT: I searched the forum before posting and couldn’t find any answers. I found some questions but those were not answered properly.

1 Like

@luvpreet Did you find a solution? I think a workaround is to create different alert rules for each instance but it is expensive to maintain when you have hundreds of alerts rules.

Hi @tomasrojas26 and welcome to the Grafana forum.

See example #5 in this tutorial. I wrote this specifically for Flux, but I would think one could do the same using other languages.

1 Like

This seems won’t work for promql as promql is not as flexible as Flux.