Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertmanagerFromGroup ¶
func AlertmanagerFromGroup(tg *targetgroup.Group, cfg *config.AlertmanagerConfig) ([]alertmanager, []alertmanager, error)
AlertmanagerFromGroup extracts a list of alertmanagers from a target group and an associated AlertmanagerConfig.
Types ¶
type Alert ¶
type Alert struct { // Label value pairs for purpose of aggregation, matching, and disposition // dispatching. This must minimally include an "alertname" label. Labels labels.Labels `json:"labels"` // Extra key/value information which does not define alert identity. Annotations labels.Labels `json:"annotations"` // The known time range for this alert. Both ends are optional. StartsAt time.Time `json:"startsAt,omitempty"` EndsAt time.Time `json:"endsAt,omitempty"` GeneratorURL string `json:"generatorURL,omitempty"` }
Alert is a generic representation of an alert in the Prometheus eco-system.
func (*Alert) ResolvedAt ¶
ResolvedAt returns true iff the activity interval ended before the given timestamp.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is responsible for dispatching alert notifications to an alert manager service.
func NewManager ¶
NewManager is the manager constructor.
func (*Manager) Alertmanagers ¶
Alertmanagers returns a slice of Alertmanager URLs.
func (*Manager) ApplyConfig ¶
ApplyConfig updates the status state as the new config requires.
func (*Manager) DroppedAlertmanagers ¶
DroppedAlertmanagers returns a slice of Alertmanager URLs.
func (*Manager) Run ¶
func (n *Manager) Run(tsets <-chan map[string][]*targetgroup.Group)
Run dispatches notifications continuously, returning once Stop has been called and all pending notifications have been drained from the queue (if draining is enabled).
Dispatching of notifications occurs in parallel to processing target updates to avoid one starving the other. Refer to https://github.com/prometheus/prometheus/issues/13676 for more details.
func (*Manager) Send ¶
Send queues the given notification requests for processing. Panics if called on a handler that is not running.
func (*Manager) Stop ¶
func (n *Manager) Stop()
Stop signals the notification manager to shut down and immediately returns.
Run will return once the notification manager has successfully shut down.
The manager will optionally drain any queued notifications before shutting down.
Stop is safe to call multiple times.
type Options ¶
type Options struct { QueueCapacity int DrainOnShutdown bool ExternalLabels labels.Labels RelabelConfigs []*relabel.Config // Used for sending HTTP requests to the Alertmanager. Do func(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) Registerer prometheus.Registerer }
Options are the configurable parameters of a Handler.