]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/prometheus: add Metrics class to manage Metric instances
authorJan Fajerski <jfajerski@suse.com>
Sat, 17 Feb 2018 11:07:46 +0000 (12:07 +0100)
committerBoris Ranto <branto@redhat.com>
Tue, 3 Apr 2018 16:36:07 +0000 (18:36 +0200)
commitc0f5b0fd319a50ed6313ed86b0bc302c46d3ae05
tree8766b4d551f60c70746ccbf7fd038377704b8bb0
parent1746324533a5f9bf9609cf0f0cc4879bbef112c7
pybind/mgr/prometheus: add Metrics class to manage Metric instances

The central change of this commit is that per-daemon metrics are now
managed by first appending the metric (using Metrics.append) to a
staging area. Then the metrics for specific paths (metric names) are
overwritten by the staged metrics (by calling Metrics.reset). This gets
rid of metrics from daemon that are no longer in the cluster. I.e. when
ceph no longer reports metrics for one OSD daemon (because it was
removed from the cluster) the prometheus module will no longer export
metrics for that daemon.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit f88877ab0bd895d8b67222225c22a12d479b7548)
src/pybind/mgr/prometheus/module.py