diff --git a/app/vmalert/Makefile b/app/vmalert/Makefile index 35906236c..d49984ddf 100644 --- a/app/vmalert/Makefile +++ b/app/vmalert/Makefile @@ -58,8 +58,8 @@ run-vmalert: vmalert ./bin/vmalert -rule=app/vmalert/testdata/rules0-good.rules \ -datasource.url=http://localhost:8428 \ -notifier.url=http://localhost:9093 \ - -remotewrite.url=http://localhost:8428 \ - -remoteread.url=http://localhost:8428 \ + -remoteWrite.url=http://localhost:8428 \ + -remoteRead.url=http://localhost:8428 \ -evaluationInterval=3s vmalert-amd64: diff --git a/app/vmalert/README.md b/app/vmalert/README.md index 4417a6746..d4a16abcc 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -50,9 +50,9 @@ Used as alert source in AlertManager. * `http:///metrics` - application metrics. * `http:///-/reload` - hot configuration reload. -`vmalert` may be configured with `-remotewrite` flag to write alerts state in form of timeseries +`vmalert` may be configured with `-remoteWrite` flag to write alerts state in form of timeseries via remote write protocol. Alerts state will be written as `ALERTS` timeseries. These timeseries -may be used to recover alerts state on `vmalert` restarts if `-remoteread` is configured. +may be used to recover alerts state on `vmalert` restarts if `-remoteRead` is configured. ### Configuration @@ -82,22 +82,21 @@ Usage of vmalert: Address to listen for http connections (default ":8880") -notifier.url string Prometheus alertmanager URL. Required parameter. e.g. http://127.0.0.1:9093 - -remoteread.basicAuth.password string - Optional basic auth password for -remoteread.url - -remoteread.basicAuth.username string - Optional basic auth username for -remoteread.url - -remoteread.lookback duration + -remoteRead.basicAuth.password string + Optional basic auth password for -remoteRead.url + -remoteRead.basicAuth.username string + Optional basic auth username for -remoteRead.url + -remoteRead.lookback duration Lookback defines how far to look into past for alerts timeseries. For example, if lookback=1h then range from now() to now()-1h will be scanned. (default 1h0m0s) - -remoteread.url vmalert - Optional URL to Victoria Metrics or VMSelect that will be used to restore alerts state. This configuration makes sense only if vmalert was configured with `remotewrite.url` before and has been successfully persisted its state. E.g. http://127.0.0.1:8428 - -remotewrite.basicAuth.password string - Optional basic auth password for -remotewrite.url - -remotewrite.basicAuth.username string - Optional basic auth username for -remotewrite.url + -remoteRead.url vmalert + Optional URL to Victoria Metrics or VMSelect that will be used to restore alerts state. This configuration makes sense only if vmalert was configured with `remoteWrite.url` before and has been successfully persisted its state. E.g. http://127.0.0.1:8428 + -remoteWrite.basicAuth.password string + Optional basic auth password for -remoteWrite.url + -remoteWrite.basicAuth.username string + Optional basic auth username for -remoteWrite.url -remoteWrite.maxQueueSize - Optional Defines the max number of pending datapoints to remote write endpoint - - -remotewrite.url string + Defines the max number of pending datapoints to remote write endpoint + -remoteWrite.url string Optional URL to Victoria Metrics or VMInsert where to persist alerts state in form of timeseries. E.g. http://127.0.0.1:8428 -rule value Path to the file with alert rules. diff --git a/app/vmalert/main.go b/app/vmalert/main.go index f524b9cea..77fb4ae08 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -39,15 +39,15 @@ absolute path to all .yaml files in root.`) remoteWriteURL = flag.String("remoteWrite.url", "", "Optional URL to Victoria Metrics or VMInsert where to persist alerts state"+ " in form of timeseries. E.g. http://127.0.0.1:8428") - remoteWriteUsername = flag.String("remoteWrite.basicAuth.username", "", "Optional basic auth username for -remotewrite.url") - remoteWritePassword = flag.String("remoteWrite.basicAuth.password", "", "Optional basic auth password for -remotewrite.url") - remoteWriteMaxQueueSize = flag.Int("remoteWrite.maxQueueSize", 10000, "Optional Defines the max number of pending datapoints to remote write endpoint") + remoteWriteUsername = flag.String("remoteWrite.basicAuth.username", "", "Optional basic auth username for -remoteWrite.url") + remoteWritePassword = flag.String("remoteWrite.basicAuth.password", "", "Optional basic auth password for -remoteWrite.url") + remoteWriteMaxQueueSize = flag.Int("remoteWrite.maxQueueSize", 10e3, "Defines the max number of pending datapoints to remote write endpoint") remoteReadURL = flag.String("remoteRead.url", "", "Optional URL to Victoria Metrics or VMSelect that will be used to restore alerts"+ - " state. This configuration makes sense only if `vmalert` was configured with `remotewrite.url` before and has been successfully persisted its state."+ + " state. This configuration makes sense only if `vmalert` was configured with `remoteWrite.url` before and has been successfully persisted its state."+ " E.g. http://127.0.0.1:8428") - remoteReadUsername = flag.String("remoteRead.basicAuth.username", "", "Optional basic auth username for -remoteread.url") - remoteReadPassword = flag.String("remoteRead.basicAuth.password", "", "Optional basic auth password for -remoteread.url") + remoteReadUsername = flag.String("remoteRead.basicAuth.username", "", "Optional basic auth username for -remoteRead.url") + remoteReadPassword = flag.String("remoteRead.basicAuth.password", "", "Optional basic auth password for -remoteRead.url") remoteReadLookBack = flag.Duration("remoteRead.lookback", time.Hour, "Lookback defines how far to look into past for alerts timeseries."+ " For example, if lookback=1h then range from now() to now()-1h will be scanned.") diff --git a/app/vmalert/remotewrite/remotewrite.go b/app/vmalert/remotewrite/remotewrite.go index 812c7a178..b586a2261 100644 --- a/app/vmalert/remotewrite/remotewrite.go +++ b/app/vmalert/remotewrite/remotewrite.go @@ -103,7 +103,8 @@ func (c *Client) Push(s prompbmarshal.TimeSeries) error { case c.input <- s: return nil default: - return fmt.Errorf("failed to push timeseries - queue is full (%d entries), hint from description and add recommendation to increaseremoteWrite.maxQueueSize", + return fmt.Errorf("failed to push timeseries - queue is full (%d entries). "+ + "Queue size is controlled by -remoteWrite.maxQueueSize flag", c.maxQueueSize) } }