fix: replace kube-state-metrics with kubelet as PrometheusJobUp anchor #5733
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.71) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 520 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.374
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #5733"
general
weight: 0.35
mmazur
Jira: https://redhat.atlassian.net/browse/AROSLSRE-1237
Summary
PrometheusJobUp— its cluster anchor wasup{job="kube-state-metrics"}, which our own Prometheus scrapes, so a dead Prometheus pod killed the anchor and the alert never fired. Swap toup{job="kubelet"}(scraped by AMA — Azure Monitor Agent — independent of our Prometheus).PrometheusMetricsAbsent— it permanently fired on the HCP workspace, carried no cluster label for IcM, and only fires if all svc and mgmt clusters in a region lose metrics at the same time;PrometheusJobUp+PrometheusUptimealready cover it per-cluster.Why —
PrometheusJobUpwas silent for the exact failure it guardsPrometheusJobUpuses anunless on(cluster)expression to detect clusters where Prometheus is absent. The left-hand side is the cluster anchor — a series that must survive when Prometheus itself is down.The previous anchor,
up{job="kube-state-metrics"}, is scraped by our Prometheus pod: those series carryprometheus=prometheus/prometheusandprometheus_replica=prom-agent-prometheus-0, both stamped by the Prometheus operator to identify the scraper. When the Prometheus pod dies it stops scraping kube-state-metrics too, so both sides of theunlessdisappear simultaneously and the alert is permanently silent — the exact failure mode it exists to catch.The fix
Replace the anchor with
up{job="kubelet"}, written by AMA (Azure Monitor Agent) — a separate DaemonSet deployed by Azure as part of the AKS managed-Prometheus add-on. AMA scrapes kubelet independently of our Prometheus installation (confirmed by the absence of anyprometheus=label on those series; AMA uses its own remote-write path to the AMW). When our Prometheus pod dies, AMA keeps writing kubelet metrics, so the anchor survives and theunlessfires with a realclusterlabel — so the IcM title and correlationId resolve to the affected cluster instead of rendering empty.Why —
PrometheusMetricsAbsentwas removedA hand-written Bicep alert watching
absent(up{job="prometheus/prometheus",namespace="prometheus"}), scoped to both the services and HCP Azure Monitor Workspaces. It was broken in three independent ways and added no coverage beyond existing alerts:1. The HCP-scoped instance fired permanently. That metric is never remote-written to the HCP AMW by design — the Prometheus pod writes its self-scrape only to the services AMW — so the alert fired from the moment it deployed, regardless of any cluster's actual health.
2. No cluster context for IcM.
absent()produces a synthetic series carrying only the labels written literally in its selector (job,namespace) — nocluster. The alert also wired noactionProperties, so IcM could not say which cluster was affected.3. Useless at scale. On a workspace shared by many clusters,
absent()only fires when every cluster stops writing at once. As management clusters scale to ~10 per region, the chance of it catching a real single-cluster outage approaches zero.PrometheusJobUp(now fixed above) andPrometheusUptimealready cover these failure modes per-cluster with correct IcM routing, so the alert was dropped rather than patched.Future improvement
Once #5732 (
underlay_clusterssource-of-truth metric) is merged and confirmed in production, thePrometheusJobUpanchor should becomeunderlay_clusters{}— the deploy-time declaration of which clusters should exist. That makes absence detection independent of any runtime scrape state (even AMA being down would not produce a false negative). ATODOcomment in the YAML points at this.🤖 Generated with Claude Code