Documentation
¶
Index ¶
- func ResolveEvent(pagerdutyKey, incidentId, reason string) (err error)
- func TriggerEvent(pdKey, description string, details interface{}) (key string, err error)
- type DegradedAction
- type DegradedService
- type ExpectedInventory
- type ExpectedInventoryEntry
- type Incident
- type Inventory
- func (i *Inventory) Clone() (i2 *Inventory)
- func (old *Inventory) Diff(inv *Inventory) (diff map[string]InventoryDiffEntry)
- func (i *Inventory) Get(mangledName string) (val int, ok bool)
- func (i *Inventory) GetList(mangledName string) (list []ServiceDesc, ok bool)
- func (i *Inventory) Reload() (err error)
- type InventoryDiffEntry
- type InventoryType
- type PagerDutyEvent
- type PagerDutyEventContext
- type PagerdutyIncident
- type SectorDigestMap
- type SectorHealth
- type SectorHealthByInventory
- type ServiceDesc
- type SlackIncident
- type SystemHealth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveEvent ¶
func TriggerEvent ¶
Types ¶
type DegradedAction ¶
type DegradedAction struct {
ActionName string // class:method~version
MinHealthyCount int
CurrentCount int
HealthLabel string // red/yellow
MissingInstances []DegradedService
}
type DegradedService ¶
type DegradedService ServiceDesc
type ExpectedInventory ¶
type ExpectedInventory map[string]ExpectedInventoryEntry
func LoadExpectedInventoryFromFile ¶
func LoadExpectedInventoryFromFile(path string) (ei ExpectedInventory, err error)
func NewExpectedInventory ¶
func NewExpectedInventory() (ei ExpectedInventory)
func (ExpectedInventory) GetSectorHealth ¶
func (ei ExpectedInventory) GetSectorHealth(inv *Inventory) (secH SectorHealth)
func (ExpectedInventory) GetSystemHealth ¶
func (ei ExpectedInventory) GetSystemHealth(inv *Inventory) (sh *SystemHealth)
type ExpectedInventoryEntry ¶
type Inventory ¶
type Inventory struct {
Cache *scamp.ServiceCache
Inventory InventoryType
}
func NewInventory ¶
func (*Inventory) Diff ¶
func (old *Inventory) Diff(inv *Inventory) (diff map[string]InventoryDiffEntry)
type InventoryDiffEntry ¶
type InventoryDiffEntry struct {
Missing []ServiceDesc `json:"missing"`
}
type InventoryType ¶
type InventoryType map[string][]ServiceDesc
type PagerDutyEvent ¶
type PagerDutyEvent struct {
ServiceKey string `json:"service_key"`
Description string `json:"description"`
EventType string `json:"event_type"`
Client string `json:"client,omitempty"` // optional
ClientURL string `json:"client_url,omitempty"` // optional
Contexts []PagerDutyEventContext `json:"contexts,omitempty"` // optional
Details interface{} `json:"details,omitempty"` // optional
IncidentKey string `json:"incident_key,omitempty"` // optional
}
type PagerDutyEventContext ¶
type PagerdutyIncident ¶
type PagerdutyIncident struct {
Missing SectorHealth
}
func NewPagerdutyIncident ¶
func NewPagerdutyIncident(pagerdutyKey string, missing SectorHealth) (yi *PagerdutyIncident)
func (*PagerdutyIncident) Description ¶
func (pi *PagerdutyIncident) Description() (desc string, err error)
func (*PagerdutyIncident) Resolve ¶
func (pi *PagerdutyIncident) Resolve() error
type SectorDigestMap ¶
type SectorDigestMap map[string][]ServiceDesc
type SectorHealth ¶
type SectorHealth map[string][]DegradedAction
func NewSectorHealth ¶
func NewSectorHealth() SectorHealth
func (SectorHealth) IsDegraded ¶
func (sh SectorHealth) IsDegraded() bool
func (SectorHealth) Red ¶
func (sh SectorHealth) Red() (red SectorHealth)
func (SectorHealth) ToSectorHealthByInventory ¶
func (sh SectorHealth) ToSectorHealthByInventory() (shi SectorHealthByInventory)
func (SectorHealth) Yellow ¶
func (sh SectorHealth) Yellow() (red SectorHealth)
type SectorHealthByInventory ¶
type SectorHealthByInventory map[string]SectorDigestMap
func NewSectorHealthByInventory ¶
func NewSectorHealthByInventory() (shi SectorHealthByInventory)
func (SectorHealthByInventory) Add ¶
func (shi SectorHealthByInventory) Add(sector, hostName, serviceName string, actionCount, actionInstances, actionTarget int)
type ServiceDesc ¶
type SlackIncident ¶
type SlackIncident struct {
// contains filtered or unexported fields
}
func NewSlackIncident ¶
func NewSlackIncident(expInv *ExpectedInventory, inv *Inventory) (yi *SlackIncident)
type SystemHealth ¶
type SystemHealth struct {
Missing []string `json:"missing"`
Red []string `json:"red"`
Yellow []string `json:"yellow"`
}
func NewSystemHealth ¶
func NewSystemHealth() (sh *SystemHealth)
func (*SystemHealth) IsDegraded ¶
func (sh *SystemHealth) IsDegraded() bool
func (*SystemHealth) MarkMissing ¶
func (sh *SystemHealth) MarkMissing(mangledName string)
func (*SystemHealth) MarkRed ¶
func (sh *SystemHealth) MarkRed(mangledName string)
func (*SystemHealth) MarkYellow ¶
func (sh *SystemHealth) MarkYellow(mangledName string)
Click to show internal directories.
Click to hide internal directories.