Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: match all non-idle cpu modes when calculating total cpu usage #81

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dashboards/k8s-views-global.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[$__rate_interval]))",
"expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\"}[$__rate_interval])))",
"interval": "",
"legendFormat": "Real",
"range": true,
Expand Down Expand Up @@ -701,7 +701,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "sum(1-rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[$__rate_interval]))",
"expr": "sum(rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\"}[$__rate_interval]))",
"interval": "",
"legendFormat": "Real",
"range": true,
Expand Down Expand Up @@ -1020,7 +1020,7 @@
"uid": "${datasource}"
},
"exemplar": true,
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[$__rate_interval]))",
"expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\"}[$__rate_interval])))",
"interval": "$resolution",
"legendFormat": "CPU usage in %",
"refId": "A"
Expand Down Expand Up @@ -1435,7 +1435,7 @@
"uid": "${datasource}"
},
"exemplar": true,
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[$__rate_interval])) by (instance)",
"expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\"}[$__rate_interval]))) by (instance)",
"interval": "$resolution",
"legendFormat": "{{ node }}",
"refId": "A"
Expand Down Expand Up @@ -2968,6 +2968,6 @@
"timezone": "",
"title": "Kubernetes / Views / Global",
"uid": "k8s_views_global",
"version": 34,
"version": 35,
"weekStart": ""
}
6 changes: 3 additions & 3 deletions dashboards/k8s-views-nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"uid": "${datasource}"
},
"exemplar": false,
"expr": "avg(1-rate(node_cpu_seconds_total{mode=\"idle\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))",
"expr": "avg(sum by (cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])))",
"instant": true,
"interval": "$resolution",
"legendFormat": "",
Expand Down Expand Up @@ -576,7 +576,7 @@
"uid": "${datasource}"
},
"exemplar": false,
"expr": "sum(1-rate(node_cpu_seconds_total{mode=\"idle\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))",
"expr": "sum(rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))",
"instant": true,
"interval": "$resolution",
"legendFormat": "",
Expand Down Expand Up @@ -3933,6 +3933,6 @@
"timezone": "",
"title": "Kubernetes / Views / Nodes",
"uid": "k8s_views_nodes",
"version": 25,
"version": 26,
"weekStart": ""
}
Loading