Quick CLI util and Prometheus exporter for checking your Kafka: The number of records that should be flowing, are they actually flowing?
The proper way of going on about this is to
- Get the prometheus/jmx_exporter
- Acquire a
jmx_exporter
configuration file from somewhere- the "official" one doesn't work that well
- Pass the
jmx_exporter
as a-javaagent
viaKAFKA_JMX_OPTS
tokafka-server-start.sh
- Target prometheus to scrape the agent
- Hope that you can now query badly named metrics like
kafka_…_brokertopicmetrics_messagesinpersec
(Which is notper sec
. You need toirate
it.)
Need to know right now? Have fun restarting your brokers.
This repeatedly queries the high watermarks of all topics via Kafka's normal listening ports and calculates a flow rate. Clone and run as
cargo run -- -b localhost:9092
If you're looking for prettier output, try totop.