Collection of Grafana dashboards written in jsonnet using grafonnet and deployed with jsonnet-bundler and grizzly.
When developing dashboards, it is often helpfull to explore changes in the Grafana GUI itself, and then find and update the corresponding fields in grafonnet code.
The supported field and methods are documented through docstrings in the GitHub repo grafana/grafonnet-lib/grafonnet repo, e.g graph_panel.libsonnet.
You may create a PR into main
to trigger a preview of the changes, linked in a
PR comment.
Although sufficient for small changes, the feedback loop between change and
result is quite slow. For frequent changes and continous visual updates, local
development is advised.
jsonnet -J vendor main.jsonnet
Define basic auth credentials for prometheus datasource in staging cluster:
export PROMETHEUS_URL=https://thanos.dev.fellesdatakatalog.digdir.no
export BASIC_AUTH_USER=<ask someone>
export BASIC_AUTH_PASSWORD=<ask someone>
Run Grafana with docker, wait for it to init, create an access token, configure datasource from dev cluster:
docker run --rm -d -p 3000:3000 --name grafana grafana/grafana
Copy example environment variables:
cp .env.example .env
Configure environment variables:
PROMETHEUS_URL=https://thanos.dev.fellesdatakatalog.digdir.no
BASIC_AUTH_USER=admin
BASIC_AUTH_PASSWORD=admin
GRAFANA_HOST=localhost:3000
GRAFANA_SCHEME=http
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=admin
Apply the dashboards and update on any saved changes:
sh apply.sh
Any local code changes will now instantly be pushed to Grafana.
Open http://localhost:3000 and login with admin
admin
.
Run docker rm -f grafana
to stop Grafana.