Child pages
  • KIP-92 - Add per partition lag metrics to KafkaConsumer
Skip to end of metadata
Go to start of metadata

Status

Current stateAccepted

Discussion thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently KafkaConsumer only has a metric of max lag across all the partitions. It would be useful to know per partition lag as well.

Public Interfaces

There is no programmatic public interface change. We are only adding new metrics.

Proposed Changes

Add per partition lag metrics to KafkaConsumer. The metric names would be:

"TOPIC-PARTITION_ID.record-lag"
"TOPIC-PARTITION_ID.record-lag-avg"
"TOPIC-PARTITION_ID.record-lag-max" 

The way to get the metrics is the same as getting other metrics. For example:

When the consumer does not own a partition anymore, the lag metric will be removed.

Notice that the per partition lag metrics have an average value reported while the max log across all the partitions only has a max value reported. This is because the average value of max lag from all the partitions may be an average from different partitions at different times, so it is not very useful. But the average value of per partition lag at different times is more meaningful.

Compatibility, Deprecation, and Migration Plan

The change is fully backwards compatible.

Rejected Alternatives

None

  • No labels