Archsaber agent can monitor Kafka (broker) running on the same server. Kafka exposes metrics via JMX and we collect them using a lightweight JMX connector - Jolokia, that you need to run alongside your Kafka instance (instructions below).

Our agent needs the Jolokia port and the username & password (if auth is enabled). If unspecified the default valued as below will be used.

The data.json entry for this plugin:

"kafka": {
     "port" : 8778,
     "username": "",
     "password": ""

Having updated data.json on your server (no need to restart archagent), enable this plugin from the server's rule config page. Set thresholds for metrics that you care about and want to be alerted on. Enabling a plugin.

Setting up Jolokia

Download the stable release version of jolokia

# Find out the release version number of jolokia
jolokia_version=$(curl -s | grep "<release>" \
| sed "s/.*<release>\([^<]*\)<\/release>.*/\1/")

# Release version number of jolokia
echo "${jolokia_version}"

# Download the jolokia agent
curl "${jolokia_version}/jolokia-jvm-${jolokia_version}-agent.jar" \
-o "jolokia-jvm-${jolokia_version}-agent.jar"

# Your jolokia agent name
echo "jolokia-jvm-${jolokia_version}-agent.jar"

We will now connect the jolokia agent to Kafka.

Now connect using the following command (to be run as the same user as the kafka instance)

java -jar "jolokia-jvm-${jolokia_version}-agent.jar" start <pid_of_kafka_instance>

If you see a Started Jolokia for PID ... message, we are done. If somehow, jolokia can't connect to kafka, we'll need to restart kafka with the jolokia agent, as detailed below.

Add jolokia agent to your kafka installation

Move the already downloaded jolokia agent to the $KAFKA_HOME/libs folder. Add the following line in the file (usually located at $KAFKA_HOME/bin). Change the port number as per the system, but make sure to update data.json. Do not forget to restart Kafka.

# Replace with your jolokia agent name as downloaded above.
export JOLOKIA_JAR=$JOLOKIA_HOME/<your jolokia agent name>
export KAFKA_OPTS="-javaagent:$JOLOKIA_JAR=port=8778,host=* $KAFKA_OPTS"

results matching ""

    No results matching ""