Skip to content

refactor(k8s): split the product dashboards and rules in place - #5309

Merged
dan-petty merged 3 commits into
mainfrom
refactor/5292-split-product-dashboards-rules
Nov 13, 2026
Merged

dan-petty merged 3 commits into
mainfrom
refactor/5292-split-product-dashboards-rules

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Move the 3 product dashboards to k8s/devops/dashboards, with their own kustomization. k8s/monitoring/dashboards lists the folder, so Application monitoring stays the owner of the ConfigMap grafana-devops-cli-dashboards. Move the 9 rule groups that watch the devops_cli_* series to k8s/devops/monitoring/prometheus-rules-values.yaml, under serverFiles.devops_cli_alerting_rules.yml. Application prometheus and deploy-stack give the chart this file after the environment values, and rule_files names it. With no path, grafana dashboards lint and sync read both folders. Delete the copy of Ingress devops/roadmap-service in k8s/ingress and the delete patch of the ingress overlay.

The homelab environment moves to its own repository (#5120). The product content now has its own files, so the copy of the environment can leave it behind.

Closes #5292

Change: openspec/changes/archive/2026-11-13-5292-split-the-product-dashboards-and-rules/

Move the 3 product dashboards to k8s/devops/dashboards with their own
kustomization. The dashboards kustomization of k8s/monitoring lists the
folder, so Application monitoring stays the owner of the ConfigMap
grafana-devops-cli-dashboards. A test fails when the overlay of
Application devops reaches the folder.

Move the 9 rule groups that select a devops_cli_ series to
k8s/devops/monitoring/prometheus-rules-values.yaml, under the key
serverFiles.devops_cli_alerting_rules.yml. Application prometheus and
deploy-stack give the chart this file after the environment values, and
the environment values name it in rule_files. Each release of
HELM_RELEASES_BY_STACK has a list of values files.

grafana dashboards lint and sync read both folders when no folder is
given. The tree reader of the tests merges the values files of a chart
source, as Helm does.

Delete the copy of the Ingress devops/roadmap-service in the
environment routes and the delete patch of the ingress overlay.

The renders of the touched Argo CD paths stay the same bytes. Only the
ConfigMap prometheus-server changes, with the same 71 alert rules.
…fig example

The comment of ai.reference_model in config.example.yaml named the old path of
ai-spend.json. Rewrap the module docstring of the alerting tests to the line length.
Archive 5292-split-the-product-dashboards-and-rules into the specs. The new capability product-monitoring-content names where the product dashboards and alert rules live. Two modified requirements are shorter, so each stays under the length limit of the validator.
@dan-petty dan-petty added type/refactor Type refactor: a new structure, same behavior scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Review and checks

Independent review of the branch against #5292, the plan on #5120, AGENTS.md, ARCHITECTURE.md and CONTRIBUTING.md.

Review fixes (commit refactor(k8s): name the new path of the AI spend dashboard in the config example):

  • config.example.yaml named the old path k8s/monitoring/dashboards/ai-spend.json. It now names k8s/devops/dashboards/ai-spend.json.
  • One line of the module docstring of tests/prometheus/test_k8s_monitoring_alerting.py had about 165 characters. It is wrapped again.

Checks at the head, on origin/main f3b8e2669:

  • uv run devops ci --check --only lint,format,typecheck,docs,constructs,openspec,k8s,test-settings: all pass (mypy strict pass).
  • uv run pytest tests/prometheus tests/grafana tests/commands/test_grafana.py tests/commands/k8s tests/invariants tests/gate tests/core/test_k8s_local_path_placement.py tests/core/test_coverage_index.py tests/telemetry/test_telemetry_instruments.py tests/ai/test_llm_pool_metrics.py tests/ai/benchmark/test_k8s_llm_gateway.py tests/commands/test_telemetry_monitoring_dry_run.py tests/docs/test_docs.py and the 4 readers of config.example.yaml: 2076 passed, 0 skipped (the promtool tests ran).
  • The builder ran the new tests first: they failed on the base (the product files did not exist), then passed.

Render diff

kubectl kustomize (kustomize 5.8.1) of each touched path at origin/main and at the head:

Path Application Result
k8s base same bytes
k8s/monitoring monitoring same bytes: ConfigMap grafana-devops-cli-dashboards comes from k8s/devops/dashboards with the same name, namespace, labels and data
k8s/overlays/homelab/ingress ingress same bytes: the copy of Ingress devops/roadmap-service is deleted at its source, not by the patch
k8s/overlays/homelab/devops, k8s/devops devops same bytes
k8s/ingress none loses Ingress devops/roadmap-service. No Application renders this folder. The native infra stack no longer applies the copy; the devops stack still applies k8s/devops/roadmap-service/ingress.yaml
k8s/argocd/apps/prometheus.yaml cluster Application prometheus gets the second valueFile $values/k8s/devops/monitoring/prometheus-rules-values.yaml

helm template of prometheus 29.47.2 (Helm 4.3.1), base values compared with both values files: the same 12 objects. Only ConfigMap prometheus-server changes: alerting_rules.yml loses the 9 product groups, the new key devops_cli_alerting_rules.yml holds them, and prometheus.yml gets the 5th rule_files entry. The rest of prometheus.yml is the same. The 71 alert rules are the same, with the same content. No pod template has a checksum of the ConfigMap, so no pod restarts.

Expected deploy effect: the config reloader reloads Prometheus, and the 9 product groups start their for timers again one time. Argo CD prunes nothing. The issue expects a non-zero argocd app diff only for prometheus; cluster also differs, because it holds the Application prometheus.

After the merge

  • argocd app diff --core --exit-code is 0 for each Application except cluster and prometheus.
  • Argo CD prunes nothing.
  • The rule API of Prometheus shows 71 alert rules.

The issue gives 27 product alerts. The 9 groups hold 25 at origin/main and at the plan base 7a158c4c3; the proposal Feasibility section records this.

#5131 PR 1 also changes the default of the dashboard folders. This branch renames DEFAULT_GRAFANA_DASHBOARDS_DIR to DEFAULT_GRAFANA_DASHBOARDS_DIRS, so the pull request that merges second must rebase and resolve the conflict.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 01:22
@dan-petty
dan-petty merged commit f31dc56 into main Nov 13, 2026
25 checks passed
@dan-petty
dan-petty deleted the refactor/5292-split-product-dashboards-rules branch November 13, 2026 01:25
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.125.2](v0.125.1...v0.125.2)
(2026-11-13)


### Code Refactoring

* **k8s:** split the product dashboards and rules in place
([#5309](#5309))
([f31dc56](f31dc56))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/refactor Type refactor: a new structure, same behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(k8s): split the product dashboards and rules in place

1 participant