[grafana] Update Dashboard for CPU Usage 87/72887/2
authorEmma Foley <efoley@redhat.com>
Tue, 31 Aug 2021 10:09:35 +0000 (11:09 +0100)
committerEmma Foley <efoley@redhat.com>
Fri, 17 Dec 2021 13:03:38 +0000 (13:03 +0000)
After the introduction of the collectd_config roles, for generating
configs, some of the configs changed, as they were no longer relying on
collectd's defaults.
One of these was the cpu plugin, which configured ``ReportPercentage True``
by the config role. The effected the grafana dashboards, because the CPU
usage dashboard explicitly selected ``type=cpu``. With the values being
reported as percentage, collectd sets the ``type=percent`` for the metrics
stored in influx (which grafana retrieves), so the dashboards dodn't
have any data to display. By  removing the ``type=cpu`` filter, the CPU
metrics are once again showing in grafana, and will be shown whether the
CPU usage is reported in percentage or the default jiffies.

Signed-off-by: "Emma Foley <efoley@redhat.com>"
Change-Id: I03a6f01677514d888e7805358855947791ab173c

docker/ansible/roles/config_files/vars/main.yml
docker/barometer-grafana/dashboards/cpu_usage_dashboard.json
docs/release/release-notes/notes/update-grafana-9bee82ecfa11f54a.yaml [new file with mode: 0644]

index 410e24e..02fd7fb 100644 (file)
@@ -18,6 +18,9 @@ collectd_hostname: "{{ inventory_hostname }}"
 
 collectd_plugin_capabilities_port: "9564"
 
+collectd_plugin_cpu_valuespercentage: False
+collectd_plugin_cpu_reportbystate: True
+
 collectd_plugin_csv_datadir: "{{ csv_log_dir }}"
 collectd_plugin_csv_storerates: False
 
index 0b8ab73..bab2742 100644 (file)
                 "measurement": "cpu_value",
                 "orderByTime": "ASC",
                 "policy": "default",
-                "query": "select derivative(mean(value),1s) AS idle from \"cpu_value\" WHERE \"type\" = 'cpu' AND \"host\" =~ /^$host$/ AND $timeFilter GROUP BY time($interval), instance, type_instance fill(null)",
+                "query": "select derivative(mean(value),1s) AS idle from \"cpu_value\" WHERE \"host\" =~ /^$host$/ AND $timeFilter GROUP BY time($interval), instance, type_instance fill(null)",
                 "rawQuery": true,
                 "refId": "A",
                 "resultFormat": "time_series",
                 "measurement": "cpu_value",
                 "orderByTime": "ASC",
                 "policy": "default",
-                "query": "SELECT mean(\"value\") FROM \"cpu_value\" WHERE (\"host\" =~ /^$host$/ AND \"type\" = 'cpu' AND \"type_instance\" != 'idle') AND $timeFilter GROUP BY time($__interval), \"instance\", \"type_instance\" fill(none)",
+                "query": "SELECT mean(\"value\") FROM \"cpu_value\" WHERE (\"host\" =~ /^$host$/ AND \"type_instance\" != 'idle') AND $timeFilter GROUP BY time($__interval), \"instance\", \"type_instance\" fill(none)",
                 "rawQuery": true,
                 "refId": "A",
                 "resultFormat": "time_series",
diff --git a/docs/release/release-notes/notes/update-grafana-9bee82ecfa11f54a.yaml b/docs/release/release-notes/notes/update-grafana-9bee82ecfa11f54a.yaml
new file mode 100644 (file)
index 0000000..95e2cbd
--- /dev/null
@@ -0,0 +1,6 @@
+containers:
+  - |
+    Grafana container was updated to support both jiffies and percent for cpu metrics.
+fixes:
+  - |
+    Update the grafana dashboard to show metrics in both jffies and percent, depending on what is configured.