feat(autoscaling): Add an Autoscaling section to the cluster-agent status #58098
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 491 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #58098"
general
weight: 0.35
AlexanderYastrebov
What does this PR do?
Adds an
Autoscalingsection to the Cluster Agent status, and therefore to the flare viacluster-agent-status.log. It reports the number ofDatadogPodAutoscalerobjects in the store, whether this replica is the leader, and per Remote Configuration product the last update received — its highest config version, when it arrived, how many configurations it carried, a running update count, and the last processing error if any.Motivation
There is no autoscaling section in the Cluster Agent status today, so working out whether workload autoscaling is running — and whether it is actually receiving recommendations — means reading logs.
Describe how you validated your changes
Unit tests for each rendering state (disabled, enabled-but-not-started, started, follower), for the per-product breakdown, and for the reset-on-update behaviour. A wiring test drives a real
ConfigRetrieverthrough the existing mock RC client and asserts the update lands under the correct product heading — verified by swapping the two product constants inNewConfigRetrieverand confirming it fails. An integration test builds the real status component through fx and asserts the rendered section layout.Built the cluster-agent; all 18 Bazel test targets under
pkg/clusteragent/autoscaling/...andcmd/cluster-agent/subcommands/start/...pass.Local QA on a kind cluster (fresh single-node
kindest/node:v1.37.0, 1-replicaCluster Agent built from this branch, DatadogPodAutoscaler CRD from the operator):
cat -A(no trailing whitespace)DatadogPodAutoscalers:tracked0 → 1 → 2 → 0across real DPA create/delete, so it reads the live store rather than a counterLeader: truematched the holder of thedatadog-leader-electionlockcluster-agent-status.logcarries the section identicallyOne branch is not covered by live QA: the populated-product rendering
(
Last config version/Configs failed/Last error). It needs real RemoteConfiguration delivery from an org with RC enabled, which the test environment does
not have — the agent's own Remote Configuration section read
Organization enabled: False, so it genuinely received nothing and correctly saidso rather than inventing an error. That branch is covered by unit tests only.
Additional Notes
Extracted from #55619, which bundled this with changes to the Remote Configuration status section and a generic multi-RC-client mechanism. This PR is only the autoscaling status part — nothing under
comp/remote-config/orpkg/config/remote/is touched.The group is named
Autoscalingrather thanWorkload Autoscalingso cluster autoscaling can join it as a sibling sub-section later.The per-product blocks are a record of what arrived, not a health verdict. The RC client invokes a product's callback only when that product's config set changes, so
No update received yetis the normal state for an organization with no remoteDatadogPodAutoscaler, and a cluster in steady state stops receiving updates entirely. The code says so where it builds the section, to stop a future reader treating a growing age as a fault.🤖 PR description and code assisted by Claude:claude-opus-5