volume_exporter

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

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 cooperates, In nodes multiple projects run on same and/or different nodes, and hence host path mount cannot be granted, further node scapping cannont 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

Flag Description
web.listen-address Address to listen on for web interface and telemetry. Default is 9888
web.telemetry-path Path under which to expose metrics. Default is /metrics
volume-dir volumes 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

metrics Type Description
volume_bytes_total{volume_name=”someName”, volume_path=”/some/path”} Gauge Total size of the volume/disk
volume_bytes_free{volume_name=”someName”, volume_path=”/some/path”} Gauge Free size of the volume/disk
volume_bytes_used{volume_name=”someName”, volume_path=”/some/path”} Gauge Used 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{name="bin",path="/bin"} 4.3428974592e+10
volume_bytes_free{name="etc",path="/etc"} 4.3428974592e+10
# HELP volume_bytes_total Total size of the volume/disk
# TYPE volume_bytes_total gauge
volume_bytes_total{name="bin",path="/bin"} 6.391887872e+10
volume_bytes_total{name="etc",path="/etc"} 6.391887872e+10
# HELP volume_bytes_used Used size of volume/disk
# TYPE volume_bytes_used gauge
volume_bytes_used{name="bin",path="/bin"} 2.0489904128e+10
volume_bytes_used{name="etc",path="/etc"} 2.0489904128e+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.12",revision="",version=""} 1
# HELP volume_percentage_used Percentage of volume/disk Utilization
# TYPE volume_percentage_used gauge
volume_percentage_used{name="bin",path="/bin"} 32.056106956689746
volume_percentage_used{name="etc",path="/etc"} 32.056106956689746

Support

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

Contributions

To help Dexecutor development you are encouraged to

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

View My profile on LinkedIn

Inspired From

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL