alertmanager

package
v0.0.0-...-57ebcc0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 14 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

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