From 48fec7db4b214fe8ef6a04f8cb53fb8a2fb9c2ca Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Wed, 11 Oct 2017 12:28:19 +0200 Subject: [PATCH] pybind/mgr/prometheus: no ports in osd_metadata Ports might change on a OSD restart and this would create a new metadata metric for this osd. Signed-off-by: Jan Fajerski --- src/pybind/mgr/prometheus/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 618d003e34b2..c086eaadf298 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -275,8 +275,8 @@ class Module(MgrModule): osd_devices = self.get('osd_map_crush')['devices'] for osd in osd_map['osds']: id_ = osd['osd'] - p_addr = osd['public_addr'] - c_addr = osd['cluster_addr'] + p_addr = osd['public_addr'].split(':')[0] + c_addr = osd['cluster_addr'].split(':')[0] dev_class = next((osd for osd in osd_devices if osd['id'] == id_)) self.metrics['osd_metadata'].set(0, ( c_addr, -- 2.47.3