From 35f2b1db3d5c7811b2cc47fae8118c2138a34473 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Fri, 31 May 2024 14:52:02 +0100 Subject: [PATCH] Rename flag and add docs Signed-off-by: George Robinson --- cmd/alertmanager/main.go | 4 ++-- docs/configuration.md | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/alertmanager/main.go b/cmd/alertmanager/main.go index 79601673ae..735dfc1372 100644 --- a/cmd/alertmanager/main.go +++ b/cmd/alertmanager/main.go @@ -147,7 +147,7 @@ func run() int { retention = kingpin.Flag("data.retention", "How long to keep data for.").Default("120h").Duration() maintenanceInterval = kingpin.Flag("data.maintenance-interval", "Interval between garbage collection and snapshotting to disk of the silences and the notification logs.").Default("15m").Duration() maxSilences = kingpin.Flag("silences.max-silences", "Maximum number of active and pending silences. If negative or zero, no limit is set.").Default("0").Int() - maxSilenceSize = kingpin.Flag("silences.max-size", "Maximum per silence size (in bytes). If negative or zero, no limit is set.").Default("0").Int() + maxPerSilenceSize = kingpin.Flag("silences.max-per-silence-size", "Maximum per silence size (in bytes). If negative or zero, no limit is set.").Default("0").Int() alertGCInterval = kingpin.Flag("alerts.gc-interval", "Interval between alert GC.").Default("30m").Duration() webConfig = webflag.AddFlags(kingpin.CommandLine, ":9093") @@ -263,7 +263,7 @@ func run() int { Retention: *retention, Limits: silence.Limits{ MaxSilences: *maxSilences, - MaxPerSilenceSize: *maxSilenceSize, + MaxPerSilenceSize: *maxPerSilenceSize, }, Logger: log.With(logger, "component", "silences"), Metrics: prometheus.DefaultRegisterer, diff --git a/docs/configuration.md b/docs/configuration.md index d72257e9b8..18a323c09d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -22,6 +22,14 @@ is not well-formed, the changes will not be applied and an error is logged. A configuration reload is triggered by sending a `SIGHUP` to the process or sending an HTTP POST request to the `/-/reload` endpoint. +## Limits + +Alertmanager supports a number of configurable limits via command-line flags. + +To limit the maximum number of active and pending silences, use the `--silences.max-silences` flag. +You can limit the maximum size of individual silences with `--silences.max-per-silence-size`, +where the unit is in bytes. + ## Configuration file introduction To specify which configuration file to load, use the `--config.file` flag.