export lag for all partition, not only owned
Some checks failed
build / test (push) Failing after 1m14s
build / lint (push) Successful in 9m28s
codeql / analyze (go) (push) Failing after 14m55s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-05-02 23:01:04 +03:00
parent c240631cdb
commit 7329bc23bc

View File

@ -106,10 +106,8 @@ func (s *subscriber) poll(ctx context.Context) {
} }
s.Lock() s.Lock()
for tp := range s.consumers { for p, l := range lmap {
if v, ok := lmap[tp.p]; ok { s.kopts.Meter.Counter(semconv.BrokerGroupLag, "topic", s.topic, "group", s.opts.Group, "partition", strconv.Itoa(int(p)), "lag", strconv.Itoa(int(l.Lag)))
s.kopts.Meter.Counter(semconv.BrokerGroupLag, "topic", s.topic, "group", s.opts.Group, "partition", strconv.Itoa(int(tp.p)), "lag", strconv.Itoa(int(v.Lag)))
}
} }
s.Unlock() s.Unlock()