VPA: Document all component metrics and test recommender metrics #9825
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 302 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.342
Real PR Conversation Timeline
1 comments
"Review active on #9825"
general
weight: 0.35
mattsu2020
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds a single Prometheus metrics reference for the VPA Admission Controller, Recommender, and Updater in
docs/metrics.md, organized into three component sections and linked from the VPA README.A shared Go generator reads the registered metric definitions and common helpers to produce metric names, types, labels, and descriptions from the Prometheus
Helpfields.hack/update-metrics.shregenerates all three tables, andhack/verify-metrics.shdetects stale documentation without modifying it. The generator supports both direct collector registration and the Updater's collector slice, and fails on unsupported definitions instead of silently omitting metrics. The reference covers VPA metrics; metrics provided by dependencies are excluded.Also adds unit coverage for Recommender metric behavior: recording recommendation latency in seconds, reporting aggregate container state counts, and classifying Metrics Server responses by error status and client name. Generator tests cover all three components, definition and registration changes, deterministic output, stale-document detection, and failures without modifying the document.
Which issue(s) this PR fixes:
Fixes #8128
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?
``
release-note
``NONE
text
go test -race ./hack/tools/metrics ./pkg/utils/metrics/recommender ./pkg/recommender/routines ./pkg/recommender/input/metrics ./pkg/recommender/input/history
go vet ./hack/tools/metrics ./pkg/utils/metrics/recommender ./pkg/recommender/routines ./pkg/recommender/input/metrics ./pkg/recommender/input/history
bash hack/verify-metrics.sh
bash hack/verify-toc.sh
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Documentation
Added a metrics guide describing metrics exposed by the Admission Controller, Recommender, and Updater, including their types, labels, and descriptions.
Added a link to the guide in the README contents.
Chores
* Added commands to generate and verify the metrics documentation, with checks that identify outdated tables and prevent stale documentation from passing verification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->