Skip to content

Commit e17cb56

Browse files
authored
ruler: report failed eval on any 5xx status (#2053)
* ruler: report failed eval on any 5xx status Signed-off-by: Miguel Ángel Ortuño <[email protected]> * addressed PR suggestion Signed-off-by: Miguel Ángel Ortuño <[email protected]>
1 parent 4076f4a commit e17cb56

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* [BUGFIX] Ring: fix bug where instances may appear unhealthy in the hash ring web UI even though they are not. #1933
3434
* [BUGFIX] API: gzip is now enforced when identity encoding is explicitly rejected. #1864
3535
* [BUGFIX] Fix panic at startup when Mimir is running in monolithic mode and query sharding is enabled. #2036
36+
* [BUGFIX] Ruler: report failed evaluation metric for any 5xx status code returned by the query-frontend when remote operational mode is enabled. #2053
3637

3738
### Mixin
3839

pkg/ruler/compat.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package ruler
88
import (
99
"context"
1010
"errors"
11-
"net/http"
1211
"time"
1312

1413
"github.com/go-kit/log"
@@ -151,9 +150,9 @@ func MetricsQueryFunc(qf rules.QueryFunc, queries, failedQueries prometheus.Coun
151150
return result, origErr
152151

153152
} else if err != nil {
154-
// When remote querier enabled, only consider failed queries those returning a 500 status code.
153+
// When remote querier enabled, only consider failed queries those returning a 5xx status code.
155154
st, ok := status.FromError(err)
156-
if ok && st.Code() == http.StatusInternalServerError {
155+
if ok && st.Code()/100 == 5 {
157156
failedQueries.Inc()
158157
}
159158
}

0 commit comments

Comments
 (0)