Prometheus exporter that scrapes meta information about a ceph cluster
Go to file
ssobolewski 8c7e4dde45 Port over lumoinous changes for labels to nautilus branch 2020-06-15 15:58:23 -06:00
collectors Port over lumoinous changes for labels to nautilus branch 2020-06-15 15:58:23 -06:00
examples various edits to README and docker-compose 2017-05-01 16:35:28 -07:00
vendor Fixing metrics to be compatible with nautilus: modified struct for pg dump pgs_brief command, fixing pg_objects_recovered, osd_scrub_state, and osd recovery rate/pg query functionality that was added into luminous 2019-12-10 15:28:18 -05:00
.gitignore Add Ceph Exporter 2016-01-06 13:27:16 -05:00
.travis.yml Nautilus compatibility: due to change of ceph df detail output, removed total objects metric from cluster_usage collector and implemented it in health. Updated to go 1.13 2019-12-04 11:18:26 -05:00
CONTRIBUTING.md Add Ceph Exporter 2016-01-06 13:27:16 -05:00
Dockerfile add TEST flag to Dockerfile to run unit tests during build 2020-06-05 13:06:25 -04:00
LICENSE Add Ceph Exporter 2016-01-06 13:27:16 -05:00
Makefile Add Ceph Exporter 2016-01-06 13:27:16 -05:00
Makefile.COMMON Nautilus compatibility: due to change of ceph df detail output, removed total objects metric from cluster_usage collector and implemented it in health. Updated to go 1.13 2019-12-04 11:18:26 -05:00
README.md add TEST flag to Dockerfile to run unit tests during build 2020-06-05 13:06:25 -04:00
config.go health: added health check warnings map into collector, removed from config 2019-09-09 11:45:17 -04:00
exporter.go health: added health check warnings map into collector, removed from config 2019-09-09 11:45:17 -04:00
exporter.yml health: added health check warnings map into collector, removed from config 2019-09-09 11:45:17 -04:00
sample.png Add Ceph Exporter 2016-01-06 13:27:16 -05:00

README.md

Ceph Exporter GoDoc Build Status Coverage Status Go Report Card

Prometheus exporter that scrapes meta information about a running ceph cluster. All the information gathered from the cluster is done by interacting with the monitors using an appropriate wrapper over rados_mon_command(). Hence, no additional setup is necessary other than having a working ceph cluster.

Dependencies

You should ideally run this exporter from the client that can talk to Ceph. Like any other ceph client it needs the following files to run correctly.

  • ceph.conf containing your ceph configuration.
  • ceph.<user>.keyring in order to authenticate to your cluster.

Ceph exporter will automatically pick those up if they are present in any of the default locations. Otherwise you will need to provide the configuration manually using --ceph.config flag.

We use Ceph's official Golang client to run commands on the cluster.

Ceph exporter is tested only on Ceph's Hammer(v0.94) and Jewel(v10.2) releases. It might not work as expected with older or non-LTS versions of Ceph.

Flags

Name Description Default
telemetry.addr Host:Port pair to run exporter on *:9128
telemetry.path URL Path for surfacing metrics to prometheus /metrics
ceph.config Path to ceph configuration file ""
ceph.user Ceph user to connect to cluster admin
exporter.config Path to ceph_exporter configuration file /etc/ceph/exporter.yml
rgw.mode Enable collection of stats from RGW (0:disabled 1:enabled 2:background) 0

Installation

Typical way of installing in Go should work.

go install

A Makefile is provided in case you find a need for it.

Docker Image

Docker Hub

The official docker image is available at digitalocean/ceph_exporter.

Build From Source

It is also possible to build your own locally from the source. The port 9128 is exposed as a default port for ceph exporter.

The exporter needs your ceph configuration in order to establish communication with the monitors. You can either pass it in as an additional command or mount the directory containing both your ceph.conf and your user's keyring under the default /etc/ceph location that Ceph checks for.

A sample build command would look like:

$ docker build -t digitalocean/ceph_exporter .

A --build-args TEST=true flag can be added to the build command above to also run go test during build: docker build -t digitalocean/ceph_exporter . --build-arg TEST=true --no-cache

You can start running your ceph exporter container now.

$ docker run -v /etc/ceph:/etc/ceph -p=9128:9128 -it digitalocean/ceph_exporter

You would have to ensure your image can talk over to the monitors. If it needs access to your host's network stack you might need to add --net=host to the above command. It makes the port mapping redundant so the -p flag can be removed.

Point your prometheus to scrape from :9128 on your host now (or your port of choice if you decide to change it).

Contributing

Please refer to the CONTRIBUTING guide for more information on how to submit your changes to this repository.

Sample view

See ./examples for docker-compose file with Grafana if you'd like to quickly get a test environment up and running.

Link to official documentation explaining docker-compose: https://docs.docker.com/compose/

Docker-compose file itself has comments on how to change it to adapt to your environment. It does use volumes in order to persist data. Docker volumes documentation: https://docs.docker.com/engine/tutorials/dockervolumes/

If you have promdash set up you can generate views like:


Copyright @ 2016-2018 DigitalOcean™ Inc.