alerting

package
v0.2.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

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"`
	CreatedAt   time.Time         `json:"createdAt,omitempty"`
	UpdatedAt   time.Time         `json:"updatedAt,omitempty"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

type AlertState added in v0.2.8

type AlertState int
const (
	StateInactive AlertState = iota
	StatePending
	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 *model.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() promWebAPI.AlertmanagerDiscovery

func (*AlertingService) SendTestAlert added in v0.2.4

func (s *AlertingService) SendTestAlert() error

type Fire added in v0.2.8

type Fire struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

type IAlertingService added in v0.2.8

type IAlertingService interface {
	DoAlert() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL