Limit kubelet /metrics/resource response body size #1870
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 78 lines diff across 1 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.261
Sensitive Paths
sensitive_paths
0.059
Real PR Conversation Timeline
1 comments
"Review active on #1870"
general
weight: 0.35
yangjunmyfm192085
What this PR does
Fixes #1856.
kubeletClient.getMetricsread the entire kubelet/metrics/resourceresponse into memory with no size limit. A pathological kubelet could return an unbounded body, and sincepkg/scraper/scraper.golaunches one goroutine per node with no concurrency cap, memory can grow without bound.Changes
Wrap the response body with
io.LimitReaderand return an error when the response exceedsmaxResponseBodySize(16 MiB).Test
Added
TestGetMetricsResponseTooLargeasserting that an oversized response returns an error.go test ./pkg/scraper/client/resource/... -count=1passes.