What is a Grafana dashboard JSON model, and why do `uid` and datasource references matter?
AdvancedConceptGrafana
Answer
Every dashboard is a JSON document with uid, title, panels[], templating.list[] (variables), time, schemaVersion and version. The uid is the stable identity used in URLs and API calls; if two files share a uid, one overwrites the other.
Panels reference datasources as {"type": "prometheus", "uid": "prom-main"}. Hard-coded uids break when the dashboard is imported elsewhere, so exported dashboards use a ${DS_PROMETHEUS} input or a datasource variable. Grafana 12 introduces a v2 dashboard schema with a different layout model.
More on Grafana
What is Grafana and what is it not?BeginnerWhat is a Grafana datasource and how do you provision one?BeginnerWhat are dashboard variables and what types exist?IntermediateHow do multi-value and "All" variables work in PromQL queries?IntermediateWhat are Grafana's built-in time variables?IntermediateWhat does "dashboards as code" mean and what are the options?Intermediate