kafka_exporter icon indicating copy to clipboard operation
kafka_exporter copied to clipboard

add imporovement

Open panszobe opened this issue 3 years ago • 5 comments

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 avatar Jun 27 '21 08:06 panszobe

@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.

danielqsj avatar Jun 28 '21 14:06 danielqsj

@panszobe is this PR based on https://github.com/danielqsj/kafka_exporter/pull/228 ?

danielqsj avatar Jun 28 '21 14:06 danielqsj

@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:

  1. users reflected that consumer group lag was negative unexpectedly
  2. 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:

  1. when one broker down, time spent is decreased from 30s to 20s, about 1/3 improvement
  2. there is no negative value of metric about consumer group lag

panszobe avatar Jun 29 '21 03:06 panszobe

@panszobe I have cherry-picked from #228, and released v1.4.1. Welcome to rebase the current master branch.

danielqsj avatar Sep 08 '21 09:09 danielqsj

Hi @panszobe, we are interested in your modifications. will you have time to rebase ?

Eriln avatar Jan 18 '22 08:01 Eriln