Grafana - Creating multi-dimensional alerts

Hello,
I saw on the documentation the concept of multi-dimensional alerting. But I haven’t seen any examples.
Can we create an alert (simple example): select count(*) from table where country=($country). And where the value of $country can be different values. Is that possible on Grafana ?

Multidimensional alerts would be more like:

select count(*) from table group by country;

and then the alert rule (with that expression) would create different alerts for each country. For example, if you have countries like US and ES, you would have one alert rule with such an expression, but it would create two alerts: one for US and one for ES, with different thresholds. Basically every alert created with new expressions (Reduce, Threshold, Math) that creates more than one alert instance is considered multidimensional alert (at least that’s how I understand it :smile: )

so you just group by sth, and then Grafana automatically creates new alerts ?

It sounds like that. You create a single alert rule, e.g. your query (first screen) that returns the memory usage of all the pods. Then, when using expressions (this time I’m using only threshold, since my query already returns only numeric data for each serie), you can see that each serie is treated as different entity (second screen). I can even use “pod” label in my summary for messaging purposes (third screen). Then, when I’m reviewing the rule, I see as many alerts as there are series returned by query (fourth screen). Mulitidimensional alerts means many alert instances treated as singular alerts created from a single alert rule.