Skip to content

feat(infra): show allocatable capacity and utilization for Kubernetes nodes - #1390

Merged
Makisuo merged 2 commits into
mainfrom
feat/k8s-node-capacity
Oct 10, 2026
Merged

Makisuo merged 2 commits into
mainfrom
feat/k8s-node-capacity

Merge remote-tracking branch 'origin/main' into feat/k8s-node-capacity

613237d
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 10, 2026 in 5m 57s

Confidence 9/10 · No issues found

🟢 Confidence 9/10 · safe to merge
SQL, spec mapping and formatting are pinned by unit tests and the SQL baseline; only the collector's allocatable metric names are unverifiable here.
quality 100/100 · no findings · tests covered · risk medium

Adds allocatable CPU/memory capacity and usage/allocatable utilization to the Kubernetes Nodes list and node detail: the fractions are computed in ClickHouse, mapped through the domain schemas, and rendered as meters with used/allocatable captions. Contained, consistent across the stack, and safe to merge.

  • listNodesQuery and nodeDetailSummaryQuery now scan k8s_cluster allocatable metrics alongside kubeletstats usage
  • nodeGaugeTimeseriesQuery divides a usage metric by a capacity metric per bucket
  • Node list/detail show utilization meters, sort by CPU utilization, and gain CPU/memory chart pivots
  • k8s.kubelet.version, k8s.node.uid and the cluster name are read with anyIf(attr != ''), so they no longer come back blank
What was checked
  • Fractions are 0-1 in SQL and rendered as unit: "percent" with formatPercent(fraction) (packages/ui/src/lib/format.ts:96)
  • capacityFraction yields NaN when allocatable is 0, so meter and percent show a dash rather than 0% (apps/web/src/components/infra/format.ts:48)
  • The list's new HAVING matches the facet probe metric, so the list and its facets exclude the same nodes (infra.ts:898)

613237d · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.