mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
pybind/mgr/prometheus: actually emit reported pg counts
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
This commit is contained in:
parent
ead0973d7d
commit
c288624eed
@ -310,10 +310,15 @@ class Module(MgrModule):
|
||||
for osd in pg_s:
|
||||
reported_pg_s = [(s,v) for key, v in pg_s[osd].items() for s in
|
||||
key.split('+')]
|
||||
for state, value in reported_pg_s:
|
||||
path = 'pg_{}'.format(state)
|
||||
self.metrics[path].set(value, (osd,))
|
||||
reported_states = [s[0] for s in reported_pg_s]
|
||||
for state in PG_STATES:
|
||||
path = 'pg_{}'.format(state)
|
||||
if state not in reported_pg_s:
|
||||
self.metrics[path].set(0, ('osd.{}'.format(osd),))
|
||||
self.log.debug('rep_pgs: {}'.format(reported_pg_s))
|
||||
if state not in reported_states:
|
||||
self.metrics[path].set(0, (osd,))
|
||||
|
||||
def collect(self):
|
||||
self.get_health()
|
||||
|
Loading…
Reference in New Issue
Block a user