Documentation
¶
Index ¶
- func GetIntegrations(integrations []*Integration) []*notify.Integration
- type Integration
- func (i *Integration) GetReport() (time.Time, model.Duration, error)
- func (i *Integration) Index() int
- func (i *Integration) Integration() *notify.Integration
- func (i *Integration) Name() string
- func (i *Integration) Notify(ctx context.Context, alerts ...*types.Alert) (bool, error)
- func (i *Integration) SendResolved() bool
- func (i *Integration) String() string
- type NotificationHistorian
- type NotificationHistoryAlert
- type NotificationHistoryEntry
- type Receiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIntegrations ¶
func GetIntegrations(integrations []*Integration) []*notify.Integration
GetIntegrations is a convenience function to unwrap all the notify.GetIntegrations from a slice of nfstatus.Integration.
Types ¶
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
Integration wraps an upstream notify.Integration, adding the ability to capture notification status.
func NewIntegration ¶
func NewIntegration(notifier notify.Notifier, rs notify.ResolvedSender, name string, idx int, receiverName string, notificationHistorian NotificationHistorian, logger log.Logger) *Integration
NewIntegration returns a new integration.
func (*Integration) Index ¶
func (i *Integration) Index() int
Index returns the index of the integration.
func (*Integration) Integration ¶
func (i *Integration) Integration() *notify.Integration
Integration returns the wrapped notify.Integration
func (*Integration) Name ¶
func (i *Integration) Name() string
Name returns the name of the integration.
func (*Integration) Notify ¶
Notify implements the Notifier interface. Note that this is only included to make out Integration a drop-in replacement for parts of Grafana Alertmanager, we cannot actually pass our Integration to Prometheus.
func (*Integration) SendResolved ¶
func (i *Integration) SendResolved() bool
SendResolved implements the ResolvedSender interface.
func (*Integration) String ¶
func (i *Integration) String() string
String implements the Stringer interface.
type NotificationHistorian ¶
type NotificationHistorian interface {
Record(ctx context.Context, nhe NotificationHistoryEntry)
}
type NotificationHistoryAlert ¶
type NotificationHistoryAlert struct {
*types.Alert
ExtraData json.RawMessage
}
type NotificationHistoryEntry ¶
type NotificationHistoryEntry struct {
Alerts []NotificationHistoryAlert
GroupKey string
Retry bool
NotificationErr error
Duration time.Duration
ReceiverName string
GroupLabels model.LabelSet
PipelineTime time.Time
}
func (NotificationHistoryEntry) Validate ¶
func (e NotificationHistoryEntry) Validate() error
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver holds onto a slice of nfstatus.Integration and some metadata.
func NewReceiver ¶
func NewReceiver(name string, active bool, integrations []*Integration) *Receiver
func (*Receiver) Integrations ¶
func (r *Receiver) Integrations() []*Integration