Skip to content

Commit

Permalink
Telemetry for peer: only televise non nil validate peer err (#1653)
Browse files Browse the repository at this point in the history
Log non flow error only if not nil for validate peer
  • Loading branch information
Amogh-Bharadwaj authored Apr 30, 2024
1 parent e3f6ef6 commit 7866e79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flow/cmd/validate_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7866e79

Please sign in to comment.