fix(grafana): satisfy dashboard-linter --strict#317
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes every violation raised by
dashboard-linter lint --strict deploy/grafana/charon.jsononmain.jobtemplate variable (label_values(charon_build_info, job), defaultcharon, includeAll=true, multi=false, allValue=.+).,job=~"$job"to every PromQL selector across all 9 panels (11 targets).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).editable: true->false(dashboard is provisioned).unit: "none"(value is constant 1).Closes #315
Test plan
python3 -m json.tool deploy/grafana/charon.jsonparses cleanlyexprselector containsjob=~"$job"; no[1m]/[5m]remaining insiderate(...)