Kafka JMX Exporter Integration
Use this integration when your Kafka cluster runs on Kubernetes through Strimzi and already exposes JMX metrics in Prometheus format. It’s a Kubernetes-native alternative to Kafka Integration’s kafka_metrics receiver: instead of connecting to the Kafka protocol directly, the KloudMate Agent scrapes the JMX Prometheus Exporter endpoint that Strimzi already exposes on each broker and exporter pod.
Prerequisites
Section titled “Prerequisites”- A Strimzi Kafka cluster.
- The JMX Prometheus Exporter enabled on the cluster.
- Metrics are exposed on port
9404.
Step 1: Install the Agent
Section titled “Step 1: Install the Agent”Install and run the KloudMate Agent in your Kubernetes cluster. See Kubernetes for the Helm install steps.
Step 2: Open the Collector Configuration
Section titled “Step 2: Open the Collector Configuration”- Go to Settings → Agents.
- Find the agent you want to configure and select the three dots.
- Choose Configure.
- Go to Collector config.
Step 3: Add the Kafka JMX Configuration
Section titled “Step 3: Add the Kafka JMX Configuration”Add the following configuration. Replace the kafka-prod regex with your own Kafka namespace.
- If the agent runs in managed mode, add it to the Custom config override section. See Custom config override.
- If the agent runs in manual mode, add it directly to the collector configuration.
This uses Kubernetes service discovery to find every pod in the cluster, then narrows the scrape targets down through three relabel_configs stages: the first keeps only pods in the kafka-prod namespace, the second keeps only pods whose Strimzi component-type label is kafka or kafka-exporter, and the third keeps only the tcp-prometheus container port those pods expose.
Step 4: Save the Configuration
Section titled “Step 4: Save the Configuration”Click Save. The Agent restarts and applies the new configuration.
Step 5: Validate in KloudMate
Section titled “Step 5: Validate in KloudMate”After the Agent restarts:
- Open Explore in KloudMate.
- Query one of the scraped metrics, for example:
- Build dashboards or alerts once the data is visible.
Kafka Exporter Dashboard
Section titled “Kafka Exporter Dashboard”Once the metrics are flowing, you can visualize broker availability, partition and replica health, message rates, and consumer group lag.
Metrics Collected
Section titled “Metrics Collected”This integration collects:
- Kafka broker metrics
- Kafka topic metrics
- Kafka consumer group metrics
- Kafka Exporter metrics
- JVM metrics
- Broker health metrics
- Replication metrics
- Network metrics
- Request metrics
- Controller metrics
Related
Section titled “Related”- Kafka Integration — the
kafka_metricsreceiver alternative, for brokers reachable directly over the Kafka protocol instead of through JMX. - Prometheus Integration — the general-purpose pattern this integration builds on.
- Custom config override — how to add this receiver to a managed KloudMate Agent.
- Explore — where to query the collected metrics.