Hello,
I am currently trying to build a dashboard to visualize metrics from Metricbeat.
Metricbeat is running as a DaemonSet in Kubernetes and pushes infrastructure and application metrics to Elasticsearch every minute.
Now, I want to create a dashboard with these metrics. For example, I want to visualize CPU consumption per namespace. The fields:
kubernetes.namespace, kubernetes.pod.name, kubernetes.pod.cpu.usage.nanocores
are exported by Metricbeat to achieve this.
However, I can't get the panels to display correctly.
My initial idea was to use Lens, which computes the sum of kubernetes.pod.cpu.usage.nanocores
and uses kubernetes.namespace
for the breakdown. This works well for the last 15 minutes, as the time bucket is set to 1 minute.
But since the time buckets are dynamically adjusted based on the selected time range, the values change when, for example, I select the last 7 days. Now the time buckets are 10 minutes, causing the values to be of course roughly 10x higher than before.
What I think is missing is calculating the average CPU usage per kubernetes.pod.name
before summing it for each time bucket.
As an alternative, I tried using TSVB. I fixed the time steps, so summing kubernetes.cpu.usage.nanocores
is enough. However, the issue I run into here is that if the displayed time range exceeds 24 hours, the query fetches too much data and fails.
I don't think this is a very unique use case, but I just can't seem to find a solution. Can anyone help with how I can build this kind of visualization?
Thanks in advance.