Skip to content

Commit

Permalink
pybind/mgr/prometheus: add device_class label to osd metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
  • Loading branch information
Jan Fajerski authored and John Spray committed Sep 27, 2017
1 parent 49b3ff8 commit 76d1918
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pybind/mgr/prometheus/module.py
Expand Up @@ -300,16 +300,17 @@ def get_mon_status(self):
def get_osd_status(self):
'''TODO add device_class label!!!'''
osd_status = self.get('osd_stats')['osd_stats']
osd_devs = self.get('osd_metadata')
osd_dev = self.get('osd_map_crush')['devices']
for osd in osd_status:
id_ = osd['osd']
dev_class = :q
dev_class = next((osd for osd in osd_dev if osd['id'] == id_))
for stat in OSD_STATS:
path = 'osd_{}'.format(stat)
self.metrics[path].set(osd[stat], (id_,))
for p_stat in OSD_PERF_STAT:
path = 'osd_{}'.format(stat)
self.metrics[path].set(osd['perf_stat'][stat], (id_,))
self.metrics[path].set(osd[stat], (id_,dev_class['class']))
for p_stat in OSD_PERF_STATS:
path = 'osd_{}'.format(p_stat)
self.metrics[path].set(osd['perf_stat'][p_stat],
(id_,dev_class['class']))

def get_pg_status(self):
pg_s = self.get('pg_summary')['by_osd']
Expand Down

0 comments on commit 76d1918

Please sign in to comment.