Setup grafana dashboards#

Now, we will deploy some specific dashboards to the grafana instance we deployed as part of Configure and deploy the support chart.

See also

It is also possible to enable logging in with GitHub to allow Community Representatives and Hub Administrators to access these dashboards as well.

Warning

We should enable GitHub login for all Grafana dashboards running on dedicated clusters, so the Community Representatives have access to them.

Login to the cluster-specific grafana#

Eventually, visiting GRAFANA_URL (which we set in Configure and deploy the support chart) will present you with a login page. Here are the credentials for logging in:

  • username: admin

  • password: located in helm-charts/support/enc-support.secret.values.yaml (sops encrypted).

Create an API key to auto-deploy the dashboards#

Once you have logged into grafana as the admin user, create a new API key. You can do this by selecting the gear icon from the left-hand menu, and then selecting API keys. The key you create needs admin permissions.

Keep this key safe as you won’t be able to retrieve it!

Create the file config/clusters/<cluster>/grafana-token.secret.yaml with the following content.

grafana_token: PASTE_YOUR_API_KEY_HERE

Then encrypt this file using sops like so:

sops --output config/clusters/<cluster>/enc-grafana-token.secret.yaml --encrypt config/clusters/<cluster>/grafana-token.secret.yaml

The encrypted file can now be committed to the repository.

Note

This key will be used by the deploy-grafana-dashboards workflow to deploy some default grafana dashboards for JupyterHub using jupyterhub/grafana-dashboards.

Deploying the Grafana Dashboards locally#

You can deploy the dashboards locally using the deployer:

deployer deploy-grafana-dashboards <CLUSTER_NAME>

Deploying the Grafana Dashboards from CI/CD#

Once you’ve pushed the encrypted grafana_token to the GitHub repository, it will be possible to manually trigger the deploy-grafana-dashboards workflow using the “Run workflow” button to deploy the dashboards.

You will first need to add the name of the cluster as a matrix entry in the deploy-grafana-dashboards.yaml workflow file and commit the change to the repo.

Note

The workflow only runs when manually triggered.

Any re-triggering of the workflow after the initial deployment will overwrite any dashboard created from the Grafana UI and not stored in the jupyterhub/grafana-dashboards repository.