From fbbda6c05e095a0678b65f128255f60231c58ae2 Mon Sep 17 00:00:00 2001 From: Santiago Date: Wed, 24 Jan 2024 21:39:06 +0100 Subject: [PATCH] Alerting: Retry readiness check to the remote Alertmanager on 5xx status code responses (#81174) --- pkg/services/ngalert/remote/client/alertmanager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/ngalert/remote/client/alertmanager.go b/pkg/services/ngalert/remote/client/alertmanager.go index 2f93652bc3b..88a7ca7638b 100644 --- a/pkg/services/ngalert/remote/client/alertmanager.go +++ b/pkg/services/ngalert/remote/client/alertmanager.go @@ -107,7 +107,7 @@ func (am *Alertmanager) IsReadyWithBackoff(ctx context.Context) (bool, error) { } if status != http.StatusOK { - if status/400 == 1 { + if status >= 400 && status < 500 { am.logger.Debug("Ready check failed with non-retriable status code", "attempt", attempts, "status", status) return false, fmt.Errorf("ready check failed with non-retriable status code %d", status) }