From 54c81eb0b4ac7f0d461203ee81b97240547d918b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Wed, 4 Sep 2024 10:38:37 +0200 Subject: [PATCH] Add even more logging --- metrics/monitor_request.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metrics/monitor_request.go b/metrics/monitor_request.go index 537a1a24b..59b7a341e 100644 --- a/metrics/monitor_request.go +++ b/metrics/monitor_request.go @@ -3,6 +3,7 @@ package metrics import ( "context" "fmt" + "github.com/golang/glog" "net/http" "time" @@ -20,11 +21,14 @@ func MonitorRequest(clientMetrics ClientMetrics, client *http.Client, r *http.Re req := r.WithContext(ctx) start := time.Now() + glog.Infof("client.Do(req)") res, err := client.Do(req) + glog.Infof("Done client.Do(req), err=%v", err) duration := time.Since(start) retries := ctx.Value(RetriesKey).(*Retries) if retries.lastStatusCode >= 400 { + glog.Infof("retries.lastStatusCode >= 400") clientMetrics.FailureCount.WithLabelValues(req.URL.Host, fmt.Sprint(retries.lastStatusCode)).Inc() return res, err } @@ -32,6 +36,7 @@ func MonitorRequest(clientMetrics ClientMetrics, client *http.Client, r *http.Re clientMetrics.RequestDuration.WithLabelValues(req.URL.Host).Observe(duration.Seconds()) clientMetrics.RetryCount.WithLabelValues(req.URL.Host).Set(float64(retries.count)) + glog.Infof("return res, err") return res, err }