You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for maintaining the confluent-kafka-go library—it’s been incredibly helpful. I’m writing to inquire about a feature present in the Java Kafka client that’s currently missing in the Go implementation: consumer partition lag tracking.
In the Java client, KafkaConsumer provides method org.apache.kafka.clients.consumer.internals.SubscriptionState#partitionLag or org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer#currentLag
In confluent-kafka-go there’s no built-in way to directly retrieve partition lag. This requires developers to manually calculate lag, which can be error-prone. Especially if the topic contains transaction control records that cannot be consumed but increase the offset of the topic.
Questions:
Is there a plan to add a convenience method (e.g., GetPartitionLag()) or expose consumer metrics like records-lag in the Go library?
If this is not on the roadmap, could you recommend a best practice for calculating partition lag with the current API (e.g., combining QueryWatermarkOffsets and Position)?
Are there any limitations or caveats to be aware of when calculating lag manually in Go?
Example Use Case:
// consume entire topicwhile(partitionConsumer.currentLag>0 ){
// keep consuming
}
// end of topic reached
Description:
Hi Confluent team! 👋
First, thank you for maintaining the
confluent-kafka-go
library—it’s been incredibly helpful. I’m writing to inquire about a feature present in the Java Kafka client that’s currently missing in the Go implementation: consumer partition lag tracking.In the Java client,
KafkaConsumer
provides methodorg.apache.kafka.clients.consumer.internals.SubscriptionState#partitionLag
or org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer#currentLagIn
confluent-kafka-go
there’s no built-in way to directly retrieve partition lag. This requires developers to manually calculate lag, which can be error-prone. Especially if the topic contains transaction control records that cannot be consumed but increase the offset of the topic.Questions:
GetPartitionLag()
) or expose consumer metrics likerecords-lag
in the Go library?QueryWatermarkOffsets
andPosition
)?Example Use Case:
Java Reference:
ConsumerMetrics
(e.g.,records-lag
)Thank you for your time and insights! 🙏
The text was updated successfully, but these errors were encountered: