Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function to refresh broker list in client #1707

Closed
wants to merge 1 commit into from

Conversation

readygodom
Copy link

@readygodom readygodom commented May 27, 2020

Add a function to refresh broker list in client.
Fix: danielqsj/kafka_exporter#134 (comment)

@readygodom readygodom requested a review from bai as a code owner May 27, 2020 09:46
@ghost ghost added the cla-needed label May 27, 2020
@readygodom readygodom changed the title add a function to refresh broker list in client Add a function to refresh broker list in client May 27, 2020
@@ -429,6 +433,29 @@ func (client *client) Leader(topic string, partitionID int32) (*Broker, error) {
return leader, err
}

func (client *client) RefreshBrokers() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already RefreshController and Brokers that work on latest metadata. Can you please elaborate on what problem does it solve??

Copy link
Author

@readygodom readygodom May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a function already exists. But the function 'client.RefreshMetadata()' does not work in project kafka-exporter: danielqsj/kafka_exporter#134 (comment), so I add a
function to refresh brokers specially.

@dnwe
Copy link
Collaborator

dnwe commented May 29, 2020

@readygodom kafka_exporter is using github.com/Shopify/sarama v1.22.1 which is missing the fix #1645 from @Stephan14 - Remove broker(s) which no longer exist in metadata

I think if you just bump kafka_exporter to latest Sarama release then your original
problem will be fixed already

@readygodom
Copy link
Author

We can use new release after fix:#1645 to resolve this problem @Shini31 danielqsj/kafka_exporter#134 (comment)

@readygodom readygodom closed this May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metric kafka_brokers does not decrease
3 participants