nfstatus

package
v0.0.0-release-12.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

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) GetReport

func (i *Integration) GetReport() (time.Time, model.Duration, error)

GetReport returns information about the last notification attempt.

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

func (i *Integration) Notify(ctx context.Context, alerts ...*types.Alert) (bool, error)

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) Active

func (r *Receiver) Active() bool

func (*Receiver) Integrations

func (r *Receiver) Integrations() []*Integration

func (*Receiver) Name

func (r *Receiver) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL