Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alerting: No Data in Classic Conditions are confusing and do not behave as expected #57961

Open
grobinson-grafana opened this issue Nov 1, 2022 · 7 comments
Assignees
Labels
area/alerting Grafana Alerting internal for issues made by grafanistas

Comments

@grobinson-grafana
Copy link
Contributor

Background:

Classic Conditions is a feature in Grafana Alerting that supports the reduction and comparison of one or more conditions, and the grouping of related conditions is known as a ConditionsCmd. A condition in ConditionsCmd can reduce a time series, contain an instant metric, or the result of another expression; and checks if it exceeds a threshold, falls within a range, or does not contain a value.

If a ConditionsCmd contains more than one condition, it reduces the boolean outcomes of the threshold, range or value checks using the logical operator of the right hand side condition until all conditions have been reduced to a single boolean outcome. ConditionsCmd does not follow operator precedence.

For example if we have the following classic condition:

min(A) > 5 OR max(B) < 10 AND C = 1

which reduces to the following boolean outcomes:

false OR true AND true

then the outcome of this ConditionsCmd is true.

What happened:

No Data in Classic Conditions are confusing and do not behave as expected.

What you expected to happen:

  • A condition in a ConditionsCmd should still be considered No Data when all of the series contain No Data

  • However, the outcome of the ConditionsCmd should change to the following:

    1. No Data when all the conditions are No Data
    2. No Data when at least one condition is No Data and the and operator is used

If we take the example min(A) > 5 OR max(B) < 10 AND C = 1 and create a No Data matrix:

A B C Outcome
Data No Data No Data No Data
Data Data No Data No Data
Data Data Data Data
No Data No Data No Data No Data
No Data Data No Data No Data
No Data Data Data Data

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Grafana version:
  • Data source type & version:
  • OS Grafana is installed on:
  • User OS & Browser:
  • Grafana plugins:
  • Others:
@un000
Copy link

un000 commented Jan 19, 2023

Have the same problem with a Classic conditions and multiple time series:

  • series A returns numbers (5, 5, 5, 5...)
  • series B returns No Data

Classic conditions:

  • WHEN median() of A IS ABOVE 1 < must be fired
  • OR
  • WHEN median() OF B IS ABOVE 0 < No Data

Result is 0 firing, 1 normal, but firing on A expected.

@segfaultdoc
Copy link

Experiencing the same issues as the ones mentioned here. This has led us to duplicate alerts across our different environments so that they can individually trigger NoData conditions.

@esemeniuc
Copy link

Also experiencing this, would like to have this resolved

@esemeniuc
Copy link

This also seems to happen when using math expression, we're missing the NoData alert:

Alert configuration:
image
image

Results:
image

@JinXiu2023
Copy link

Experiencing the same probelms. The result of classic condition follows the nodata querys. It is very confusing. Will the issue be solved? Thanks very much.

@kshnyakin
Copy link

kshnyakin commented Nov 29, 2023

I join the request to solve the problem. It's already a year old and it's pretty serious.
The same problem and with Math conditions (a year has passed since the task was opened :-))

@Aboitier
Copy link

Aboitier commented Apr 26, 2024

Also joining.

I have 3 time-series queries that are all reduced to have a single number. One of the three queries displays 'No Data' and the resulting Math Expression ($Q1+$Q2+$Q3) displays 'No Data'. I find this... strange logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Grafana Alerting internal for issues made by grafanistas
Projects
Status: In progress
Development

No branches or pull requests

8 participants