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: Fix alert list panel showing firing alerts with no instances #50069

Merged
merged 2 commits into from
Jun 2, 2022

Conversation

gillesdemey
Copy link
Member

@gillesdemey gillesdemey commented Jun 2, 2022

What this PR does / why we need it:

Fixes a bug where the alert list panel would show firing alerts with no instances.

Additionally it clarifies that no alerts are shown that match the current set of filters and indicates how many instances are not being shown (because they are hidden by at least one of the alert state filters).

Screenshot 2022-06-02 at 11 28 35

Screenshot 2022-06-02 at 11 28 51

Special notes for your reviewer:

@gillesdemey gillesdemey added this to the 9.0.0-beta3 milestone Jun 2, 2022
@gillesdemey gillesdemey requested a review from a team June 2, 2022 09:49
@gillesdemey gillesdemey requested a review from a team as a code owner June 2, 2022 09:49
@@ -122,15 +122,15 @@ function filterRules(props: PanelProps<UnifiedAlertListOptions>, rules: PromRule
name.toLocaleLowerCase().includes(replacedName.toLocaleLowerCase())
);
}
if (Object.values(options.stateFilter).some((value) => value)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the root of the problem, we only filtered alerts when any of the state filters were true, meaning that if no states were selected it would show firing alerts with 0 instances (they instances are filtered in GroupedModeView)

Copy link
Contributor

@konrad147 konrad147 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! Just one minor nit

public/app/plugins/panel/alertlist/AlertInstances.tsx Outdated Show resolved Hide resolved
@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.

3 participants