Documentation
¶
Index ¶
- Constants
- func FromAlertStateToPostableAlerts(firingStates []*state.State, stateManager *state.Manager, appURL *url.URL) apimodels.PostableAlerts
- func NewScheduler(cfg SchedulerCfg, expressionService *expr.Service, appURL *url.URL, ...) *schedule
- type FakeExternalAlertmanager
- func (am *FakeExternalAlertmanager) AlertNamesCompare(expected []string) bool
- func (am *FakeExternalAlertmanager) Alerts() amv2.PostableAlerts
- func (am *FakeExternalAlertmanager) AlertsCount() int
- func (am *FakeExternalAlertmanager) Close()
- func (am *FakeExternalAlertmanager) Handler() func(w http.ResponseWriter, r *http.Request)
- func (am *FakeExternalAlertmanager) URL() string
- type FakeInstanceStore
- func (f *FakeInstanceStore) DeleteAlertInstance(_ int64, _, _ string) error
- func (f *FakeInstanceStore) FetchOrgIds() ([]int64, error)
- func (f *FakeInstanceStore) GetAlertInstance(q *models.GetAlertInstanceQuery) error
- func (f *FakeInstanceStore) ListAlertInstances(q *models.ListAlertInstancesQuery) error
- func (f *FakeInstanceStore) SaveAlertInstance(q *models.SaveAlertInstanceCommand) error
- type ScheduleService
- type SchedulerCfg
Constants ¶
View Source
const ( NoDataAlertName = "DatasourceNoData" Rulename = "rulename" )
Variables ¶
This section is empty.
Functions ¶
func NewScheduler ¶
func NewScheduler(cfg SchedulerCfg, expressionService *expr.Service, appURL *url.URL, stateManager *state.Manager) *schedule
NewScheduler returns a new schedule.
Types ¶
type FakeExternalAlertmanager ¶
type FakeExternalAlertmanager struct {
// contains filtered or unexported fields
}
func NewFakeExternalAlertmanager ¶
func NewFakeExternalAlertmanager(t *testing.T) *FakeExternalAlertmanager
func (*FakeExternalAlertmanager) AlertNamesCompare ¶
func (am *FakeExternalAlertmanager) AlertNamesCompare(expected []string) bool
func (*FakeExternalAlertmanager) Alerts ¶
func (am *FakeExternalAlertmanager) Alerts() amv2.PostableAlerts
func (*FakeExternalAlertmanager) AlertsCount ¶
func (am *FakeExternalAlertmanager) AlertsCount() int
func (*FakeExternalAlertmanager) Close ¶
func (am *FakeExternalAlertmanager) Close()
func (*FakeExternalAlertmanager) Handler ¶
func (am *FakeExternalAlertmanager) Handler() func(w http.ResponseWriter, r *http.Request)
func (*FakeExternalAlertmanager) URL ¶
func (am *FakeExternalAlertmanager) URL() string
type FakeInstanceStore ¶
type FakeInstanceStore struct {
// contains filtered or unexported fields
}
func (*FakeInstanceStore) DeleteAlertInstance ¶
func (f *FakeInstanceStore) DeleteAlertInstance(_ int64, _, _ string) error
func (*FakeInstanceStore) FetchOrgIds ¶
func (f *FakeInstanceStore) FetchOrgIds() ([]int64, error)
func (*FakeInstanceStore) GetAlertInstance ¶
func (f *FakeInstanceStore) GetAlertInstance(q *models.GetAlertInstanceQuery) error
func (*FakeInstanceStore) ListAlertInstances ¶
func (f *FakeInstanceStore) ListAlertInstances(q *models.ListAlertInstancesQuery) error
func (*FakeInstanceStore) SaveAlertInstance ¶
func (f *FakeInstanceStore) SaveAlertInstance(q *models.SaveAlertInstanceCommand) error
type ScheduleService ¶
type ScheduleService interface { Run(context.Context) error Pause() error Unpause() error AlertmanagersFor(orgID int64) []*url.URL DroppedAlertmanagersFor(orgID int64) []*url.URL // contains filtered or unexported methods }
ScheduleService handles scheduling
type SchedulerCfg ¶
type SchedulerCfg struct { C clock.Clock BaseInterval time.Duration Logger log.Logger EvalAppliedFunc func(models.AlertRuleKey, time.Time) MaxAttempts int64 StopAppliedFunc func(models.AlertRuleKey) Evaluator eval.Evaluator RuleStore store.RuleStore OrgStore store.OrgStore InstanceStore store.InstanceStore AdminConfigStore store.AdminConfigurationStore MultiOrgNotifier *notifier.MultiOrgAlertmanager Metrics *metrics.Scheduler AdminConfigPollInterval time.Duration DisabledOrgs map[int64]struct{} MinRuleInterval time.Duration }
SchedulerCfg is the scheduler configuration.
Click to show internal directories.
Click to hide internal directories.