Skip to content

paksu/kafka-jolokia-telegraf-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-jolokia-telegraf-collector

Kafka broker JMX metric collection made easy with Telegraf

Parses Kafka Broker JMX metrics exposed via jolokia and converts them to a set of InfluxDB Line protocol metrics

Currently supports at least Kafka versions 0.9 or newer and Influxdb 0.13 or newer. May support older Kafka but not tested

If you use this script please let me know https://twitter.com/joonapaak

Requirements

Install and configure jolokia to expose Kafka Broker JMX metrics.

Setting KAFKA_OPTS=-javaagent:/path/to/jolokia/jolokia-1.3.3/agents/jolokia-jvm.jar when launching Kafka broker should be enough

Usage

How to run the script

python kafka_jolokia_reporter.py [--jolokia-host] [--jolokia-port] [--jolokia-context]

  • --jolokia-host defaults to localhost
  • --jolokia-port defaults to 8778
  • --jolokia-context defaults to /jolokia

Example: python kafka_jolokia_reporter.py --jolokia-host=localhost --jolokia-port=8778 --jolokia-context=/jolokia

Configure script to pass metrics to telegraf

The collector script works with Telegraf exec plugin.

Example configuration

[[inputs.exec]]
    commands = ["python /path/to/kafka_jolokia_reporter.py"]
    data_format = "influx"

About

Simple Kafka broker JMX metric collection with Telegraf

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages