Skip to content

feat(grafana): add Kubernetes 3831 and 1471 curated packs - #437

Merged
shmsr merged 2 commits into
mainfrom
feat/grafana-3831-1471-kubernetes-packs
Sep 3, 2026
Merged

feat(grafana): add Kubernetes 3831 and 1471 curated packs#437
shmsr merged 2 commits into
mainfrom
feat/grafana-3831-1471-kubernetes-packs

Conversation

@shmsr

@shmsr shmsr commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Curated pack for Grafana 3831 (Kubernetes Cluster Autoscaler): every panel is ES|QL because native PROMQL LAST(value, step) is empty in Lens on prometheus_native ingest. Grafana's bare sum() on *_total stays LAST_OVER_TIME (not RATE); time()-last_activity is DATE_DIFF seconds; Nodes available is ready/total * 100 so the number+% tile shows 100%, not 1%. Flattened "New row" panels sit at y: 2. KPI chrome titles are shortened for Kibana tiles.
  • Curated pack for Grafana 1471 (Kubernetes App Metrics): Heapster container_name / pod_name / kubernetes_io_hostname and HTTP kubernetes_namespace rewrite to canonical labels. $container binds both cAdvisor container and HTTP app. Request rate restores nginx (engine dropped it for status vs code grouping) as Grafana-style native | 200 / nginx | 500 / haproxy | 2xx series. Plugin rewrites $namespace/$container populate off container_name. Per-pod graphs group by pod; response time uses PERCENTILE of the duration gauge.
  • Engine: blank inner Lens labels (not just value / computed_value) so flattened metric tiles do not show the raw field name.
  • Shared k8s_exporter now emits cluster_autoscaler_* plus cAdvisor spec/user/system and native/nginx/haproxy HTTP series so both packs validate on the curated rig.

Test plan

  • pytest tests/test_curated_packs.py -k "3831 or 1471" (18 passed)
  • Full tests/test_curated_packs.py + ruff + pin verifier
  • Cross-profile leakage gate (scripts/run_cross_profile_corpus.py) — OK
  • Live migrate + upload both dashboards (metrics-k8s.prometheus-default, prometheus_native)
  • live_validate --fail-on-bug: 3831 10/10 ok, 1471 13/13 ok, 0 data_gap, 0 bugs
  • dashboards_api --fail-on-error: 10 and 13 mapped, 0 errors
  • grafana-validate-uploaded: 0 runtime errors, 0 empty, 0 overlaps
  • Kibana view-mode: 3831 KPI values match exporter (2 nodes, 100% available, 0/1 safe, duration tiles); 1471 Request rate legend is native | 200 / nginx | 500 / haproxy | 2xx; $container=webweb-0/web-1, switch to redis → cache-0

Fixes #402
Fixes #403

shmsr and others added 2 commits September 3, 2026 13:40
Cluster Autoscaler and App Metrics need pack-level ES|QL, Heapster label
bridges, and layout so they render in Kibana instead of empty native PROMQL
LAST steps and cartesian HTTP legends.
Remove the redundant integer cast so the required Ruff check passes, and isolate the pod-count regression case so failures identify the affected behavior.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: fixed, then approved. No Critical or Important findings remain.

What I verified

  • Contract/diff: both canonical dashboards (Grafana 1471 rev 1 and 3831 rev 1) resolve through the new registry entries; both provenance pins verify. I generated and inspected IR plus native artifacts from the canonical sources: 23/23 panels mapped (1471: 10 clean + 3 explicitly approximate; 3831: 10 clean), 0 manual, 0 not-feasible, canonical namespace/container controls, single Lens breakdowns, guarded ratios, cumulative LAST_OVER_TIME semantics, DATE_DIFF activity tiles, and non-overlapping 3831 layout.
  • Boundaries/regressions: reviewed empty/duplicate Lens labels, zero-denominator guards, optional HTTP-series behavior, canonical/legacy label rewriting, flattened-row positions, and the metric/gauge native payload shapes. The label change remains limited to empty or duplicate inner labels when chrome titles are shown. Five-profile portability passed without canonical-name leakage. No supported panel type or fidelity baseline was added/changed.
  • Tests: the new targeted tests fail on the unmodified merge base at the first missing 3831 registry assertion, so they are not vacuous. The split 1471 pod-count test retains every original assertion.
  • Docs/conventions: operator-visible behavior is documented in docs/sources/grafana.md; fidelity manifests contain no UNKNOWN entries and explicitly disclose the three 1471 approximations and three 3831 presentation approximations. The PERCENTILE concern was probed: it is not claimed as exact histogram_quantile parity; the manifest and emitted warning explicitly identify the duration-gauge approximation.

Fixes in b0c50e3

  • Critical <parity-rig/curated/grafana_763_redis_exporter/k8s_exporter.py:257>: removed an unnecessary int() around an already-integer memory-limit expression. It mattered because Ruff RUF046 made the required CI gate fail. The emitted value remains byte-for-byte 536870912.
  • Minor <tests/test_curated_packs.py:5714>: separated the Number-of-pods scenario from the response-time test so failures identify the behavior they cover.
  • Minor <tests/test_curated_packs.py:5880>: removed the extra blank line at EOF so git diff --check is clean.

Gates

  • Targeted: 19 passed, 204 deselected.
  • Full unit suite: 6,219 passed, 53 skipped, 473 subtests passed.
  • Lint: 498 source headers checked; skill mirror/structure checks passed; Ruff 0 errors.
  • Typecheck: 0 issues in 10 source files.
  • Provenance: 2/2 pins verified.
  • Cross-profile corpus: 5 profiles passed; each produced 23 panels, 20 green / 3 yellow / 0 red.
  • Post-push GitHub CI: 14/14 checks passed.

Visual verification did not apply to the review fix: it changes no migration/render/layout/control code. The only runtime edit is a lint-equivalent integer expression whose exporter output was verified identical; the other edits are tests/whitespace. No pre-existing base failures remain, and there are no optional Minor follow-ups from this review.

@shmsr shmsr self-assigned this Sep 3, 2026
@shmsr shmsr added source:grafana Grafana source migration program:curated-packs Curated Grafana community dashboard packs program:grafana-engine Grafana translator and engine correctness labels Sep 3, 2026
@shmsr
shmsr merged commit 0a5340a into main Sep 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

program:curated-packs Curated Grafana community dashboard packs program:grafana-engine Grafana translator and engine correctness source:grafana Grafana source migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pack] Grafana 3831 Kubernetes Cluster Autoscaler [pack] Grafana 1471 Kubernetes App Metrics

2 participants