vmalert: fix flag names and description in README (#475)

Change also adds the recommendation for `remotewrite`
queue error.
This commit is contained in:
Roman Khavronenko 2020-05-13 19:32:21 +01:00 committed by GitHub
parent ba48438b06
commit db7dd96346
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 25 deletions

View file

@ -58,8 +58,8 @@ run-vmalert: vmalert
./bin/vmalert -rule=app/vmalert/testdata/rules0-good.rules \ ./bin/vmalert -rule=app/vmalert/testdata/rules0-good.rules \
-datasource.url=http://localhost:8428 \ -datasource.url=http://localhost:8428 \
-notifier.url=http://localhost:9093 \ -notifier.url=http://localhost:9093 \
-remotewrite.url=http://localhost:8428 \ -remoteWrite.url=http://localhost:8428 \
-remoteread.url=http://localhost:8428 \ -remoteRead.url=http://localhost:8428 \
-evaluationInterval=3s -evaluationInterval=3s
vmalert-amd64: vmalert-amd64:

View file

@ -50,9 +50,9 @@ Used as alert source in AlertManager.
* `http://<vmalert-addr>/metrics` - application metrics. * `http://<vmalert-addr>/metrics` - application metrics.
* `http://<vmalert-addr>/-/reload` - hot configuration reload. * `http://<vmalert-addr>/-/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 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 ### Configuration
@ -82,22 +82,21 @@ Usage of vmalert:
Address to listen for http connections (default ":8880") Address to listen for http connections (default ":8880")
-notifier.url string -notifier.url string
Prometheus alertmanager URL. Required parameter. e.g. http://127.0.0.1:9093 Prometheus alertmanager URL. Required parameter. e.g. http://127.0.0.1:9093
-remoteread.basicAuth.password string -remoteRead.basicAuth.password string
Optional basic auth password for -remoteread.url Optional basic auth password for -remoteRead.url
-remoteread.basicAuth.username string -remoteRead.basicAuth.username string
Optional basic auth username for -remoteread.url Optional basic auth username for -remoteRead.url
-remoteread.lookback duration -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) 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 -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 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 -remoteWrite.basicAuth.password string
Optional basic auth password for -remotewrite.url Optional basic auth password for -remoteWrite.url
-remotewrite.basicAuth.username string -remoteWrite.basicAuth.username string
Optional basic auth username for -remotewrite.url Optional basic auth username for -remoteWrite.url
-remoteWrite.maxQueueSize -remoteWrite.maxQueueSize
Optional Defines the max number of pending datapoints to remote write endpoint Defines the max number of pending datapoints to remote write endpoint
-remoteWrite.url string
-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 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 -rule value
Path to the file with alert rules. Path to the file with alert rules.

View file

@ -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"+ 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") " 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") 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") 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") 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"+ 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") " E.g. http://127.0.0.1:8428")
remoteReadUsername = flag.String("remoteRead.basicAuth.username", "", "Optional basic auth username 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") 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."+ 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.") " For example, if lookback=1h then range from now() to now()-1h will be scanned.")

View file

@ -103,7 +103,8 @@ func (c *Client) Push(s prompbmarshal.TimeSeries) error {
case c.input <- s: case c.input <- s:
return nil return nil
default: 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) c.maxQueueSize)
} }
} }