danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.09k stars 602 forks source link

Fix issue#409: skip error group members #441

Closed showuon closed 1 month ago

showuon commented 1 month ago

Fix https://github.com/danielqsj/kafka_exporter/issues/409

GroupDescription structure there are Err/ErrorCode fields, that are not checked by the exporter for errors in the Kafka response. Therefore, the exporter always believes, that the answer is correct, which sometimes leads to collisions in the metric.

This PR fixes it by checking the error code and log error for code not equal to 0.

The log when describe some groups with error is like this:

E0515 15:26:48.895819   37293 kafka_exporter.go:573] Cannot describe for the group console-consumer-57947 with error code 16
showuon commented 1 month ago

@danielqsj , could you help take a look? Thanks.

showuon commented 1 month ago

@danielqsj , gently ping for review. Thanks.

danielqsj commented 1 month ago

/lgtm thanks @showuon