简体   繁体   中英

Prometheus - PromQL - filter by dict attribute

I am trying to get memory usage by K8S PODs in particular states only:

sum(container_memory_usage_bytes{kube_pod_status_phase{phase="Pending"}})

but am getting an error: "parse error: unexpected left brace '{'"

What's the correct syntax?

if you want to calculate sum memory usage in kube_pod_status_phase:

sum(container_memory_usage_bytes) by (kube_pod_status_phase)

or if you want to sum all memory usage:

sum(container_memory_usage_bytes)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM