[英]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.