Documentation ¶
Overview ¶
Package alertmanager contains business logic of working with Alertmanager.
Index ¶
- type Service
- func (svc *Service) FindAlertByID(ctx context.Context, id string) (*ammodels.GettableAlert, error)
- func (svc *Service) GenerateBaseConfigs()
- func (svc *Service) GetAlerts(ctx context.Context) ([]*ammodels.GettableAlert, error)
- func (svc *Service) IsReady(ctx context.Context) error
- func (svc *Service) RequestConfigurationUpdate()
- func (svc *Service) Run(ctx context.Context)
- func (svc *Service) SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts)
- func (svc *Service) Silence(ctx context.Context, id string) error
- func (svc *Service) Unsilence(ctx context.Context, id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is responsible for interactions with Alertmanager.
func (*Service) FindAlertByID ¶
FindAlertByID searches alert by ID in alertmanager.
func (*Service) GenerateBaseConfigs ¶
func (svc *Service) GenerateBaseConfigs()
GenerateBaseConfigs generates alertmanager.base.yml if it is absent, and then writes basic alertmanager.yml if it is absent or empty. It is needed because Alertmanager was added to PMM with invalid configuration file (it will fail with "no route provided in config" error).
func (*Service) RequestConfigurationUpdate ¶
func (svc *Service) RequestConfigurationUpdate()
RequestConfigurationUpdate requests Alertmanager configuration update.
func (*Service) SendAlerts ¶
func (svc *Service) SendAlerts(ctx context.Context, alerts ammodels.PostableAlerts)
SendAlerts sends given alerts. It is the caller's responsibility to call this method every now and then.