Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Added log entry for GetPeer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thrawn01 committed Oct 11, 2022
1 parent f24e03b commit 0af0655
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ func (s *V1Instance) asyncRequests(ctx context.Context, req *AsyncReq) {
asyncRequestRetriesCounter.WithLabelValues(req.Req.Name).Add(1)
req.Peer, err = s.GetPeer(ctx, req.Key)
if err != nil {
errPart := fmt.Sprintf("Error finding peer that owns rate limit '%s'", req.Key)
s.log.WithContext(ctx).WithError(err).WithField("key", req.Key).Error(errPart)
countError(err, "Error in GetPeer")
err = errors.Wrap(err, fmt.Sprintf("Error finding peer that owns rate limit '%s'", req.Key))
err = errors.Wrap(err, errPart)
resp.Resp = &RateLimitResp{Error: err.Error()}
break
}
Expand Down Expand Up @@ -665,6 +667,7 @@ func (s *V1Instance) SetPeers(peerInfo []PeerInfo) {
peer = NewPeerClient(PeerConfig{
TLS: s.conf.PeerTLS,
Behavior: s.conf.Behaviors,
Log: s.log,
Info: info,
})
}
Expand All @@ -677,6 +680,7 @@ func (s *V1Instance) SetPeers(peerInfo []PeerInfo) {
peer = NewPeerClient(PeerConfig{
TLS: s.conf.PeerTLS,
Behavior: s.conf.Behaviors,
Log: s.log,
Info: info,
})
}
Expand Down

0 comments on commit 0af0655

Please sign in to comment.