STOR-3222: Promtool unit tests for Storage Path Alerting #775
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 373 lines diff across 4 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.354
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #775"
general
weight: 0.35
rvagner78
Refactor volume path health rules into reusable topology recordings and use them in definition of Alerts. Added promtool unit tests.
Running the unit tests
Install the pinned promtool and run all fixtures:
This uses
go install -mod=mod github.com/prometheus/prometheus/cmd/promtool@v0.316.0with a repository-local GOBIN (_output/tools/bin). Go caches module downloads and compilation results. Go and network access are required; no container runtime is needed. These tests also run throughmake verify(the required CI verify job) andmake check. The vendor-mode override applies only to tool installation, not to the operator build.To use an existing binary without installation, invoke the script directly:
Prefix either command with
PROMTOOL_DEBUG=1for detailed evaluation output.Recording-rule scope and cardinality
The metadata recordings are kept separate from device joins so normalization, deduplication, and matching keys remain explicit. The bound-claim recording intentionally covers all distinct nonempty volume names reported by Bound PVCs, including non-CSI volumes; the downstream PV-context join restricts its use to CSI PVs. This scope is unchanged by the review follow-up.
At each evaluation, for C distinct (persistentvolume, driver, volume_handle) CSI tuples and B distinct volume names reported by Bound PVCs, the three metadata recordings contribute at most 2C + B series. They are not gated on exporter mappings or path-health data, so their cardinality cost also applies on platforms without multipath/NVMe health data. Device topology recordings add series for matching node/device mappings. These recording names and label sets are query-visible interfaces.
STOR-3188 missing-mapping semantics: path alerts do not latch. Once an exporter mapping is absent from query results, its device recordings and path alerts clear even if the volume remains unreachable. Disappearance follows staleness/lookback behavior rather than necessarily happening immediately on detachment; returning mappings restart alert timers.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Storage alerts now include relevant volume and claim context when available, while continuing to report volumes without a matching claim.
Added
make verify-prometheus-rulesto validate Prometheus rules and run alert scenarios; it is also included inmake verify.Bug Fixes
Improved alert context for multipath and NVMe devices, including handling of missing or stale mappings and health metrics.
Documentation
* Added guidance on alert behavior and running and extending the Prometheus rule tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->