From 50b3092fbba69aab5bde074cb5a675de6a894065 Mon Sep 17 00:00:00 2001 From: akrzos Date: Sun, 3 Jun 2018 12:09:05 -0400 Subject: [PATCH] Looks like ceph changed its json format for perf_stat data per osd Change-Id: I1707f535cdd3c64a16f516a8b3ba57688580b9e1 --- .../files/collectd_ceph_storage.py | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ansible/install/roles/collectd-openstack/files/collectd_ceph_storage.py b/ansible/install/roles/collectd-openstack/files/collectd_ceph_storage.py index 0235b07fd..5cba7ec2a 100644 --- a/ansible/install/roles/collectd-openstack/files/collectd_ceph_storage.py +++ b/ansible/install/roles/collectd-openstack/files/collectd_ceph_storage.py @@ -226,14 +226,24 @@ class CollectdCephStorage(object): self.dispatch_value( osd_id, 'num_snap_trimming', osd['num_snap_trimming'], self.ceph_pg_stats_interval) - self.dispatch_value( - osd_id, 'apply_latency_ms', - osd['fs_perf_stat']['apply_latency_ms'], - self.ceph_pg_stats_interval) - self.dispatch_value( - osd_id, 'commit_latency_ms', - osd['fs_perf_stat']['commit_latency_ms'], - self.ceph_pg_stats_interval) + if 'fs_perf_stat' in osd: + self.dispatch_value( + osd_id, 'apply_latency_ms', + osd['fs_perf_stat']['apply_latency_ms'], + self.ceph_pg_stats_interval) + self.dispatch_value( + osd_id, 'commit_latency_ms', + osd['fs_perf_stat']['commit_latency_ms'], + self.ceph_pg_stats_interval) + elif 'perf_stat' in osd: + self.dispatch_value( + osd_id, 'apply_latency_ms', + osd['perf_stat']['apply_latency_ms'], + self.ceph_pg_stats_interval) + self.dispatch_value( + osd_id, 'commit_latency_ms', + osd['perf_stat']['commit_latency_ms'], + self.ceph_pg_stats_interval) def read_ceph_pool(self): """Reads stats from "ceph osd pool" and "ceph df" commands."""