Alerting: Update state history service to filter states transitions (#58863)

* rename the method to better reflect its behavior
* make historian filter transition on itself
* call historian with all changes
This commit is contained in:
Yuri Tseretyan
2022-12-06 12:33:15 -05:00
committed by GitHub
parent 18d09cd3fe
commit a85adeed96
6 changed files with 120 additions and 25 deletions

View File

@@ -23,7 +23,7 @@ type RuleReader interface {
// Historian maintains an audit log of alert state history.
type Historian interface {
// RecordStates writes a number of state transitions for a given rule to state history.
RecordStates(ctx context.Context, rule *models.AlertRule, states []StateTransition)
RecordStatesAsync(ctx context.Context, rule *models.AlertRule, states []StateTransition)
}
// ImageCapturer captures images.