I have multiple dashboards sharing the same library panel, say "CPU Load". Each dashboard has a different Prometheus Data Source and customer ID. Both datasource
and customerID
are variables in the dashboard settings, hence the library panel is configured like this (simplified):
Data Source: ${datasource}
Query: cpu_load{customer="$customerID"}
I want to create a single alert rule to trigger an alert whenever CPU load is above a certain threshold in any of the dashboards where the library panel "CPU Load" is present, instead of creating one Alert Rule for each instance of the panel with hardcoded datasource
and customerID
.
Is this even possible? I'm using Grafana 9.4.7.
Thanks
No, this is not possible.
Grafana doesn't support variables in alerting rules.
Not to mention data source variables, to create alerts over multiple sources.
You'll need to define a per-data-source alert.