]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: add interface and objectstore to osd metadata
authorJan Fajerski <jfajerski@suse.com>
Fri, 23 Nov 2018 13:34:49 +0000 (14:34 +0100)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Wed, 27 Feb 2019 04:11:28 +0000 (11:11 +0700)
This adds three new labels to the osd_metadata metric:
- back_iface
- front_iface
- objectstore

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit ec9dc3a8e2c2546d44e6c80f6d7022882615d47f)

src/pybind/mgr/prometheus/module.py

index fc013fb8591277394b308368b8c13824d01dbc9f..289032fbe1970fab96631957e88a1341a63a5d86 100644 (file)
@@ -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