From 2c4e384f0752baf646d296f6e90bd8a3394b71fb Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 23 Jan 2023 21:04:50 -0800 Subject: [PATCH] lib/promscrape: properly log the actual response size after c4229a1bbabbed96b388e40ec659376e1782d529 --- lib/promscrape/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/promscrape/client.go b/lib/promscrape/client.go index 333c5a2ec0..835c08e050 100644 --- a/lib/promscrape/client.go +++ b/lib/promscrape/client.go @@ -324,7 +324,7 @@ func (c *client) ReadData(dst []byte) ([]byte, error) { if len(dst) > c.hc.MaxResponseBodySize { maxScrapeSizeExceeded.Inc() return dst, fmt.Errorf("the response from %q exceeds -promscrape.maxScrapeSize=%d (the actual response size is %d bytes); "+ - "either reduce the response size for the target or increase -promscrape.maxScrapeSize", c.scrapeURL, len(dst), maxScrapeSize.N) + "either reduce the response size for the target or increase -promscrape.maxScrapeSize", c.scrapeURL, maxScrapeSize.N, len(dst)) } if statusCode != fasthttp.StatusOK { metrics.GetOrCreateCounter(fmt.Sprintf(`vm_promscrape_scrapes_total{status_code="%d"}`, statusCode)).Inc()