From ec9dc3a8e2c2546d44e6c80f6d7022882615d47f Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 23 Nov 2018 14:34:49 +0100 Subject: [PATCH] mgr/prometheus: add interface and objectstore to osd metadata This adds three new labels to the osd_metadata metric: - back_iface - front_iface - objectstore Signed-off-by: Jan Fajerski --- src/pybind/mgr/prometheus/module.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 662da96b72b..cc94661c237 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -59,8 +59,9 @@ MDS_METADATA = ('ceph_daemon', 'fs_id', 'hostname', 'public_addr', 'rank', MON_METADATA = ('ceph_daemon', 'hostname', 'public_addr', 'rank', 'ceph_version') -OSD_METADATA = ('ceph_daemon', 'cluster_addr', 'device_class', 'hostname', - 'public_addr', 'ceph_version') +OSD_METADATA = ('back_iface', 'ceph_daemon', 'cluster_addr', 'device_class', + 'front_iface', 'hostname', 'objectstore', 'public_addr', + 'ceph_version') OSD_STATUS = ['weight', 'up', 'in'] @@ -432,12 +433,25 @@ class Module(MgrModule): host_version = servers.get((str(id_), 'osd'), ('','')) + # collect disk occupation metadata + osd_metadata = self.get_metadata("osd", str(id_)) + if osd_metadata is None: + continue + + obj_store = osd_metadata.get('osd_objectstore', '') + f_iface = osd_metadata.get('front_iface', '') + b_iface = osd_metadata.get('back_iface', '') + self.metrics['osd_metadata'].set(1, ( + b_iface, 'osd.{}'.format(id_), c_addr, dev_class, + f_iface, host_version[0], - p_addr, host_version[1] + obj_store, + p_addr, + host_version[1] )) # collect osd status @@ -447,11 +461,6 @@ class Module(MgrModule): 'osd.{}'.format(id_), )) - # collect disk occupation metadata - osd_metadata = self.get_metadata("osd", str(id_)) - if osd_metadata is None: - continue - osd_objectstore = osd_metadata.get('osd_objectstore', None) if osd_objectstore == "filestore": # collect filestore backend device -- 2.39.5