简体   繁体   English

无法获得Kafka消费者JMX指标的records-lag-max的价值

[英]Not getting value for records-lag-max for kafka consumer jmx metrics

I am running a java kafka stream application with JMX enabled. 我正在启用JMX的情况下运行Java Kafka流应用程序。 I am trying to fetch the consumer lags but getting infinity for all the consumers that application have. 我试图获取消费者的滞后,但是对于该应用程序拥有的所有消费者而言,它们都是无限的。

I am looking the below jmx metrics: 我正在查看以下jmx指标:

kafka.consumer.type_consumer-fetch-manager-metrics.client-id_consumer-v1*.records-lag-max

I am not sure why it is not giving the exact value. 我不确定为什么它没有给出确切的价值。 Please let me know: 请告诉我:

  • If I am missing something here, 如果我在这里想念什么,
  • OR, looking the wrong metrics, 或者,查看错误的指标,
  • OR Need to do some extra configuration to get the consumer lags. 或需要做一些额外的配置来消除消费者的滞后。

Thanks in advance !!! 提前致谢 !!!

I got the reason for the issue. 我有这个问题的原因。 Actually, in the case of consumer lags, my service was retrying infinite time to connect to the database which was stooping consumers to generate the metrics, therefore, I was getting the value as infinite. 实际上,在消费者滞后的情况下,我的服务正在重试无限时间以连接到数据库,该数据库弯腰了消费者以生成指标,因此,我得到的价值是无限的。

So, there was nothing wrong from JMX side, it was the use case which was causing the issue. 因此,从JMX方面来看,这没有什么错,是导致问题的用例。

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

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