Sign inSign up

msales/kage

By msales

•Updated almost 7 years ago

Kafka monitoring agent

Image
0

2.9K

msales/kage repository overview

⁠Kage

Go Report Card Build Status Docker build Coverage Status GitHub release GitHub license

⁠Synopsis

Kage (as in "Kafka AGEnt") reads Offset- and Lag metrics from Kafka and writes them to an InfluxDB.

⁠Motivation

When you're running Kafka you probably want to have monitoring as well.
You can - of course - query the beans directly via JMX and work with that, but that requires another JVM that collects the data.
If you're a java-shop anyway and have all that available - give it a try. We decided that we wanted to get the metrics straight out of Kafka and feed them into InfluxDB in a configurable way - and here we are now.

⁠Basic Installation

Grab a binary from the Releases or clone the repo and build it yourself.
Run the binary with the configuration options found below.

kage agent <CONFIG OPTIONS>

⁠Advanced Installation

There's systemd configuration magic in examples/systemd/.
Put the files in the appropriate directories on your machine (in case of Debian/Ubuntu that should be /lib/systemd/system and /lib/systemd/system-generators), remember to chmod 0755 the generator, create /etc/kage/, run systemctl daemon-reload and then you should get one service per configuration-file in /etc/kage/.

⁠Configuration

Kage can be configured with command line flags and environment variables.

⁠Command Line Flags
FlagOptionsMultiple AllowedDescriptionEnvironment Variable
--logstdout, fileNoThe type of log to use.KAGE_LOG
--log.fileNoThe path to the file to log to.KAGE_LOG_FILE
--log.leveldebug, info, warn, errorNoThe log level to use.KAGE_LOG_LEVEL
--kafka.brokersYesThe kafka seed brokers connect to. Format: 'ip:port'.KAGE_KAFKA_BROKERS
--kafka.ignore-topicsYesThe kafka topic patterns to ignore. This may contian wildcards.KAGE_KAFKA_IGNORE_TOPICS
--kafka.ignore-groupsYesThe kafka consumer group patterns to ignore. This may contian wildcards.KAGE_KAFKA_IGNORE_GROUPS
--reportersinflux, stdoutYesThe reporters to use.KAGE_REPORTERS
--influxNoThe DSN of the InfluxDB server to report to. Format: http://user:pass@ip:port/database⁠'.KAGE_INFLUX
--influx.metricNoThe measurement name to report statistics under.KAGE_INFLUX_METRIC
--influx.policyNoThe retention policy to report statistics under.KAGE_INFLUX_POLICY
--influx.tagsYesAdditional tags to add to the statistics. Format: 'key=value'KAGE_INFLUX_TAGS
--serverNoStart the http server.KAGE_SERVER
--portNoThe port to bind to for the http server.KAGE_PORT
⁠Multi value environment variables

When using environment variables where mutltiple values are allowed, the values should be comma seperated. E.g. --reporters=stdout --reporters=influx should become KAGE_REPORTERS=stdout,influx.

⁠HTTP Endpoints

Kage has an optional http server that can be enabled with the --server configuration. This allows health checking as well as fetching broker and consumer group information. The endpoints are as follows:

⁠GET /health

Gets the current health status of Kage. Returns a 200 status code if Kage is healthy, otherwise a 500 status code

⁠GET /brokers

Get the state of all known brokers.

⁠GET /brokers/health

Get the current kafka health status. Returns a 200 status code if all brokers are connected, otherwise a 500 status code

⁠GET /topics

Get a topic offset information in json format.

⁠GET /metadata

Get a topic metadata information in json format.

⁠GET /consumers

Get a consumer group offset information in json format.

⁠GET /consumers/:group

Get a consumer group offset information for the specified consumer group in json format, or will return with a 404 status code.

⁠Contributors

We're supposed to tell you how to contribute to kage here.
Since this is github: You know the drill - open issues, fork, create PRs, ...

⁠TODO

  • provide ansible-templates and examples
  • set up debian packaging

⁠License

MIT-License. As is. No warranties whatsoever. Mileage may vary. Batteries not included.

Tag summary

Content type

Image

Digest

Size

3.2 MB

Last updated

almost 7 years ago

docker pull msales/kage