Building Kafka Exporter - linux-on-ibm-z/docs GitHub Wiki

Building Kafka Exporter

The instructions provided below specify the steps to obtain Kafka Exporter latest version on Linux on IBM Z for the following distributions:

  • RHEL (7.8, 7.9, 8.6, 8.7, 8.8, 9.0, 9.1, 9.2)
  • SLES (12 SP5, 15 SP4)
  • Ubuntu (20.04, 22.04, 22.10, 23.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Kafka Exporter binaries are available and can be downloaded from here.

Note: Kafka Exporter(v1.7.0) was verified at the time of creation of these instructions

1. Start Apache Kafka

  • Get Apache Kafka -- Instructions for getting Apache Kafka can be found here

  • Start Apache Kafka -- Follow official quickstart guide given here to start Apache Kafka

2. Start Kafka Exporter

  • To start the process, extract binary tarball to /<source_root>/ and follow steps given below
export SOURCE_ROOT=/<source_root>/
export PATH=$PATH:$SOURCE_ROOT/<kafka_exporter_binary_folder>/
kafka_exporter --kafka.server=<kafka_host_name>:9092 [--kafka.server=another-server ...]

3. Verification (Optional)

  • After Kafka Exporter starts running, run the following command should return the exposed Prometheus metrics
curl http://localhost:9308/metrics
  • When there is one Apache Kafka instance connected, part of the output should look like this
# HELP kafka_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which kafka_exporter was built, and the goos and goarch for the build.
# TYPE kafka_exporter_build_info gauge
kafka_exporter_build_info{branch="HEAD",goarch="s390x",goos="linux",goversion="go1.20.4",revision="7e840e81a0170375214e2c1e1dc7ce94aeff8712",tags="netgo",version="1.7.0"} 1

Please refer to the official document for the metrics output details.

References: