Repository navigation
Description
Update 2026-11-26 (infra move): The dashboard and the alerts stay in devops-cli, under k8s/devops/.
The dashboard goes in k8s/devops/dashboards/ and the alert group in k8s/devops/monitoring/prometheus-rules-values.yaml. tests/prometheus/test_k8s_monitoring_dashboards.py and its PROVISIONED list are gone. A new redis_exporter series needs the allow list in dan-petty/homelab (k8s/monitoring/k8s-monitoring-values.yaml).
Problem or Motivation
The owner asked on 2026-11-11 for brain metrics on a Grafana dashboard, with alerts and a place in the Service dashboard. Today no dashboard shows a Valkey series or a brain series, and no alert covers a late brain task, a high fallback share or an insight with no durable copy.
Proposed Solution & Architectural Design
k8s/devops/dashboards/project-brain.json(uiddevops-project-brain, title "Roadmap / Project Brain") in its ownconfigMapGeneratorentrygrafana-project-brain-dashboard, so each ConfigMap stays under 262,144 bytes.- Add it to
_PURE_DEVOPS_CLI_DASHBOARDS(tests/telemetry/test_telemetry_instruments.py). The allow list for theredis_exporterseries is in dan-petty/homelab (see the update above). - Variables:
datasource,loki_datasource,repo,task,instance. - Rows: Health (late tasks, fallback share, sync lag, undurable entries, brain spend 7 days); Contents (entries by kind and state, insights by state, proposals 30 days); Reads and GitHub (reads by store and result, embedding lookups by tier, requests saved, 304 share, first reads); Valkey (memory, keys and client errors for
valkey-devopsandvalkey-roadmap; evictions forvalkey-devopsonly, becausevalkey-roadmaphas the policynoeviction); Maintenance (runs by task and result, entries changed, keys removed, Jev decisions by point); Per item (references by provider and result); Audit (a Loki panel{namespace="devops"} | json | logger="devops_cli.roadmap.brain"). - Alert group
project-brainink8s/devops/monitoring/prometheus-rules-values.yaml, in the sparse-series form of the roadmap-service group, each selector by job, never by pod:BrainTaskLate,BrainTaskFailing,BrainValkeyFallback,BrainSyncLagHigh,BrainUndurable,BrainCacheEvicting,BrainSpendHigh. - promtool tests in
tests/fixtures/prometheus_rules/project_brain_tests.yaml, registered intests/prometheus/test_k8s_monitoring_alerting.py; one runbook row for each alert in the Alerting section ofk8s/README.md. - The collapsed row "Project brain" in the roadmap-pipeline dashboard and the insights table are scope 2 and 3 of feat(roadmap): serve the project insights and show them in Grafana #6599, not of this item.
Target Subsystem
Kubernetes & Minikube Automation (k8s/devops/dashboards/, k8s/devops/monitoring/).
Existing Tool Considered
Grafana dashboards as JSON, promtool, Prometheus, Loki and the existing dashboard and alert tests. No new tool. Cost: about 200,000 tokens and 4 hours to build.
Acceptance Criteria
tests/grafana/test_grafana_dashboards.pyandtests/telemetry/test_telemetry_instruments.pypass, and each query names a declared metric.- Each alert has a promtool case that fires, one that stays quiet, and one over a pod change.
- After the sync, the Grafana MCP tool
get_dashboard_by_uid devops-project-brainreturns the dashboard.
Dependencies
#4693. Part of the project brain plan #4624. (#3655 is a dependency of the row, which #6599 holds.)
Source: #4624
Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches returned only the Grafana/Loki images the cluster already runs, no maintained tool that ships a project-brain dashboard or alerts over this project's own devops_cli_* and redis_exporter series. The issue asks for no new tool.
Lacks:
- No dashboard over the project's devops_cli_* brain instruments
- No alerts for late, failing, undurable or expensive brain tasks
- No Valkey or fallback-share panels and no runbook rows
Proposed design
Problem statement
The owner asked for brain metrics on a Grafana dashboard, with alerts and a place in the Service dashboard. No dashboard shows a Valkey series or a brain series today. No alert covers a late brain task, a high fallback share or an insight with no durable copy. This item adds the project brain dashboard, its seven alerts, the promtool cases and the runbook rows. The roadmap-pipeline row and the insights table belong to #6599.
Acceptance criteria
Requirement: Dashboard ConfigMap entry
The k8s/devops/dashboards/kustomization.yaml SHALL generate k8s/devops/dashboards/project-brain.json in its own configMapGenerator entry named grafana-project-brain-dashboard.
Scenario: Kustomize renders the project brain ConfigMap
- WHEN
kubectl kustomize k8s/devops/dashboardsruns. - THEN The output holds one ConfigMap named
grafana-project-brain-dashboardwith the keyproject-brain.json.
Requirement: Dashboard lint
The project brain dashboard MUST pass the dashboard checks of tests/grafana/test_grafana_dashboards.py.
Scenario: The Grafana dashboard test runs
- WHEN
uv run pytest tests/grafana/test_grafana_dashboards.pyruns. - THEN The command exits 0 and reports no error for
project-brain.json.
Requirement: Declared instruments
Each PromQL query of the project brain dashboard that reads a devops_cli_* series MUST name an instrument that src/devops_cli/telemetry/instruments.py declares.
Scenario: The telemetry test checks the dashboard queries
- WHEN
uv run pytest tests/telemetry/test_telemetry_instruments.pyruns after the dashboard joins_PURE_DEVOPS_CLI_DASHBOARDS. - THEN The command exits 0 and reports no unsent
devops_cli_*series.
Requirement: Dashboard registry
tests/telemetry/test_telemetry_instruments.py MUST list project-brain.json in _PURE_DEVOPS_CLI_DASHBOARDS.
Scenario: The telemetry registry holds the dashboard
- WHEN
uv run pytest tests/telemetry/test_telemetry_instruments.pyruns. - THEN The command exits 0 and
_PURE_DEVOPS_CLI_DASHBOARDSholdsproject-brain.json.
Requirement: Alert group in the product rules
The project-brain alert group MUST be in k8s/devops/monitoring/prometheus-rules-values.yaml under serverFiles.devops_cli_alerting_rules.yml.
Scenario: The k8s CI row validates the product rule file
- WHEN
uv run devops ci --check --only k8sruns. - THEN The command exits 0 and reports no error for the
project-braingroup.
Requirement: Alert selectors and cases
Each of the seven project brain alerts MUST select its series by a job matcher and MUST have a fire case, a quiet case and a pod-change case.
Scenario: The alerting test runs the project brain cases
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns. - THEN The command exits 0 and promtool passes
tests/fixtures/prometheus_rules/project_brain_tests.yamlfor the seven alerts.
Requirement: BrainCacheEvicting scope
The BrainCacheEvicting alert MUST select the valkey-devops instance only and MUST NOT select valkey-roadmap.
Scenario: Promtool runs the eviction cases
- WHEN
promtool test rules tests/fixtures/prometheus_rules/project_brain_tests.yamlruns. - THEN The fire case uses
valkey-devops, thevalkey-roadmapcase stays quiet and promtool exits 0.
Requirement: Runbook rows
The ## Alerting section of k8s/README.md MUST hold one row for each of the seven project brain alerts.
Scenario: The k8s CI row reads the Alerting table
- WHEN
uv run devops ci --check --only k8sruns. - THEN The command exits 0 and reports no missing row for the seven project brain alerts.
Requirement: Pending a person after the merge
The synced dashboard MUST show uid devops-project-brain, its title, its five variables, its seven rows and the Valkey row with evictions for valkey-devops only.
Scenario: A person reads the dashboard from Grafana
- WHEN A person syncs the product dashboards after the merge and calls the Grafana MCP tool
get_dashboard_by_uid devops-project-brain. - THEN The tool returns the dashboard with title
Roadmap / Project Brain, the five variables, the seven rows and the Valkey row with evictions forvalkey-devopsonly.
Existing Tool Considered
The alternatives check of 2026-11-26 in the issue body gives the verdict none and names no tool. The block lists what no tool covers. The change builds dashboard JSON, one rule group and promtool cases on the Grafana, Prometheus and Loki stack that the cluster already runs. Written cost: about 200,000 tokens and 4 hours to build, keep and fix that code.
Key questions
- Where does the project brain dashboard live and how does the project provision it?: The dashboard is
k8s/devops/dashboards/project-brain.json. Thek8s/devops/dashboards/kustomization.yamlgets aconfigMapGeneratorentry namedgrafana-project-brain-dashboardwith the file and the sidecar labels of the other product dashboards. (best practice) [sources: k8s/devops/dashboards/kustomization.yaml, tests/telemetry/test_telemetry_instruments.py, docs/HOMELAB_REPO_SWITCH.md:170]- Chosen: Product dashboard folder with its own generator. Product dashboards live in
k8s/devops/dashboards/, and one generator keeps each ConfigMap under 262,144 bytes. - Rejected: Join the existing product dashboard ConfigMap. One ConfigMap would hold every product dashboard and can pass the size limit.
- Rejected: Environment dashboard folder. The environment tree is in dan-petty/homelab, and this repository does not hold it.
- Chosen: Product dashboard folder with its own generator. Product dashboards live in
- Where does the
project-brainalert group go?: The group goes ink8s/devops/monitoring/prometheus-rules-values.yamlunderserverFiles.devops_cli_alerting_rules.yml. The chart loads this product file next to the environment rules. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, tests/prometheus/test_k8s_monitoring_alerting.py, docs/HOMELAB_REPO_SWITCH.md:170]- Chosen: Product rule file. The chart loads this file next to the environment rules, and the group watches
devops_cli_*series. - Rejected: Environment rule file. The environment values file lives in dan-petty/homelab, and this repository does not hold it.
- Rejected: A new rule file. The chart loads one product rule file, and the alerting test names that file.
- Chosen: Product rule file. The chart loads this file next to the environment rules, and the group watches
- How does each project brain counter alert count a sparse series?: Each counter alert uses the sparse form of the roadmap-stage rule:
(last_over_time(series[window]) unless last_over_time(series[window] offset window)) or increase(series[window]). The form counts a series that starts inside the window from zero. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml]- Chosen: Sparse-series form. It counts the first export of a short-lived job, as the roadmap-stage rule does.
- Rejected: Raw
increase. It misses the first value of a series that starts in the window. - Rejected: Raw
rate. It needs two samples and misses a job that exports one sample.
- Which label do the project brain alerts select?: Each
devops_cli_*selector names a job matcher and never a pod. The rule uses the job label that each brain series carries. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml]- Chosen: Job matcher. Pod names change, and the file selects each
devops_cli_*series by job. - Rejected: Pod matcher. A pod matcher breaks when the pod restarts.
- Rejected: No selector. The rule would count a workstation or another job.
- Chosen: Job matcher. Pod names change, and the file selects each
- How are the seven project brain alerts tested and registered?:
tests/fixtures/prometheus_rules/project_brain_tests.yamlholds a fire case, a quiet case and a pod-change case for each alert. The rule-test registry intests/prometheus/test_k8s_monitoring_alerting.pymaps the groupproject-brainto that file. (best practice) [sources: tests/prometheus/test_k8s_monitoring_alerting.py]- Chosen: Promtool cases in the shared rule-test registry. The existing test runs each registered group and requires a case for each alert.
- Rejected: No promtool cases. The test requires a case for each alert of a tested group.
- Rejected: A Python-only expression check. It does not evaluate the rule over samples.
- Which
redis_exporterseries may the dashboard andBrainCacheEvictingread?: Only the series that the allow list in dan-petty/homelab keeps. A new series must join that allow list ink8s/monitoring/k8s-monitoring-values.yamlof dan-petty/homelab before a panel or an alert reads it.BrainCacheEvictingselectsvalkey-devopsonly, becausevalkey-roadmapuses thenoevictionpolicy. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, docs/HOMELAB_REPO_SWITCH.md:170, k8s/devops/valkey-roadmap/valkey.conf]- Chosen: Allow-listed
redis_exporterseries only. The chart drops a series outside its allow list, so the panel stays empty and the alert cannot fire. - Rejected: Any
redis_exporterseries. A series outside the allow list never reaches Prometheus. - Rejected: A new exporter. The stack already scrapes
redis_exporter, and no new tool is needed.
- Chosen: Allow-listed
- Which label does the first-reads counter have?: The first-reads counter has no
outcomelabel. The first-reads panel must not group byoutcome. [sources: src/devops_cli/telemetry/instruments.py] - Which Valkey instance can evict keys?:
valkey-devopscan evict keys.valkey-roadmapuses thenoevictionpolicy and never evicts. [sources: k8s/devops/valkey-roadmap/valkey.conf] - Which section of
k8s/README.mdholds the alert rows?: The## Alertingsection holds the row of each alert. [sources: k8s/README.md] - Does this item add a new
redis_exporterseries to the allow list in dan-petty/homelab?: No. This item reads only the series that the allow list already keeps. A new series is a separate change in dan-petty/homelab. (best practice) [sources: docs/HOMELAB_REPO_SWITCH.md:170, k8s/devops/monitoring/prometheus-rules-values.yaml]- Chosen: Use existing allow-listed series only. The allow list is in another repository, and this item has no issue there.
- Rejected: Add a new series in this item. The allow list lives in dan-petty/homelab, so this repository cannot change it.
- Rejected: Add a new exporter. The stack already scrapes
redis_exporter.
- What gates the dashboard offline, and how is the live Grafana read recorded?: The offline gates are
uv run pytest tests/grafana/test_grafana_dashboards.py,uv run pytest tests/telemetry/test_telemetry_instruments.pyandkubectl kustomize k8s/devops/dashboards. The liveget_dashboard_by_uid devops-project-brainread is an acceptance criterion namedPending a person after the merge. (best practice) [sources: tests/grafana/test_grafana_dashboards.py, k8s/README.md]- Chosen: Offline tests and generator render. Both run offline, and the live read stays a person step after the sync.
- Rejected: The live read as the only gate. It needs a live Grafana and a sync, so it cannot gate the pull request.
- Rejected: No check. The dashboard can still break the lint or the generator.
- Which test files register a product dashboard?:
_PURE_DEVOPS_CLI_DASHBOARDSintests/telemetry/test_telemetry_instruments.pyregisters the dashboard, andtests/grafana/test_grafana_dashboards.pylints it. The oldtests/prometheus/test_k8s_monitoring_dashboards.pyand itsPROVISIONEDlist are gone. [sources: tests/telemetry/test_telemetry_instruments.py, tests/grafana/test_grafana_dashboards.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(monitoring)scope of the title gives the scope.It is a requested monitoring feature with two open dependencies, not a blocking defect.The owner asked for brain metrics, alerts, and a dashboard; without them, late brain tasks and high fallback share go unnoticed.The body estimates about 4 hours: one dashboard JSON, seven alert rules, promtool tests, and three test-file updates.Both add Grafana dashboards and alerts under k8s/monitoring/dashboards/ and are siblings from the project-brain plan #4624, but #3655 covers pipeline metrics while this covers brain and Valkey metrics.dan-petty commentedon Nov 12, 2026
Scope from the content freshness plan (2026-11-11)
This issue is child 19 of #4880, the content freshness tracker. The scope adds document-drift panels and alerts.
Why
A document-drift lane with a cap can let findings wait for a long time with no signal. This issue has no panel or alert for document drift.
New scope
docs_check_at_main_headfails 2 days in a row.The panels follow
docs/DESIGN.mdwhen #4735 lands it.Acceptance added
Depends on: #4693, and the dependencies that this issue already names.
devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches surfaced only unrelated hits (container images such as grafana/grafana and valkey/valkey, and MDN documentation pages) and no open, maintained tool or library that supplies a project-brain dashboard, its panels and the seven brain alerts. The need is repository-specific dashboard JSON, Prometheus rule groups and promtool cases built on Grafana, Prometheus and Loki, which the issue itself names as "No new tool".
Tool: none found
Lacks:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at 0820a64 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.
devops-cli-service commentedon Nov 26, 2026
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.
dan-petty commentedon Nov 27, 2026
Design check, 2026-11-26
Body, 7 corrections
tests/prometheus/test_k8s_monitoring_dashboards.pydoes not exist. The list and criterion 1 do not name it now.## Alerting(k8s/README.md:189).valkey-roadmapnever evicts (k8s/devops/valkey-roadmap/valkey.conf,noeviction).src/devops_cli/telemetry/instruments.py:811).Refine block
k8s/monitoring/prometheus-values.yaml. This repository does not hold that file.BrainCacheEvictingcan fire forvalkey-devopsonly.Place: correct. Argo CD reads
k8s/devopsand the rule file from this repository (docs/HOMELAB_REPO_SWITCH.md:170).Dependencies: #4693 is open. The task, proposal and undurable series come with #4687 and #4693.
Open question: the body names no issue of dan-petty/homelab for the allow list.
devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
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.