Need assistance calculating CPU Busy from prometheus node exporter metric

Hello team,

i currently have Grafana dashboard but considering that i try to learn ES as much as possible and have been using it for log aggregation for quite some time, i would like to switch to Kibana/ES to view metrics as well.
I've successfully imported metrics from prometheus using remote_write and elastic fleet agent, however I'm having trouble figuring out how to display CPU Busy time like in Grafana dashboard.

Below is a screenshot from Grafana providing the CPU Busy gauge.

Metrics used to calculate this were previously imported, so was not put together by me:

(((count(count(node_cpu_seconds_total{instance="$node",job="$job"}) by (cpu))) - avg(sum by (mode)(irate(node_cpu_seconds_total{mode='idle',instance="$node",job="$job"}[5m])))) * 100) / count(count(node_cpu_seconds_total{instance="$node",job="$job"}) by (cpu))

Now I'm having trouble reflecting this to Kibana. I have fields prometheus.node_cpu_seconds_total.counter and prometheus.node_cpu_seconds_total.rate but have no idea how to use them to calculate.
I'm on ES/Kibana versions 8.1.2, I'm guessing i have to use TSVB and/or some of the math/bucket script aggregations but, please don't bash on me - my math skills are extremely bad :blush:

Any help is extremely welcome!

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