Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶ added in v0.2.8
type Alert struct {
State AlertState `json:"state"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
modified
type AlertState ¶ added in v0.2.8
type AlertState int
AlertState denotes the state of an active alert.
const ( // StateInactive is the state of an alert that is neither firing nor pending. StateInactive AlertState = iota // StatePending is the state of an alert that has been active for less than // the configured threshold duration. StatePending // StateFiring is the state of an alert that has been active for longer than // the configured threshold duration. StateFiring )
func (AlertState) String ¶ added in v0.2.9
func (s AlertState) String() string
type AlertingRule ¶ added in v0.2.8
type AlertingRule struct {
Rule model.Rule `json:"rule,omitempty"`
Active map[uint64]*Alert `json:"active,omitempty"`
}
func (AlertingRule) State ¶ added in v0.2.10
func (r AlertingRule) State() AlertState
type AlertingRuleGroup ¶ added in v0.2.15
type AlertingRuleGroup struct {
DatasourceSelector model.DatasourceSelector `json:"datasourceSelector,omitempty"`
GroupLabels map[string]string `json:"groupLabels,omitempty"`
AlertingRules []AlertingRule `json:"alertingRules,omitempty"`
}
type AlertingService ¶
type AlertingService struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *config.Config, alertRuleFiles []model.RuleFile, datasourceService datasourceservice.IDatasourceService, remoteService *remote.RemoteService) *AlertingService
func (*AlertingService) DoAlert ¶ added in v0.2.8
func (s *AlertingService) DoAlert() error
func (*AlertingService) GetAlertingRuleGroups ¶ added in v0.2.18
func (s *AlertingService) GetAlertingRuleGroups() []AlertingRuleGroup
func (*AlertingService) GetAlertmanagerDiscovery ¶ added in v0.2.18
func (s *AlertingService) GetAlertmanagerDiscovery() webapi.AlertmanagerDiscovery
func (*AlertingService) SendTestAlert ¶ added in v0.2.4
func (s *AlertingService) SendTestAlert() error
type IAlertingService ¶ added in v0.2.8
type IAlertingService interface {
DoAlert() error
}
Click to show internal directories.
Click to hide internal directories.