Giter Club home page Giter Club logo

kafka-monitoring-tool's Introduction

Project Description

This is an application to track the offsets for all the consumer groups in a Kafka cluster. This app will collect offset information for both a regular Kafka consumer and also Storm-Kafka Spout. The app provides a rest endpoint that can be called on-demand to get this information. You can also configure the app to push the offset metrics at a regular interval to a StatsD server, so that you can use a metric collection system like InfluxDB/Grafana to collect the information from StatsD and monitor.

Prerequisites

Java 1.7 Maven 3

Installation (install commands)

git clone https://github.com/Symantec/kafka-monitoring-tool.git

cd kafka-monitoring-tool

mvn package

You will have the kafka-monitoring-tool-0.0.1.jar created in the “target” directory.

Running project

java -jar target/kafka-monitoring-tool-0.0.1.jar server

By default the application assumes the zookeeper is running localhost on port 2181. If you need to provide a zookeeper host, pass it as a jvm parameter like this:

java -Ddw.zookeeperUrls=ZKHOST:ZKPORT,ZKHOST:ZKPORT,ZKHOST:PORT -jar kafka-monitoring-tool-0.0.1.jar server

Once the server is up, run the following command from localhost to get the information in a json format. curl -X GET http://localhost:8080/kafka/offset

Configuration (config commands)

The application can also be passed a yml file as a configuration file, instead of passing the zookeeper urls on the command line. Default.yml file is available in the project. The way you start the project with yml file is like this:

java -jar kafka-monitoring-tool-0.0.1.jar server default.yml

API parameters

There are few Query Params you can pass to the API to get specific results. Examples are:

If you would like the output in a HTML format instead of Json format, try this: http://localhost:8080/kafka/offset?outputType=html

If you would like to get only the offsets from a regular consumers, try with the consumerType=regular parameter, example: http://localhost:8080/kafka/offset?consumerType=regular

If you would only like the storm spout consumers, try this: http://localhost:8080/kafka/offset?consumerType=spout

PushToStatsD

If you would like to push the stats to a StatsD server, you can configure the service to do so. You just need to enable the the pushToStatsD property. By default the application assumes the statsD is listening on the localhost at port 8125.

java -Ddw.zookeeperUrls=ZKHOST:ZKPORT,ZKHOST:ZKPORT,ZKHOST:PORT -Ddw.pushToStatsD=true -jar kafka-monitoring-0.1.0.jar server

By default the metrics are collected and pushed every 60 seconds. If you want to change the frequency, set this property: java -Ddw.zookeeperUrls=ZKHOST:ZKPORT,ZKHOST:ZKPORT,ZKHOST:PORT -Ddw.pushToStatsD=true —Ddw.refreshSeconds=60 -jar kafka-monitoring-tool-0.0.1.jar server

To push metrics to statsd server listening on a different host on a different port, set the following parameters: java -Ddw.zookeeperUrls=ZKHOST:ZKPORT,ZKHOST:ZKPORT,ZKHOST:PORT -Ddw.pushToStatsD=true —Ddw.refreshSeconds=60 -Ddw.statsDHost=locahost —Ddw.statsDPort=8125 -Ddw.statsDPrefix=kafka-monitor -jar kafka-monitoring-tool-0.0.1.jar server

You can also configure all these properties in a yml config file and pass in the config file to the app, like java -jar kafka-monitoring-tool-0.0.1.jar server default.yml

kafka-monitoring-tool's People

Contributors

karthikkrk 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.