Documentation ¶
Overview ¶
Package alerts for alert rules
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID string `mapstructure:"id"` Annotations map[string]string `mapstructure:"annotations"` Metrics []string `mapstructure:"metrics"` Tags string `mapstructure:"tags"` Tenant string `mapstructure:"tenant"` AlertIfHigherThan *float64 `mapstructure:"alert-if-higher-than"` AlertIfLowerThan *float64 `mapstructure:"alert-if-lower-than"` Type AlertType State bool TrigerMetric string TrigerValue float64 TrigerTimestamp int64 }
Alert defines one alert
type AlertRules ¶
type AlertRules struct { Storage storage.Storage ServerURL string ServerMethod string ServerInsecure bool Verbose bool Alerts []*Alert AlertsInterval int Heartbeat int64 }
AlertRules defines prameters for the alerts run rutine
func (*AlertRules) FilterAlerts ¶
func (a *AlertRules) FilterAlerts(tenant string, id string, state string) []Alert
FilterAlerts return a list of alerts, filter by tenant, id and state
func (*AlertRules) Init ¶
func (a *AlertRules) Init()
Init fill in missing configuration data, and start the alert checking loop
Click to show internal directories.
Click to hide internal directories.