notification

package
v0.0.0-...-bfdd474 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationHandler

type NotificationHandler struct {
	// contains filtered or unexported fields
}

NotificationHandler is responsible for dispatching alert notifications to an alert manager service.

func NewNotificationHandler

func NewNotificationHandler(o *NotificationHandlerOptions) *NotificationHandler

NewNotificationHandler constructs a new NotificationHandler.

func (*NotificationHandler) Collect

func (n *NotificationHandler) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*NotificationHandler) Describe

func (n *NotificationHandler) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*NotificationHandler) Run

func (n *NotificationHandler) Run()

Run dispatches notifications continuously.

func (*NotificationHandler) Stop

func (n *NotificationHandler) Stop()

Stop shuts down the notification handler.

func (*NotificationHandler) SubmitReqs

func (n *NotificationHandler) SubmitReqs(reqs NotificationReqs)

SubmitReqs queues the given notification requests for processing.

type NotificationHandlerOptions

type NotificationHandlerOptions struct {
	AlertmanagerURL string
	QueueCapacity   int
	Deadline        time.Duration
}

NotificationHandlerOptions are the configurable parameters of a NotificationHandler.

type NotificationReq

type NotificationReq struct {
	// Short-form alert summary. May contain text/template-style interpolations.
	Summary string
	// Longer alert description. May contain text/template-style interpolations.
	Description string
	// A reference to the runbook for the alert.
	Runbook string
	// Labels associated with this alert notification, including alert name.
	Labels model.LabelSet
	// Current value of alert
	Value model.SampleValue
	// Since when this alert has been active (pending or firing).
	ActiveSince time.Time
	// A textual representation of the rule that triggered the alert.
	RuleString string
	// Prometheus console link to alert expression.
	GeneratorURL string
}

NotificationReq is a request for sending a notification to the alert manager for a single alert vector element.

type NotificationReqs

type NotificationReqs []*NotificationReq

NotificationReqs is just a short-hand for []*NotificationReq. No methods attached. Arguably, it's more confusing than helpful. Perhaps we should remove it...

Jump to

Keyboard shortcuts

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