Grafana 8.5 - Rule, conditions and no data and error handling configuration

  • What Grafana version and what operating system are you using?
    Grafana 8.5, web interface

  • What are you trying to achieve?
    I am trying to include alerts to my queries.

  • How are you trying to achieve it?
    I am trying to use the alert option available in the dashboard.

  • What happened?
    Here is my query (Bottom 20 users, where the GPU utilization was more than 0.1 and lower than 10 in the last 3h):
    bottomk(20, sum by(user, account, cluster, slurmjobid, gpu) (avg_over_time(slurm_job_utilization_gpu{cluster=“narval”}[3h])) >= 0.1 < 10)

I would like to have an alert when I have a user where this query will have an avg() of value OF IS BELOW 2 and IS ABOVE 0.1 for 1h.

I would like to know the difference between what we are setting as an interval in the Rule section Evaluate every 5m For 1h and what we are setting here query (A, 1h, now) I do not understand what to put there for the value of time (query (A, 1h, now) and what is the now-time option means.

  1. Rule:
    Evaluate every 5m For 1h
    and Conditions:
  2. WHEN avg() OF query (A, 1h, now) IS BELOW 2
    AND avg() OF query (A, 1h, now) IS ABOVE 0.1
  • What did you expect to happen?

I would like to have an alert when I have a user where this query will have an avg() of value OF IS BELOW 2 and IS ABOVE 0.1 for 1h. I would like to eliminate all the users where this query is below 1h. The alert needs to be on for 1h.

Also, what should I put in no data and error handling to achieve that?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

I received an alert, but some of the jobs were less than 1h. I also received more than 20 outputs results and some of the results are present more than once.

Thanks for explaining the difference between The rule section and Conditions section for the time definition and interval.

  • Did you follow any online instructions? If so, what is the URL?
    No

I have resolved by myself, please close the case thank you.