alert

package
v0.0.0-...-60e2f33 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Summary     string  `json:"summary"`
	Description string  `json:"description"`
	Labels      Labels  `json:"labels,omitempty"`
	Payload     Payload `json:"payload,omitempty"`
}

type AlertManager

type AlertManager interface {
	HandleAlert(PrometheusAlertNotification) []AlertResponse
}

An AlertManager is responsible for coordinating Prometheus alerts sent to it.

func MakeAlertManager

func MakeAlertManager() AlertManager

MakeAlertManager returns an alertManager.

type AlertResponse

type AlertResponse struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
	Alert  Alert  `json:"alert,omitempty"`
}

AlertResponse is the minimal representation of an Alert typically used for listings, etc.

type Labels

type Labels struct {
	AlertName string `json:"alertname"`
}

type Payload

type Payload struct {
	ActiveSince  string `json:"activeSince"`
	AlertingRule string `json:"alertingRule"`
	GeneratorUrl string `json:"generatorURL"`
	Value        string `json:"value"`
}

type PrometheusAlertNotification

type PrometheusAlertNotification struct {
	Version string  `json:"version"`
	Status  string  `json:"status"`
	Alert   []Alert `json:"alert,omitempty"`
}

PrometheusAlertNotification represents an alert notification from Prometheus.

Jump to

Keyboard shortcuts

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