From 05a37d4a61c427ed532138ab0c13a9dd4d0f65fb Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Thu, 19 Apr 2018 17:27:03 +0200 Subject: [PATCH] pybind/mgr/prometheus: fix creation of osd_metadata metric Signed-off-by: Jan Fajerski --- src/pybind/mgr/prometheus/module.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 0673710657710..c7daa128dd8af 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -451,7 +451,7 @@ class Module(MgrModule): servers = self.get_service_list() for osd in osd_map['osds']: # id can be used to link osd metrics and metadata - id_ = str(osd['osd']) + id_ = osd['osd'] # collect osd metadata p_addr = osd['public_addr'].split(':')[0] c_addr = osd['cluster_addr'].split(':')[0] @@ -474,9 +474,9 @@ class Module(MgrModule): id_)) continue - host_version = servers.get((id_, 'osd'), ('','')) + host_version = servers.get((str(id_), 'osd'), ('','')) - self.metrics['osd_metadata'].set(1, ( + self.metrics.append('osd_metadata', 1, ( c_addr, dev_class, id_, host_version[0], @@ -490,7 +490,7 @@ class Module(MgrModule): ('osd.{}'.format(id_),)) # collect disk occupation metadata - osd_metadata = self.get_metadata("osd", id_) + osd_metadata = self.get_metadata("osd", str(id_)) if osd_metadata is None: continue dev_keys = ("backend_filestore_dev_node", "bluestore_bdev_dev_node") -- 2.39.5