Add the `node` label to an application metric that does not have it?
AdvancedProductionRapid-Fire PromQL & LogQL
Answer
sum by (namespace, pod) (rate(http_requests_total[5m]))
* on (namespace, pod) group_left (node)
max by (namespace, pod, node) (kube_pod_info)
kube_pod_info has value 1, so multiplying keeps the original value. The max by dedupes it when kube-state-metrics runs with two replicas, which otherwise causes many-to-many matching not allowed.
More on Rapid-Fire PromQL & LogQL
Requests per second per service over the last 5 minutes?BeginnerPercentage of 5xx responses per service?Beginnerp99 latency per route from a histogram?IntermediateTop 5 pods by CPU usage in a namespace?BeginnerMemory working set as a percentage of the container limit?IntermediateWhich scrape targets are down right now?Beginner