Parametrised datasource not working in case of alerts

In case I have parametrised datasource and any alert for certain dashboard - I am unable to save any changes, getting:

Alert validation error: Data source used by alert rule not found, alertName=<NAME>, datasource=$datasource

Grafana v6.5.2

All graphs works correctly with this variable, tested twice.
Appreciate any help / advice.

1 Like

I have same issue. Have you resolved it?
Grafana v7.1.5

I found this documentation.

The query used in an alert rule cannot contain any template variables.

So I’ll create a duplicated panel with static Datasource only for alert…

1 Like

I would’ve really expected that you would just have to provide the values for the alerting; instead of having to create (and maintain!) a copy of your dashboard for alerting purposes.

Ideally, an “any of these” option, with a parameterised message to know which one failed would be even better (alerting would then automatically be added for extra environments/combinations provided)

But… just being able to use parameterised panels would already help A LOT imho…