Skip to content

Update customrules.yaml adjust recording rule to correct metric#80

Merged
sumitarora2786 merged 4 commits into
mainfrom
sumitarora2786-patch-1
Jul 8, 2026
Merged

Update customrules.yaml adjust recording rule to correct metric#80
sumitarora2786 merged 4 commits into
mainfrom
sumitarora2786-patch-1

Conversation

@sumitarora2786

@sumitarora2786 sumitarora2786 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved object storage monitoring metrics by calculating byte and operation rates over a 5-minute window.
    • This helps produce more accurate and stable dashboard and alert values for reads, writes, and transferred bytes.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@sumitarora2786, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1c158a8-c9ed-4988-9525-a99bb178b423

📥 Commits

Reviewing files that changed from the base of the PR and between cfcca9b and e0d5e18.

📒 Files selected for processing (3)
  • charts/ceph-operations/Chart.yaml
  • charts/ceph-operations/alerts/customrules.yaml
  • charts/ceph-operations/plugindefinition.yaml
📝 Walkthrough

Walkthrough

Four Prometheus recording rules in the ceph-operations alerts chart were modified to compute rates instead of raw cumulative values. Byte metrics now use irate(...[5m]) and operation count metrics now use rate(...[5m]) within their respective label_replace expressions.

Changes

Ceph Objectstore Recording Rules

Layer / File(s) Summary
Rate-based metric calculation
charts/ceph-operations/alerts/customrules.yaml
The objectstore_bytes_received_total, objectstore_bytes_sent_total, objectstore_read_ops_total, and objectstore_write_ops_total recording rules now wrap their source metrics with irate(...[5m]) or rate(...[5m]) instead of referencing raw counters directly.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the change set and correctly points to updating recording rules in customrules.yaml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sumitarora2786-patch-1

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
charts/ceph-operations/alerts/customrules.yaml (2)

11-11: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Prefer rate over irate in recording rules.

irate only 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 recommend rate for recording rules because it averages over all samples in the window, producing a smoother and more reliable series. Consider using rate consistently 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

_total suffix is now semantically misleading.

The recording rules are named objectstore_bytes_received_total, objectstore_bytes_sent_total, objectstore_read_ops_total, and objectstore_write_ops_total, but after wrapping the source metrics with irate/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 _total suffix (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

📥 Commits

Reviewing files that changed from the base of the PR and between 43476e6 and cfcca9b.

📒 Files selected for processing (1)
  • charts/ceph-operations/alerts/customrules.yaml

@senolcolak senolcolak left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sumitarora2786
sumitarora2786 merged commit 763a018 into main Jul 8, 2026
5 checks passed
@sumitarora2786
sumitarora2786 deleted the sumitarora2786-patch-1 branch July 8, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants