Prometheus & Alertmanager — metrics and alerts
Metrics exist on three tiers, batch results arrive through Pushgateways, and alerts deliberately page nobody yet — they surface in the Alertmanager and Grafana UIs, which is the owner’s standing choice (2026-10-24), not an oversight.
Part A — How it is set up
The three tiers
- Tooling plane — a hand-rolled stack in the mini’s
agentopsnamespace (GitOps fromrhels/lab-agentops,gitops/modules/observability): Prometheus v2.55.1, Alertmanager v0.27.0, Grafana 11.3.1. Stateless by construction (no volumes — config in git, state in-pod). Front doorsprom.rhels.comandalerts.rhels.com(no login; tailnet-only). - Workload cluster —
kube-prometheus-stackon CRC (namespacemonitoring), alongside OpenShift’s built-in monitoring. The scrape contract: the app exposes/metrics, aServiceMonitorselects it, Prometheus scrapes it. Alertmanager and kube-state-metrics were enabled on 2026-10-24 — before that this stack had no CronJob metrics at all and its alerts went nowhere. - The Macs —
node_exporteron each host, scraped by Grafana Alloy, remote-written to Grafana Cloud. This tier is the host ground truth (including the SSH-session counts that watch the macOS session cap); when a host “seems down”, these series — not a stale report — decide. See tools/grafana.md.
Pushgateways (for things that cannot be scraped)
CronJobs and one-shot jobs exit before a scrape would find them, so batch producers push:
- Tooling plane:
prom/pushgateway:v1.9.0in theagentopsstack. Its tenant is group-sync, which pushes per-group check results every 2 minutes (identity.md). - CRC: a Pushgateway in the
monitoringnamespace (Argo CD app fromclusters/crc/observability/pushgateway/), scraped by the CRC Prometheus through a ServiceMonitor. Its tenants are the test producers — thelog-login-testsandlog-delivery-testCronJobs and the agent-side health suite — which PUT a per-run result set (per-check status, run counts, duration) at the end of each run. The exact metric model is documented in that app’sREADME.mdin the GitOps repo, and rendered by the Lab Test Results Grafana dashboard. - Retention truth: the CRC Prometheus retention was raised from
24 h to 15 days for those trends, and since 2026-10-24 its
TSDB sits on a 10 Gi PVC (a
volumeClaimTemplatein the stack’s GitOps values) instead of the originalemptyDir. History now survives pod restarts — proven the same day by deleting the pod and finding the pre-restart samples identical after — and is lost only with the CRC VM itself.
Alerting
- CRC: PrometheusRule
crc-cronjob-consecutive-failures(labelled so the stack’s Prometheus picks it up) carries one alert per check CronJob —LogDeliveryTestConsecutiveFailuresandLoginTestsConsecutiveFailures. Each fires only after two consecutive failed runs; at the 3-hour cadence that means ~6 hours of real breakage and no single-flake noise. Deliberate dogfooding: the login tests verify the alerting stack’s own logins, and the alerting stack watches the tests. - Receivers: the default route lands in the CRC Alertmanager and is read in its UI and in Grafana (datasource wired 2026-10-24). No email/webhook receivers — owner’s pick; do not invent one.
- Tooling plane: the
agentopsAlertmanager routes the group-sync signal; its escalation design keys off thefailing_sincetimestamp group-sync records, so only long-lived group failures escalate. - Adjacent signal: Kyverno
PolicyReports on CRC are read like any other cluster signal (see observability.md).
Part B — How to use it
- Query metrics: the Prometheus UI (
prom.rhels.comfor the tooling plane; the CRC stack through Grafana Explore or its own route) — start from the metric, not the dashboard: check the series exists before wondering why a panel is empty. - See what is firing: Alertmanager UI (
alerts.rhels.com, or the CRC Alertmanager via Grafana’s Alerting view). An alert listed there has already passed its consecutive-failure bar — treat it as real until a direct probe says otherwise. - Silence an alert: create the silence in the Alertmanager UI with an expiry and a comment naming the issue. Silences are the one accepted UI-only action here; an unexplained silence is a finding, not a fix.
- Read test trends: the Lab Test Results dashboard in CRC
Grafana (tools/grafana.md) — runs, passed,
failed, per-check history. To verify a producer pushed, query the
Pushgateway’s own
/metricsor the CRC Prometheus for the run’s series before blaming the dashboard. - Add a scrape target: give the workload a
/metricsendpoint and aServiceMonitorin git (CRC) — never a hand-edited scrape config on the Prometheus pod. - Add an alert: a
PrometheusRulein the GitOps repo carrying the stack’s release label, an expression that requires a sustained condition (the consecutive-failure pattern above is the house style), and a summary that says what is broken and where to look. Alert rules added in a UI do not exist, as far as this lab is concerned.