grafana/pkg/services/ngalert/state/historian/sql.go
2023-01-24 15:41:38 +00:00

31 lines
724 B
Go

package historian
import (
"context"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/ngalert/state"
)
type SqlBackend struct {
log log.Logger
}
func NewSqlBackend() *SqlBackend {
return &SqlBackend{
log: log.New("ngalert.state.historian"),
}
}
func (h *SqlBackend) RecordStatesAsync(ctx context.Context, _ *models.AlertRule, _ []state.StateTransition) <-chan error {
errCh := make(chan error)
close(errCh)
return errCh
}
func (h *SqlBackend) QueryStates(ctx context.Context, query models.HistoryQuery) (*data.Frame, error) {
return data.NewFrame("states"), nil
}