Alerting: Move annotation functionality behind a history persistence interface (#56133)

* Move annotation functionality behind a history persistence interface

* Rename to RecordState

* Fix lint error in import aliasing

* One more import linter error
This commit is contained in:
Alexander Weaver
2022-10-05 15:32:20 -05:00
committed by GitHub
parent b3087cfcd1
commit 8df830557a
9 changed files with 134 additions and 97 deletions

View File

@@ -3,7 +3,9 @@ package state
import (
"context"
"sync"
"time"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/ngalert/models"
)
@@ -41,3 +43,8 @@ type FakeRuleReader struct{}
func (f *FakeRuleReader) ListAlertRules(_ context.Context, q *models.ListAlertRulesQuery) error {
return nil
}
type FakeHistorian struct{}
func (f *FakeHistorian) RecordState(ctx context.Context, rule *models.AlertRule, labels data.Labels, evaluatedAt time.Time, currentData, previousData InstanceStateAndReason) {
}