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: Dont show 1 firing series when no data in Expressions PreviewSummary #76981

Conversation

soniaAguilarPeiron
Copy link
Member

What is this feature?

This PR fixes the issue related to Expressions incorrectly counting fired alerts when no data is present.

Why do we need this feature?

We need to show consistent and accurate counts in the PreviewSummary on the Alert rule form.

Who is this feature for?

All users.

Which issue(s) does this PR fix?:

Fixes https://github.com/grafana/support-escalations/issues/7811

Special notes for your reviewer:

After the change:

Screenshot 2023-10-23 at 16 54 51

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@soniaAguilarPeiron soniaAguilarPeiron added this to the 10.3.x milestone Oct 23, 2023
@soniaAguilarPeiron soniaAguilarPeiron self-assigned this Oct 23, 2023
@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team as a code owner October 23, 2023 15:45
@soniaAguilarPeiron soniaAguilarPeiron requested review from gillesdemey, VikaCep and konrad147 and removed request for a team October 23, 2023 15:45
@@ -238,6 +232,21 @@ export const PreviewSummary: FC<{ firing: number; normal: number; isCondition: b
return <span className={mutedText}>{`${seriesCount} series`}</span>;
};

export function getGroupedByStateAndSeriesCount(series: DataFrame[]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@@ -82,3 +82,74 @@ function makeSeries(n: number) {
})
);
}

describe('getGroupedByStateAndSeriesCount', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

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.

LGTM!

@soniaAguilarPeiron soniaAguilarPeiron merged commit ed54239 into main Oct 24, 2023
16 checks passed
@soniaAguilarPeiron soniaAguilarPeiron deleted the alerting/not-show-firing-in-expression-summary-when-no-data branch October 24, 2023 13:50
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
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.

None yet

4 participants