Alerting: update state manager to return StateTransition instead of State (#58867)

* improve test for stale states
* update state manager return StateTransition
* update scheduler to accept state transitions
This commit is contained in:
Yuri Tseretyan
2022-12-06 13:07:39 -05:00
committed by GitHub
parent a85adeed96
commit abb49d96b5
6 changed files with 108 additions and 81 deletions
+6
View File
@@ -158,6 +158,12 @@ func WithTitle(title string) AlertRuleMutator {
}
}
func WithFor(duration time.Duration) AlertRuleMutator {
return func(rule *AlertRule) {
rule.For = duration
}
}
func GenerateAlertLabels(count int, prefix string) data.Labels {
labels := make(data.Labels, count)
for i := 0; i < count; i++ {