jupyterhub / grafana-dashboards

Grafana Dashboards useful for k8s + JupyterHub
https://jupyterhub-grafana.readthedocs.io
BSD 3-Clause "New" or "Revised" License
55 stars 23 forks source link

Add test to render and lint dashboards #106

Closed consideRatio closed 7 months ago

consideRatio commented 7 months ago

This projects use jsonnet to render grafana dashboard definitions (json). Our pre-commit hooks ensures we have formatted and valid jsonnet files, but until now we haven't done checks on the rendered grafana dashboards.

The only input variable for rendering dashboard definitions is a list of datasource names for the global dashboard. This makes the rendered dashboards very very similar between admins rendering them for their respective deployments, and therefore linting one is to lint them all pretty much.

I've not used grafana/dashboard-linter myself before, and I just searched for a linter as a way to have some kind of test on the validity of the rendered dashboards. I don't know if and what rules make sense etc, but figured this could help us maintain this project.

https://github.com/grafana/dashboard-linter/blob/main/docs/index.md#rules

Future improvement ideas

consideRatio commented 7 months ago

Since this isn't changing anything that could impact the dashboards, I'll go for a merge to retain momentum and use this to inspect things in #90.