我正在寻找一个普罗米修斯指标,它可以让我在terminating状态消失之前监控pods在状态中花费的时间。
我尝试过使用kube_pod_container_status_terminated,但它似乎只在pod完成终止过程后才注册pod,但不能帮助我理解终止pod需要多长时间。
我也看过kube_pod_status_phase,它是我之前在这个频道发现的,但它似乎也缺乏这种洞察力。
我目前正在使用cAdvisor、kube-state-metrics和prometheus node-exporter收集我的k8s工作负载上的指标,但如果它们包含所需的数据,我会很乐意考虑使用其他收集器。
一个非普罗米修斯的解决方案也会很好。
有什么想法吗?谢谢!
发布于 2018-12-17 23:03:06
Kubernetes本身、Heapster和metrics-server都没有提供这样的指标,但是你可以通过安装kube-state-metrics来获得接近你所提到的指标。它有几个反映pod状态的pod指标:
kube_pod_status_phase
kube_pod_container_status_terminated
kube_pod_container_status_terminated_reason
kube_pod_container_status_last_terminated_reason您可以在Documentation中找到kube-state-metrics提供的完整pods指标列表。
还有一个可以简化kube-state-metrics安装的Bitnami Helm chart。
https://stackoverflow.com/questions/52345005
复制相似问题