Create visualization for sum of system.cpu.cores per host

I'm trying to create a visualization for the total cores for each host and then sum them all up to get a count for each of our clusters. Is it possible?

Sure ... What version are you on?

You certainly should be able to create a number of different types of visualizations for

This assumes there is a label for the "cluster" which you can sum / agregrate on.

Perhaps provide a bit more information on what and how you are collecting the data.

Something like this is by cluster.

this is by host

How do you create a label? I was able to get per host using the visualization you provided but not for the entire cluster as I'm not sure how to label. We are on version 8.8.1.

How are you collecting the metrics?

Metricbeat / Elastic Agent? on your K8s Cluster? If so the cluster metadata should be picked up.

I am not sure if that exact metric widget is in 8.8 I think it is ... you will need to check.

If these are some sort of custom cluster you will need to add a field in metricbeat or agent.

Metricbeat and what we want to do is get the sum for the last value for each compute node in the cluster. I'm able to get the number of cores per compute using the last value for system.cpu.cores but, I don't know how to get the sum of them all. I tried to edit the formula and use "sum(last_value(system.cpu.cores, kql='system.cpu.cores: *'))" and it didn't work. Is this possible?

You don't you just take out the Break down by Field...

If you want both Break down by host and total, you will need to do 2 separate viz or a table with a Sum

Thanks! That helps. But, what do we do if we have thousands of documents that don't have system.cpu.cores set and it shows '-' in the visualization?

Well only the docs with that will be included... BUT if you really want to be sure... and it is not a bad idea.

In the KQL bar at the top will filter to only include those documents that contain

system.cpu.cores: *

or : cpu

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