How to monitor messages rate in Kafka topics?
Asked Answered
T

1

7

How can I get alerted when there is a message rate in some topic higher or lower than usual?

Tiresome answered 13/1, 2019 at 12:2 Comment(1)
I've edited your question because asking for tools is considered off-topic. help center But basically, you need to enable JMX on the brokers and (Java) clients, then you need a tool to export JMX values into a aggregate system, such as Prometheus, as mentioned, but there are still other optionsHeritage
S
6

Kafka emits tons of metrics that allow to monitor its usage and health. This includes metrics for incoming message rate, see the Monitoring section in the docs.

Your use case is typically achieved with a tool that handles metrics and is able to fire alerts based on user defined queries.

For example, Prometheus handles that very well. You need to set it up so metrics from Kafka are forwarded to Prometheus (using https://github.com/prometheus/jmx_exporter). As it's a very common use case, you'll find hundreds of articles online that describe how to set that up. The JMX exporter has sample configs for the Kafka JMX patterns, as well.

Once the metrics are in Prometheus you can aggregate them across brokers and set up Alerts.

Sterilization answered 13/1, 2019 at 15:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.