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:
Santiago
2025-05-13 13:25:56 +02:00
committed by GitHub
parent 08c55b60ab
commit 6c3d89f390
5 changed files with 24 additions and 6 deletions
+6
View File
@@ -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