danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.22k stars 618 forks source link

Fix issue#409: skip error group members #441

Closed showuon closed 6 months ago

showuon commented 6 months 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 6 months ago

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

showuon commented 6 months ago

@danielqsj , gently ping for review. Thanks.

danielqsj commented 6 months ago

/lgtm thanks @showuon