Skip to content

Commit 5fdb775

Browse files
committed
Eagerly initialize failed metrics
1 parent ffa4211 commit 5fdb775

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

e2e/producer.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ func (s *Service) produceMessage(ctx context.Context, partition int) {
3939
ackDuration := time.Since(startTime)
4040
s.messagesProducedInFlight.WithLabelValues(pID).Dec()
4141
s.messagesProducedTotal.WithLabelValues(pID).Inc()
42-
// We add 0 in order to ensure that the "failed" metric series for that partition id is initialized as well.
42+
// We add 0 in order to ensure that the "failed" metric series for that partition id are initialized as well.
4343
s.messagesProducedFailed.WithLabelValues(pID).Add(0)
44+
s.lostMessages.WithLabelValues(pID).Add(0)
4445

4546
if err != nil {
4647
s.messagesProducedFailed.WithLabelValues(pID).Inc()

0 commit comments

Comments
 (0)