Der OpenAdvice Blog

Montag, 17. Januar 2022

Extended Grafana dashboard version control

If you used Grafana before, you might have noticed that it has its own version control built in. This is great if you ever messed up a dashboard. However, this version control is local to a Grafana instance, meaning, you cannot simply use the stored dashboards’ data to – for instance – migrate to another system or support a staging process. Unless you manually copy/paste the dashboard JSON to your additional instance. As this is tedious and nothing we wanne do in 2022, we at OpenAdvice got your back and came up with a solution, that stores dashboard JSON data in GitLab and is even capable of deploying dashboards to any Grafana instance you configure. All you need to do is clicking a button. Sounds too good to be true? Well, here is how it goes: Using our lightweight grafana2gitlab docker container, we collect all dashboards via Grafana’s API and store them within GitLab. We also subscribe to GrafanaLive (this feature got introduced with Grafana version 8) and listen for any changes on dashboards. Doing so, we never miss any updates and got full version control of the dashboards. On top of this, we developed a plugin for Grafana, our so-called DashboardManager, which visualizes the dashboards stored in Gitlab and gives you the ability to deploy a dashboard to one or more Grafana instances you configured via the plugin’s setting:

 

Using this plugin, you can see which version of a dashboard is currently deployed in an instance, what the latest version is, and the actions columns is where the magic happens: Click one of the buttons and the dashboard will be deployed to the Grafana instance you selected. So, if you have a staged environment, this is the tool to use to fully support this process. Interested? Reach out to us and learn more about our take on version control in Grafana!