Metrics data cannot be displayed in UA plug-in for Kafka

Metrics data cannot be displayed in Kafka plug-in because mntr is not executed in Zookeeper.

Problem

After you install and configure the Kafka plug-in, the metrics cannot be displayed in the console. By looking into the UA log, you can find the following error:

2020-06-05T18:07:18Z E! [inputs.zookeeper]: Error in plugin: unexpected line in mntr response: "mntr is not executed because it is not in the whitelist."

Cause

mntr is not executed because it is not in the whitelist of Zookeeper.

Solution

Add mntr into the whitelist.

  1. Edit zookeeper-server-start.sh, for example, run vim zookeeper-server-start.sh.
  2. Append the following line:
    EXTRA_ARGS=${EXTRA_ARGS-'-name zookeeper -loggc -Dzookeeper.4lw.commands.whitelist=*'}