Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AlertsFxTag = config.NameTag("AlertsFx")
AlertsFxTag - name tag for alerter in fx.
Functions ¶
Types ¶
type Alert ¶
type Alert struct {
// contains filtered or unexported fields
}
Alert is a wrapper around models.PostableAlert with handy transform methods.
func AlertsFromLogs ¶
AlertsFromLogs gets slice of alerts from OTEL Logs.
func NewAlert ¶
func NewAlert(opts ...AlertOption) *Alert
NewAlert created new instance of Alert with StartsAt set to now.
func (*Alert) SetAnnotation ¶
SetAnnotation sets a single annotation. It overwrites the previous value if exists.
func (*Alert) SetSeverity ¶
SetSeverity sets the alert severity in labels. Overwrites previous value if exists.
type AlertOption ¶ added in v0.13.0
type AlertOption func(*Alert)
AlertOption is a type for constructor options.
func WithAnnotation ¶ added in v0.13.0
func WithAnnotation(key, value string) AlertOption
WithAnnotation is an option function for constructor.
func WithLabel ¶ added in v0.13.0
func WithLabel(key, value string) AlertOption
WithLabel is an option function for constructor.
func WithName ¶ added in v0.13.0
func WithName(name string) AlertOption
WithName is an option function for constructor.
func WithSeverity ¶ added in v0.13.0
func WithSeverity(severity string) AlertOption
WithSeverity is an option function for constructor.
type Alerter ¶
Alerter is responsible for receiving alerts and propagating them to the channel returned by AlertsChan().
func NewSimpleAlerter ¶
NewSimpleAlerter returns new instance of SimpleAlerter with channel of given size.
func ProvideAlerter ¶
func ProvideAlerter(unmarshaller config.Unmarshaller) (Alerter, error)
ProvideAlerter creates an alerter.
type AlerterConfig ¶
type AlerterConfig struct { // ChannelSize size of the alerts channel in the alerter. Alerts should be // consument from it quickly, so no big sizes are needed. ChannelSize int `json:"channel_size" validate:"gt=0" default:"100"` }
AlerterConfig for alerter. swagger:model +kubebuilder:object:generate=true
func (*AlerterConfig) DeepCopy ¶
func (in *AlerterConfig) DeepCopy() *AlerterConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlerterConfig.
func (*AlerterConfig) DeepCopyInto ¶
func (in *AlerterConfig) DeepCopyInto(out *AlerterConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SimpleAlerter ¶
type SimpleAlerter struct {
// contains filtered or unexported fields
}
SimpleAlerter implements Alerter interface. It just simple propagates alerts to the channel.
func (*SimpleAlerter) AddAlert ¶
func (a *SimpleAlerter) AddAlert(alert *Alert)
AddAlert adds alert to the channel.
func (*SimpleAlerter) AlertsChan ¶
func (a *SimpleAlerter) AlertsChan() <-chan *Alert
AlertsChan returns the alerts channel.