Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidAlertGroup will be used when the alertgroup is not valid. ErrInvalidAlertGroup = errors.New("invalid alert group") )
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier interface {
Notify(ctx context.Context, alertGroup *model.AlertGroup) error
Type() string
}
Notifier knows how to notify alerts to different backends.
func NewMeasureNotifier ¶
func NewMeasureNotifier(rec NotifierMetricsRecorder, next Notifier) Notifier
NewMeasureNotifier wraps a notifier and measures using metrics.
type NotifierMetricsRecorder ¶
type NotifierMetricsRecorder interface {
ObserveForwardNotifierOpDuration(ctx context.Context, notifierType string, op string, success bool, t time.Duration)
}
NotifierMetricsRecorder knows how to record metrics on forward.Notifier.
type Service ¶
type Service interface {
// Forward knows how to forward alerts from an input to an output.
Forward(ctx context.Context, alertGroup *model.AlertGroup) error
}
Service is the domain service that forwards alerts
func NewMeasureService ¶
func NewMeasureService(rec ServiceMetricsRecorder, next Service) Service
NewMeasureService wraps a service and measures using metrics.
Click to show internal directories.
Click to hide internal directories.