diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 0dd07e6374d65ce4725b9bf95d6e27b4b39a7e4f..7e153bc329c07623169ed31dfe8091c807ee9b33 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -102,7 +102,6 @@ type flagConfig struct { localStoragePath string notifier notifier.Options - notifierTimeout model.Duration forGracePeriod model.Duration outageTolerance model.Duration resendDelay model.Duration @@ -275,8 +274,8 @@ func main() { a.Flag("alertmanager.notification-queue-capacity", "The capacity of the queue for pending Alertmanager notifications."). Default("10000").IntVar(&cfg.notifier.QueueCapacity) - a.Flag("alertmanager.timeout", "Timeout for sending alerts to Alertmanager."). - Default("10s").SetValue(&cfg.notifierTimeout) + // TODO: Remove in Prometheus 3.0. + alertmanagerTimeout := a.Flag("alertmanager.timeout", "[DEPRECATED] This flag has no effect.").Hidden().String() a.Flag("query.lookback-delta", "The maximum lookback duration for retrieving metrics during expression evaluations and federation."). Default("5m").SetValue(&cfg.lookbackDelta) @@ -321,6 +320,10 @@ func main() { os.Exit(2) } + if *alertmanagerTimeout != "" { + level.Warn(logger).Log("msg", "The flag --alertmanager.timeout has no effect and will be removed in the future.") + } + // Throw error for invalid config before starting other components. if _, err := config.LoadFile(cfg.configFile); err != nil { level.Error(logger).Log("msg", fmt.Sprintf("Error loading config (--config.file=%s)", cfg.configFile), "err", err)