From 18338d60d5bd96a93c4a61a8719908f3ffe66598 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 2 Nov 2021 14:12:39 -0700 Subject: [PATCH] treat all 2xx, 3xx as good status-codes fixes #13560 --- cmd/http-stats.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/http-stats.go b/cmd/http-stats.go index fe7d7998a..626413544 100644 --- a/cmd/http-stats.go +++ b/cmd/http-stats.go @@ -178,8 +178,8 @@ func (st *HTTPStats) toServerHTTPStats() ServerHTTPStats { // Update statistics from http request and response data func (st *HTTPStats) updateStats(api string, r *http.Request, w *logger.ResponseWriter) { - // A successful request has a 2xx response code - successReq := w.StatusCode >= 200 && w.StatusCode < 300 + // A successful request has a 2xx response code or < 4xx response + successReq := w.StatusCode >= 200 && w.StatusCode < 400 if !strings.HasSuffix(r.URL.Path, prometheusMetricsPathLegacy) || !strings.HasSuffix(r.URL.Path, prometheusMetricsV2ClusterPath) || @@ -189,7 +189,7 @@ func (st *HTTPStats) updateStats(api string, r *http.Request, w *logger.Response switch w.StatusCode { case 0: case 499: - // 499 is a good error, shall be counted at canceled. + // 499 is a good error, shall be counted as canceled. st.totalS3Canceled.Inc(api) default: st.totalS3Errors.Inc(api)