简体   繁体   English

使用 Prometheus 监控 PVC 使用情况

[英]Monitoring PVC Usage with Prometheus

I am using Prometheus 2.33 version.我使用的是 Prometheus 2.33 版本。 The following query does not work.以下查询不起作用。

kubelet_volume_stats_available_bytes kubelet_volume_stats_available_bytes

kubelet_volume_stats_capacity_bytes kubelet_volume_stats_capacity_bytes

The following query is used to monitor the DISK usage of the POD.以下查询用于监控 POD 的 DISK 使用情况。

container_fs_usage_bytes container_fs_usage_bytes

container_fs_limit_bytes container_fs_limit_bytes

Is there a way to get the usage of PVC, Limit value?有没有办法得到PVC的使用量,限制值?

For PVC, Kube.netes exposes these metrics to Prometheus, you can use them to monitor a persistent volume's usage:对于 PVC,Kube.netes 将这些指标公开给 Prometheus,您可以使用它们来监控持久卷的使用情况:

kube_persistentvolume_capacity_bytes 
kube_persistentvolumeclaim_resource_requests_storage_bytes

EDIT : These metrics are from kube-state-metrics - a service that produces Prometheus format metrics based on the current state of the Kube.netes native resources.编辑:这些指标来自kube-state-metrics - 一种基于 Kube.netes 本机资源的当前 state 生成 Prometheus 格式指标的服务。 It is basically listening to Kube.netes API and gathering information about its resources and objects, in particular for PV - PV metrics and PVC - PVC metrics .它基本上是在监听 Kube.netes API 并收集有关其资源和对象的信息,特别是 PV- PV 指标和 PVC- PVC 指标 More information about the service ishere .有关该服务的更多信息,请参见此处

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

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