From: Jan Fajerski Date: Fri, 23 Nov 2018 13:34:49 +0000 (+0100) Subject: mgr/prometheus: add interface and objectstore to osd metadata X-Git-Tag: v12.2.12~13^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=23861c1c9950cdb745ba0f020fa8afc10d9aaf1e;p=ceph.git 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 (cherry picked from commit ec9dc3a8e2c2546d44e6c80f6d7022882615d47f) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index fc013fb8591..289032fbe19 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -91,8 +91,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'] @@ -464,12 +465,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 @@ -479,11 +493,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