rules: add unknown state for unevaluated alerting rules#17282
Merged
juliusv merged 4 commits intoprometheus:mainfrom Oct 17, 2025
Merged
rules: add unknown state for unevaluated alerting rules#17282juliusv merged 4 commits intoprometheus:mainfrom
juliusv merged 4 commits intoprometheus:mainfrom
Conversation
Signed-off-by: Sahil Rasaikar <sahil.rasaikar@gmail.com>
Signed-off-by: Sahil Rasaikar <sahil.rasaikar@gmail.com>
Signed-off-by: Sahil Rasaikar <sahil.rasaikar@gmail.com>
juliusv
reviewed
Oct 8, 2025
Member
juliusv
left a comment
There was a problem hiding this comment.
Looks pretty good, thanks. A few comments. And I assume you tested it and it works? :)
… String method to match constant order. Signed-off-by: Sahil Rasaikar <sahil.rasaikar@gmail.com>
Contributor
Author
Contributor
Author
|
@beorn7 , can i have a review here, also for next time what's the correct way to ask for reviews? Thanks. |
Member
|
Thanks, looks good now! 👍
I think you did everything correct - we're just sometimes slow with reviews because there are a lot of things happening (in the project and elsewhere in life), and the people reviewing PRs are mostly doing this on a volunteer basis and a bit random in their prioritization. |
juliusv
approved these changes
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.






Which issue(s) does the PR fix:
Fixes #4510
Does this PR introduce a user-facing change?
Description
This PR introduces a new
StateUnknownstate for alerting rules that haven't been evaluated yet. Previously, unevaluated rules would show as "inactive" which could be misleading as it suggests the rule has been evaluated and found no matching alerts.Changes:
Backend (Go):
StateUnknownconstant with value-1to theAlertStateenumAlertingRule.State()to returnStateUnknownwhen the rule's evaluation timestamp is zero (indicating it hasn't been evaluated)AlertState.String()to handle the new unknown stateFrontend (Mantine UI):
RuleStatetype to include "unknown"Benefits:
Testing:
The existing test suite has been updated to accommodate the new state. The test now sets the evaluation timestamp to ensure that the existing test cases continue to work as expected.
Note on implementation:
The implementation checks if
evaluationTimestampis zero to determine if a rule has been evaluated. This is a reliable indicator as the timestamp is set during each evaluation cycle.