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 NoRulesSplash being rendered for some seconds, fater creating a rule #77048

Merged

Conversation

soniaAguilarPeiron
Copy link
Member

What is this feature?

This pull request addresses an issue where, just after creating a new alert rule, the alert list view initially renders the message "You have not created alert rules" along with an empty list. However, within a few seconds, the user interface (UI) is updated to correctly display the list of rules.

Context:

This behavior occurs because when a rule is created in the ruler, it immediately appears in the /api/ruler/grafana/api/v1/rules, but there is a slight delay before the rule's status is reflected in /api/prometheus/grafana/api/v1/rules.
The rendering logic for the NoRulesSplash was originally based on the Prometheus rules response, which caused the delay in UI updates.

Why do we need this feature?

The alert list view should display an accurate and up-to-date state of alert rules, immediately after they are created, without any delay or misleading messages.

Who is this feature for?

All users

Special notes for your reviewer:

After the change:

create-first-alert.mp4

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 area/alerting Grafana Alerting area/frontend add to changelog no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Oct 24, 2023
@soniaAguilarPeiron soniaAguilarPeiron added this to the 10.3.x milestone Oct 24, 2023
@soniaAguilarPeiron soniaAguilarPeiron self-assigned this Oct 24, 2023
@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team as a code owner October 24, 2023 13:47
@soniaAguilarPeiron soniaAguilarPeiron requested review from gillesdemey, VikaCep and konrad147 and removed request for a team October 24, 2023 13:47
Copy link
Contributor

@VikaCep VikaCep left a comment

Choose a reason for hiding this comment

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

LGTM!

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 f1ce73d into main Oct 25, 2023
16 checks passed
@soniaAguilarPeiron soniaAguilarPeiron deleted the alerting-fix-no-rules-warning-when-creating-rule branch October 25, 2023 07:32
ssama88 pushed a commit to ssama88/grafana that referenced this pull request Oct 31, 2023
…eating a rule (grafana#77048)

* Fix NoRulesSplash being rendered for some seconds, fater creating a rule

* Add ruler response/loading,dispatched,error to the logic in hasNoAlertRulesCreatedYet expression
@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
Labels
add to changelog area/alerting Grafana Alerting area/frontend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants