Hi Nikolay, Have you seen the consumer-side lag metrics [1]? "records-lag", "records-lag-avg", "records-lag-max" all give lag stats on a per-topic-partition basis.
If so, I'd be curious to know what the motivation for duplicating existing client metrics onto brokers would be? [1] https://kafka.apache.org/31/documentation.html#consumer_fetch_monitoring Cheers, Chris On Wed, Feb 16, 2022 at 4:38 AM Nikolay Izhikov <nizhi...@apache.org> wrote: > Hello, Kafka team. > > When running in production the common user question is «How big lag > between producer and consumer?». > We have a `kafka-consumer-groups.sh` tool and > `AdminClient#getListConsumerGroupOffsetsCall` to answer the question. > > Even detailed guides on how to calculate *consumer lag* with built-in > Kafka tools, exists. [1] > > Obviously, approach with tool or AdminClient requires additional coding > and setup which can be inconvenient. > > I think Kafka should provide per partition consumer offset metric. > It will simplify running Kafka deployment and monitoring in production. > > Looked in `GroupMetadataManager.scala` and think it possible to add those > metrics. > > What do you think? > Do we need this metrics on Kafka broker? > > [1] https://www.baeldung.com/java-kafka-consumer-lag