Versions in this module Expand all Collapse all v1 v1.0.0 Dec 6, 2022 Changes in this version + const RuleFileSuffix + const Version + func FsWatcher(path string, callback func(event *fsnotify.Event, e error)) + func RenderAlertMessage(writer http.ResponseWriter, request *http.Request) + type AlertContent struct + EndsAt *time.Time + Match *Match + Rule *conf.Rule + StartsAt *time.Time + State AlertState + func (ac *AlertContent) GetAlertMessage(generatorURL string) string + func (ac *AlertContent) HasResolved() bool + type AlertMessage struct + Path string + Payload string + StartsAt *time.Time + UniqueId string + type AlertSampleMessage struct + ES conf.EsConfig + Ids []string + Index string + type AlertState int + const Pending + const Resolved + type ElasticAlert struct + func NewElasticAlert(c *conf.AppConfig, opts *conf.FlagOption) *ElasticAlert + func (ea *ElasticAlert) SetAppConf(c *conf.AppConfig) + func (ea *ElasticAlert) Start() + func (ea *ElasticAlert) Stop() + type ElasticAlertPrometheusMetrics struct + OpRedis sync.Map + Query sync.Map + WebhookNotify sync.Map + func NewElasticAlertPrometheusMetrics() *ElasticAlertPrometheusMetrics + type ElasticJob struct + EndsAt *time.Time + Scheduler *gocron.Scheduler + StartsAt *time.Time + type FileLoader struct + RulesFolder string + RulesFolderRecursion bool + func (fl *FileLoader) GetRules() map[string]*conf.Rule + func (fl *FileLoader) InjectConfig(config map[string]any) + func (fl *FileLoader) ReloadSchedulerJob(engine *ElasticAlert) + type FrequencyRule struct + func (fr *FrequencyRule) FilterMatchCondition(r *conf.Rule, matches []Match) *Match + func (fr *FrequencyRule) GetMatches(r *conf.Rule, resultHits []any) []Match + type Loader interface + GetRules func() map[string]*conf.Rule + InjectConfig func(config map[string]any) + ReloadSchedulerJob func(*ElasticAlert) + func NewLoaderInstance(t string) Loader + type Match struct + EndsAt time.Time + HitsNumber int + Ids []string + StartsAt time.Time + func (mc *Match) Fingerprint() string + type OpRedisMetrics struct + Cmd string + Key string + Path string + Status int + UniqueId string + Value int64 + type QueryMetrics struct + EsAddress string + Index string + Path string + Status int + UniqueId string + Value int64 + type RuleStatusCollector struct + AppInfoDesc *prometheus.Desc + Ea *ElasticAlert + LinkRedisDesc *prometheus.Desc + OpRedisDesc *prometheus.Desc + QueryDesc *prometheus.Desc + RuleStatusDesc *prometheus.Desc + WebhookNotifyDesc *prometheus.Desc + func NewRuleStatusCollector(ea *ElasticAlert) *RuleStatusCollector + func (rc *RuleStatusCollector) Collect(ch chan<- prometheus.Metric) + func (rc *RuleStatusCollector) Describe(ch chan<- *prometheus.Desc) + type RuleType interface + FilterMatchCondition func(r *conf.Rule, matches []Match) *Match + GetMatches func(r *conf.Rule, hits []any) []Match + func NewRuleType(t string) RuleType + type WebhookNotifyMetrics struct + Path string + Status int + UniqueId string + Value int64