|
|
@ -46,6 +46,7 @@ type ExternalAlertmanager struct { |
|
|
|
type ExternalAMcfg struct { |
|
|
|
type ExternalAMcfg struct { |
|
|
|
URL string |
|
|
|
URL string |
|
|
|
Headers http.Header |
|
|
|
Headers http.Header |
|
|
|
|
|
|
|
Timeout time.Duration |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type Option func(*ExternalAlertmanager) |
|
|
|
type Option func(*ExternalAlertmanager) |
|
|
@ -229,11 +230,16 @@ func buildNotifierConfig(alertmanagers []ExternalAMcfg) (*config.Config, map[str |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeout := am.Timeout |
|
|
|
|
|
|
|
if timeout == 0 { |
|
|
|
|
|
|
|
timeout = defaultTimeout |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
amConfig := &config.AlertmanagerConfig{ |
|
|
|
amConfig := &config.AlertmanagerConfig{ |
|
|
|
APIVersion: config.AlertmanagerAPIVersionV2, |
|
|
|
APIVersion: config.AlertmanagerAPIVersionV2, |
|
|
|
Scheme: u.Scheme, |
|
|
|
Scheme: u.Scheme, |
|
|
|
PathPrefix: u.Path, |
|
|
|
PathPrefix: u.Path, |
|
|
|
Timeout: model.Duration(defaultTimeout), |
|
|
|
Timeout: model.Duration(timeout), |
|
|
|
ServiceDiscoveryConfigs: sdConfig, |
|
|
|
ServiceDiscoveryConfigs: sdConfig, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|