openebs-archive / monitor-pv

custom stats collector for OpenEBS persistent volumes
Apache License 2.0
4 stars 5 forks source link
hostpath kubernetes monitoring openebs persistent-volumes pre-alpha prometheus-exporter storage

monitor-pv

custom stats collector for OpenEBS persistent volumes (jiva, localpv)

Pre-requisite

How to use

How it works

The monitor PV daemonset pods consist of two containers i.e node-exporter and monitor-pv. The monitor-pv collects the PV size and PV utilization information & places it in a file on the shared mount. The node exporter uses its text-file collector to expose this data as metrics.

It exposes two metrics pv_capacity_bytes and pv_utilization_bytes.

Prometheus Configuration

To scrape the metrics in prometheus add this configuration in prometheus configuration file:

    - job_name: 'monitor-pv'
      kubernetes_sd_configs:
      - role: pod
      relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app]
        regex: monitor-pv
        action: keep

If you want to scrape only monitor-pv metrics and drop all other node-exporter metrics use the below configuration:

    - job_name: 'monitor-pv'
      kubernetes_sd_configs:
      - role: pod
      relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app]
        regex: monitor-pv
        action: keep
      metric_relabel_configs:
      - source_labels: [__name__]
        regex: '(pv_capacity_bytes|pv_utilization_bytes)'
        action: keep

Example:

monitor-pv-1

monitor-pv-2