Here we'll go over the Kafka Consumer Lag Data Source configuration fields, and show how to add a Consumer Lag graph. Please see our Kafka Overview article for details about other Kafka data sources besides Consumer Lag.
The Kafka Lag plugin collects lag metrics for each consumer group talking to Kafka. It can be deployed anywhere such as on the Kafka cluster or on the application cluster reading from Kafka.
Configure Kafka Consumer Lag Data Sources
Open up the configuration modal
for Kafka, and click on the Configure Data Sources tab. In the Add a data source drop down menu 
, select Kafka Consumer Group
. Click on Edit 
to the right to expose the fields that need to be configured 
The plugin requires the following information:
Hostname / IP for the host in this service cluster which should do the work of collecting data.
||Hostname(or IP):Port # pair for the Zookeeper service managing the Kafka cluster e.g. Host:2181.
||Optional suffix to reinterpret all paths relative to this root.
||If you specify the group name, it will collect metrics only for that consumer group. If you leave it blank, it will collect metrics for all the consumer groups. Metrics will have the group name as a tag.
|Run as unix user
||Leave empty or type "nobody".
Adding Consumer Lag Graph
With the correct service selected, click on Metrics from the upper right navigation panel , and then click on Add Graph :
In the top filter field, type "lag"  and scroll down to find and click on "lag" . Under the curve option, you can select topic for a per topic graph :
If you have any questions or comments about this article, feel free to contact us at firstname.lastname@example.org.