twmb / franz-go

franz-go contains a feature complete, pure Go library for interacting with Kafka from 0.8.0 through 3.6+. Producing, consuming, transacting, administrating, etc.
BSD 3-Clause "New" or "Revised" License
1.61k stars 158 forks source link

fix: client.Lag doesn't calculate lag for all consumergroups with client.Lag(ctx) #712

Closed 0xgirish closed 1 month ago

0xgirish commented 2 months ago
image

Getting lag as nil, in case Lag method was called as client.Lag(ctx), other methods of this library defaults to listing offsets and describing to all the groups/topics incase no group/topic is specified, Assuming the same behaviour for this method.

e.g. Client.DescribeGroups

DescribeGroups describes either all groups specified, or all groups in the cluster if none are specified.

Client.ListTopics

ListTopics issues a metadata request and returns TopicDetails. Specific topics to describe can be passed as additional arguments. If no topics are specified, all topics are requested. Internal topics are not returned unless specifically requested. To see all topics including internal topics, use ListTopicsWithInternal.

0xgirish commented 2 months ago

After changes:

image
0xgirish commented 2 months ago

@twmb please review.

0xgirish commented 2 months ago

@twmb I have addressed the review comment.