mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/promscrape: always initialize http client for stream parsing mode
Stream parsing mode can be automatically enabled when scraping targets with big response bodies exceeding the -promscrape.minResponseSizeForStreamParse , so it must be always initialized.
This commit is contained in:
parent
0f4fda1bda
commit
99011c6b63
@ -106,7 +106,6 @@ func newClient(sw *ScrapeWork) *client {
|
|||||||
MaxIdempotentRequestAttempts: 1,
|
MaxIdempotentRequestAttempts: 1,
|
||||||
}
|
}
|
||||||
var sc *http.Client
|
var sc *http.Client
|
||||||
if *streamParse || sw.StreamParse {
|
|
||||||
var proxyURLFunc func(*http.Request) (*url.URL, error)
|
var proxyURLFunc func(*http.Request) (*url.URL, error)
|
||||||
if proxyURL := sw.ProxyURL.URL(); proxyURL != nil {
|
if proxyURL := sw.ProxyURL.URL(); proxyURL != nil {
|
||||||
proxyURLFunc = http.ProxyURL(proxyURL)
|
proxyURLFunc = http.ProxyURL(proxyURL)
|
||||||
@ -138,7 +137,6 @@ func newClient(sw *ScrapeWork) *client {
|
|||||||
return http.ErrUseLastResponse
|
return http.ErrUseLastResponse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return &client{
|
return &client{
|
||||||
hc: hc,
|
hc: hc,
|
||||||
sc: sc,
|
sc: sc,
|
||||||
|
Loading…
Reference in New Issue
Block a user