Documentation ¶
Index ¶
- Constants
- Variables
- func SilencesDataLoad(client *ent.Client) func(ids ...int) ([]*sil.Entry, error)
- func UserIDsFromLabels(set label.LabelSet) ([]int, error)
- type AlertCallback
- type AlertManager
- type AmOption
- type Coordinator
- func (c *Coordinator) AddNamedRoute(input []*profile.Route) error
- func (c *Coordinator) AddTenantReceiver(input []*profile.Receiver) error
- func (c *Coordinator) GetReceivers() []profile.Receiver
- func (c *Coordinator) ProfileString() string
- func (c *Coordinator) Reload() error
- func (c *Coordinator) ReloadHooks(ss ...func(*profile.Config) error)
- func (c *Coordinator) RemoveNamedRoute(routeNames []string) error
- func (c *Coordinator) RemoveTenantReceiver(receiverNames []string) error
- func (c *Coordinator) ResolveTimeout() time.Duration
- func (c *Coordinator) WalkReceivers(visit func(receiver profile.Receiver) error) error
- type NlogCallback
- type UserSubscribe
Constants ¶
View Source
const NotifyMinTimeout = 10 * time.Second
NotifyMinTimeout is the minimum timeout that is set for the context of a call to a notification pipeline.
Variables ¶
View Source
var (
ErrTenantIDNotFound = errors.New("tenant id not found")
)
Functions ¶
func SilencesDataLoad ¶
SilencesDataLoad is a data loader for silences.
Types ¶
type AlertCallback ¶
type AlertCallback struct {
// contains filtered or unexported fields
}
AlertCallback 是Alert处理回调类,由于消息中心是系统服务,对于alert无法有明显的上下文,因此需要在回调中处理租户时采用的忽略.
func (*AlertCallback) PostDelete ¶
func (a *AlertCallback) PostDelete(alert *alert.Alert)
type AlertManager ¶
type AlertManager struct { Coordinator *Coordinator NotificationLog notify.NotificationLog Silences *silence.Silences Marker alert.Marker Alerts provider.Alerts Dispatcher *dispatch.Dispatcher Inhibitor *inhibit.Inhibitor Silencer *silence.Silencer Subscribe *UserSubscribe DB *ent.Client Peer *members.Peer // contains filtered or unexported fields }
func NewAlertManager ¶
func NewAlertManager(app *woocoo.App, opts ...AmOption) (*AlertManager, error)
func (*AlertManager) Apply ¶
func (am *AlertManager) Apply(cnf *conf.Configuration) error
func (*AlertManager) Members ¶
func (am *AlertManager) Members() error
func (*AlertManager) Start ¶
func (am *AlertManager) Start(co *Coordinator, config *profile.Config) error
func (*AlertManager) Stop ¶
func (am *AlertManager) Stop()
type Coordinator ¶
type Coordinator struct { ActiveReceivers map[string]int // receiver name -> number of Notifiers Template *template.Template // knockout sdk KOSdk *api.SDK // contains filtered or unexported fields }
Coordinator helps the Alert Manager collaborate with external components.
func NewCoordinator ¶
func NewCoordinator(cnf *conf.Configuration) *Coordinator
NewCoordinator returns a new coordinator with the given configuration for alert manager. It does not yet load the configuration from file. This is done in `Reload()`.
func (*Coordinator) AddNamedRoute ¶
func (c *Coordinator) AddNamedRoute(input []*profile.Route) error
func (*Coordinator) AddTenantReceiver ¶
func (c *Coordinator) AddTenantReceiver(input []*profile.Receiver) error
func (*Coordinator) GetReceivers ¶
func (c *Coordinator) GetReceivers() []profile.Receiver
func (*Coordinator) ProfileString ¶
func (c *Coordinator) ProfileString() string
func (*Coordinator) Reload ¶
func (c *Coordinator) Reload() error
Reload triggers a configuration reload from file and notifies all configuration change reloadHooks.
func (*Coordinator) ReloadHooks ¶
func (c *Coordinator) ReloadHooks(ss ...func(*profile.Config) error)
ReloadHooks subscribes the given Subscribers to configuration changes.
func (*Coordinator) RemoveNamedRoute ¶
func (c *Coordinator) RemoveNamedRoute(routeNames []string) error
func (*Coordinator) RemoveTenantReceiver ¶
func (c *Coordinator) RemoveTenantReceiver(receiverNames []string) error
func (*Coordinator) ResolveTimeout ¶
func (c *Coordinator) ResolveTimeout() time.Duration
func (*Coordinator) WalkReceivers ¶
func (c *Coordinator) WalkReceivers(visit func(receiver profile.Receiver) error) error
type NlogCallback ¶
type NlogCallback struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.