Sign inSign up

mnadeem/volume_exporter

By mnadeem

•Updated about 3 years ago

Useful to monitor disk/volume/PV storage

Image
1

100K+

mnadeem/volume_exporter repository overview

⁠Volume Exporter

Build Status License Docker Docker Pulls Go Report Card

Useful to monitor disk/volume/PV storage, for various reasons

  • Host path cannot to be mounted to container/Deamonset
  • In ability⁠ of Cloud provider to gather information about PV

This is what happens in corporates, Multiple projects run on same and/or different nodes, and hence host path mount cannot be granted, further node scrapping cannot be done as well, since it requires cluster role, as in a cluster multiple projects/namespace runs, and hence cluster role is not granted to project teams.

Above I have listed some of the use cases ( real world ) where in node exporter cannot be deployed, should this stop us from monitoring pv/volumes/disk?

This is altogether a different exporter and does not duplicate any existing exporters. Its area of focus (Where ever node exporter cannot be deployed) is altogether different.

It just fills the vacuum

⁠Wiki

Refer project wiki⁠ for more details

⁠Running

⁠Command Line locally
go run main.go --volume-dir=practices:E:\practices
⁠Usage
Usage of Temp\go-build869878202\b001\exe\main.exe:
  -volume-dir value
        Volumes to report, the format is volumeName:VolumeDir;
         For example ==> logs:/app/logs; can be used multiple times to provide more than one value
  -web.listen-address string
        Address to listen on for web interface and telemetry. (default ":9888")
  -web.telemetry-path string
        Path under which to expose metrics. (default "/metrics")
⁠Docker Locally
docker run --rm -p 9889:9888 -it mnadeem/volume_exporter --volume-dir=bin:/bin
⁠Deploy It in Cloud

Add as a sidecar

        - name: volume-exporter
          image:  mnadeem/volume_exporter
          imagePullPolicy: "Always"
          args:
            - --volume-dir=prometheus:/prometheus
          ports:
          - name: metrics-volume
            containerPort: 9888
          volumeMounts:
          - mountPath: /prometheus
            name: prometheus-data
            readOnly: true

⁠Config

FlagDescription
web.listen-addressAddress to listen on for web interface and telemetry. Default is 9888
web.telemetry-pathPath under which to expose metrics. Default is /metrics
volume-dirvolumes to report, the format is volumeName:VolumeDir, For example ==> logs:/app/logs, you can use this flag multiple times to provide multiple volumes

⁠Exporterd Metrics

metricsTypeDescription
volume_bytes_total{volume_name=”someName”, volume_path=”/some/path”}GaugeTotal size of the volume/disk
volume_bytes_free{volume_name=”someName”, volume_path=”/some/path”}GaugeFree size of the volume/disk
volume_bytes_used{volume_name=”someName”, volume_path=”/some/path”}GaugeUsed size of volume/disk

Here is a sample metrics exporterd by running

docker run --rm -p 9888:9888  -it docker.repo1.uhc.com/mnadeem/volume_exporter:latest  -volume-dir=bin:/bin -volume-dir=etc:/etc
# HELP volume_bytes_free Free size of the volume/disk
# TYPE volume_bytes_free gauge
volume_bytes_free{volume_name="bin",volume_path="/bin"} 4.341569536e+10
volume_bytes_free{volume_name="etc",volume_path="/etc"} 4.341569536e+10
# HELP volume_bytes_total Total size of the volume/disk
# TYPE volume_bytes_total gauge
volume_bytes_total{volume_name="bin",volume_path="/bin"} 6.391887872e+10
volume_bytes_total{volume_name="etc",volume_path="/etc"} 6.391887872e+10
# HELP volume_bytes_used Used size of volume/disk
# TYPE volume_bytes_used gauge
volume_bytes_used{volume_name="bin",volume_path="/bin"} 2.050318336e+10
volume_bytes_used{volume_name="etc",volume_path="/etc"} 2.050318336e+10
# HELP volume_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which volume_exporter was built.
# TYPE volume_exporter_build_info gauge
volume_exporter_build_info{branch="",goversion="go1.15",revision="",version=""} 1
# HELP volume_percentage_used Percentage of volume/disk Utilization
# TYPE volume_percentage_used gauge
volume_percentage_used{volume_name="bin",volume_path="/bin"} 32.07688208958619
volume_percentage_used{volume_name="etc",volume_path="/etc"} 32.07688208958619

⁠Support

If you need help using volume_exporter feel free to drop an email or create an issue⁠ (preferred)

⁠Contributions

To help development you are encouraged to

  • Provide suggestion/feedback/Issue
  • pull requests for new features
  • Star :star2: the project

View My profile on LinkedIn

⁠Inspired From

Tag summary

Content type

Image

Digest

sha256:5147999b7…

Size

8.6 MB

Last updated

about 3 years ago

docker pull mnadeem/volume_exporter