【问题标题】:Calculate the availability of a pod in kubernetes over a period of time计算一段时间内 Kubernetes 中 pod 的可用性
【发布时间】:2020-01-17 04:37:56
【问题描述】:

我需要使用 PromQL 计算一段时间内 Kubernetes 中 pod 的可用性百分比。欢迎提出任何建议。

【问题讨论】:

    标签: kubernetes prometheus grafana promql


    【解决方案1】:

    我能够通过以下查询实现它:

    (sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",condition="true", namespace="$namespace"}))[$availability_span:5m])) / (sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",namespace="$namespace"}))[$availability_span:5m])) * 100

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-18
      • 2011-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多