Skip to content

feat(observability): repo-owned dashboards-as-code + Scratch folder convention#202

Merged
jvcorredor merged 4 commits into
mainfrom
worktree-homelab-182-dashboards-as-code
May 16, 2026
Merged

feat(observability): repo-owned dashboards-as-code + Scratch folder convention#202
jvcorredor merged 4 commits into
mainfrom
worktree-homelab-182-dashboards-as-code

Conversation

@jvcorredor

Copy link
Copy Markdown
Member

What

Establishes the hybrid dashboard workflow promised by ADR-0007 / PRD #176 (user stories 1, 9, 19): production dashboards live as JSON in the repo and provision read-only; a manually-created Scratch folder stays writable for in-flight investigations.

Changes

  • dashboards/nodes.json — repo-authored 6-node CPU / memory / disk / network overview (story 2). Reads node-exporter + kube-state-metrics series kube-prometheus-stack ships out of the box, so it has data from first sync.
  • dashboards/addon-health.json — repo-authored cluster + addon health overview (story 1). The Cluster & workload health row (kube-state-metrics) has data immediately; the Addon exporters row (ArgoCD, cert-manager, ESO, Longhorn) reads "No data" until each addon ships a ServiceMonitor — wide-open discovery scrapes it the moment it does.
  • dashboards/kustomization.yaml — both dashboards registered as their own configMapGenerator entries; per-dashboard provenance recorded via homelab.jackhall.dev/dashboard-source; every ConfigMap stamped grafana_folder: Homelab.
  • helm-values.yaml — sidecar folderAnnotation: grafana_folder + provider.foldersFromFilesStructure: true, so repo-owned dashboards land in a read-only Homelab Grafana folder, distinct from the writable operator-created Scratch folder.
  • README.md — new Dashboards-as-code section: the folder convention (folderAnnotation chosen over dashboard tags, with rationale), the promote-from-Scratch workflow, and smoke-test steps for provisioning, edit-and-resync, and the Scratch folder.

Folder convention

folderAnnotation was chosen over dashboard tags: tags label a dashboard but cannot place it in a folder, so they cannot give Scratch its own read/write boundary. Chart-bundled dashboards carry no annotation and stay in Grafana's "General" folder. The "Scratch" folder is operator-created in the UI (the sidecar provisions dashboards, not empty folders) and intentionally absent from Git.

Validation

  • python3 -m json.tool — both new dashboards are valid JSON.
  • kubectl kustomize dashboards/ — renders 3 ConfigMaps, each grafana_folder: Homelab, label grafana_dashboard: "1", namespace observability.
  • scripts/lint-apps.sh kubernetes/apps/kube-prometheus-stack — passes unmodified.
  • helm template — confirms FOLDER_ANNOTATION=grafana_folder on the sidecar and foldersFromFilesStructure: true in the provisioning provider.

In-cluster acceptance checks (Grafana not reachable from this environment) are documented as smoke-test steps 9–11 in the README.

Closes: #182

🤖 Generated with Claude Code

jvcorredor and others added 4 commits May 15, 2026 21:04
…onvention

Establish the hybrid dashboard workflow from ADR-0007 / PRD #176 user
stories 1, 9, and 19: production dashboards live as JSON in the repo and
provision read-only; a manually-created Scratch folder stays writable
for in-flight investigations.

- dashboards/nodes.json — repo-authored 6-node CPU/mem/disk/network
  overview (story 2), reads node-exporter + kube-state-metrics.
- dashboards/addon-health.json — repo-authored cluster + addon health
  overview (story 1). The workload-health row reads kube-state-metrics
  and has data from first sync; the addon-exporter row fills in per
  addon as ServiceMonitors land.
- dashboards/kustomization.yaml — register both dashboards as their own
  configMapGenerator entries; record per-dashboard provenance; stamp
  every ConfigMap with grafana_folder: Homelab.
- helm-values.yaml — sidecar folderAnnotation: grafana_folder plus
  provider.foldersFromFilesStructure: true, so repo dashboards land in
  a read-only "Homelab" Grafana folder, distinct from the writable
  operator-created "Scratch" folder.
- README — folder convention (folderAnnotation chosen over tags, with
  rationale), the promote-from-Scratch workflow, and smoke-test steps
  for provisioning, edit-and-resync, and the Scratch folder.

Closes: #182

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jvcorredor jvcorredor merged commit 6296346 into main May 16, 2026
3 checks passed
@jvcorredor jvcorredor deleted the worktree-homelab-182-dashboards-as-code branch May 16, 2026 02:36
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.

feat(observability): repo-owned dashboards-as-code + Scratch folder convention

1 participant