繁体   English   中英

Prometheus - PromQL - 按字典属性过滤

[英]Prometheus - PromQL - filter by dict attribute

我试图让 K8S POD 仅在特定状态下使用 memory:

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

但我收到一个错误:“解析错误:意外的左大括号'{'”

什么是正确的语法?

如果要计算 kube_pod_status_phase 中的总和 memory 使用量:

sum(container_memory_usage_bytes) by (kube_pod_status_phase)

或者如果你想总结所有 memory 的使用:

sum(container_memory_usage_bytes)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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