From 668d1e82dad063f5db8c6dbc45cc1530b2058c88 Mon Sep 17 00:00:00 2001 From: Rafael da Fonseca Date: Tue, 30 Apr 2024 11:00:25 +0100 Subject: [PATCH] Don't log error if there is no error --- client/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index e09105a..a5ff175 100644 --- a/client/client.go +++ b/client/client.go @@ -127,7 +127,9 @@ func (c *Client) registerMetrics(configPrefix string) { metrics.ClientRequestsDroppedCounter, } err := metrics.RegisterMetrics(collectors) - c.logger.WithError(err).Error("failed to register metric") + if err != nil { + c.logger.WithError(err).Error("failed to register metric") + } } // Send sends an event to another server via grpc using the client's configured topic