mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Set timeout for marathon_sd
This commit is contained in:
parent
c689b35858
commit
2bc12fa2fb
|
@ -124,6 +124,7 @@ var (
|
|||
|
||||
// DefaultMarathonSDConfig is the default Marathon SD configuration.
|
||||
DefaultMarathonSDConfig = MarathonSDConfig{
|
||||
Timeout: model.Duration(30 * time.Second),
|
||||
RefreshInterval: model.Duration(30 * time.Second),
|
||||
}
|
||||
|
||||
|
@ -776,6 +777,7 @@ func (c *NerveSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||
// MarathonSDConfig is the configuration for services running on Marathon.
|
||||
type MarathonSDConfig struct {
|
||||
Servers []string `yaml:"servers,omitempty"`
|
||||
Timeout model.Duration `yaml:"timeout,omitempty"`
|
||||
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
|
||||
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
|
||||
|
||||
|
|
|
@ -269,6 +269,7 @@ var expectedConf = &Config{
|
|||
Servers: []string{
|
||||
"https://marathon.example.com:443",
|
||||
},
|
||||
Timeout: model.Duration(30 * time.Second),
|
||||
RefreshInterval: model.Duration(30 * time.Second),
|
||||
TLSConfig: TLSConfig{
|
||||
CertFile: "testdata/valid_cert_file",
|
||||
|
|
|
@ -87,6 +87,7 @@ func NewDiscovery(conf *config.MarathonSDConfig) (*Discovery, error) {
|
|||
}
|
||||
|
||||
client := &http.Client{
|
||||
Timeout: time.Duration(conf.Timeout),
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: tls,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue