简体   繁体   English

Flink Kafka 指标:如何获取它们

[英]Flink Kafka metrics: How to get them

Ideally, I'd like to run some experiments that measure the pressure on the input consumer of my application (ie, If my application lags behind the input data topic and the messages arrive faster than they are processed).理想情况下,我想运行一些实验来测量我的应用程序的输入消费者的压力(即,如果我的应用程序落后于输入数据主题并且消息到达的速度比处理它们的速度快)。 I've been told it's common but I have no clue how to do it有人告诉我这很常见,但我不知道该怎么做

I'm reading the 1.9 Metrics docs and from what I get I have to configure the conf/flink-conf.yaml (in standalone mode) let's say for the jmx reporter like this:我正在阅读 1.9 Metrics文档,据我所知,我必须配置 conf/flink-conf.yaml (在独立模式下)让我们对 jmx 记者说这样的:

metrics.reporter.jmx.factory.class: org.apache.flink.metrics.jmx.JMXReporterFactory
metrics.reporter.jmx.port: 8789

Then am I supposed to run the flink app with the start-cluster.sh script and then what?那么我应该使用 start-cluster.sh 脚本运行 flink 应用程序,然后呢? Where are those metrics stored?这些指标存储在哪里?

In the same docs committedOffsets and currentOffsets are specified for Kafka.相同的文档中,为 Kafka 指定了committedOffsets 和 currentOffsets。 I believe that the consumer lag is defined as committedOffsets - currentOffsets or not?我相信消费者滞后被定义为committedOffsets - currentOffsets 与否? There are more metrics here (eg, records-lag-avg) and it is stated that those metrics are also exposed. 这里有更多的指标(例如,records-lag-avg), 据说这些指标也被公开了。 Can anyone provide me with a step by step guide?任何人都可以为我提供分步指南吗? I'm a bit confused我有点困惑

I would use the Prometheus JMX exporter我会使用Prometheus JMX 导出器

Depending on your environment setup use eather a docker image for Prometheus and Grafana or a Kubernetes Helm chart.根据您的环境设置,为 Prometheus 和 Grafana 使用 docker 映像或 Kubernetes Helm 图表。

there is an opensource grafana dashboard preconfigured for Apache Kafka metrics.有一个为 Apache Kafka 指标预配置的开源 grafana 仪表板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM