Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - type APIAlert
 - type AlertState
 - type AlertStatus
 - type Manager
 - func (m *Manager) AddSilenceRule(alertID string) error
 - func (m *Manager) GetAlertList() ([]*APIAlert, error)
 - func (m *Manager) GetDefaultConfig() *alertconfig.Config
 - func (m *Manager) GetState(alertID string, apiAlerts []*APIAlert) string
 - func (m *Manager) RemoveSilenceRule(alertID string) error
 - func (m *Manager) SendAlert(labels map[string]string) error
 
- type Matcher
 - type Matchers
 - type Silence
 - type SilenceState
 - type SilenceStatus
 
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 (*Manager) GetAlertList ¶
func (*Manager) GetDefaultConfig ¶
func (m *Manager) GetDefaultConfig() *alertconfig.Config
func (*Manager) RemoveSilenceRule ¶
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"`
}
     Click to show internal directories. 
   Click to hide internal directories.