Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Manage Grafana Dashboards

This how-to guide covers how to manage Grafana dashboards across 2i2c clusters, including how to add new dashboards and managing deployments via CI/CD.

Existing dashboards

We currently deploy the following dashboards with CI/CD:

This is handled by the deployer command deployer deploy-dashboards, which clones these GitHub repositories and uses the ./deploy.py script to communicate with the Grafana REST API to deploy the dashboards.

This workflow file defines the GitHub Action to run the CI/CD job once per day.

Adding custom dashboards

Prerequisites

  1. Install go-jsonnet (the Grafonnet library is vendored with the jsonnet-builder).

Dashboards as code

You can manually prototype and create Grafana dashboards with the UI.

Once you are happy with the dashboard design, you can export the dashboard as JSON.

Grafonnet

We can use the JSON as a template to encapsulate the dashboard as Grafonnet for reproducibility.

In the top-level dashboards folder, you can find

The Grafonnet documentation is a good resource for learning how to encapsulate your dashboard design as Grafonnet/Jsonnet code.

You can check your work is valid Jsonnet as you develop by running

jsonnet -J dashboards/vendor dashboards/<dashboard-name>.jsonnet

Manually deploy dashboards

To manually deploy your dashboard to a Grafana instance, run the command

deployer deploy-dashboards --dashboard-type custom $CLUSTER_NAME