Remote Alertmanager: Add timeouts to the HTTP client (#105279)
* Remote Alertmanage: Add timeouts to the HTTP client * code review suggestions
This commit is contained in:
@@ -47,6 +47,7 @@ const (
|
||||
`
|
||||
alertingDefaultInitializationTimeout = 30 * time.Second
|
||||
evaluatorDefaultEvaluationTimeout = 30 * time.Second
|
||||
remoteAlertmanagerDefaultTimeout = 30 * time.Second
|
||||
schedulerDefaultAdminConfigPollInterval = time.Minute
|
||||
schedulerDefaultExecuteAlerts = true
|
||||
schedulerDefaultMaxAttempts = 3
|
||||
@@ -152,6 +153,7 @@ type RemoteAlertmanagerSettings struct {
|
||||
TenantID string
|
||||
Password string
|
||||
SyncInterval time.Duration
|
||||
Timeout time.Duration
|
||||
}
|
||||
|
||||
type UnifiedAlertingScreenshotSettings struct {
|
||||
@@ -396,6 +398,10 @@ func (cfg *Cfg) ReadUnifiedAlertingSettings(iniFile *ini.File) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
uaCfgRemoteAM.Timeout, err = gtime.ParseDuration(valueAsString(remoteAlertmanager, "timeout", (remoteAlertmanagerDefaultTimeout).String()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uaCfg.RemoteAlertmanager = uaCfgRemoteAM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user