Consumer lag
Consumer lag measures how much a consumer’s processing position trails the latest available data or events.
Apache Kafka in Action
A consumer lag metric reports replication lag separately for each follower, topic, and partition.
- How it is used
- Tracks replication delay separately for each follower, topic, and partition.
- How deep it goes
- Defines the metric's scope and operating expectations, but does not give a collection command or alert threshold.
- Examples
- Uses leader-and-follower replication as its operating case; offset tables illustrate the distinct consumer-group lag.
- What you can do after
- Diagnose/debug with it by locating a lagging follower, topic, and partition and watching for progressively increasing delay.
Kafka for Architects
Lag is the amount by which processing or consumption falls behind the latest available data.
- How it is used
- Guides consumer scaling and operational monitoring by revealing whether a consumer group keeps pace with incoming records.
- How deep it goes
- Defines lag, gives JMX and offset-based calculations, and notes missing-offset inaccuracies without detailing metric implementation.
- Examples
- Uses a customer aggregation consumer and a partition-offset diagram to make backlog measurement concrete.
- What you can do after
- Diagnose processing backlogs and evaluate when consumer instances or monitoring investigation may be necessary.
Related concepts
- CQRSused by · CQRS is an architectural pattern that separates operations and models for changing application state from those for querying or reading state.
- monitoringmeasured by · Monitoring is the ongoing observation and measurement of a system’s behavior, state, or operational signals to assess its condition and detect changes or problems.
- consumer groupmeasures · A consumer group is a logical set of message consumers that cooperatively processes a shared stream by distributing its partitions among group members.
- offsetuses · An offset is a position or displacement measured relative to a reference point, such as within an ordered sequence, memory region, or layout.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

