Documentation ¶
Overview ¶
Package alerts has functions and data types for storing alert information and calculating similar alerts.
Index ¶
Constants ¶
View Source
const TimeFormat = time.RFC3339
TimeFormat is the time format of alert boundaries
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Annotations map[string]string `json:"annotations,omitempty"` StartsAt string `json:"startsAt,omitempty"` EndsAt string `json:"endsAt,omitempty"` GeneratorURL string `json:"generatorURL,omitempty"` Labels map[string]string `json:"labels"` Status string `json:"status,omitempty"` Related map[string]uint `json:"related,omitempty"` }
Alert stores the necessary data of one alert.
type AlertSource ¶
AlertSource is an interface for all alerts sources.
type ElasticSearchSource ¶
type ElasticSearchSource struct { AlertSource // contains filtered or unexported fields }
ElasticSearchSource represents ElasticSearch as a source for alerts.
func NewElasticSearchSource ¶
func NewElasticSearchSource(index string, client *elastic.Client, logger *zap.Logger) (ElasticSearchSource, error)
NewElasticSearchSource returns a new ElasticSearchSource.
func (ElasticSearchSource) GetAlertsFromTo ¶
func (es ElasticSearchSource) GetAlertsFromTo(from, to time.Time) (ret []Alert, err error)
GetAlertsFromTo retrieves the alerts between specified boundaries.
type State ¶
type State struct { Firing []string Alerts map[string]Alert LastUpdated time.Time // contains filtered or unexported fields }
State is the current state of the alerts parser.
func (*State) GetLastUpdated ¶
GetLastUpdated gets the time when State was last updated.
Click to show internal directories.
Click to hide internal directories.