Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Consumer Lag

Lag is an offset difference, not elapsed time. Diagnose the trend and business delay using the topic’s record rate and timestamps.

Terminal window
kafka-consumer-groups.sh --bootstrap-server kafka:9092 \
--describe --group orders-consumer
kafka-consumer-groups.sh --bootstrap-server kafka:9092 \
--describe --group orders-consumer --state
kafka-consumer-groups.sh --bootstrap-server kafka:9092 \
--describe --group orders-consumer --members --verbose

Record lag by partition, member assignment, input rate, consume/process rate, rebalance history, deployment changes, and downstream latency.

PatternLikely cause
All partitions growInsufficient total capacity or shared dependency
One partition growsHot key, broker/partition, or assigned member problem
Lag grows during rebalancesMember churn or slow callbacks
Lag jumps after outageExpected backlog; measure catch-up rate
Offset unavailableEmpty group, missing commit, ACL, or invalid position

Check records consumed, fetch latency, poll interval, processing latency, commit latency, assigned partitions, JVM pauses, CPU throttling, and external calls. Compare input rate with sustained processing rate and calculate whether catch-up meets the required recovery time.

Adding consumers helps only until active members equal partition count. It does not fix a single hot partition, slow external service, or broker-side fetch problem.

  • Restore unhealthy consumers or dependencies.
  • Scale active consumers where partitions permit.
  • Reduce per-record processing cost or batch external work safely.
  • Fix a hot partitioning key or add partitions only after evaluating ordering and key distribution.
  • Pause or shed noncritical input only through an approved application mechanism.

Lag decreases at a predictable rate, processing capacity exceeds arrival rate, members remain stable, commits progress, and end-to-end business delay returns to its objective.

See rebalance storm and offset out of range for related failures.