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

Cannot get oldest offset of topic kafkatopic2 partition 1: #311

Open
aditya-iaxis opened this issue May 23, 2022 · 1 comment
Open

Cannot get oldest offset of topic kafkatopic2 partition 1: #311

aditya-iaxis opened this issue May 23, 2022 · 1 comment

Comments

@aditya-iaxis
Copy link

aditya-iaxis commented May 23, 2022

Hello All/ @danielqsj , I am facing the following issue.

Cannot get oldest offset of topic kafkatopic2 partition 1: kafka server: In the middle of a leadership election, there is currently no leader for this partition and hence it is unavailable for writes.

Get "http://172.40.1.32:9308/metrics": dial tcp 172.40.1.32:9308: connect: connection refused
and sometimes context length exceeded.

Sometimes the kafka metric in prometheus targets shows down and sometimes up. It keeps toggling

However, when I check the kafka pod logs, it does not show any errors. There are several other apps using the same kafka too and they have no issues.

Also, the above metrics link takes me like 30-40 secs to open. Any pointers for this?

@aditya-iaxis aditya-iaxis changed the title Cannot get oldest offset of topic kafkatopic2 partition 7: Cannot get oldest offset of topic kafkatopic2 partition 1: May 23, 2022
@shengbinxu
Copy link

shengbinxu commented Nov 8, 2023

I also encountered similar problem.
My log displays: "Cannot get oldest offset of topic kafkatopic2 partition 1: kafka server: In the middle of a leadership election, there is currently no leader for this partition and hence it is unavailable for writes."
And then, "metrics link takes me like 30-40 seconds to open."

This is because the Kafka service is experiencing an issue where some topic partitions have no leader. This results in the exporter taking a long time to retrieve statistics for this topic, causing the metrics link to be very slow.

In this situation:
1、it is advisable to increase the scrape_timeout for Prometheus.
2、In our business context, when the exporter encounters the error mentioned above, it is because one broker has failed, and some topic partitions are indeed unable to write data.

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

No branches or pull requests

2 participants