2

I have set alerts for Disk usage and now I want set alerts for Memory usage but I am not able to set it is giving error FAILED TO TEST RULE. Axes B is used and Axes C is Total.

enter image description here

enter image description here

  • Previously I have added alert for disk usage and now trying to add for memory usage in same dashboard. –  Jan 24 '19 at 12:30

3 Answers3

2

In terms of defining an alert, I think you are doing it correctly.

Looking at Grafana's source code here. The error message "Failed to test rule" seems to be a nasty one as it is returning a http 500 code, which means "internal server error".

In other words, this is possibly a Grafana server bug. Probably raise it with the Grafana team here with the steps to replicate.

Samuel Toh
  • 18,006
  • 3
  • 24
  • 39
2

I just checked my Data Source it was $datasource and I am using influxDB so I changed it to influxDb.

0

I recommend to change the avg() in your Conditions. Set it to last(). So it takes only the last value for your alert.

Mike
  • 174
  • 1
  • 11
  • I tried it by changing `avg()` to `last()` but it is still giving me same error. –  Jan 27 '19 at 05:26
  • Are you using template variables in your Query B? If yes this could be the problem. I had the same issue. Grafana isn't able to do Alerting with template variables. have a look at this: https://github.com/grafana/grafana/issues/6557 – Mike Jan 28 '19 at 07:52