From 7866e7919cf717cad4fa85768000437adbb1925d Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Tue, 30 Apr 2024 10:33:50 +0530 Subject: [PATCH] Telemetry for peer: only televise non nil validate peer err (#1653) Log non flow error only if not nil for validate peer --- flow/cmd/validate_peer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flow/cmd/validate_peer.go b/flow/cmd/validate_peer.go index 647c86c07a..bae2a1f8b6 100644 --- a/flow/cmd/validate_peer.go +++ b/flow/cmd/validate_peer.go @@ -61,11 +61,11 @@ func (h *FlowRequestHandler) ValidatePeer( validationConn, ok := conn.(connectors.ValidationConnector) if ok { validErr := validationConn.ValidateCheck(ctx) - displayErr := fmt.Sprintf("failed to validate peer %s: %v", req.Peer.Name, validErr) - h.alerter.LogNonFlowWarning(ctx, telemetry.CreatePeer, req.Peer.Name, - displayErr, - ) if validErr != nil { + displayErr := fmt.Sprintf("failed to validate peer %s: %v", req.Peer.Name, validErr) + h.alerter.LogNonFlowWarning(ctx, telemetry.CreatePeer, req.Peer.Name, + displayErr, + ) return &protos.ValidatePeerResponse{ Status: protos.ValidatePeerStatus_INVALID, Message: displayErr,