Raw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?
AdvancedProductionObservability as Code, Security & Vendor Choices
Answer
- Raw JSON (exported from the UI): easiest start, but diffs are huge and copy-paste spreads across hundreds of files.
- Jsonnet + Grafonnet: functions and libraries generate consistent panels; it is the language of the monitoring mixins. Steep learning curve and a niche language.
- Grafana Foundation SDK: typed builders in Go, TypeScript, Python, Java and PHP generated from Grafana's schemas. Teams use a language they already know with IDE completion.
Our rule: raw JSON for one-off dashboards owned by a team, generated code for anything standardised (the service RED dashboard every team gets). Generated output is still committed or rendered in CI so reviewers can see the result.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateWhat are monitoring mixins and how do you consume them?AdvancedHow do Grafana dashboards get loaded automatically in `kube-prometheus-stack`?Beginner