Documentation ¶
Overview ¶
Package alerthook implements reception of alertmanager webhooks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(listenAddr string, alertHandler AlertHandler, registerer prometheus.Registerer)
Serve provides an alertmanager webhook server. It registers a handler on '/alert' to receive alerts. It also registers handlers for '/metrics' (Prometheus metrics) and '/-/healthy' (health checking).
Alerts are forwarded to the provided AlertHandler.
Types ¶
type AlertHandler ¶
type AlertHandler interface { HandleAlert(context.Context, *alertmanager.Alert) error Healthy() bool }
AlertHandler should be implemented by clients wishing to receive the alerts from the hook.
type AlertHook ¶
type AlertHook struct {
// contains filtered or unexported fields
}
func New ¶
func New(handler AlertHandler, registerer prometheus.Registerer) *AlertHook
Click to show internal directories.
Click to hide internal directories.