manager

package
v2.0.0-beta2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertStateUnprocessed AlertState = "unprocessed"
	AlertStateActive                 = "active"
	AlertStateSuppressed             = "suppressed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAlert

type APIAlert struct {
	*model.Alert
	Status      AlertStatus `json:"status"`
	Receivers   []string    `json:"receivers"`
	Fingerprint string      `json:"fingerprint"`
}

type AlertState

type AlertState string

type AlertStatus

type AlertStatus struct {
	State       AlertState `json:"state"`
	SilencedBy  []string   `json:"silencedBy"`
	InhibitedBy []string   `json:"inhibitedBy"`
}

type Manager

type Manager struct {
	IsDeploy bool
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cluster *config.UserContext) *Manager

func (*Manager) AddSilenceRule

func (m *Manager) AddSilenceRule(alertID string) error

func (*Manager) GetAlertList

func (m *Manager) GetAlertList() ([]*APIAlert, error)

func (*Manager) GetDefaultConfig

func (m *Manager) GetDefaultConfig() *alertconfig.Config

func (*Manager) GetState

func (m *Manager) GetState(alertID string, apiAlerts []*APIAlert) string

func (*Manager) RemoveSilenceRule

func (m *Manager) RemoveSilenceRule(alertID string) error

func (*Manager) SendAlert

func (m *Manager) SendAlert(alertID, text, title, severity string) error

type Matcher

type Matcher struct {
	Name    string `json:"name"`
	Value   string `json:"value"`
	IsRegex bool   `json:"isRegex"`
	// contains filtered or unexported fields
}

type Matchers

type Matchers []*Matcher

type Silence

type Silence struct {
	ID string `json:"id"`

	Matchers Matchers `json:"matchers"`

	StartsAt time.Time `json:"startsAt"`
	EndsAt   time.Time `json:"endsAt"`

	UpdatedAt time.Time `json:"updatedAt"`

	CreatedBy string `json:"createdBy"`
	Comment   string `json:"comment,omitempty"`

	Status SilenceStatus `json:"status"`
	// contains filtered or unexported fields
}

type SilenceState

type SilenceState string
const (
	SilenceStateExpired SilenceState = "expired"
	SilenceStateActive  SilenceState = "active"
	SilenceStatePending SilenceState = "pending"
)

type SilenceStatus

type SilenceStatus struct {
	State SilenceState `json:"state"`
}

Jump to

Keyboard shortcuts

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