簡體   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