
Kafka Lag Is High — But Why? I Built a CLI to Answer That
klag — A CLI That Tells You Why Your Kafka Consumer Is Lagging You've seen it before: your Kafka consumer lag is climbing. You open Grafana, stare at the offset graphs, and start guessing. Is the producer sending too much? Did a rebalance fire? Is the consumer process even alive? klag is a CLI tool I built to skip the guessing. It connects to your Kafka broker, snapshots lag per partition, samples produce/consume rates, and runs a set of detectors to tell you the root cause — directly in your terminal. Install npm install -g @closeup1202/klag Basic Usage # One-shot analysis klag -b localhost:9092 -g my-consumer-group # Watch mode — refreshes every 5s klag -b localhost:9092 -g my-consumer-group --watch # Omit --group to pick interactively from a live list klag -b localhost:9092 What It Detects klag runs up to five detectors after collecting a lag snapshot and a rate sample: Detector What it catches PRODUCER_BURST Produce rate is 2x+ higher than consume rate — consumer can't keep up SLOW
Continue reading on Dev.to
Opens in a new tab



