From f3eaa110ddc8a5a0c01e1c32b958277174800900 Mon Sep 17 00:00:00 2001 From: Yu Xia Date: Thu, 25 Mar 2021 11:47:27 -0700 Subject: [PATCH] Fix emit 0 count if encounters error (#4073) --- common/domain/replication_queue.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/domain/replication_queue.go b/common/domain/replication_queue.go index b4f4ae3a70b..c3440fba01f 100644 --- a/common/domain/replication_queue.go +++ b/common/domain/replication_queue.go @@ -336,13 +336,14 @@ func (q *replicationQueueImpl) emitDLQSize() { ).IncCounter( metrics.DomainReplicationQueueSizeErrorCount, ) + } else { + q.metricsClient.Scope( + metrics.DomainReplicationQueueScope, + ).UpdateGauge( + metrics.DomainReplicationQueueSizeGauge, + float64(size), + ) } - q.metricsClient.Scope( - metrics.DomainReplicationQueueScope, - ).UpdateGauge( - metrics.DomainReplicationQueueSizeGauge, - float64(size), - ) } } }