如何在kafka主题中监视消息率? [英] How to monitor messages rate in kafka topics?

查看:113
本文介绍了如何在kafka主题中监视消息率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当某些主题的消息速率比平时高或低时,我如何得到警报?

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

推荐答案

Kafka发出大量指标,可以监控其使用情况和健康状况.这包括传入消息速率的度量,请参阅文档中的监视部分.

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.

例如, Prometheus 可以很好地处理这一问题.您需要进行设置,以便将来自Kafka的指标转发到Prometheus(使用 https://github.com/prometheus/jmx_exporter ).由于这是一个非常常见的用例,因此您会在网上找到数百篇描述如何进行设置的文章. JMX导出器还具有用于Kafka JMX模式的示例配置.

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.

一旦度量标准出现在Prometheus中,您就可以跨经纪商对其进行汇总并设置警报

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

这篇关于如何在kafka主题中监视消息率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆