Messaginglagoffset lagbacklog

Consumer lag

Definition

Consumer lag is the gap between the latest offset written to a partition and the offset the consumer group has committed, or equivalently the age of the oldest unprocessed record.

In practice

Lag is the main health signal for stream processing. Steady near-zero lag means consumers keep up; lag that grows means producers outpace consumers, and every downstream view is getting staler. Time-based lag (how many seconds behind) is easier to alert on than record counts, because record rates vary.

Look at lag per partition, not just per group: one hot or stuck partition can grow while the average looks fine. Adding consumers helps only up to the number of partitions, and if lag outlasts retention, unread records are deleted. Lag that spikes during rebalances and recovers is normal; lag that never recovers is not.

Example

Partition 7 of orders has its latest offset at 1,204,500 and the billing group has committed 1,180,100, a lag of 24,400 records or about 4 minutes.