Code Monkey home page Code Monkey logo

gluster-prometheus's Introduction

Prometheus exporter for Gluster Metrics

Build Status

These exporters will be run on all Gluster peers, So it makes sense to collect only local metrics and aggregate in Prometheus server when required.

Install

mkdir -p $GOPATH/src/github.com/gluster
cd $GOPATH/src/github.com/gluster
git clone https://github.com/gluster/gluster-prometheus.git
cd gluster-prometheus
PREFIX=/usr make
PREFIX=/usr make install

Usage

Run gluster-exporter with default settings, glusterd is consumable at http://localhost:8080/metrics

systemctl enable gluster-exporter
systemctl start gluster-exporter

Systemd service uses following configuration file for global and collectors related configurations.

/etc/gluster-exporter/gluster-exporter.toml
[globals]
gluster-mgmt = "glusterd"
glusterd-dir = "/var/lib/glusterd"
gluster-binary-path = "gluster"
gd2-rest-endpoint = "http://127.0.0.1:24007"
port = 8080
metrics-path = "/metrics"
log-dir = "/var/log"
log-file = "gluster-exporter.log"
log-level = "info"

[collectors.gluster_ps]
name = "gluster_ps"
sync-interval = 5
disabled = false

[collectors.gluster_brick]
name = "gluster_brick"
sync-interval = 5
disabled = false

To use gluster-exporter without systemd,

gluster-exporter --config=/etc/gluster-exporter/gluster-exporter.toml

Metrics

List of supported metrics are documented here.

Adding New metrics

glusterCPUPercentage = prometheus.NewGaugeVec(
    prometheus.GaugeOpts{
        Namespace: "gluster",
        Name:      "cpu_percentage",
        Help:      "CPU Percentage used by Gluster processes",
    },
    []string{"volume", "peerid", "brick_path"},
)
  • Implement the function to gather data, and register to gather data in required interval

prometheus.MustRegister(glusterCPUPercentage)

registerMetric("gluster_brick", brickUtilization)
  • Add an entry in /etc/gluster-exporter/gluster-exporter.toml

[collectors.gluster_ps]
name = "gluster_ps"
sync-interval = 5
disabled = false
  • Thats it! Exporter will run these registered metrics.

gluster-prometheus's People

Contributors

aravindavk avatar drevilish avatar sidharthanup avatar vredara avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.