Skip to content

feat(grafana): apply the design colors to the dashboards #4762

Done

Description

@dan-petty

Update 2026-11-26 (infra move): most dashboards of this list are now in dan-petty/homelab.

  • default_theme and the cluster dashboards (llm-stack, ingress-tunnel, service dashboards and others) are a follow-up issue there.
  • This issue keeps the builder defaults, the linter color rule, the contrast test and the dashboards in k8s/devops/dashboards/.

Follow-up: dan-petty/homelab#279.


Problem or Motivation

The Grafana dashboards do not follow the design spec of #4735:

  • The own dashboards hold 21 hex or rgb literals (llm-stack 9, ingress-tunnel 7, sre-service 5). A hex value does not follow the Grafana theme.
  • The dashboards have 196 palette-classic color modes and 70 default red thresholds at 80.
  • Grafana green and red are 5.0 (light) and 6.8 (dark) apart in CIEDE2000 under simulated deuteranopia, so a reader with deuteranopia cannot tell "ok" from "error".
  • The builder defaults to palette-classic and the unit short (grafana/schema.py:82-84, builders.py:60 and 89).
  • Grafana 13.2.4 runs with default_theme = dark only.
  • 195 panel titles are in Title Case, 25 in sentence case and 43 mixed.

Proposed Solution & Architectural Design

  • (dan-petty/homelab follow-up) Set [users] default_theme = system in k8s/monitoring/grafana-values.yaml (owner decision 5 of feat(design): track the project design spec #4735).
  • Change the builder defaults: one series uses the Grafana color text; series 1 and 2 use the hex values of src/devops_cli/design/tokens-base.json (#a463f2, #e7298a, which pass 3:1 on all four Grafana backgrounds); a third entity uses text as baseline or "Other"; more series use the shades mode of text or a table. Status uses the Grafana color names of roles.ini [grafana] (ok text, warn semi-dark-orange, error red), which resolve for each theme (owner decision 6). fillOpacity 0. Series 2 uses the line style dash [10,10]. Reference lines are named constant queries (for example vector(14.4)) with a role color name and the line style dots. Heatmaps use continuous-cividis. Legends are a list for 3 series or fewer, else a table with last, mean and max.
  • Add a color rule to grafana/linter.py: a hex value must be a series value of tokens-base.json, and a color name must be in roles.ini [grafana].
  • Use sentence-case panel titles, and give every panel a description.
  • Migrate the 10 own dashboards after the panel children of fix(monitoring): track readable project dashboards #4675 merge. fix(monitoring): track readable project dashboards #4675 keeps the default Grafana colors until then (its owner decision 5).
  • Keep the 5 gnetId-derived copies (k8s-views-*, nvidia-dcgm) and Node Exporter Full as published (owner decision 7).

Target Subsystem

Monitoring (src/devops_cli/grafana/, k8s/monitoring/).

Existing Tool Considered

Grafana's built-in color names, which resolve for each theme, the shades mode, continuous-cividis and the built-in colorblind themes (deut_prot, tritanopia) for readers who need them. The existing dashboard linter takes the new rule. No new dependency. Custom code: two linter rules of about 60 lines. Cost: about 60,000 tokens and 3 hours for the rules, plus the dashboard migration.

Acceptance Criteria

  • The linter reports 0 hex values outside the allowlist and 0 color names outside roles.ini [grafana] in the 10 own dashboards.
  • A test asserts that every allowed hex value is 3:1 or more on #ffffff, #f4f5f5, #181b1f and #111217.
  • grafana-values.yaml sets default_theme = system.

Dependencies

Source: #4735

Alternatives check of 2026-11-24: partly.
Tool: grafana/dashboard-linter (https://github.com/grafana/dashboard-linter), Apache-2.0, last activity 2026-11-20, maintained.
Reason: Searches found grafana/dashboard-linter, an active Apache-2.0 CLI that lints Grafana dashboards for best practices, including panel title, description and unit checks, but it has no color rule, so it covers only part of the issue.

Covers:

  • Panel title and description best-practice checks
  • Panel unit checks on Prometheus dashboards
  • CLI, Docker image and GitHub Action over dashboard JSON

Lacks:

  • Hex or rgb literal allowlist from tokens-base.json
  • Color names checked against roles.ini [grafana]
  • palette-classic and field color-mode detection
  • Colorblind contrast, sentence-case rule, builder defaults and dashboard migration

Proposed design

Problem statement

The five product Grafana dashboards under k8s/devops/dashboards/ still use palette-classic, nonzero fills and colors outside the design tokens, and the typed dashboard schema still defaults to palette-classic and the short unit. The Grafana linter has no color or unit rule, so a new dashboard can reintroduce the same colors. This issue fixes the schema defaults, adds the color and unit rules and the contrast test, and migrates the five dashboards. The service dashboard template already follows the design; the default theme and the cluster dashboards are the homelab follow-up.

Acceptance criteria

Requirement: The dashboard schema defaults to text

The dashboard schema SHALL default a field color to the fixed Grafana color text and SHALL NOT default the color mode to palette-classic.

Scenario: A default field config uses text

  • WHEN the test builds FieldDefaults() from src/devops_cli/grafana/schema.py
  • THEN its color is {'mode': 'fixed', 'fixedColor': 'text'}, and no field config has the mode palette-classic.

Requirement: A panel with no unit is reported

The dashboard schema SHALL keep an absent unit as None and SHALL NOT fall back to short, and the Grafana linter SHALL report a timeseries or stat panel with no unit.

Scenario: A panel with no unit is reported

  • WHEN the test lints a dashboard whose timeseries panel has no unit
  • THEN the report holds a finding that names the panel and the missing unit.

Requirement: The linter reports a foreign color

The Grafana linter SHALL report a hex or rgb color outside the two series values of tokens-base.json, a color name outside text, semi-dark-orange and red, and a field color mode outside fixed, thresholds, shades and continuous-cividis.

Scenario: A dashboard holds a foreign hex, an unknown name and palette-classic

  • WHEN the test lints a dashboard with #ff0000, super-light-green and the mode palette-classic
  • THEN it reports three findings, each naming the value and the panel.

Requirement: Allowed hex values pass 3:1 on the four backgrounds

A test MUST assert that each hex value that the linter allows has a contrast of 3:1 or more on #ffffff, #f4f5f5, #181b1f and #111217.

Scenario: Each allowed hex passes on each background

  • WHEN the contrast test reads the linter's allowed hex values and computes each ratio with coloraide
  • THEN each value has a ratio of 3.0 or more on each of the four backgrounds.

Requirement: The five product dashboards follow the design colors

Each of the five dashboard JSON files under k8s/devops/dashboards/ MUST hold no color outside the allowlist, no color mode outside the four, no fillOpacity other than 0, and one unit on each timeseries and stat panel.

Scenario: The k8s row lints the five product dashboards

  • WHEN uv run devops ci --check --only k8s runs on the branch
  • THEN the row reports no color, color-mode, fill or unit finding for the five dashboards.

Existing Tool Considered

grafana/dashboard-linter (Apache-2.0, maintained) is the open tool that the alternatives check names; its block states what it lacks. The project keeps one linter, src/devops_cli/grafana/linter.py, because it already runs on the product dashboards in the k8s gate, and the color rule reads src/devops_cli/design/tokens-base.json and holds the Grafana names that docs/DESIGN.md records. Written cost: about 60,000 tokens and 3 hours to build, keep and fix the color and unit rules, plus the migration of the five dashboards. No package dependency is added.

Key questions

  • Which dashboards does this issue migrate?: The five JSON files listed in k8s/devops/dashboards/kustomization.yaml: ai-spend.json, devops-ai-rag.json, devops-cli.json, project-metrics.json and roadmap-service-telemetry.json. The ten cluster dashboards and the five gnetId copies are not in this repository at this commit; the cluster dashboards are the homelab follow-up. [sources: k8s/devops/dashboards/kustomization.yaml:30, k8s/devops/dashboards/kustomization.yaml:31, k8s/devops/dashboards/kustomization.yaml:32, k8s/devops/dashboards/kustomization.yaml:33, k8s/devops/dashboards/kustomization.yaml:34, tests/gate/k8s_checks/dashboards.py:16]
  • Which file holds the builder defaults that still emit palette-classic and short?: src/devops_cli/grafana/schema.py: FieldDefaults.color defaults to {'mode': 'palette-classic'} at line 86 and unit defaults to short at line 88. src/devops_cli/grafana/builders.py does not exist at this commit; the service dashboard builder is src/devops_cli/grafana/service_dashboard.py. [sources: src/devops_cli/grafana/schema.py:86, src/devops_cli/grafana/schema.py:88, src/devops_cli/grafana/service_dashboard.py:18]
  • Does the service dashboard builder already follow the design colors?: Yes. service_dashboard.py reads color-data-cat-1 and color-data-cat-2 for series 1 and 2, uses text for a single series and the third series, draws a reference line as vector(<value>) with the dots style, sets fillOpacity 0 and requires a unit on each chart and tile. Its tests assert the colors and the 3:1 contrast. [sources: src/devops_cli/grafana/service_dashboard.py:174, src/devops_cli/grafana/service_dashboard.py:183, src/devops_cli/grafana/service_dashboard.py:191, src/devops_cli/grafana/service_dashboard.py:326, src/devops_cli/grafana/service_dashboard.py:338, tests/grafana/test_service_dashboard.py:478]
  • Which color names does the linter allow, and does roles.ini exist?: The allowed names are text, semi-dark-orange and red, the names of the ### Grafana paragraph of docs/DESIGN.md and the constants of service_dashboard.py. No roles.ini exists in the repository at this commit, so the linter holds the names as a constant and a test compares them with the design paragraph. (best practice) [sources: docs/DESIGN.md:163, src/devops_cli/grafana/service_dashboard.py:61, src/devops_cli/grafana/service_dashboard.py:64, tests/grafana/test_service_dashboard.py:513]
    • Chosen: Use the design names as a constant in the linter. The names are in docs/DESIGN.md and service_dashboard.py, and no roles.ini exists at this commit.
    • Rejected: Read roles.ini [grafana]. No roles.ini is in the repository at this commit, so feat(output): add one Rich theme of status roles and marks #4748 is not a dependency.
  • Which color rule does the linter apply?: A hex or rgb value must be one of the two series values of tokens-base.json (#a463f2 and #e7298a). A color name must be text, semi-dark-orange or red. A field color mode must be fixed, thresholds, shades or continuous-cividis. The linter also reports a timeseries or stat panel with no unit. (best practice) [sources: docs/DESIGN.md:258, src/devops_cli/grafana/linter.py:132, tests/gate/k8s_checks/dashboards.py:30, tests/grafana/test_service_dashboard.py:184]
    • Chosen: Add the rule to the project linter. The linter already runs on the product dashboards in the k8s gate, and the rule reads the token file.
    • Rejected: Adopt grafana/dashboard-linter for the color rule. The alternatives check records that it has no color rule.
    • Rejected: Check colors only in a test. A test does not stop a new foreign color in a later dashboard.
  • Which theme does Grafana use after the change?: The design records default_theme = system, but this repository holds no Grafana values file: k8s/devops/kustomization.yaml lists no monitoring values, and the product dashboards are applied from the environment tree (dan-petty/homelab). The theme and the cluster dashboards are the follow-up in dan-petty/homelab#279, so this issue changes no values file. [sources: docs/DESIGN.md:258, k8s/devops/kustomization.yaml:3, k8s/devops/dashboards/kustomization.yaml:4]
  • Which unit does a panel with no unit keep?: None, so the linter reports it; no short fallback. A row or text panel has no unit and still loads. (best practice) [sources: src/devops_cli/grafana/schema.py:88, docs/DESIGN.md:258]
    • Chosen: Keep an absent unit as None and report it. The linter can report a timeseries or stat panel with no unit, and a row panel still loads.
    • Rejected: Keep short as the default. The issue names the silent short fallback as a problem.
    • Rejected: Make unit a required field. A row or text panel has no unit and would fail to load.
  • Which title style and description do the panels use?: Sentence case, and every panel has a non-empty description. This part is deferred to a new issue so that the color rule and the color migration land in one pull request. (best practice) [sources: docs/DESIGN.md:191, docs/DESIGN.md:258]
    • Chosen: Sentence case with a description. docs/DESIGN.md asks for sentence case and a description.
    • Rejected: Keep Title Case. The design uses sentence case.
  • Which dashboards are exempt from the color rule?: None in this repository. The five gnetId copies and Node Exporter Full are not in k8s/devops/dashboards/; the upstream copies stay as published in the environment tree. The linter runs on the five product dashboards. [sources: k8s/devops/dashboards/kustomization.yaml:30, docs/DESIGN.md:258]
  • Which dependencies does this issue still have?: None. The token JSON of feat(design): add the design tokens and their build #4738 is in src/devops_cli/design/tokens-base.json; the panel children of fix(monitoring): track readable project dashboards #4675 are present as the five dashboards and their query fixtures; the color names of feat(output): add one Rich theme of status roles and marks #4748 are in docs/DESIGN.md and service_dashboard.py, so no roles.ini is needed. [sources: src/devops_cli/design/tokens-base.json:50, k8s/devops/dashboards/kustomization.yaml:30, tests/fixtures/dashboard_queries/devops-cli.yaml:5, docs/DESIGN.md:163]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7358

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: none. The title has the scope grafana, and .github/labels.yml declares no scope/grafana label. Add the label to the file to give the scope to this item.
    • Priority: P2-Medium. It fixes an accessibility gap for colorblind readers but does not break existing functionality.
    • Value: Medium. It makes dashboards readable for deuteranopia users and enforces a consistent design system.
    • Effort: Medium. It needs two linter rules of about 60 lines plus migration of 10 dashboards.
    • Related: test(monitoring): lint dashboards for range, window and legend errors #4743, which asks for a different change. Both add rules to grafana/linter.py, but #4743 lints range, window and legend errors while this candidate lints color values and names.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: Searches found grafana/dashboard-linter, a maintained Apache-2.0 CLI linter for Grafana dashboards, and Grafana's newer gcx linter (custom Rego rules). dashboard-linter covers only the panel title/description and unit parts of the issue's asks; it has no rule for color values, design tokens, palette modes or colorblind contrast, which is the core of this issue, so it covers the need only in part.

    Tool: grafana/dashboard-linter (https://github.com/grafana/dashboard-linter)

    • License: Apache-2.0
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • checks that every panel has a title and a description (panel-title-description rule)
    • checks that panels define valid units (panel-units rule)
    • rule-level exclusions/warnings through a .lint config, plus a --fix and --strict mode

    Lacks:

    • no check of hex/rgb color literals, color names or palette-classic color modes
    • no design-token allowlist (e.g. tokens-base.json) or roles.ini [grafana] color-name rule
    • no colorblind contrast / CIEDE2000 or theme-resolution check
    • no sentence-case panel-title rule
    • does not touch the builder defaults, default_theme, or the migration of the 10 own dashboards
    • Grafana's gcx linter could hold custom Rego color rules, but it is a new dependency and still needs the rules written

    Tools considered:

    Searches run:

    • grafana dashboard linter tool rule panel title unit, results: 5
    • grafana dashboard linter check panel colors hex literals, results: 5
    • grafana dashboard-linter github rules yaml, results: 5
    • colorblind friendly grafana dashboard palette tool open source, results: 5
    • grafana gcx lint-resources dashboard rules color, results: 5
    • linter enforce design tokens color palette grafana dashboards open source, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at e5dfddb while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  7. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  8. added
    status/ready
    and removed
    status/new
    on Nov 26, 2026
  9. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  10. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  11. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  12. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 20:38 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions