# How to get the total of memory and cpu usage of my cluster

**URL:** https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170
**Category:** Kibana
**Created:** [November 1, 2021, 7:51pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170 "2021-11-01T19:51:48Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 1, 2021, 7:51pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/1 "2021-11-01T19:51:48Z")

</div>

Hi team, I am working on Kibana Dashboard trying to get a particular metric. for example, I have 3 kubernetes nodes and I am trying to create a dashboard with the Total of memory and CPU consumption, I am trying with lens, TVSB, and the classic Aggregation Based, I am not able to get the proper value of the Total Consumption, for example

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c28d1af020f665bc657c2d7ced702cecacbb8c2a.png)  
I have the 3 nodes there, with the memory capacity, But I can't find the way to sum the 3 nodes to get the total capacity, is it possible to do?

Regards!

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 1, 2021, 8:42pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/2 "2021-11-01T20:42:12Z")

</div>

Hi @Sergio_Ferreyra Welcome to the Community.

Yes this is not super easy today.

You need to do a Series Agg : Sum across the Nodes

Today this is not supported in Lens, that is coming soon.

In TSVB

Example

Average of Metrics (example load.1m)

Series Agg : Sum

Group By : Terms : Node Name

This is saying Add the Average of the 1M Load across my nodes in for each Bucket.

Here an example :

 ![Screen Shot 2021-11-01 at 1.38.38 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02408d4867cb96ff915413f09aefa578d22a37a1.jpeg)

 ![Screen Shot 2021-11-01 at 1.41.58 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/a/eaadc7f3fc77850ef94cada0513e1171a20e55c5.png)

Give it a Try...

---

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 1, 2021, 9:05pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/3 "2021-11-01T21:05:24Z")

</div>

Hi @stephenb Thanks ! good news if Lens will support this feature in the future, I will try now, the problem with the average is I am not sure why is doing this operation example (3.9+3.9+7.8)/3 =5.2, so it's showing the average value between the 3 nodes and not the total of the capacity of the cluster. I will try again anyway

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 1, 2021, 9:09pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/4 "2021-11-01T21:09:11Z")

</div>

Make sure that the Series Agg is **Sum** not Average.

That means Sum the 3 Individual Averages

And you have to do that Group By Terms then set to node Name

 ![Screen Shot 2021-11-01 at 2.10.21 PM](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c66eb8a61d19ce4c5c9b3ba492c5412f1e4df9e1.png)

---

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 1, 2021, 9:41pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/5 "2021-11-01T21:41:42Z")

</div>

Good, I did the same and looks good, just a question , I am trying to get the CPU capacity, for example I have 4 kubernetes nodes in Digital Ocean with 2vcpu, so the total that DO shows me is 8.  
Example  
: ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/e/9e4e1e8a199e59795842aec91bf701753cb364ac.png)  
I am using kubernetes.node.cpu.capacity.core field to get the values, example

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/b/8be9e6be13bcbff110dbcc38407a02e6221a45b2.png)

Here the example  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/e/9e8c7db595cb3cab6eb40b2a0aa4775e58b95b23.png)  
Do you know if I am using the proper field to get the values?

Regards!

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 1, 2021, 9:47pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/6 "2021-11-01T21:47:51Z")

</div>

I do not I am not an expert on K8s metrics but I am sure you can look it up... is that metricbeat if so you can look at what fields are exported and the definitions.

> **[Kubernetes fields | Metricbeat Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-kubernetes.html)**

---

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 1, 2021, 9:49pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/7 "2021-11-01T21:49:00Z")

</div>

@stephenb yes, I read that documentation, thanks a lot!

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 1, 2021, 9:49pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/8 "2021-11-01T21:49:49Z")

</div>

you can take the Group By and Series Agg out and see the individuals nodes / values.... maybe something else is reporting

---

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 1, 2021, 9:50pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/9 "2021-11-01T21:50:09Z")

</div>

Sure, good Idea

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [November 1, 2021, 10:16pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/10 "2021-11-01T22:16:45Z")

</div>

linking up what I think is a related enhancement that would bring this to lens formula - [[Lens] Formula: Define level of metric · Issue #94789 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/94789)

you _can_ get at this number in formula but you need to be willing to visualize something like your node name. the series agg is the way to do it today!

---

<div class="post-metadata">

### Author: ![Sergio\_Ferreyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_ferreyra/32/93646_2.png) [@Sergio\_Ferreyra](https://discuss.elastic.co/u/Sergio_Ferreyra)
#### Post date: [November 2, 2021, 2:35pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/11 "2021-11-02T14:35:12Z")

</div>

@stephenb It's working well and better than the DO panel 😃.

thanks a lot!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 30, 2021, 2:35pm UTC](https://discuss.elastic.co/t/how-to-get-the-total-of-memory-and-cpu-usage-of-my-cluster/288170/12 "2021-11-30T14:35:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
