mirror of
https://github.com/ceph/ceph
synced 2025-01-04 10:12:30 +00:00
mgr/prometheus: add missing 'deep' state to PG_STATES in ceph-mgr prometheus plugin
without this the endpoint throws 500s when any PG is doing a deep scrub. Signed-off-by: Peter Woodman <peter@shortbus.org> Fixes: http://tracker.ceph.com/issues/22116
This commit is contained in:
parent
664a2f9fae
commit
8c93c0eeaf
@ -42,7 +42,7 @@ def health_status_to_number(status):
|
|||||||
elif status == 'HEALTH_ERR':
|
elif status == 'HEALTH_ERR':
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
PG_STATES = ['creating', 'active', 'clean', 'down', 'scrubbing', 'degraded',
|
PG_STATES = ['creating', 'active', 'clean', 'down', 'scrubbing', 'deep', 'degraded',
|
||||||
'inconsistent', 'peering', 'repair', 'recovering', 'forced-recovery',
|
'inconsistent', 'peering', 'repair', 'recovering', 'forced-recovery',
|
||||||
'backfill', 'forced-backfill', 'wait-backfill', 'backfill-toofull',
|
'backfill', 'forced-backfill', 'wait-backfill', 'backfill-toofull',
|
||||||
'incomplete', 'stale', 'remapped', 'undersized', 'peered']
|
'incomplete', 'stale', 'remapped', 'undersized', 'peered']
|
||||||
@ -266,12 +266,15 @@ class Module(MgrModule):
|
|||||||
try:
|
try:
|
||||||
self.metrics[path].set(value)
|
self.metrics[path].set(value)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warn('Skipping unknown PG State {}'.format(state))
|
self.log.warn("skipping pg in unknown state {}".format(state))
|
||||||
reported_states = [s[0] for s in reported_pg_s]
|
reported_states = [s[0] for s in reported_pg_s]
|
||||||
for state in PG_STATES:
|
for state in PG_STATES:
|
||||||
path = 'pg_{}'.format(state)
|
path = 'pg_{}'.format(state)
|
||||||
if state not in reported_states:
|
if state not in reported_states:
|
||||||
|
try:
|
||||||
self.metrics[path].set(0)
|
self.metrics[path].set(0)
|
||||||
|
except KeyError:
|
||||||
|
self.log.warn("skipping pg in unknown state {}".format(state))
|
||||||
|
|
||||||
def get_metadata_and_osd_status(self):
|
def get_metadata_and_osd_status(self):
|
||||||
osd_map = self.get('osd_map')
|
osd_map = self.get('osd_map')
|
||||||
|
Loading…
Reference in New Issue
Block a user