Skip to content

Commit

Permalink
mgr/prometheus: add interface and objectstore to osd metadata
Browse files Browse the repository at this point in the history
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 ec9dc3a)
  • Loading branch information
Jan Fajerski authored and k0ste committed Feb 27, 2019
1 parent 98259b2 commit 23861c1
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/pybind/mgr/prometheus/module.py
Expand Up @@ -91,8 +91,9 @@ def health_status_to_number(status):

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']

Expand Down Expand Up @@ -464,12 +465,25 @@ def get_metadata_and_osd_status(self):

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
Expand All @@ -479,11 +493,6 @@ def get_metadata_and_osd_status(self):
'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
Expand Down

0 comments on commit 23861c1

Please sign in to comment.