Skip to content

Commit

Permalink
feat: use node_exporter metrics for node CPU (#16)
Browse files Browse the repository at this point in the history
Use the node_exporter CPU metrics to get system level data.

Fixes: #3

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ authored Jul 18, 2022
1 parent 879bd4c commit 27e4577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dashboards/k8s-views-global.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{id=\"/\"}[$__rate_interval])) / sum(machine_cpu_cores)",
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval]))",
"interval": "",
"legendFormat": "Real",
"range": true,
Expand Down Expand Up @@ -686,7 +686,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{id=\"/\"}[$__rate_interval]))",
"expr": "sum(1-rate(node_cpu_seconds_total{mode=\"idle\"}}[$__rate_interval]))",
"interval": "",
"legendFormat": "Real",
"range": true,
Expand Down Expand Up @@ -998,7 +998,7 @@
"uid": "${datasource}"
},
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{id=\"/\"}[$__rate_interval])) / sum(machine_cpu_cores)",
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval]))",
"interval": "$resolution",
"legendFormat": "CPU usage in %",
"refId": "A"
Expand Down Expand Up @@ -1396,7 +1396,7 @@
"uid": "${datasource}"
},
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{image!=\"\"}[$__rate_interval])) by (node) / sum(machine_cpu_cores) by (node)",
"expr": "avg by (node) (1-rate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval]))",
"interval": "$resolution",
"legendFormat": "{{ node }}",
"refId": "A"
Expand Down

0 comments on commit 27e4577

Please sign in to comment.