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: Set isNoData if isCondNoData #58422

Closed
wants to merge 1 commit into from

Conversation

grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented Nov 8, 2022

What this PR does / why we need it:

In the original ConditionsCmd code No Data was set to true if thisCondNoData, even if the outcome of the || or && comparison was false.

if c.Operator == "or" {
	firing = firing || thisCondFiring
	noDataFound = noDataFound || thisCondNoData
} else {
	firing = firing && thisCondFiring
	noDataFound = noDataFound && thisCondNoData
}

if thisCondNoData {
	matches = append(matches, EvalMatch{
		Metric: "NoData",
	})
        // noDataFound is set to true here
	noDataFound = true
}

This line appears to be significant in maintaining the current behaviour of ConditionsCmd and was omitted from #56812.

Which issue(s) does this PR fix?:

Fixes #55085

Special notes for your reviewer:

@grobinson-grafana grobinson-grafana added add to changelog backport v9.1.x Bot will automatically open backport PR backport v9.2.x Mark PR for automatic backport to v9.2.x labels Nov 8, 2022
@grobinson-grafana grobinson-grafana added this to the 9.2.5 milestone Nov 8, 2022
@grobinson-grafana grobinson-grafana requested a review from a team November 8, 2022 12:57
@grobinson-grafana grobinson-grafana self-assigned this Nov 8, 2022
@grobinson-grafana grobinson-grafana requested a review from a team as a code owner November 8, 2022 12:57
@grobinson-grafana grobinson-grafana requested review from papagian, zserge and ying-jeanne and removed request for a team November 8, 2022 12:57
@grobinson-grafana grobinson-grafana changed the title Alerting: Remove isNoData comparisons from ConditionsCmd Alerting: Set isNoData if isCondNoData Nov 8, 2022
@grobinson-grafana grobinson-grafana added no-backport Skip backport of PR and removed backport v9.1.x Bot will automatically open backport PR backport v9.2.x Mark PR for automatic backport to v9.2.x labels Nov 8, 2022
@grobinson-grafana
Copy link
Contributor Author

No backport because I have decided not to backport #56812.

@grobinson-grafana grobinson-grafana force-pushed the grobinson/fix-no-data-classic-2 branch 5 times, most recently from 29f18d1 to 1ff53f4 Compare November 8, 2022 13:02
@grobinson-grafana grobinson-grafana deleted the grobinson/fix-no-data-classic-2 branch November 8, 2022 13:09
@github-actions github-actions bot removed this from the 9.2.5 milestone Nov 8, 2022
@grafanabot
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Grafana 9.1.4 NoData reduce problem
2 participants