mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
dc28196237
1. split package rule under /app/vmalert, expose needed objects 2. add vmalert-tool with unittest subcmd https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2945
49 lines
1 KiB
YAML
49 lines
1 KiB
YAML
rule_files:
|
|
- rules.yaml
|
|
|
|
tests:
|
|
- interval: 1m
|
|
name: "Failing test"
|
|
input_series:
|
|
- series: test
|
|
values: "0"
|
|
|
|
metricsql_expr_test:
|
|
- expr: test
|
|
eval_time: 0m
|
|
exp_samples:
|
|
- value: 0
|
|
labels: test
|
|
|
|
# will failed cause there is no "Test" group and rule defined
|
|
alert_rule_test:
|
|
- eval_time: 0m
|
|
groupname: Test
|
|
alertname: Test
|
|
exp_alerts:
|
|
- exp_labels: {}
|
|
|
|
- interval: 1m
|
|
name: Failing alert test
|
|
input_series:
|
|
- series: 'up{job="test"}'
|
|
values: 0x10
|
|
|
|
alert_rule_test:
|
|
# will failed cause rule is firing
|
|
- eval_time: 5m
|
|
groupname: group1
|
|
alertname: InstanceDown
|
|
exp_alerts: []
|
|
|
|
- interval: 1m
|
|
name: Failing alert test with missing groupname
|
|
input_series:
|
|
- series: 'up{job="test"}'
|
|
values: 0x10
|
|
|
|
alert_rule_test:
|
|
# will failed cause missing groupname
|
|
- eval_time: 5m
|
|
alertname: AlwaysFiring
|
|
exp_alerts: []
|