Alerting: Stop retries on 4xx status code responses (remote Alertmanager readiness check) (#80350)

This commit is contained in:
Santiago 2024-01-11 12:12:35 +01:00 committed by GitHub
parent 8dba53b541
commit 6c87d9a1e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,10 @@ func (am *Alertmanager) IsReadyWithBackoff(ctx context.Context) (bool, error) {
}
if status != http.StatusOK {
if status/400 == 1 {
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)
}
am.logger.Debug("Ready check failed, status code is not 200", "attempt", attempts, "status", status, "err", err)
continue
}