Currently, we can collect num of messages consumer lagging behind producer. However, if messages come into a partition sporadically, we are not easy to define consumer lag alert threshold. If we know how long consumer lagging behind latest message, it must be helpful.
There are two options:
- expose per partition lag time by consumer jmx metrics
- expose consumer lag time in kafka-consumer-groups.sh