alertmanager

package
v0.0.0-...-2652df3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleWebhook

func HandleWebhook(logger log.Logger, counter prometheus.Counter, webhooks chan<- notify.WebhookMessage) http.HandlerFunc

HandleWebhook returns a HandlerFunc that forwards webhooks to all bots via a channel

func ListAlerts

func ListAlerts(logger log.Logger, alertmanagerURL string) ([]*types.Alert, error)

ListAlerts returns a slice of Alert and an error.

func ListSilences

func ListSilences(logger log.Logger, alertmanagerURL string) ([]types.Silence, error)

ListSilences returns a slice of Silence and an error.

func Resolved

func Resolved(s types.Silence) bool

Resolved returns if a silence is resolved by EndsAt

func SilenceMessage

func SilenceMessage(s types.Silence) string

SilenceMessage converts a silences to a message string

func TestHandleWebhook

func TestHandleWebhook(t *testing.T)

func TestResolved

func TestResolved(t *testing.T)

Types

type StatusResponse

type StatusResponse struct {
	Status string `json:"status"`
	Data   struct {
		Uptime      time.Time `json:"uptime"`
		VersionInfo struct {
			Branch    string `json:"branch"`
			BuildDate string `json:"buildDate"`
			BuildUser string `json:"buildUser"`
			GoVersion string `json:"goVersion"`
			Revision  string `json:"revision"`
			Version   string `json:"version"`
		} `json:"versionInfo"`
	} `json:"data"`
}

StatusResponse is the data returned by Alertmanager about its current status.

func Status

func Status(logger log.Logger, alertmanagerURL string) (StatusResponse, error)

Status returns a StatusResponse or an error.

Jump to

Keyboard shortcuts

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