Configure PVC Metrics

You can use dashboards and alerts for PersistentVolumeClaim (PVC) metrics in the regions where PVC metrics are supported.

To see data on PVC dashboards and alerts, ensure that the prerequisites are met.


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.

- apiGroups:
  - ""
  - nodes/metrics
  - nodes/proxy
- nonResourceURLs:
  - /metrics
  - 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 KSM metrics are enabled by default for Sysdig agent v12.3.0 and above. The configuration for collecting the resource metrics looks similar to:

     - services
     - resourcequotas
     - persistentvolumes
     - persistentvolumeclaims
     - storageclasses

Disable Collecting PVC Metrics

To disable collecting PVC metrics, add the following to the dragent.yaml file:

    - services
    - resourcequotas

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:

     - 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:

        - persistentvolumes
        - persistentvolumeclaims
        - storageclasses

Access PVC Dashboard from the Library

  1. Log in to Sysdig Monitor and click Dashboards.

  2. On the Dashboards slider, scroll down to locate Dashboard Library (formerly: Dashboard Templates).

  3. Click Kubernetes to expand the Kubernetes section.

  4. Select the PVC and Storage dashboard.

Access PVC Alert Template

  1. Log in to Sysdig Monitor and click Alerts.

  2. On the Alerts page, click Library.

  3. On the Library page, click All Templates.

  4. Select the Kubenetes PVC alert templates.

PVC Metrics

MetricsMetric TypeLabelsMetric Source
kube_persistentvolume_status_phaseGaugepersistentvolume, phaseKubernetes API
kube_persistentvolume_claim_refGaugepersistentvolume, nameKubernetes API
kube_storageclass_createdGaugestorageclassKubernetes API
kube_storageclass_infoGaugestorageclass, provisioner, reclaim_policy, volume_binding_modeKubernetes API
kube_storageclass_labelsGaugestorageclassKubernetes API
kube_pod_spec_volumes_persistentvolumeclaims_infoGaugenamespace, pod, uid, volume, persistentvolumeclaimKubernetes API
kube_pod_spec_volumes_persistentvolumeclaims_readonlyGaugenamespace, pod, uid, volume, persistentvolumeclaimKubernetes API
kube_persistentvolumeclaim_status_conditionGaugenamespace, persistentvolumeclaim, type, statusKubernetes API
kube_persistentvolumeclaim_status_phaseGaugenamespace, persistentvolumeclaim, phaseKubernetes API
kube_persistentvolumeclaim_access_modeGaugenamespace, persistentvolumeclaim, access_modeKubernetes API
kubelet_volume_stats_inodesGaugenamespace, persistentvolumeclaimKubelet
kubelet_volume_stats_inodes_freeGaugenamespace, persistentvolumeclaimKubelet
kubelet_volume_stats_inodes_usedGaugenamespace, persistentvolumeclaimKubelet
kubelet_volume_stats_used_bytesGaugenamespace, persistentvolumeclaimKubelet
kubelet_volume_stats_available_bytesGaugenamespace, persistentvolumeclaimKubelet
kubelet_volume_stats_capacity_bytesGaugenamespace, persistentvolumeclaimKubelet
storage_operation_duration_seconds_bucketGaugeoperation_name, volume_plugin,leKubelet
storage_operation_duration_seconds_sumGaugeoperation_name, volume_pluginKubelet
storage_operation_duration_seconds_countGaugeoperation_name, volume_pluginKubelet
storage_operation_errors_totalGaugeoperation_name, volume_pluginKubelet
storage_operation_status_countGaugeoperation_name, status, volume_pluginKubelet