mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Revert "Port 'Don't disable HTTP keep-alives for remote storage connections.' to 2.0 (see #3173)"
This reverts commit 0997191b18
.
This commit is contained in:
parent
746752b946
commit
9c3c98e8de
|
@ -54,7 +54,7 @@ type ClientConfig struct {
|
|||
|
||||
// NewClient creates a new Client.
|
||||
func NewClient(index int, conf *ClientConfig) (*Client, error) {
|
||||
httpClient, err := httputil.NewClientFromConfigAndOptions(conf.HTTPClientConfig, "remote_storage", false)
|
||||
httpClient, err := httputil.NewClientFromConfig(conf.HTTPClientConfig, "remote_storage")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -34,12 +34,6 @@ func newClient(rt http.RoundTripper) *http.Client {
|
|||
// NewClientFromConfig returns a new HTTP client configured for the
|
||||
// given config.HTTPClientConfig. The name is used as go-conntrack metric label.
|
||||
func NewClientFromConfig(cfg config.HTTPClientConfig, name string) (*http.Client, error) {
|
||||
return NewClientFromConfigAndOptions(cfg, name, true)
|
||||
}
|
||||
|
||||
// NewClientFromConfigAndOptions returns a new HTTP client configured for the
|
||||
// given config.HTTPClientConfig. The name is used as go-conntrack metric label.
|
||||
func NewClientFromConfigAndOptions(cfg config.HTTPClientConfig, name string, disableKeepAlives bool) (*http.Client, error) {
|
||||
tlsConfig, err := NewTLSConfig(cfg.TLSConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -49,7 +43,7 @@ func NewClientFromConfigAndOptions(cfg config.HTTPClientConfig, name string, dis
|
|||
var rt http.RoundTripper = &http.Transport{
|
||||
Proxy: http.ProxyURL(cfg.ProxyURL.URL),
|
||||
MaxIdleConns: 20000,
|
||||
DisableKeepAlives: disableKeepAlives,
|
||||
DisableKeepAlives: false,
|
||||
TLSClientConfig: tlsConfig,
|
||||
DisableCompression: true,
|
||||
// 5 minutes is typically above the maximum sane scrape interval. So we can
|
||||
|
|
Loading…
Reference in a new issue