Skip to content

mon: surface data dir + db size as perf counters - #68916

Merged
ifed01 merged 1 commit into
ceph:mainfrom
lumir-sliva:mon-data-perf-counters
Aug 19, 2026
Merged

ifed01 merged 1 commit into
ceph:mainfrom
lumir-sliva:mon-data-perf-counters

Conversation

@lumir-sliva

Copy link
Copy Markdown
Contributor

Summary

HealthMonitor::check_member_health() already collects filesystem stats for the data directory and the estimated on-disk size of the monitor key/value store every tick, and uses them to raise MON_DISK_LOW/CRIT/BIG. The values aren't surfaced anywhere else, so there's no way to trend monitor DB growth or available space on the filesystem hosting mon_data.

This adds four counters to the existing mon perf-counter group, set from check_member_health() after the stats are populated:

  • data_disk_total_bytes — filesystem total
  • data_disk_avail_bytes — filesystem available
  • data_disk_avail_percent — filesystem available, as a percentage
  • db_total_bytes — estimated on-disk size of the key/value store

They're tagged PRIO_USEFUL, so they propagate to the prometheus mgr module and ceph-exporter (both consume daemon perf counters at that priority) and appear as ceph_mon_* metrics with the ceph_daemon label.

No new config option, no admin-socket additions, no API change.

Tracker: https://tracker.ceph.com/issues/76589

Verification

Built on a vstart cluster, 1 mon + 1 mgr + 1 osd.

ceph daemon mon.a perf dump mon:

{
  "mon": {
    "num_sessions": 6,
    "session_add": 1,
    "session_rm": 26,
    "session_trim": 0,
    "num_elections": 2,
    "election_call": 0,
    "election_win": 2,
    "election_lose": 0,
    "data_disk_total_bytes": 211483705344,
    "data_disk_avail_bytes": 99612540928,
    "data_disk_avail_percent": 47,
    "db_total_bytes": 932419
  }
}

ceph daemon mon.a perf schema (new entries only):

"data_disk_total_bytes": {
  "type": 2, "metric_type": "gauge", "value_type": "integer",
  "description": "Total size of the filesystem hosting the monitor data directory",
  "nick": "dtot", "priority": 5, "units": "bytes"
},
"data_disk_avail_bytes": {
  "type": 2, "metric_type": "gauge", "value_type": "integer",
  "description": "Available space on the filesystem hosting the monitor data directory",
  "nick": "davb", "priority": 5, "units": "bytes"
},
"data_disk_avail_percent": {
  "type": 2, "metric_type": "gauge", "value_type": "integer",
  "description": "Available space on the filesystem hosting the monitor data directory, as a percentage",
  "nick": "dpct", "priority": 5, "units": "none"
},
"db_total_bytes": {
  "type": 2, "metric_type": "gauge", "value_type": "integer",
  "description": "Estimated on-disk size of the monitor key/value store",
  "nick": "dbsz", "priority": 5, "units": "bytes"
}

prometheus mgr module endpoint (exclude_perf_counters=false):

# HELP ceph_mon_data_disk_total_bytes Total size of the filesystem hosting the monitor data directory
# TYPE ceph_mon_data_disk_total_bytes gauge
ceph_mon_data_disk_total_bytes{ceph_daemon="mon.a"} 211483705344.0
# HELP ceph_mon_data_disk_avail_bytes Available space on the filesystem hosting the monitor data directory
# TYPE ceph_mon_data_disk_avail_bytes gauge
ceph_mon_data_disk_avail_bytes{ceph_daemon="mon.a"} 99607396352.0
# HELP ceph_mon_data_disk_avail_percent Available space on the filesystem hosting the monitor data directory, as a percentage
# TYPE ceph_mon_data_disk_avail_percent gauge
ceph_mon_data_disk_avail_percent{ceph_daemon="mon.a"} 47.0
# HELP ceph_mon_db_total_bytes Estimated on-disk size of the monitor key/value store
# TYPE ceph_mon_db_total_bytes gauge
ceph_mon_db_total_bytes{ceph_daemon="mon.a"} 2148576.0

ceph-exporter endpoint (same names, same descriptions, since both scrape the same schema):

ceph_mon_data_disk_total_bytes{ceph_daemon="mon.a"} 211483705344
ceph_mon_data_disk_avail_bytes{ceph_daemon="mon.a"} 99506790400
ceph_mon_data_disk_avail_percent{ceph_daemon="mon.a"} 47
ceph_mon_db_total_bytes{ceph_daemon="mon.a"} 2607983

db_total_bytes is visibly growing across scrapes (932 419 → 2 148 576 → 2 607 983 bytes over a few minutes) as the mon writes maps/keys, which is what trending is meant to expose.

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)
    • Includes unit test(s)
    • Includes integration test(s)
    • Includes bug reproducer
    • No tests

@lumir-sliva
lumir-sliva requested a review from a team as a code owner May 14, 2026 18:17
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

20 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@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

@lumir-sliva
lumir-sliva force-pushed the mon-data-perf-counters branch from bc3bb10 to 59033d6 Compare June 16, 2026 06:50
@lumir-sliva

Copy link
Copy Markdown
Contributor Author

@ceph/core mind taking a look when you get a chance? Adds four mon perf gauges (data dir total/avail/avail_percent + db total bytes) that auto-surface as ceph_mon_* via prometheus and ceph-exporter. Anthony D'Atri's tracker enhancement. Rebased on main, all green.

@lumir-sliva

Copy link
Copy Markdown
Contributor Author

@rzarzynski mind taking a look when you get a chance, or pointing me to the right person? (the @ceph/core mention above doesn't notify since I'm not in the org)

@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

The HealthMonitor already collects filesystem stats and the estimated
size of the monitor's key/value store on every tick, and uses them to
raise MON_DISK_LOW/CRIT/BIG.  They are not exposed anywhere else, so
there is no way to trend monitor DB growth or available space on the
filesystem hosting mon_data.

Register four new counters in the existing mon perf-counter group and
set them from HealthMonitor::check_member_health() after the stats are
populated:

  data_disk_total_bytes    - filesystem total
  data_disk_avail_bytes    - filesystem available
  data_disk_avail_percent  - filesystem available, as a percentage
  db_total_bytes           - estimated on-disk size of the kv store

They are tagged PRIO_USEFUL, so they surface automatically as
ceph_mon_* Prometheus metrics via the prometheus mgr module and via
ceph-exporter (both consume daemon perf counters at that priority).

Tracker: https://tracker.ceph.com/issues/76589
Signed-off-by: Lumir Sliva <[email protected]>
@lumir-sliva
lumir-sliva force-pushed the mon-data-perf-counters branch from 59033d6 to ab30aa8 Compare July 21, 2026 08:52
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath10-testing-20260806.013257-main.

@lee-j-sanders

Copy link
Copy Markdown
Member

@ifed01
ifed01 merged commit d811619 into ceph:main Aug 19, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

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

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants