Alerting: Fix NoRulesSplash being rendered for some seconds, fater creating a rule #77048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: