pagerdutyeventer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonEventToSignature added in v0.3.1

func CommonEventToSignature(payload PagerDutyPayload) uint64

CommonEventToSignature returns a signature for a given common event.

Types

type PagerDutyEventer

type PagerDutyEventer interface {
	// Handler handles http requests.
	Handler(http.ResponseWriter, *http.Request)
}

PagerDutyEventer can handle valid pagerduty events.

func NewPagerDutyEventer

func NewPagerDutyEventer(
	ctx context.Context,
	logger logr.Logger,
	cli client.Client,
	cache cache.Cache,
	sinkEventToKafka bool,
	kafkaAddress string,
	sinkEventToWebhookReceiver bool,
	webhookAddress string,
	pagerdutyEventerEnabled bool,
) PagerDutyEventer

NewPagerDutyEventer creates a new PagerDutyEventer.

type PagerDutyImage

type PagerDutyImage struct {
	Src  string `json:"src"`
	Alt  string `json:"alt"`
	Href string `json:"href"`
}
type PagerDutyLink struct {
	HRef string `json:"href"`
	Text string `json:"text"`
}

type PagerDutyMessage

type PagerDutyMessage struct {
	RoutingKey  string            `json:"routing_key,omitempty"`
	ServiceKey  string            `json:"service_key,omitempty"`
	DedupKey    string            `json:"dedup_key,omitempty"`
	IncidentKey string            `json:"incident_key,omitempty"`
	EventType   string            `json:"event_type,omitempty"`
	Description string            `json:"description,omitempty"`
	EventAction string            `json:"event_action"`
	Payload     *PagerDutyPayload `json:"payload"`
	Client      string            `json:"client,omitempty"`
	ClientURL   string            `json:"client_url,omitempty"`
	Details     map[string]string `json:"details,omitempty"`
	Images      []PagerDutyImage  `json:"images,omitempty"`
	Links       []PagerDutyLink   `json:"links,omitempty"`
}

PagerDutyMessage contains a message with the payload in PD-CEF. See more details at https://support.pagerduty.com/docs/pd-cef. This code block refers to https://github.com/prometheus/alertmanager/blob/v0.24.0/notify/pagerduty/pagerduty.go#L75.

type PagerDutyPayload

type PagerDutyPayload struct {
	Summary       string            `json:"summary"`
	Source        string            `json:"source"`
	Severity      string            `json:"severity"`
	Timestamp     string            `json:"timestamp,omitempty"`
	Class         string            `json:"class,omitempty"`
	Component     string            `json:"component,omitempty"`
	Group         string            `json:"group,omitempty"`
	CustomDetails map[string]string `json:"custom_details,omitempty"`
}

PagerDutyPayload contains the details of each PD-CEF field. See more details at https://support.pagerduty.com/docs/pd-cef.

Jump to

Keyboard shortcuts

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