Remote Alertmanager: Add timeout to the remoteClient (#112157)

This commit is contained in:
Santiago
2025-10-08 11:13:02 +00:00
committed by GitHub
parent 69184b5027
commit 3f4c9879c9
2 changed files with 5 additions and 1 deletions
@@ -139,6 +139,7 @@ func NewAlertmanager(ctx context.Context, cfg AlertmanagerConfig, store stateSto
Logger: logger,
Password: cfg.BasicAuthPassword,
TenantID: cfg.TenantID,
Timeout: cfg.Timeout,
URL: u,
}
mc, err := remoteClient.New(mcCfg, metrics, tracer)
+4 -1
View File
@@ -11,6 +11,7 @@ import (
"net/url"
"path"
"strings"
"time"
alertingNotify "github.com/grafana/alerting/notify"
@@ -65,7 +66,8 @@ type Config struct {
TenantID string
Password string
Logger log.Logger
Logger log.Logger
Timeout time.Duration
}
// successResponse represents a successful response from the Mimir API.
@@ -98,6 +100,7 @@ func New(cfg *Config, metrics *metrics.RemoteAlertmanager, tracer tracing.Tracer
c := &http.Client{
Transport: rt,
Timeout: cfg.Timeout,
}
tc := alertingInstrument.NewTimedClient(c, metrics.RequestLatency)
trc := alertingInstrument.NewTracedClient(tc, tracer, "remote.alertmanager.client")