Compare commits

...

8 Commits

Author SHA1 Message Date
Jayice
b9bb73d705 Merge remote-tracking branch 'origin/issue-11160' into issue-11160 2026-06-30 23:59:10 +08:00
Jayice
a34029cb35 rename Series column to "Series Returned" 2026-06-30 18:41:12 +08:00
JAYICE
e6d36822b7 Merge branch 'master' into issue-11160 2026-06-30 17:08:56 +08:00
Jayice
54a86d2ad4 address review comments 2026-06-30 16:58:55 +08:00
Jayice
85eccb0603 fix cubic review 2026-06-26 03:32:51 +08:00
Jayice
29a3e728c3 fix cubic review 2026-06-25 16:55:42 +08:00
Jayice
901f1e9fb2 fix cubic review 2026-06-25 14:47:27 +08:00
Jayice
76f2752fd6 extend rule state to count state number 2026-06-25 14:27:38 +08:00
3 changed files with 17 additions and 4 deletions

View File

@@ -543,8 +543,10 @@ func (rh *requestHandler) groups(rf *rulesFilter) *listGroupsResponse {
if !groupFound && !strings.Contains(strings.ToLower(rule.Name), rf.search) {
continue
}
ruleWithExtendedState := rule
ruleWithExtendedState.ExtendState()
if rf.extendedStates {
rule.ExtendState()
rule = ruleWithExtendedState
}
if !rf.matchesRule(&rule) {
continue
@@ -552,7 +554,18 @@ func (rh *requestHandler) groups(rf *rulesFilter) *listGroupsResponse {
if rf.excludeAlerts {
rule.Alerts = nil
}
g.States[rule.State]++
ruleState := ruleWithExtendedState.State
if ruleState == "inactive" || ruleState == "pending" || ruleState == "firing" {
g.States["ok"]++
} else {
// 1. alerting rule with unhealthy or nomatch state
// 2. recording rule
g.States[ruleState]++
if ruleState == "nomatch" {
g.States["ok"]++
}
}
filteredRules = append(filteredRules, rule)
}
if len(g.Rules) == 0 || len(filteredRules) > 0 {

View File

@@ -169,7 +169,7 @@
<thead>
<tr>
<th scope="col" class="w-60">Rule</th>
<th scope="col" class="w-20" class="text-center" title="How many series were produced by the rule">Series</th>
<th scope="col" class="w-20" class="text-center" title="How many series were produced by the rule">Series Returned</th>
<th scope="col" class="w-20" class="text-center" title="How many seconds ago rule was executed">Updated</th>
</tr>
</thead>

View File

@@ -535,7 +535,7 @@ func StreamListGroups(qw422016 *qt422016.Writer, r *http.Request, groups []*rule
<thead>
<tr>
<th scope="col" class="w-60">Rule</th>
<th scope="col" class="w-20" class="text-center" title="How many series were produced by the rule">Series</th>
<th scope="col" class="w-20" class="text-center" title="How many series were produced by the rule">Series Returned</th>
<th scope="col" class="w-20" class="text-center" title="How many seconds ago rule was executed">Updated</th>
</tr>
</thead>