From d22e6edcce7c413925513223f862a08f774e49f4 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Fri, 16 Oct 2026 18:03:49 +0200 Subject: [PATCH] kolla: Scrape the Ceph mgr when OSISM deploys Ceph The prometheus module of the Ceph mgr is enabled on every cephadm deployment (ceph_mgr_modules), but the Prometheus that OSISM deploys does not scrape it. On 2024.1 and 2024.2 the scrape job came from kolla-operations (prometheus.yml.d/50-ceph.yml). kolla-operations is not used from 2025.1 on, so since then a deployment has no Ceph metrics in Prometheus unless the operator adds a prometheus.yml.d overlay. kolla-ansible already has a ceph_mgr_exporter job for this, gated on enable_prometheus_ceph_mgr_exporter and fed by prometheus_ceph_mgr_exporter_endpoints. Turn it on when Prometheus is enabled, kolla-operations is not, and the ceph-mgr group has hosts, which is the case when OSISM deploys Ceph; with an external Ceph the group is empty. The endpoints are all ceph-mgr hosts on port 9283, at the same address kolla uses for the node exporter on those hosts (the API address, or prometheus_target_address). The module listens on all addresses. Standby mgrs answer with an empty body, so listing all of them makes the metrics follow the active mgr without duplicates. Tested on a 2026.1 deployment with three mgrs and Prometheus on the manager: osism apply prometheus renders the job with the three API addresses, all targets are up, ceph_health_status exists once, and after ceph mgr fail it comes from the new active mgr. The enable expression evaluates to false without a ceph-mgr group, with Prometheus off, and with kolla-operations on. A deployment that already scrapes the mgr through its own overlay gets the metrics twice, under two job names, until the overlay is removed. UpgradeImpact Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Roger Luethi --- all/099-kolla.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/all/099-kolla.yml b/all/099-kolla.yml index 4094a75..a92ac39 100644 --- a/all/099-kolla.yml +++ b/all/099-kolla.yml @@ -156,6 +156,13 @@ glance_enable_rolling_upgrade: "yes" # k8s volumes should be monitored inside the cluster and not by the node-exporter prometheus_node_exporter_cmdline_extras: "--collector.filesystem.mount-points-exclude=^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+|var/lib/kubelet/pods/.+)($|/)" +# prometheus ceph mgr exporter +# Scrape the prometheus module of every Ceph mgr when OSISM deploys Ceph. +# Standby mgrs answer with an empty body, so the metrics follow the active one. +# On 2024.1/2024.2 kolla-operations ships its own "ceph" job instead. +enable_prometheus_ceph_mgr_exporter: "{{ enable_prometheus | bool and not enable_kolla_operations | bool and groups['ceph-mgr'] | default([]) | length > 0 }}" +prometheus_ceph_mgr_exporter_endpoints: "{% set endpoints = [] %}{% for host in groups['ceph-mgr'] | default([]) %}{% set _ = endpoints.append('api' | kolla_address(host, override_var='prometheus_target_address') | put_address_in_context('url') ~ ':9283') %}{% endfor %}{{ endpoints }}" + ########################################################## # Custom features