alertmanager

package
v0.0.0-...-c6bac7f Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlertPath is the path to post alarms to
	AlertPath = "/api/v1/alerts"
)

Variables

View Source
var (
	// AlertPathURL holds the base URL to the
	AlertPathURL *url.URL
)

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Labels       Labels      `json:"labels"`
	Annotations  Annotations `json:"annotations"`
	StartsAt     time.Time   `json:"startsAt"`
	EndsAt       time.Time   `json:"endsAt"`
	GeneratorURL string      `json:"generatorUrl"`
}

Alert defines an alertmanager alarm

func (Alert) Alerts

func (a Alert) Alerts() Alerts

Alerts implements the Alerter interface

type AlertManager

type AlertManager struct {
	URL             url.URL
	Alerter         Alerter
	RefreshInterval time.Duration
}

AlertManager client

func New

func New(URL url.URL, alerter Alerter, refreshInterval time.Duration) *AlertManager

New returns a new AlertManger

func (AlertManager) Trigger

func (am AlertManager) Trigger(a Alerter) error

Trigger sends the Alert to the AlertManager

type Alerter

type Alerter interface {
	Alerts() Alerts
}

Alerter returns an Alerts slice

type Alerts

type Alerts []Alert

Alerts is a slice of alert

func (Alerts) Alerts

func (a Alerts) Alerts() Alerts

Alerts implements the Alerter interface

type Annotations

type Annotations map[string]string

Annotations holds additional information for an alarm

type Labels

type Labels map[string]string

Labels holds labels that uniqly identifies an alarm

Jump to

Keyboard shortcuts

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