PR1.5 (P0): fix rules-consumer gap + scrape drops blocking Sloth SLO verification - #7
Merged
Merged
Conversation
…locked, dead job/bucket fixed Live verification of PR1 (Sloth SLOs, #6) failed: slo:current_burn_rate:ratio returned nothing because this lab's standalone `prometheus` chart reads no monitoring.coreos.com CRs — Sloth's Deployment generated correct PrometheusRules that nothing ever consumed. Four fixes (F1-F4 in the 2026-07-03 diagnosis): - F1: retire the Sloth runtime chart/CRDs (pure overhead, zero consumers). prometheusservicelevels.yaml is now a build-time spec rendered by the pinned `sloth` CLI via provisioning/scripts/gen_slos.sh (`just gen-slos`) into plain rule groups embedded in prometheus/values.yaml's serverFiles.recording_rules.yml / .alerting_rules.yml — the paths serverFiles.prometheus.yml's rule_files already pointed at. Added .github/workflows/slo-drift.yml to fail CI on spec/rendered-rule drift. - F2: allow kube-state-metrics' 8080/8081 through the monitoring l7-visibility CNP — KSM's scrape job existed and KSM was healthy, but the CNP only allowlisted 9090/3000/80, so every same-node scrape timed out. - F3: delete the fictional rook-ceph-operator:2112 scrape job/CNP rule (that Service never existed — the operator ships no Prometheus endpoint); add the real rook-ceph-exporter:9926 job instead. - F4: ceph-osd-latency's le="0.049999" bucket doesn't exist — verified live against ceph_osd_op_w_latency_bucket, corrected to le="0.099999". Objective becomes p99 < 100ms, not <50ms; updated the SLO spec and mach-2 dashboard's Row 3 panel description to match. Also documented as CLAUDE.md gotchas #24 (build-time SLO rendering) and #25 (CNP port allowlisting for new scrape targets). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Live verification of PR1 (#6, Sloth SLOs) failed:
slo:current_burn_rate:ratioreturned nothing for all four SLOs. This PR is the diagnosed fix (the "F1-F4" findings from 2026-07-03's live diagnosis) that unblocks re-running that verification.F1 — Sloth's rules never loaded, root-caused: this lab runs the standalone community
prometheuschart, which reads nomonitoring.coreos.comCRs (no ServiceMonitor/PrometheusRule controller —prometheus-operator-crdsships CRD schemas only). Sloth's Deployment was generating perfectly correctPrometheusRuleCRs that nothing ever consumed.applications/infrastructure/sloth/{config.json,kustomization.yaml,values.yaml}).prometheusservicelevels.yamlis now a build-time-only spec.provisioning/scripts/gen_slos.sh(just gen-slos) — runs the pinnedslothCLI (v0.16.0, matching the retired chart version) against the spec and splices the rendered rule groups intoapplications/infrastructure/prometheus/values.yaml'sserverFiles.recording_rules.yml/.alerting_rules.yml, which is exactly whereserverFiles.prometheus.yml'srule_files:already pointed (wired and waiting since PR1)..github/workflows/slo-drift.yml— fails PRs where the spec and rendered rules disagree.kustomize build --enable-helm applications/infrastructure/prometheusrenders a ConfigMap with realgroups:content under both keys;gen_slos.shis idempotent (reran twice, zero diff).F2 — kube-state-metrics scrape silently dropped by CNP: KSM's job existed, KSM was healthy, but
monitoring/l7-visibility's CiliumNetworkPolicy only allowlisted ports 9090/3000/80 — every same-node scrape to KSM's 8080/8081 timed out (context deadline exceeded). Added 8080/8081 to the allowlist.F3 — fictional scrape job removed:
rook-ceph-operator:2112targeted a Service that has never existed (the Rook operator ships no Prometheus endpoint). Deleted the scrape job and the matching CNP rule; added the realrook-ceph-exporter:9926job instead (verified live: the Service exists with that exact port).F4 — wrong histogram bucket, verified live:
ceph-osd-latency'sle="0.049999"was a reasoned-but-wrong guess — that bucket doesn't exist.ceph_osd_op_w_latency_bucketis a 2× ladder starting atle="0.099999". Corrected the SLI query; the SLO's real objective is p99 < 100ms, not <50ms. Updated the SLO description andceph-observability-mach-2.jsonRow 3's panel description to match (previously said "< 50ms").Also updated
CLAUDE.md: removed the sloth wave-33 row from the sync-wave table (no longer a deployed app), added gotcha #24 (build-time SLO rendering pipeline) and #25 (CNP port allowlisting for new scrape targets in CNP'd namespaces).Cluster-affecting note
The live
slothArgoCD Application has theresources-finalizer.argocd.argoproj.iofinalizer set, so once this is merged andceph-lab-rootsyncs, ArgoCD will cascade-delete the Sloth Deployment, its CRDs, and the 4PrometheusServiceLevelCRs from the cluster. This is intentional (that's the "retire the runtime app" part of F1) but worth knowing before you sync.Test plan
kustomize build --enable-helm applications/infrastructure/prometheussucceeds, rendersrecording_rules.yml/alerting_rules.ymlwith real rule groupskustomize build --enable-helm applications/infrastructure/l7-policiessucceedsgen_slos.shre-run twice produces zero diff (idempotent)rook-ceph-exporterService confirmed live atrook-ceph-exporter.rook-ceph.svc.cluster.local:9926le="0.049999"references outside historical/explanatory commentsslo:current_burn_rate:ratio{sloth_id=...}series appear in Prometheus (the actual PR1 verification gate)upin Prometheus🤖 Generated with Claude Code