I’m trying to make a graph that repeats this prometheus query for each element in $NODE
The query represents how much memory was requested over how much a node really has:
scalar(sum(kube_pod_container_resource_requests_memory_bytes{node=“$NODE”}))/scalar(node_memory_MemTotal_bytes{nodename=“$NODE”})
I can make a dashboard that makes a separate graph for each instance, and that works fine, but I’d like to have all of the graphs in one single node, for comparison/filtering/etc.
I can also have all of ONE of those sub-querries in one graph easily:
sum by(node)(kube_pod_container_resource_requests_memory_bytes)
or
sum by(nodename)(node_memory_MemTotal_bytes)
But that really doesn’t help. And so far I’ve had no luck combining them into the composite graph I need.
Is what I’m trying to do even possible with prometheus & grafana?