Skip to content

Commit

Permalink
Rename flag and add docs
Browse files Browse the repository at this point in the history
Signed-off-by: George Robinson <george.robinson@grafana.com>
  • Loading branch information
grobinson-grafana committed May 31, 2024
1 parent ada0127 commit 35f2b1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/alertmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 35f2b1d

Please sign in to comment.