Skip to content

Grafana: Specify datasources by name instead of UID

Florian Sesser requested to merge 125.dont-set-static-datasource-uids into develop

This is a workaround to a current problem with Grafana. Until a proper fix upstream in Nix (or Grafana) lands, I edited our dashboards to be addressing the data sources with their common (and writeable) name instead of the "U"ID Grafana from version 8.3 or so on would like to do.


Nix does not yet let us set provisioned datasource UIDs, yet Grafana now exports (and expects) them and, while it can "autogenerate" them if you do not set them, that autogeneration is not consistent over our different environments.

Here's the Grafana PR that introduced this Schema change, with a lot of funny discussion wether this is breaking or not: https://github.com/grafana/grafana/pull/33817

Here's a related issue: https://github.com/grafana/grafana/discussions/45230 (This MR does what this issue calls the "editing dashboard JSONs to use legacy by-name method").

Edited by Florian Sesser

Merge request reports