dashboard: generate the sample dashboard with grafonnet (#2570)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-09 09:30:54 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 54aeb2b391
commit bf2dfc05fe
12 changed files with 1972 additions and 15 deletions
+21
View File
@@ -44,6 +44,27 @@ The **Reboots** annotation marks each reboot of the selected host on all graphs.
Click a hostname in the Fleet tab to open that host in the Overview tab.
### Changing the dashboard
Don't edit the JSON file by hand. It is generated from Jsonnet with [grafonnet](https://github.com/grafana/grafonnet) as part of the [windows_exporter mixin](../contrib/mixin):
- [dashboards/windows-exporter.libsonnet](../contrib/mixin/dashboards/windows-exporter.libsonnet) defines the tabs, panels and queries.
- [lib/dashboard.libsonnet](../contrib/mixin/lib/dashboard.libsonnet) holds the panel and layout helpers.
The generator writes the v2 schema directly, so it needs neither Grafana nor Prometheus.
Install the pinned tools and regenerate the file in `contrib/mixin`:
```sh
cd contrib/mixin
make tools
export PATH="$(go env GOPATH)/bin:$PATH"
make dashboard
```
`make dashboard` runs `jb install` to fetch grafonnet into `contrib/mixin/vendor` and renders the dashboard.
`make lint` fails if the committed JSON file differs from the generated one.
Check new or changed queries in Grafana before you open a pull request, for example by importing the file into a local Grafana 13.
![Screenshot of the Fleet tab.](dashboard-fleet.png)
![Screenshot of the Overview tab.](dashboard-overview.png)