Skip to content

fix(grafana): satisfy dashboard-linter --strict#317

Merged
obchain merged 3 commits intomainfrom
fix/315-grafana-lint-strict
Apr 25, 2026
Merged

fix(grafana): satisfy dashboard-linter --strict#317
obchain merged 3 commits intomainfrom
fix/315-grafana-lint-strict

Conversation

@obchain
Copy link
Copy Markdown
Owner

@obchain obchain commented Apr 25, 2026

Summary

Fixes every violation raised by dashboard-linter lint --strict deploy/grafana/charon.json on main.

  • New top-level job template variable (label_values(charon_build_info, job), default charon, includeAll=true, multi=false, allValue=.+).
  • Appended ,job=~"$job" to every PromQL selector across all 9 panels (11 targets).
  • Replaced hardcoded rate(...[1m]) / rate(...[5m]) (and the histogram_quantile rate-buckets) with $__rate_interval. Non-rate ranges (increase(...[$__range])) untouched.
  • instance.allValue: .* -> .+ (linter prefers non-empty match).
  • Top-level editable: true -> false (dashboard is provisioned).
  • Build info panel: added unit: "none" (value is constant 1).

Closes #315

Test plan

  • python3 -m json.tool deploy/grafana/charon.json parses cleanly
  • grep audit: every expr selector contains job=~"$job"; no [1m]/[5m] remaining inside rate(...)
  • CI dashboard-linter job (added in PR feat(deploy): local Prometheus + Grafana stack for laptop demos #313 stack) passes on this branch
  • Spot-check rendered dashboard locally with the deploy/observability stack

obchain added 3 commits April 25, 2026 23:29
- Add top-level `job` template variable (label_values(charon_build_info, job))
- Append `,job=~"$job"` selector to every PromQL target across all panels
- Replace hardcoded `[1m]`/`[5m]` rate ranges with `$__rate_interval`
  (rate/irate only; non-rate `[$__range]` and `histogram_quantile` unaffected)
- Set `instance` `allValue` from `.*` to `.+` (linter prefers non-empty match)
- Flip top-level `editable: true` -> `false` (lock dashboard via provisioning)
- Add `unit: "none"` to Build info panel (value is always 1)
dashboard-linter --strict rejects single-select job templates. Multi
plus includeAll + allValue=".+" still resolves to a valid regex
selector for `job=~"$job"`.
The prom/prometheus image entrypoint is `prometheus`, so passing
`promtool` as the first arg makes prometheus parse it as an argument
("unexpected promtool"). Override the entrypoint so promtool runs
directly.

Pre-existing failure on main; surfaces here because the dashboard-linter
step now passes and exposes the next broken step in the workflow.
@obchain obchain merged commit 19ed142 into main Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: grafana-lint --strict fails on main (charon.json) — multiple pre-existing violations

1 participant