kafka_exporter
kafka_exporter copied to clipboard
add imporovement
Main Improvements
- Adjust the order of fetching messages , get consumer group offsets firstly before getting topics and partitions messages, and then calculate, to solve consumer group lag negative issue.
- Add concurrency control, and share the same result to all the demands on a fetching period, which would have an appreciable improvement of performance, especially when there is a broker down.
@panszobe thanks for the big PRs. Generally looks good to me. But due to the complex of PR, please have a check and give some test results.
@panszobe is this PR based on https://github.com/danielqsj/kafka_exporter/pull/228 ?
@panszobe thanks for the big PRs. Generally looks good to me. But due to the complex of PR, please have a check and give some test results.
Yes, we met two main problems on our production environment a few weeks ago:
- users reflected that consumer group lag was negative unexpectedly
- when one broker down, fetching metrics will take long time
Therefore, we wanted to find solutions from PRs and issue records, and found #213,but we just pick up something which fit our demands. On the basis of concurrency control, we imported adjusting order of fetching metrics. During the fixing, we found that code compile is in trouble, because github.com/prometheus/common with version 0.29.0 has no log module, today i see is altered to 0.25.0 back. We used old version 0.25.0 too at that time. Through gray updating, we push it all on production ENV.
After doing that, we gained something good as below:
- when one broker down, time spent is decreased from 30s to 20s, about 1/3 improvement
- there is no negative value of metric about consumer group lag
@panszobe I have cherry-picked from #228, and released v1.4.1. Welcome to rebase the current master branch.
Hi @panszobe, we are interested in your modifications. will you have time to rebase ?