From 93f62a9d93e71fdee9086d53d4b1bcd50af6d095 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Thu, 7 Oct 2021 05:38:49 +0000 Subject: [PATCH] Fix graphs to use dns name dns_name appears to be a more reliable key for the graphs as instance may return the IP or the hostname which breaks the host match Change-Id: Ie2b890a1eddd62aeb28d4e0261b6626976bb9c14 --- build-requirements.txt | 1 + src/dashboards/hosts-overview.json | 18 +++++++++--------- test-requirements.txt | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build-requirements.txt b/build-requirements.txt index 271d895..38b1a77 100644 --- a/build-requirements.txt +++ b/build-requirements.txt @@ -1 +1,2 @@ +cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. git+https://github.com/canonical/charmcraft.git@0.10.2#egg=charmcraft diff --git a/src/dashboards/hosts-overview.json b/src/dashboards/hosts-overview.json index 28e6707..9c1a372 100644 --- a/src/dashboards/hosts-overview.json +++ b/src/dashboards/hosts-overview.json @@ -184,7 +184,7 @@ "tableColumn": "", "targets": [ { - "expr": "avg(\n 1 - (\n avg by(instance) \n (cpu_usage_idle{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\", cpu='cpu-total'} / 100)))", + "expr": "avg(\n 1 - (\n avg by(dns_name) \n (cpu_usage_idle{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\", cpu='cpu-total'} / 100)))", "format": "time_series", "instant": true, "intervalFactor": 1, @@ -267,7 +267,7 @@ "tableColumn": "", "targets": [ { - "expr": "avg (((mem_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) - (\n (mem_free{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n (mem_cached{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n (mem_buffered{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) +\n (mem_slab{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})\n )) /\n (mem_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}))", + "expr": "avg (((mem_total{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) - (\n (mem_free{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n (mem_cached{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n (mem_buffered{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) +\n (mem_slab{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})\n )) /\n (mem_total{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}))", "format": "time_series", "instant": true, "intervalFactor": 1, @@ -349,7 +349,7 @@ "tableColumn": "", "targets": [ { - "expr": "sum ((irate(diskio_reads{instance=~\"($osd_hosts|$mds_hosts).*\"}[5m])) + \n(irate(diskio_writes{instance=~\"($osd_hosts|$mds_hosts).*\"}[5m])))", + "expr": "sum ((irate(diskio_reads{dns_name=~\"($osd_hosts|$mds_hosts).*\"}[5m])) + \n(irate(diskio_writes{dns_name=~\"($osd_hosts|$mds_hosts).*\"}[5m])))", "format": "time_series", "instant": true, "intervalFactor": 1, @@ -431,7 +431,7 @@ "tableColumn": "", "targets": [ { - "expr" : "avg (label_replace(label_replace((irate(diskio_io_time[5m]) / 10 ), \"device\", \"$1\", \"name\", \"(.+)\"), \"exported_instance\", \"$1\", \"host\", \"(.+)\") * on(exported_instance, device) group_right(ceph_daemon) label_replace(ceph_disk_occupation{instance=~\"($osd_hosts|$mds_hosts).*\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"))", + "expr" : "avg (label_replace(label_replace((irate(diskio_io_time[5m]) / 10 ), \"device\", \"$1\", \"name\", \"(.+)\"), \"exported_instance\", \"$1\", \"host\", \"(.+)\") * on(exported_instance, device) group_right(ceph_daemon) label_replace(ceph_disk_occupation{dns_name=~\"($osd_hosts|$mds_hosts).*\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"))", "format": "time_series", "instant": true, "intervalFactor": 1, @@ -514,7 +514,7 @@ "tableColumn": "", "targets": [ { - "expr": "sum (\n irate(net_bytes_recv{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n) +\nsum (\n irate(net_bytes_sent{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]))", + "expr": "sum (\n irate(net_bytes_recv{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n) +\nsum (\n irate(net_bytes_sent{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]))", "format": "time_series", "instant": true, "intervalFactor": 1, @@ -572,10 +572,10 @@ "steppedLine": false, "targets": [ { - "expr": "topk(10,100 * (\n 1 - (\n avg by(instance) \n (cpu_usage_idle{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\", cpu='cpu-total'} / 100))))", + "expr": "topk(10,100 * (\n 1 - (\n avg by(dns_name) \n (cpu_usage_idle{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\", cpu='cpu-total'} / 100))))", "format": "time_series", "intervalFactor": 1, - "legendFormat": "{{instance}}", + "legendFormat": "{{dns_name}}", "refId": "A" } ], @@ -659,10 +659,10 @@ "steppedLine": false, "targets": [ { - "expr": "topk(10, (sum by(instance) (\n (\n irate(net_bytes_recv{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n ) +\n (\n irate(net_bytes_sent{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n ))\n )\n)", + "expr": "topk(10, (sum by(dns_name) (\n (\n irate(net_bytes_recv{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n ) +\n (\n irate(net_bytes_sent{dns_name=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n ))\n )\n)", "format": "time_series", "intervalFactor": 1, - "legendFormat": "{{instance}}", + "legendFormat": "{{dns_name}}", "refId": "A" } ], diff --git a/test-requirements.txt b/test-requirements.txt index 8057d2c..fb837fb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -15,3 +15,4 @@ git+https://github.com/openstack-charmers/zaza.git#egg=zaza git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack pytz # workaround for 14.04 pip/tox pyudev # for ceph-* charm unit tests (not mocked?) +cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.