Fix datasource selection

It appears that Grafana unconditionally replaces `${DS_PROMETHEUS}` in the JSON
with the UID of the datasource selected in the dashboard import dialogue.

I couldn’t find any way how to escape that (the usual suspects like `\$`, `\\$`
and `$$` all don’t work).

However, one can simply use another name and Grafana will keep the variable as
is and thus selectable via the templating.

This commit replaces any occurrence of `${DS_PROMETHEUS}` with
`${datasource}` and further changes the templating to also use the variable name
and the label to use capitalisation like the others already do.

Closes: https://github.com/rfmoz/grafana-dashboards/issues/51
Closes: https://github.com/rfmoz/grafana-dashboards/issues/139
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
This commit is contained in:
Christoph Anton Mitterer 2023-11-28 03:20:01 +01:00
parent 6349e87b27
commit de0ae6bf5c

File diff suppressed because it is too large Load diff