Skip to content

Commit

Permalink
Fix: #147 (#148)
Browse files Browse the repository at this point in the history
* Fix: #147

* update to 1m eval time

* fix unit test eval time

---------

Co-authored-by: honghan <[email protected]>
  • Loading branch information
honghan-wong and honghan-wong authored Jan 15, 2024
1 parent f064828 commit b61b1c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/prometheus_alert_rules/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ groups:
rules:
- alert: CollectorFailed
expr: '{__name__=~"(.*)_collector_failed"} == 1'
for: 0m
for: 1m
labels:
severity: error
annotations:
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_alert_rules/test_general.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
rule_files:
- ../../../src/prometheus_alert_rules/general.yaml

evaluation_interval: 1m
evaluation_interval: 2m

tests:
- interval: 1m
- interval: 2m
input_series:
- series: ipmidcmi_collector_failed{instance="ubuntu-99", collector="ipmidcmi"}
values: '1x15'
- series: ipmisel_collector_failed{instance="ubuntu-99", collector="ipmisel"}
values: '1x15'

alert_rule_test:
- eval_time: 0m
- eval_time: 2m
alertname: CollectorFailed
exp_alerts:
- exp_labels:
Expand Down

0 comments on commit b61b1c2

Please sign in to comment.