Kafka includes support for automatically reporting various metrics (messages, bytes per topic etc.) in it's kafka.metrics.KafkaCSVMetricsReporter
. This library provides an alternative which creates Riemann events.
Build the JAR and copy it to your Kafka install's ./libs
directory.
$ mvn package
$ cp target/kafka-riemann-reporter-0.1-SNAPSHOT-jar-with-dependencies.jar $KAFKA_HOME/libs
You can publish metrics directly to a running Riemann service; ensure the following is in your server.properties
:
kafka.metrics.polling.interval.secs=5
kafka.metrics.reporters=org.pingles.kafka.KafkaRiemannReporter
kafka.riemann.metrics.reporter.enabled=true
kafka.riemann.metrics.reporter.publisher=riemann
kafka.riemann.metrics.reporter.publisher.host=127.0.0.1
kafka.riemann.metrics.reporter.publisher.port=5555
Alternatively, you can create Riemann event messages and push them to a Kafka topic. Set the following in your server.properties
:
kafka.metrics.polling.interval.secs=5
kafka.metrics.reporters=org.pingles.kafka.KafkaRiemannReporter
kafka.riemann.metrics.reporter.enabled=true
kafka.riemann.metrics.reporter.publisher=kafka
kafka.riemann.metrics.reporter.publisher.topic=riemann_event