Grafana dashboards as code
Grafana dashboards versioned in git and synced over the API: dry-run diff, idempotent apply, round-trip pull of existing dashboards.
The problem
Dashboards edited by hand in the UI drift: no review, no history, no way to tell who changed a panel.
What it does
A small command-line tool that treats a folder of JSON files in git as the source
of truth, modelled on terraform plan and apply:
diffshows what would change without touching anything, and in CI it can fail a pipeline when dashboards drift from the repo;applybrings the server to the state of the files, and a second run changes nothing;pullbrings existing dashboards back into git.
It comes from a tool I use to keep the monitoring dashboards of a device fleet under version control.