Update customrules.yaml adjust recording rule to correct metric#80
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughFour Prometheus recording rules in the ceph-operations alerts chart were modified to compute rates instead of raw cumulative values. Byte metrics now use ChangesCeph Objectstore Recording Rules
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
charts/ceph-operations/alerts/customrules.yaml (2)
11-11: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winPrefer
rateoveriratein recording rules.
irateonly considers the last two samples within the range vector, which makes it unsuitable for recording rules — any alert or dashboard querying the recorded metric will miss spikes that occurred between evaluations. Prometheus best practices recommendratefor recording rules because it averages over all samples in the window, producing a smoother and more reliable series. Consider usingrateconsistently for all four rules.♻️ Proposed fix
- irate(radosgw_bytes_received[5m]), + rate(radosgw_bytes_received[5m]),- irate(radosgw_bytes_sent[5m]), + rate(radosgw_bytes_sent[5m]),Also applies to: 20-20
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/ceph-operations/alerts/customrules.yaml` at line 11, The recording rules in customrules.yaml use irate for radosgw metrics, but recording rules should use rate to produce stable series. Update the radosgw_bytes_received rule and the other related recording rules in this block to use rate consistently instead of irate, keeping the existing metric names and query structure intact.
11-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
_totalsuffix is now semantically misleading.The recording rules are named
objectstore_bytes_received_total,objectstore_bytes_sent_total,objectstore_read_ops_total, andobjectstore_write_ops_total, but after wrapping the source metrics withirate/rate, the recorded values are per-second rates, not cumulative totals. Downstream queries or alerts referencing these names may assume monotonic counters. Consider renaming to drop the_totalsuffix (e.g.,objectstore_bytes_received_per_second,objectstore_read_ops_per_second).Also applies to: 20-20, 29-29, 38-38
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/ceph-operations/alerts/customrules.yaml` at line 11, The recording rule names in customrules.yaml are misleading because the values produced by rate/irate are per-second rates, not cumulative totals. Rename the affected objectstore recording rules to remove the _total suffix and use a rate-oriented suffix like _per_second, updating the corresponding rule names that use irate/rate so downstream queries and alerts align with the semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@charts/ceph-operations/alerts/customrules.yaml`:
- Line 11: The recording rules in customrules.yaml use irate for radosgw
metrics, but recording rules should use rate to produce stable series. Update
the radosgw_bytes_received rule and the other related recording rules in this
block to use rate consistently instead of irate, keeping the existing metric
names and query structure intact.
- Line 11: The recording rule names in customrules.yaml are misleading because
the values produced by rate/irate are per-second rates, not cumulative totals.
Rename the affected objectstore recording rules to remove the _total suffix and
use a rate-oriented suffix like _per_second, updating the corresponding rule
names that use irate/rate so downstream queries and alerts align with the
semantics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 866888fa-ccfd-45be-b866-79d37a3a2451
📒 Files selected for processing (1)
charts/ceph-operations/alerts/customrules.yaml
Summary by CodeRabbit