# Simple cpu usage graph

**URL:** <https://community.grafana.com/t/simple-cpu-usage-graph/41316>\
**Category:** Prometheus\
**Created:** [January 5, 2021, 5:01pm UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316 "2021-01-05T17:01:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spamcassybren](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@spamcassybren](https://community.grafana.com/u/spamcassybren)\
**Post date:** [January 5, 2021, 5:01pm UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316/1 "2021-01-05T17:01:42Z")

</div>

Hey, I want to make a graph that shows cpu utilisation. Just one line between 0-100% showing the cpu utilisation. I’ve seen some cpu utilisation graphs, but they have 6 or something lines in them. I’m searching for a one-line solution. Kind of like the line in taskmanager in windows:  
 ![image](https://us1.discourse-cdn.com/grafana/original/2X/a/a7e4c51660869e75a3e7ff80343545ddcb2c7142.png)  
Just one line between 0-100%.

I have prometheus and node exporter. How can i do that?  
thanks

---

<div class="post-metadata">

**Author:** ![codlord](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@codlord](https://community.grafana.com/u/codlord)\
**Post date:** [January 5, 2021, 5:40pm UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316/2 "2021-01-05T17:40:41Z")

</div>

I have a bar panel with a % CPU load using this “Instant” metric:

`100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[30m])) * 100)`

I have to admit I don’t really know how accurate this is or exactly what it is measuring but I found it somewhere and it seems to work for my purposes. You may be able to use something similar for a time graph.

---

<div class="post-metadata">

**Author:** ![spamcassybren](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@spamcassybren](https://community.grafana.com/u/spamcassybren)\
**Post date:** [January 6, 2021, 10:06am UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316/3 "2021-01-06T10:06:36Z")

</div>

I tested it and it works perfectly. Comparing the graph with the output op `top`, I can say that it’s very accurate. Thanks

---

<div class="post-metadata">

**Author:** ![suryakirans](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suryakirans](https://community.grafana.com/u/suryakirans)\
**Post date:** [September 22, 2021, 10:40am UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316/4 "2021-09-22T10:40:50Z")

</div>

Iam facing a big issue i want to map all my three nodes CPU Usage in one graph so which query leads to that can anyone help me

---

<div class="post-metadata">

**Author:** ![kanagasabaikarunanit](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@kanagasabaikarunanit](https://community.grafana.com/u/kanagasabaikarunanit)\
**Post date:** [August 4, 2022, 2:42pm UTC](https://community.grafana.com/t/simple-cpu-usage-graph/41316/5 "2022-08-04T14:42:49Z")

</div>

To see total CPU utilization in one graph, we have to add two `cpu_usage_user` & `cpu_usage_system`

cpu\_usage\_user{host=~“(hostname-._)“}+cpu\_usage\_system{host=~”(hostname-._)”}

or

cpu\_usage\_user{host=“hostname”}+cpu\_usage\_system{host=“hostname”}
