lib/promscrape: increase the duration for reading the full response in stream parsing mode

Increase the duration from 10x to 30x of the configured `scrape_interval'.

This should help https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1365
This commit is contained in:
Aliaksandr Valialkin 2021-06-14 12:28:07 +03:00
parent 074b11fa69
commit df057177a0

View file

@ -128,10 +128,10 @@ func newClient(sw *ScrapeWork) *client {
ResponseHeaderTimeout: sw.ScrapeTimeout,
},
// Set 10x bigger timeout than the sw.ScrapeTimeout, since the duration for reading the full response
// Set 30x bigger timeout than the sw.ScrapeTimeout, since the duration for reading the full response
// can be much bigger because of stream parsing.
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1017#issuecomment-767235047
Timeout: 10 * sw.ScrapeTimeout,
Timeout: 30 * sw.ScrapeTimeout,
}
if sw.DenyRedirects {
sc.CheckRedirect = func(req *http.Request, via []*http.Request) error {