diff --git a/app/vminsert/main.go b/app/vminsert/main.go index c1244cf8fc..28bdbbc169 100644 --- a/app/vminsert/main.go +++ b/app/vminsert/main.go @@ -202,7 +202,13 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { httpserver.Errorf(w, r, "%s", err) return true } - w.WriteHeader(http.StatusNoContent) + statusCode := http.StatusNoContent + if strings.HasPrefix(p.Suffix, "prometheus/api/v1/import/prometheus/metrics/job/") { + // Return 200 status code for pushgateway requests. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3636 + statusCode = http.StatusOK + } + w.WriteHeader(statusCode) return true } if strings.HasPrefix(p.Suffix, "datadog/") { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index facb33e5bc..f6dd2afd5b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -21,6 +21,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): [dockerswarm_sd_configs](https://docs.victoriametrics.com/sd_configs.html#dockerswarm_sd_configs): apply `filters` only to objects of the specified `role`. Previously filters were applied to all the objects, which could cause errors when different types of objects were used with filters that were not compatible with them. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3579). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): suppress all the scrape errors when `-promscrape.suppressScrapeErrors` is enabled. Previously some scrape errors were logged even if `-promscrape.suppressScrapeErrors` flag was set. * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): consistently put the scrape url with scrape target labels to all error logs for failed scrapes. Previously some failed scrapes were logged without this information. +* BUGFIX: [Pushgateway import](https://docs.victoriametrics.com/#how-to-import-data-in-prometheus-exposition-format): properly return `200 OK` HTTP response code. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3636). ## [v1.86.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.86.1)