diff --git a/prometheus/push/push.go b/prometheus/push/push.go index e048809f6..d8bfd846e 100644 --- a/prometheus/push/push.go +++ b/prometheus/push/push.go @@ -267,7 +267,7 @@ func (p *Pusher) push(method string) error { return err } defer resp.Body.Close() - if resp.StatusCode != 202 { + if resp.StatusCode != 200 && resp.StatusCode != 202 { body, _ := ioutil.ReadAll(resp.Body) // Ignore any further error as this is for an error message only. return fmt.Errorf("unexpected status code %d while pushing to %s: %s", resp.StatusCode, p.fullURL(), body) }