Kafka Integration
Use this integration when you want to monitor Kafka brokers, topics, and consumers in KloudMate through the OpenTelemetry kafkametrics receiver running in the KloudMate Agent.
Prerequisites
Section titled “Prerequisites”- Install and run the KloudMate Agent.
- Ensure your Kafka brokers are reachable from the node where the Agent is running.
- Have your Kafka broker addresses, protocol version, and authentication credentials ready.
Step 1: Define the Kafka Metrics Receiver
Section titled “Step 1: Define the Kafka Metrics Receiver”Add the following kafkametrics receiver to your Agent configuration file (typically /etc/km-agent/config.yaml). Replace the broker addresses, credentials, and protocol version to match your environment.
The scrapers block controls which data is collected. brokers, topics, and consumers are the three available options. The metrics listed under the metrics block are not enabled by default and must be explicitly set to enabled: true to be collected.
Step 2: Add to Pipeline
Section titled “Step 2: Add to Pipeline”Add the kafkametrics receiver to the metrics pipeline in your Agent configuration.
Step 3: Restart the Agent
Section titled “Step 3: Restart the Agent”Step 4: Validate in KloudMate
Section titled “Step 4: Validate in KloudMate”After the Agent restarts:
- Open Explore in KloudMate.
- Query one of the scraped Kafka metrics, such as
kafka.brokersorkafka.topic.partitions. - Build dashboards or alarms once the data is visible.
Standard Kafka Dashboards
Section titled “Standard Kafka Dashboards”KloudMate provides prebuilt Kafka dashboards through dashboard templates. These dashboards help you visualize broker availability, topic partitions, consumer lag, offsets, and replication health.
To import and start using these templates, follow the steps described in Import from Templates.
Default Kafka Metrics
Section titled “Default Kafka Metrics”Kafka Monitoring automatically collects commonly used Kafka metrics when enabled.
Example Metrics
| Metric Name | Description |
|---|---|
| kafka.brokers | Number of brokers in the cluster. |
| kafka.topic.partitions | Number of partitions in a topic. |
| kafka.partition.current_offset | Current offset of a topic partition. |
| kafka.partition.oldest_offset | Oldest available offset of a topic partition. |
| kafka.partition.replicas | Number of replicas configured for a topic partition. |
| kafka.partition.replicas_in_sync | Number of in-sync replicas for a topic partition. |
| kafka.consumer_group.members | Number of members in a consumer group. |
| kafka.consumer_group.lag | Current approximate lag of a consumer group for a topic partition. |
| kafka.consumer_group.lag_sum | Current approximate sum of consumer group lag across all topic partitions. |
| kafka.consumer_group.offset | Current consumer group offset for a topic partition. |
| kafka.consumer_group.offset_sum | Sum of consumer group offsets across topic partitions. |
For the complete metrics list, refer to the metrics reference.