Raised as https://github.com/prometheus/prometheus/issues/12871
On Wednesday, 20 September 2023 at 08:36:04 UTC+1 Brian Candler wrote: > On Tuesday, 19 September 2023 at 21:38:12 UTC+1 [email protected] > wrote: > > I am passing multiple values as , values: '1 1 1 1 1 0 0 0 0 -1 -1 -1 -1 > -1 -1' > > > (Not for the mysql_up series you're not - and it was unknown at that point > whether you were using that series in your alerting rules. > Since you're not using it, you might as well remove it.) > > I found the solution, but it's a bit weird and I'd like to raise it as an > issue. You need to explicitly set the "interval" on your rule test to 1m. > Once you've done that, the additional problems are: > - "for: 5m" means you need the expression to be alerting for *6* data > points > - the 'eval_time' needs to point to a time where it has been alerting for > 6 data points > > It works with the following changes: > > --- test-rule3.yaml.orig 2023-09-20 08:12:40.181790387 +0100 > +++ test-rule3.yaml 2023-09-20 08:32:27.828676576 +0100 > @@ -7,8 +7,9 @@ > > - 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' > + values: '1 1 1 1 1 1 0 0 0 0 -1 -1 -1 -1 -1 -1' > > + interval: 1m > > alert_rule_test: > - alertname: MySQLReplicationLag > eval_time: 5m > @@ -20,7 +21,7 @@ > > description: "There is a MySQL replication delay. \n" > > - alertname: MySQLReplicationDown > - eval_time: 10m > + eval_time: 15m > > exp_alerts: > - exp_labels: > severity: High > -- 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/fcd9c6f5-6850-40e8-82e1-868de28caadan%40googlegroups.com.

