From c2d45635a9361a6fdbb775ac05a8fb0829aae39d Mon Sep 17 00:00:00 2001 From: E Sequeira <5458743+geseq@users.noreply.github.com> Date: Wed, 2 Nov 2022 04:51:41 +0000 Subject: [PATCH] requester: Remove httpclient.Do errors from latency measurement (#1072) * remove httpclient.Do errors from latency measurement * fix an oopsie --- exchanges/request/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exchanges/request/request.go b/exchanges/request/request.go index d4cd7c2fa94..186cfa0d8ef 100644 --- a/exchanges/request/request.go +++ b/exchanges/request/request.go @@ -165,7 +165,7 @@ func (r *Requester) doRequest(ctx context.Context, endpoint EndpointLimit, newRe resp, err := r._HTTPClient.do(req) - if r.reporter != nil { + if r.reporter != nil && err == nil { r.reporter.Latency(r.name, p.Method, p.Path, time.Since(start)) }