promQL how to divide node_load by number of cores

I have load.

node_load1

node_load1{group="FTP",instance="10.41.48.100:9100",job="node"} 0.1
node_load1{group="Prometheus",instance="localhost:9100",job="node"} 0.2

And I have number of cores for each instance

count(node_cpu_seconds_total{mode="idle"}) by (instance)

{instance="10.41.48.100:9100"} 1
{instance="localhost:9100"} 8

And now I need to divide it by node label ignoring other labels.

node_load1 / on (instance) count(node_cpu_seconds_total{mode="idle"})

But result is no data. What am I doing wrong? Is not on(<labels>) matching only specified labels ignoring anything else?

Thank you.

2 Answers

Use:

node_load1 / count by (group, instance, job) (node_cpu_seconds_total{mode="idle"})

Marcelo's answer shows me an empty query result.

sum(node_load5{}) by (instance) / count(node_cpu_seconds_total{mode="system"}) by (instance)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like