From: Jan Fajerski Date: Wed, 11 Oct 2017 10:28:19 +0000 (+0200) Subject: pybind/mgr/prometheus: no ports in osd_metadata X-Git-Tag: v13.0.1~333^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48fec7db4b214fe8ef6a04f8cb53fb8a2fb9c2ca;p=ceph.git 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 --- 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,