Kafka Metric RequestHandlerAvgIdlePercent

Viewed 837

I am building grafana dashboard of kafka metrics. My kafka version is 2.5.0 I am confused about kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent metric.

according to kafka documentation it is "The average fraction of time the request handler threads are idle and value should be between 0 and 1, ideally > 0.3"

but when i tried to get the metric i did not find any metric with name "kafka_server_kafkarequesthandlerpool_requesthandleravgidlepercent". Instead the metric i found is "kafka_server_kafkarequesthandlerpool_requesthandleravgidlepercent_count". its value is not between 0 and 1 but a very large number.

seems it is not a percent metric but some count metric which value keep increasing.

1 Answers

You might wanna copy the following LOC into your jmx-config yml file. https://github.com/strimzi/strimzi-kafka-operator/blob/master/examples/metrics/kafka-metrics.yaml#L122-L134

This solved the problem for me. The metric becomes available as kafka_server_kafkarequesthandlerpool_requesthandleravgidle_percent

Apparently your yml file didn't have this config. These lines in the link above make the metric available as gauge, which is the correct one - the metric you mention is a counter, which is obviously not correct for the common use case of RequestHandlerAvgIdlePercent.

Related