Configure PVC Metrics
Prerequisites
PVC objects are monitored automatically with Sysdig Agent v12.2.0 and above.
To learn about agent configuration, see Configure the Agent
Apply Rules
If you are upgrading the Sysdig agent, either download sysdig-agent-clusterrole.yaml or apply the following rule to the ClusterRole associated with your Sysdig agent.
rules:
- apiGroups:
- ""
resources:
- nodes/metrics
- nodes/proxy
- nonResourceURLs:
- /metrics
verbs:
- get
The rules are required to scrape the kubelet containers. With this rule enabled, you will also have the kubelet metrics and can access kubelet templates for both dashboards and alerts.
This configuration change is only required for agent upgrades because the sysdig-agent-clusterrole.yaml
associated with fresh installations will already have this configuration. See Steps for Kubernetes (Vanilla) for information on Sysdig agent installation.
Sysdig Agent v12.3.x and Above
The following kube-state-metrics (KSMs) are enabled by default for Sysdig agent v12.3.0 and above. The configuration for collecting the resource metrics looks similar to:
k8s_extra_resources:
include:
- services
- resourcequotas
- persistentvolumes
- persistentvolumeclaims
- storageclasses
Disable Collecting PVC Metrics
To disable collecting PVC metrics, add the following to the dragent.yaml
file:
k8s_extra_resources:
include:
- services
- resourcequotas
For details on how to configure dragent.yaml
, see Configure the Agent
Here, you remove the entries corresponding to the persistentvolumes
and persistentvolumeclaims
resources from the k8s_extra_resources
.
Collect Additional Resource Metrics
To enable collecting other resource metrics, such as horizontalpodautoscalers
, add the entries corresponding to the resources to the dragent.yaml
file:
k8s_extra_resources:
include:
- services
- resourcequotas
- persistentvolumes
- persistentvolumeclaims
- storageclasses
- horizontalpodautoscalers
- ingresses
- certificatesigningrequests
For more information, see Enable Kube State Metrics.
Sysdig Agent Prior to v12.3.0
Contact your Sysdig representative or Sysdig Support for technical assistance with enabling PVC metrics in your environment.
Upgrade Sysdig agent to v12.2.0 or above
If you are an existing Sysdig user, include the following configuration in the
dragent.yaml
file:k8s_extra_resources: include: - persistentvolumes - persistentvolumeclaims - storageclasses
Access PVC Dashboard from the Library
Log in to Sysdig Monitor and click Dashboards.
On the Dashboards slider, scroll down to locate Dashboard Library (formerly: Dashboard Templates).
Click Kubernetes to expand the Kubernetes section.
Select the PVC and Storage dashboard.
Access PVC Alert Template
Log in to Sysdig Monitor and click Alerts.
On the Alerts page, click Library.
On the Library page, click All Templates.
Select the Kubernetes PVC alert templates.
PVC Metrics
Metrics | Metric Type | Labels | Metric Source |
---|---|---|---|
kube_persistentvolume_status_phase | Gauge | persistentvolume, phase | Kubernetes API |
kube_persistentvolume_claim_ref | Gauge | persistentvolume, name | Kubernetes API |
kube_storageclass_created | Gauge | storageclass | Kubernetes API |
kube_storageclass_info | Gauge | storageclass, provisioner, reclaim_policy, volume_binding_mode | Kubernetes API |
kube_storageclass_labels | Gauge | storageclass | Kubernetes API |
kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | namespace, pod, uid, volume, persistentvolumeclaim | Kubernetes API |
kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | namespace, pod, uid, volume, persistentvolumeclaim | Kubernetes API |
kube_persistentvolumeclaim_status_condition | Gauge | namespace, persistentvolumeclaim, type, status | Kubernetes API |
kube_persistentvolumeclaim_status_phase | Gauge | namespace, persistentvolumeclaim, phase | Kubernetes API |
kube_persistentvolumeclaim_access_mode | Gauge | namespace, persistentvolumeclaim, access_mode | Kubernetes API |
kubelet_volume_stats_inodes | Gauge | namespace, persistentvolumeclaim | Kubelet |
kubelet_volume_stats_inodes_free | Gauge | namespace, persistentvolumeclaim | Kubelet |
kubelet_volume_stats_inodes_used | Gauge | namespace, persistentvolumeclaim | Kubelet |
kubelet_volume_stats_used_bytes | Gauge | namespace, persistentvolumeclaim | Kubelet |
kubelet_volume_stats_available_bytes | Gauge | namespace, persistentvolumeclaim | Kubelet |
kubelet_volume_stats_capacity_bytes | Gauge | namespace, persistentvolumeclaim | Kubelet |
storage_operation_duration_seconds_bucket | Gauge | operation_name, volume_plugin,le | Kubelet |
storage_operation_duration_seconds_sum | Gauge | operation_name, volume_plugin | Kubelet |
storage_operation_duration_seconds_count | Gauge | operation_name, volume_plugin | Kubelet |
storage_operation_errors_total | Gauge | operation_name, volume_plugin | Kubelet |
storage_operation_status_count | Gauge | operation_name, status, volume_plugin | Kubelet |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.