Project

General

Profile

Actions

Enhancement #76589

closed
AD LS

Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem

Enhancement #76589: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem

Added by Anthony D'Atri 7 months ago. Updated 3 months ago.

Status:
Backporting
Priority:
Normal
Assignee:
Category:
Monitor
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
squid tentacle umbrella
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Tags (freeform):
Fixed In:
v21.3.0-2145-gd811619430
Released In:
Upkeep Timestamp:
2026-08-27T18:46:08+00:00

Related issues 3 (2 open — 1 closed)

Copied to Ceph - Backport #79613: squid: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystemFix Under ReviewLumir Sliva

Actions
Copied to Ceph - Backport #79614: tentacle: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystemResolvedLumir Sliva

Actions
Copied to Ceph - Backport #79618: umbrella: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystemFix Under ReviewLumir Sliva

Actions

AD Updated by Anthony D'Atri 7 months ago Actions #1

  • Tags set to low-hanging-fruit
  • Subject changed from Surface Prometheus metrics for the size of each mon to Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem
  • Category set to Monitor

It would be useful for trending to surface the size of each mon's DB as a Prometheus metric,.

In HealthMonitor.cc around line 604 we see `stats.store_stats.bytes_total` and `stats.fs_stats.avail_percent`, so this should simply be a matter of surfacing.

`src/pybind/mgr/prometheus/module.py` and `src/exporter/DaemonMetricCollector.cc` may be of interest.

LS Updated by Lumir Sliva 7 months ago Actions #2

  • Status changed from New to In Progress
  • Assignee set to Lumir Sliva

Taking this. Branch mon-data-perf-counters adds four per-mon perf counters in the existing mon group:

  • 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 mon key/value store

Values come from stats.fs_stats.* and stats.store_stats.bytes_total that HealthMonitor::check_member_health() already collects on every tick. They surface automatically as ceph_mon_* Prometheus metrics via the prometheus mgr module and ceph-exporter (both consume daemon perf counters at PRIO_USEFUL). No new config option; no admin-socket additions.

Build and verify on a vstart cluster next, PR to follow.

LS Updated by Lumir Sliva 7 months ago Actions #3

  • Pull request ID set to 68916

PR submitted: https://github.com/ceph/ceph/pull/68916

Verified on vstart (1 mon + 1 mgr + 1 osd):

  • perf dump mon and counter dump both show the four new counters
  • perf schema reports them as priority: 5 (PRIO_USEFUL), units: bytes where applicable, gauge
  • prometheus mgr module exposes them at /metrics as ceph_mon_{data_disk_total_bytes,data_disk_avail_bytes,data_disk_avail_percent,db_total_bytes} with ceph_daemon="mon.a" label (set mgr/prometheus/exclude_perf_counters to false to see them)
  • ceph-exporter exposes the same names/descriptions on its endpoint (default scrape path)
  • db_total_bytes visibly grows across scrapes as the mon writes maps/keys, which is what trending is meant to expose

UB Updated by Upkeep Bot 4 months ago Actions #4

  • Status changed from In Progress to Resolved
  • Merge Commit set to d811619430dcc47dd3c7ecc279c58cb11181f0fb
  • Fixed In set to v21.3.0-2145-gd811619430
  • Upkeep Timestamp set to 2026-08-19T07:55:59+00:00

LS Updated by Lumir Sliva 4 months ago Actions #5

  • Status changed from Resolved to Pending Backport
  • Backport set to squid tentacle

UB Updated by Upkeep Bot 4 months ago Actions #6

  • Copied to Backport #79613: squid: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem added

UB Updated by Upkeep Bot 4 months ago Actions #7

  • Copied to Backport #79614: tentacle: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem added

UB Updated by Upkeep Bot 4 months ago Actions #8

  • Tags (freeform) set to backport_processed

LS Updated by Lumir Sliva 4 months ago Actions #9

  • Backport changed from squid tentacle to squid tentacle umbrella

LS Updated by Lumir Sliva 4 months ago Actions #10

  • Copied to Backport #79618: umbrella: Surface Prometheus metrics for the size of each mon's db and the amount of free space on the db's filesystem added

UB Updated by Upkeep Bot 3 months ago Actions #11

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-08-19T07:55:59+00:00 to 2026-08-27T18:46:08+00:00
Actions

Also available in: PDF Atom