πŸ™ Ceph Mgr Prometheus Module

🎯 Purpose

The ceph-mgr Prometheus module exposes Ceph cluster metrics for Prometheus and Grafana. In this environment, it provides:


βš™οΈ How It Works


🧩 Key Concepts

πŸ“Š Cluster Metrics

These metric families come from the active manager and describe the whole cluster:

πŸ’½ OSD and Pool Metrics

The ceph_daemon label identifies a daemon, such as osd.0 or mon.pve-0. Pool metrics use the pool_id label; join with ceph_pool_metadata to get the pool name.

πŸ“ˆ Per-Daemon Performance Counters

Since Ceph Reef, per-daemon performance counters (such as ceph_osd_op_r_latency_sum and ceph_osd_op_w) are excluded from the manager module by default. They are expected to come from cephadm’s ceph-exporter daemon, which Proxmox does not deploy.

This environment sets mgr/prometheus/exclude_perf_counters to false, so the manager module exports them instead.


πŸ“ Configuration & Service

Configuration: Stored in the Ceph configuration database, not in a file. View it with ceph config get mgr mgr/prometheus/<option>.

Service: ceph-mgr@<node> (systemd), for example ceph-mgr@pve-0

Listener: :::9283 by default (all addresses)

Module settings managed by Ansible:

Prometheus settings (roles/prometheus_setup/defaults/main/main.yml):

The module needs no credentials and serves metrics without authentication.


πŸš€ Deployment

The ceph_nodes inventory group contains the Proxmox Ceph nodes. Enable and configure the module with:

source /opt/python_3.12/bin/activate
ansible-playbook -i inventory/pve/inventory.ini playbooks/proxmox/deploy_pve_monitoring.yml

The Ceph tasks run once, on the first host in ceph_nodes, because the module is cluster-wide. The same playbook also deploys Node Exporter and PVE Exporter to the Proxmox nodes.

Refresh Prometheus scrape targets after inventory changes:

ansible-playbook playbooks/prometheus/deploy_prometheus_exporters.yml

This refresh command uses the repository’s full combined inventory (inventory/); do not limit it to inventory/pve/, or exporter groups from other inventories will be omitted from that run.

Deploy the Ceph alert rules with the main Prometheus playbook, then refresh the exporter targets again:

ansible-playbook -i inventory/prometheus/inventory.ini playbooks/prometheus/deploy_prometheus.yml
ansible-playbook playbooks/prometheus/deploy_prometheus_exporters.yml

Syntax-check the deployment playbook before applying changes:

ansible-playbook -i inventory/pve/inventory.ini --syntax-check playbooks/proxmox/deploy_pve_monitoring.yml

Deploying the Ceph Mgr Prometheus Module to Proxmox_Nodes runbook provides a comprehensive instruction on deploying Ceph Mgr using Ansible.


πŸ”” Alert Rules

The ceph group in prometheus.rules.yml contains:

prometheus.yml does not currently have an alerting: section, so these alerts appear in Prometheus and Grafana but are not sent to Alertmanager.


πŸ” Common Prometheus Queries


πŸ“Š Grafana Usage Notes

The Proxmox VE Status dashboard uses the ceph job for its Ceph Health, OSDs Up / Total, Capacity Used, Monitors In Quorum, and Pool Usage panels. The pve_exporter and Node Exporter jobs provide the Proxmox API and host-level metrics for the same nodes.

Because the standby managers return no Ceph data, dashboard queries wrap Ceph metrics in max or max by (...) so a manager failover does not create duplicate or broken series.


πŸ› οΈ Troubleshooting

❌ Ceph Target Is Down

Check:

πŸ“­ Targets Are Up but There Is No Ceph Data

Check:

This is the condition that triggers CephMetricsAbsent.

πŸ“ˆ Per-OSD Latency or Operation Metrics Are Missing

Check:

πŸ› οΈ Quick Verification Commands

ceph mgr stat
ceph mgr services
ceph mgr module ls | grep prometheus
systemctl status ceph-mgr@$(hostname)
journalctl -u ceph-mgr@$(hostname) -n 50 --no-pager
curl -s http://localhost:9283/metrics | grep '^ceph_health_status'

Run the curl command on the node with the active manager; on a standby node it returns nothing.


πŸ” Security & Operational Guidance


🧾 Summary

The ceph-mgr Prometheus module exposes Ceph cluster, OSD, and pool metrics from the active manager for Prometheus to scrape. Prometheus scrapes every Ceph node so it follows manager failovers, and the ceph alert group and Proxmox dashboard make cluster health and capacity visible alongside the PVE exporter and Node Exporter metrics.