CollectD plugin for ZooKeeper metrics
Clone or download
odcinek Merge pull request #10 from odcinek/master
Fix for zk_service_health
Latest commit ed01f7d Jan 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.arcconfig add arcconfig Jul 2, 2014
.gitignore Plugin cleanups, documentation and license Jul 19, 2015
LICENSE Plugin cleanups, documentation and license Jul 19, 2015
README.md Update zk_service_health metric when not serving. Apr 21, 2017
zk-collectd.py Fix for zk_service_health Jan 3, 2019

README.md

CollectD ZooKeeper plugin

CollectD plugin for getting metrics and information from ZooKeeper servers. Based off the ZooKeeper monitoring script check_zookeeper.py.

Requires ZooKeeper 3.4.0 or greater in order to use the mntr four letter word command.

TODO: if support for earlier versions is needed, add srvr command, available in since 3.3.0, or stat (fetches extra uneeded data but available pre-3.3).

Install

  1. Checkout this repository somewhere on your system accessible by collectd; for example as /usr/share/collectd/collectd-zookeeper
  2. Configure the plugin (see below).
  3. Restart collectd.

Configuration

Add the following to your collectd config:

<LoadPlugin "python">
  Globals true
</LoadPlugin>

<Plugin python>
  ModulePath "/usr/share/collectd/collectd-zookeeper"
  Import "zk-collectd"

  <Module "zk-collectd">
    Hosts "localhost"
    Port 2181
  </Module>

  # You may have as many Module sections as you want
  <Module "zk-collectd">
    Hosts "localhost"
    Port 2182
    Instance "dev"
  </Module>
</Plugin>

Metrics

All metrics are reported with the plugin:zookeeper dimension. Additionally, if you specify an Instance in your Module configuration block, its value will be reported as the plugin_instance dimension.

zk_is_leader is a synthetic metric which is 0 if the contents of zk_server_state is 'follower'. zk_service_health is a synthetic metric which tracks if service is running and servicing requests.

License

Available under the terms of the Apache Software License v2. See LICENSE file for details.