community
community copied to clipboard
New community plugin for kafka
From slack: khaled [8:43 AM]  hey i made a handler for sending checks result to kafka , would it be inetresting to share it ?
 matt [8:44 AM]  @khaled absolutely!! Mind linking us to it?
 khaled [8:44 AM]  it's just a litte .rb file , how cani share it ?
majormoses I will create the repo and do some basic setup.
Ok so here is the Handler, i didn't make options to add parameters so there is 3 stuff you may want to change manually in the code :
-the broker (kafka ip) -the name of the destination topic in kafka -and what is sended(here it's event.inspect which contain the json check result it was enough for me)
here is the code :
https://gist.github.com/bk-khaled/4f47a26258cfb9be8b5909639fa6e375
If you have trouble installing the package 'kafka' it's mostly a PATH issue ( you have to install it in the right directory) if you have trouble like : failed to send message , if kafka in a remote machine, you should change the server.properties of kafka, uncomment listners.host and put there the kafka IP, then restart kafka
Finally, add a handler, pipe type, with this file as a command to get your checks result sended to kafka
PS: this is the ruby kafka package used in the code https://github.com/zendesk/ruby-kafka
Looks like a repo is still needed here. Very cool work @bk-khaled, we need to tackle this soon!
Looks like we should reach out and see about incorporating this: https://github.com/uswitch/sensu-plugins-kafka-lag
sorry for the long silence I have been quite busy. I have created the base for the kafka plugin to be worked on, once it is reviewed and merged we can start adding actual checks, handlers. etc.
@majormoses this one looks more comprehensive: https://github.com/obazoud/sensu-plugins-kafka/
I will reach out, sorry this got lost in the all that was going on at the time for me.