]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/prometheus/module.py: defaultdict for num_by_state 38596/head
authorAlexander Sushko <alexandrsushko@gmail.com>
Fri, 27 Nov 2020 11:04:13 +0000 (14:04 +0300)
committerLaura Paduano <lpaduano@suse.com>
Thu, 17 Dec 2020 14:04:38 +0000 (15:04 +0100)
commitce037a6cde6204770649353167d84b0982334b74
tree35db02f97cd5843b4fb091c0f2dd2b677176ce89
parentbdf3eebcd22d7d0b3dd4d5501bee5bac354d5b55
pybind/mgr/prometheus/module.py: defaultdict for num_by_state

num_by_state[state] += count in get_pg_status method raises KeyError
if pg state is not in PG_STATES list. PG_STATES should be synced with
osd_types.cc:pg_state_string(). But sometimes it is not. After the
KeyError raise mgr metrics are not available at all.

Fixes: https://tracker.ceph.com/issues/46142
Signed-off-by: Alexander Sushko <alexandrsushko@gmail.com>
(cherry picked from commit 3f7ee9cbd335e4b8686688b79ec6110d73a7390e)

 Conflicts:
src/pybind/mgr/prometheus/module.py
 - Resolved import conflict
src/pybind/mgr/prometheus/module.py