...

Package webhook

import "github.com/prometheus/alertmanager/notify/webhook"
Overview
Index

Overview ▾

type Message

Message defines the JSON object send to webhook endpoints.

type Message struct {
    *template.Data

    // The protocol version.
    Version         string `json:"version"`
    GroupKey        string `json:"groupKey"`
    TruncatedAlerts uint64 `json:"truncatedAlerts"`
}

type Notifier

Notifier implements a Notifier for generic webhooks.

type Notifier struct {
    // contains filtered or unexported fields
}

func New

func New(conf *config.WebhookConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error)

New returns a new Webhook.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, alerts ...*types.Alert) (bool, error)

Notify implements the Notifier interface.