Monitoring Kafka with OpenTelemetry means collecting broker and consumer metrics through the OpenTelemetry Collector's Kafka receivers over OTLP, so streaming health, especially consumer lag, is fully visible..
Monitoring Kafka with OpenTelemetry means collecting broker and consumer metrics through the OpenTelemetry Collector's Kafka receivers over OTLP, so streaming health, especially consumer lag, is fully visible.
The defining Kafka signal is consumer-group lag, how far each consumer group is behind the newest offset on each topic and partition, because lag that grows without bound means data is not being processed in time, and everything downstream goes stale. Around it you watch the broker fabric: under-replicated partitions, offline partitions, request latency, throughput, and broker disk usage.
Reading lag correctly means reading it per partition, not just as a group total: a single hot or stuck partition can hide inside a healthy-looking aggregate, and it is usually the partition, not the whole group, that is the incident.
The OpenTelemetry Collector's kafkametrics receiver connects to the brokers and collects the fabric-level and consumer-level metrics, broker and partition counts, per-partition current and oldest offsets, in-sync replica counts, and consumer-group lag and offsets, without running an agent on the brokers. For broker JVM and internal metrics, the JMX receiver reads Kafka's MBeans over a JMX port.
Producers and consumers instrumented with OpenTelemetry add the other half: traces that follow a message from producer through the broker to the consumer, so you can see not just that lag exists but where in the pipeline a message stalls. The setup detail to get right is pointing kafkametrics at the bootstrap brokers with the correct protocol and credentials; consumer lag is derived from the difference between the partition's latest offset and the group's committed offset, so both must be readable.
The signals that explain most Kafka incidents:
| Signal | Source | What it tells you / watch for |
|---|---|---|
kafka.consumer_group.lag | kafkametrics receiver | Per-group, per-partition lag. The single most important Kafka signal; watch the trend, not the instant value. |
kafka.consumer_group.lag_sum | kafkametrics receiver | Total lag per group; useful for a top-line view but hides hot partitions. |
kafka.partition.replicas vs replicas_in_sync | kafkametrics receiver | Their difference is under-replicated partitions, the sign a broker is down or lagging. |
kafka.partition.current_offset rate | kafkametrics receiver | Produce/consume throughput per partition; a sudden drop can mean a stalled producer or consumer. |
consumer-group members | kafkametrics receiver | Members dropping to zero, or churning, indicates crashes or rebalance storms. |
broker disk usage | host/JMX | Kafka retains data on disk; a full broker disk takes partitions offline. |
A Kafka dashboard should surface lag and replication health first. Row one: consumer-group lag over time per group and topic (a rising line is the alarm), and the top partitions by lag to catch the hot-partition case. Row two: under-replicated partition count derived from replicas minus in-sync replicas, and offline partitions. Row three: throughput per topic and broker disk usage, so a stalled pipeline or a filling disk is visible early.
# consumer lag by group and topic (watch the slope, not the value)
kafka.consumer_group.lag by (group, topic)
# under-replicated partitions = replicas that are not in sync
kafka.partition.replicas - kafka.partition.replicas_in_sync
# throughput per partition (a drop can mean a stalled consumer)
rate(kafka.partition.current_offset[5m]) by (topic, partition)
Lag climbs steadily for a group while producers keep writing, so consumers are falling behind. Read it per partition: if one partition dominates, the consumer handling it is slow or stuck; if all rise together, the group is under-provisioned or repeatedly rebalancing. Scale consumers, fix the slow processing, or stop the rebalance loop.
The count of partitions whose replicas are not all in sync rises, meaning a broker is down or too slow to keep up, and durability is at risk. Identify the lagging broker from the fabric metrics; the cause is usually a broker under disk or network pressure, or a broker that has fallen out of the cluster.
Consumer-group membership churns and lag sawtooths as the group repeatedly rebalances, pausing consumption each time. The tell is members joining and leaving in the metrics. Causes include consumers exceeding the session timeout because processing is too slow, or unstable instances; tune timeouts and processing, or stabilise the consumers.
Starting thresholds to tune:
| Condition | Signal | Meaning |
|---|---|---|
| consumer_group.lag rising for 15m | lag | Consumers falling behind; data going stale. |
| replicas - replicas_in_sync > 0 for 5m | replication | Under-replicated partitions; durability at risk. |
| offline partitions > 0 | availability | Data unavailable; a broker or disk has failed. |
| broker disk usage > 85% | capacity | Approaching the point where partitions go offline. |
Ops Singularity's TelemetryOps ingests Kafka telemetry over OpenTelemetry, and its DataOps and Sentinel capabilities resolve streaming incidents, growing lag, a stalled consumer, an under-replicated partition, through governed Action Tickets. Explore TelemetryOps and DataOps.
Use the OpenTelemetry Collector's kafkametrics receiver, which collects consumer-group lag per topic along with broker and topic metrics, exported over OTLP.
Consumer-group lag, under-replicated and offline partitions, request and produce latency, throughput, and broker disk usage.
Bring a real incident. We will show you Sentinel investigate, act and verify end to end, with every action reversible and audited.