Documentation
¶
Index ¶
- type Alert
- func (a *Alert) AsLogs() plog.Logs
- func (a *Alert) Name() string
- func (a *Alert) SetAnnotation(key, value string)
- func (a *Alert) SetAnnotations(annotations map[string]string)
- func (a *Alert) SetLabel(key, value string)
- func (a *Alert) SetLabels(labels map[string]string)
- func (a *Alert) SetName(name string)
- func (a *Alert) SetSeverity(severity string)
- func (a *Alert) Severity() string
- type Alerter
- type AlerterConfig
- type FxIn
- type SimpleAlerter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
models.PostableAlert
}
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() *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) SetAnnotations ¶
SetAnnotations overwrites all the current annotations with the one provided.
func (*Alert) SetLabel ¶
SetLabel sets a single annotation. It overwrites the previous value if exists.
func (*Alert) SetLabels ¶
SetLabels overwrites all the current annotations with the one provided. Caution: this will overwrite also name and severity!
func (*Alert) SetSeverity ¶
SetSeverity sets the alert severity in labels. Overwrites previous value if exists.
type Alerter ¶
Alerter is responsible for receiving alerts and propagating them to the channel returned by AlertsChan().
func ProvideAlerter ¶
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 FxIn ¶
type FxIn struct { fx.In Unmarshaller config.Unmarshaller }
FxIn describes parameters passed to alerter constructor.
type SimpleAlerter ¶
type SimpleAlerter struct {
// contains filtered or unexported fields
}
SimpleAlerter implements Alerter interface. It just simple propagates alerts to the channel.
func NewSimpleAlerter ¶
func NewSimpleAlerter(channelSize int) *SimpleAlerter
NewSimpleAlerter returns new instance of SimpleAlerter with channel of given size.
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.