v1.107.0612.6 MB
Apache-2.0
strict
core18
VMAlert command-line tool
vmalert-tool
https://docs.victoriametrics.com/vmalert-tool/
Unit testing for rules
https://docs.victoriametrics.com/vmalert-tool/#unit-testing-for-rules
You can use
See how to run vmalert-tool for unit test below:
Run vmalert-tool with one or multiple test files via --files cmd-line flag
vmalert-tool unittest is compatible with Prometheus config format for tests (https://prometheus.io/docs/prometheus/latest/configuration/unittestingrules/#test-file-format except)
https://docs.victoriametrics.com/vmalert-tool/
Unit testing for rules
https://docs.victoriametrics.com/vmalert-tool/#unit-testing-for-rules
You can use
vmalert-tool to run unit tests for alerting and recording rules. It will perform the following actions:
- sets up an isolated VictoriaMetrics instance;
- simulates the periodic ingestion of time series;
- queries the ingested data for recording and alerting rules evaluation like https://docs.victoriametrics.com/vmalert/;
- checks whether the firing alerts or resulting recording rules match the expected results.
See how to run vmalert-tool for unit test below:
Run vmalert-tool with one or multiple test files via --files cmd-line flag
./vmalert-tool unittest --files test1.yaml --files test2.yamlvmalert-tool unittest is compatible with Prometheus config format for tests (https://prometheus.io/docs/prometheus/latest/configuration/unittestingrules/#test-file-format except)
promqlexprtest field. Use metricsqlexprtest field name instead. The name is different because vmalert-tool validates and executes MetricsQL (https://docs.victoriametrics.com/metricsql/) expressions, which aren’t always backward compatible with PromQL (https://prometheus.io/docs/prometheus/latest/querying/basics/).Update History
v1.107.0 (6)13 Dec 2025, 09:47 UTC
25 Apr 2024, 19:40 UTC
9 Dec 2024, 16:02 UTC
13 Dec 2025, 09:47 UTC
