Skip to content

Commit 510ea18

Browse files
Prevent counting 2xx responses as failed writes
1 parent 103b264 commit 510ea18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/ruler/compat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (a *PusherAppender) Commit() error {
9696
_, err := a.pusher.Push(user.InjectOrgID(a.ctx, a.userID), req)
9797
if err != nil {
9898
// Don't report errors that ended with 4xx HTTP status code (series limits, duplicate samples, out of order, etc.)
99-
if resp, ok := httpgrpc.HTTPResponseFromError(err); !ok || resp.Code/100 != 4 {
99+
if resp, ok := httpgrpc.HTTPResponseFromError(err); !ok || (resp.Code/100 != 2 && resp.Code/100 != 4) {
100100
a.failedWrites.Inc()
101101
}
102102
}

0 commit comments

Comments
 (0)