Hi,
I have below prometheus unit test 

I tried a lot of manipulations on input_series. But it is always throwing 
failure. 
It only evaluates the first value in the input series.


Unit Testing:  tests/infra_db_alerts-tests.yml
  FAILED:
    alertname: MySQLReplicationDown, time: 10m, 
        exp:[
            0:
              Labels:{alert_owner="alerts-infra", 
alertname="MySQLReplicationDown", severity="High"}
              Annotations:{description="MySQL replication is broken. \n"}
            ], 
        got:[]

rule_files:
- ../rules/db_alerts.yml

tests:
# MySQL Alert Tests
- input_series:
- series: mysql_up
values: 0
- series: mysql_global_variables_innodb_replication_delay
values: '1 1 1 1 1 0 0 0 0 -1 -1 -1 -1 -1 -1'

alert_rule_test:
- alertname: MySQLReplicationLag
eval_time: 5m
exp_alerts:
- exp_labels:
severity: High
alert_owner: alerts-infra
exp_annotations:
description: "There is a MySQL replication delay. \n"

- alertname: MySQLReplicationDown
eval_time: 10m
exp_alerts:
- exp_labels:
severity: High
alert_owner: alerts-infra
exp_annotations:
description: "MySQL replication is broken. \n"

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/80bd28b0-0566-4abc-95c0-ff8ab965ee76n%40googlegroups.com.

Reply via email to