Skip to content

mgr/prometheus: Add BlueStore fragmentation alert - #72889

Merged
afreen23 merged 1 commit into
ceph:mainfrom
AnuragRaut08:wip-bluestore-fragmentation-alert
Oct 29, 2026
Merged

afreen23 merged 1 commit into
ceph:mainfrom
AnuragRaut08:wip-bluestore-fragmentation-alert

Conversation

@AnuragRaut08

@AnuragRaut08 AnuragRaut08 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/81948
Signed-off-by: Anurag Raut [email protected]

PR Description:

The Prometheus alert rules for BlueStore free-space fragmentation need to identify affected OSDs and provide actionable troubleshooting information
This PR addresses this by:

  • Defining an alert rule to detect high BlueStore free-space fragmentation.
  • Including OSD-specific labels to identify affected OSDs.
  • Providing descriptive alert annotations with the fragmentation score and troubleshooting command.
  • Setting appropriate alert severity and type labels.

Validation covers rule syntax, metric scraping, and alert evaluation using controlled fragmentation metrics for multiple OSDs.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Comment thread src/pybind/mgr/prometheus/module.py Resolved

@abhidesai6 abhidesai6 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.

Add screenshot / screencast of the alert raised. Show UI alert screen, and prometheus alert condition.

Comment thread src/pybind/mgr/prometheus/module.py Resolved
@github-project-automation github-project-automation Bot moved this from New to Review in progress in Ceph-Dashboard Oct 26, 2026
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from bfaf84d to a089e8c Compare October 26, 2026 18:06
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@AnuragRaut08

Copy link
Copy Markdown
Contributor Author
image image

Added screenshots showing CephOSDFreeSpaceFragmentation firing in Prometheus and appearing as an active alert in the Ceph Dashboard.

Comment thread src/pybind/mgr/prometheus/module.py Resolved
Comment thread src/pybind/mgr/prometheus/module.py Resolved
Comment thread src/pybind/mgr/prometheus/module.py Resolved
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from a089e8c to 299272a Compare October 27, 2026 11:05
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from 299272a to 77e04eb Compare October 27, 2026 12:55

@cloudbehl cloudbehl 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.

Feels like we could simplify this a bit. We’re handling cert health checks separately here and skipping them again in the generic health-history loop. Could we define a shared constant for these checks and reuse it in both places? That way, we don’t have to maintain the same alert names in multiple places, and it’s easier to keep things in sync.

@abhidesai6

Copy link
Copy Markdown

Currently with your changes , we are only showing summary of message. We also want detail of each warned OSD in message.
Can you take care of this ?
image

[ceph: root@ceph-node-00 /]# ceph health detail --format json

{"status":"HEALTH_WARN","checks":{"BLUESTORE_FREE_FRAGMENTATION":{"severity":"HEALTH_WARN","summary":{"message":"6 OSD(s) experiencing high free space fragmentation of BlueStore","count":6},"detail":[{"message":" osd.0 0.000089"},{"message":" osd.1 0.000089"},{"message":" osd.2 0.000069"},{"message":" osd.3 0.000037"},{"message":" osd.4 0.000032"},{"message":" osd.5 0.000035"}],"muted":false}},"mutes":[]}
[ceph: root@ceph-node-00 /]# ceph health detail --format json | jq
{
  "status": "HEALTH_WARN",
  "checks": {
    "BLUESTORE_FREE_FRAGMENTATION": {
      "severity": "HEALTH_WARN",
      "summary": {
        "message": "6 OSD(s) experiencing high free space fragmentation of BlueStore",
        "count": 6
      },
      "detail": [
        {
          "message": " osd.0 0.000089"
        },
        {
          "message": " osd.1 0.000089"
        },
        {
          "message": " osd.2 0.000069"
        },
        {
          "message": " osd.3 0.000037"
        },
        {
          "message": " osd.4 0.000032"
        },
        {
          "message": " osd.5 0.000035"
        }
      ],
      "muted": false
    }
  },
  "mutes": []
}
[ceph: root@ceph-node-00 /]#

@AnuragRaut08

AnuragRaut08 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author
image Verified: `CephOSDFreeSpaceFragmentation` is firing as a warning, with the summary and details of all 6 affected OSDs included in the `message` label.
ceph_health_detail{cluster="8c9bcf82-d13e-11f1-8fb8-52540034b236", instance="ceph_cluster", job="ceph", message="6 OSD(s) experiencing high free space fragmentation of BlueStore. Affected OSDs: osd.0 0.000090, osd.1 0.000089, osd.2 0.000070, osd.3 0.000041, osd.4 0.000035, osd.5 0.000040", name="BLUESTORE_FREE_FRAGMENTATION", severity="HEALTH_WARN"}

@AnuragRaut08

Copy link
Copy Markdown
Contributor Author

Feels like we could simplify this a bit. We’re handling cert health checks separately here and skipping them again in the generic health-history loop. Could we define a shared constant for these checks and reuse it in both places? That way, we don’t have to maintain the same alert names in multiple places, and it’s easier to keep things in sync.

I’ve defined a shared HEALTH_CHECKS_WITH_MESSAGE constant and reused it in both places to keep the check names in sync.

@AnuragRaut08

Copy link
Copy Markdown
Contributor Author

jenkins test dashboard

@AnuragRaut08

Copy link
Copy Markdown
Contributor Author

jenkins test dashboard cephadm

@abhidesai6 abhidesai6 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

Comment thread src/pybind/mgr/prometheus/module.py Resolved
@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Ceph-Dashboard Oct 28, 2026
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from 95c59f7 to 6418a54 Compare October 28, 2026 10:45
Comment thread src/pybind/mgr/prometheus/module.py Resolved
Comment thread src/pybind/mgr/prometheus/module.py Resolved
Comment thread src/pybind/mgr/prometheus/module.py Resolved
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from 6418a54 to 0b00c7b Compare October 29, 2026 05:06
Populate the health detail message label and include affected OSD
details for BlueStore fragmentation. Add a dedicated Prometheus
alert with warning severity.

Fixes: https://tracker.ceph.com/issues/81948

Signed-off-by: Anurag Raut <[email protected]>
@AnuragRaut08
AnuragRaut08 force-pushed the wip-bluestore-fragmentation-alert branch from 0b00c7b to 6a49ee5 Compare October 29, 2026 05:10
@AnuragRaut08

Copy link
Copy Markdown
Contributor Author

Thanks @afreen23 Addressed all three suggestions in the latest commit:

  • Renamed alert_id to health_check.
  • Added and reused the BLUESTORE_FREE_FRAGMENTATION constant.
  • Renamed the helper to _process_health_checks_with_message and updated the corresponding tests.

@afreen23
afreen23 merged commit 2c7159f into ceph:main Oct 29, 2026
15 of 16 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Oct 29, 2026
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 2c7159f1c5e73fe4a98548abcbd5a00af8e130ce^..2c7159f1c5e73fe4a98548abcbd5a00af8e130ce

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/40835290468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants