zookeeper exporter for prometheus
Switch branches/tags
Nothing to show
Clone or download
dabealu Merge pull request #3 from dabealu/no-serving-leader
fix metrics formatting if leader doesn't respond to mntr
Latest commit ba56aa5 Jul 14, 2018


Prometheus zookeeper exporter

Exports mntr zookeeper's stats in prometheus format.
zk_followers, zk_synced_followers and zk_pending_syncs metrics are available only on cluster leader.


./build.sh script builds dabealu/zookeeper-exporter:latest docker image.
To build image with different name, pass it to build.sh as a first arg.


Usage of /usr/local/bin/zookeeper-exporter:
  -listen string
        address to listen on (default "")
  -location string
        metrics location (default "/metrics")
  -zk-host string
        zookeeper host (default "")
  -zk-list string
        comma separated list of zk servers, i.e. ',,', this flag overrides --zk-host/port
  -zk-port string
        zookeeper port (default "2181")

An example docker-compose.yml can be used for management of clustered zookeeper + exporters:

# start zk cluster and exporters
docker-compose up -d

# get metrics of first exporter (second and third exporters are on 8082 and 8083 ports)
curl -s localhost:8081/metrics

# at 8084 port there's exporter which handles multiple zk hosts
curl -s localhost:8084/metrics

# shutdown containers
docker-compose down -v