Documentation ¶
Index ¶
- type AlertmanagerAnnotations
- type AlertmanagerLabels
- type AlertmanagerRequest
- type Config
- type Diagnostic
- type HandlerConfig
- type Service
- func (s *Service) Alert(...) error
- func (s *Service) Close() error
- func (s *Service) DefaultHandlerConfig() HandlerConfig
- func (s *Service) Handler(c HandlerConfig, ctx ...keyvalue.T) (alert.Handler, error)
- func (s *Service) Open() error
- func (s *Service) Test(options interface{}) error
- func (s *Service) TestOptions() interface{}
- func (s *Service) Update(newConfig []interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertmanagerAnnotations ¶
type AlertmanagerLabels ¶
type AlertmanagerRequest ¶
type AlertmanagerRequest struct { Status string `json:"status"` Labels AlertmanagerLabels `json:"labels"` Annotations AlertmanagerAnnotations `json:"annotations"` }
type Config ¶
type Config struct { // Whether Alerta integration is enabled. Enabled bool `toml:"enabled" override:"enabled"` // The Alerta URL. URL string `toml:"url" override:"url"` // Whether to skip the tls verification of the alertmanager host InsecureSkipVerify bool `toml:"insecure-skip-verify" override:"insecure-skip-verify"` // The environment in which to raise the alert. Environment string `toml:"environment" override:"environment"` // The origin of the alert. Origin string `toml:"origin" override:"origin"` // Optional timeout, can be overridden per alert. Timeout toml.Duration `toml:"timeout" override:"timeout"` }
type Diagnostic ¶
type HandlerConfig ¶
type HandlerConfig struct { // Alertmanager resource. // Can be a template and has access to the same data as the AlertNode.Details property. // Default: {{ .Name }} Resource string `mapstructure:"resource"` // Alertmanager event. // Can be a template and has access to the same data as the idInfo property. // Default: {{ .ID }} Event string `mapstructure:"event"` // Alertmanager environment. // Can be a template and has access to the same data as the AlertNode.Details property. // Defaut is set from the configuration. Environment string `mapstructure:"environment"` // Alertmanager group. // Can be a template and has access to the same data as the AlertNode.Details property. // Default: {{ .Group }} Group string `mapstructure:"group"` // Alertmanager group. // Can be a template and has access to the same data as the AlertNode.Details property. // Default: {{ .Group }} Customer string `mapstructure:"customer"` // Alertmanager value. // Can be a template and has access to the same data as the AlertNode.Details property. // Default is an empty string. Value string `mapstructure:"value"` // Alertmanager origin. // If empty uses the origin from the configuration. Origin string `mapstructure:"origin"` // List of effected Services Service []string `mapstructure:"service"` // Alertmanager timeout. // Default: 24h Timeout time.Duration `mapstructure:"timeout"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(c Config, d Diagnostic) *Service
func (*Service) DefaultHandlerConfig ¶
func (s *Service) DefaultHandlerConfig() HandlerConfig
func (*Service) TestOptions ¶
func (s *Service) TestOptions() interface{}
Click to show internal directories.
Click to hide internal directories.