Why define dashboards as code?

Manually creating dashboards through the Grafana UI works fine for one or two dashboards. But as your team grows and your observability needs expand, manual dashboard management leads to real problems:

  • No version history. Someone changes a panel and breaks it. Who changed it? What did it look like before? No one knows.
  • Duplication drift. Teams copy dashboards across environments. Over time, copies diverge and no one is sure which version is correct.
  • No code review. Dashboard changes bypass the review process your team uses for everything else.
  • Fragile handoffs. Onboarding a new team member means sharing screenshots or walking through the UI live.

What dashboards as code solves

Defining dashboards as strongly typed code means:

  • Every change is tracked in Git with full commit history
  • Dashboard definitions go through the same pull request review as application code
  • Strong typing catches errors at compile time, before a broken dashboard reaches production
  • Dashboards become reproducible across environments (dev, staging, production)

The Grafana Foundation SDK provides builder classes in Go and TypeScript that produce valid Grafana dashboard JSON. You write code, run it, and get a JSON file ready for deployment.

In the next milestone, you set up a project with the Foundation SDK installed.


page 2 of 8