pagerduty

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pagerduty delivers Console events to PagerDuty via the Events API v2 (https://events.pagerduty.com/v2/enqueue). A component going down or degraded triggers an alert; the matching recovery resolves it, correlated by a deterministic dedup key so PagerDuty groups the open/close pair into a single incident.

PagerDuty is a paging sink, so only component health transitions are delivered — flag-change events are not incidents and are skipped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	// RoutingKey is the integration key of the target PagerDuty service.
	RoutingKey string
	// Endpoint is the enqueue URL; defaults to the public Events API v2 endpoint.
	Endpoint string
	// HTTP issues the POST. If nil, a client with a sane timeout is used.
	HTTP *http.Client
}

Notifier posts events to PagerDuty's Events API v2.

func New

func New(routingKey string, opts ...Option) *Notifier

New builds a PagerDuty notifier for the given routing (integration) key.

func (*Notifier) Name

func (n *Notifier) Name() string

Name identifies the sink.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, ev core.Event) error

Notify triggers or resolves a PagerDuty alert for ev. Down/degraded transitions trigger; a recovery resolves the correlated alert. Events that are not component health transitions (e.g. flag changes) are skipped.

type Option

type Option func(*Notifier)

Option configures a Notifier.

func WithEndpoint

func WithEndpoint(url string) Option

WithEndpoint overrides the enqueue URL (used in tests).

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the HTTP client.

Jump to

Keyboard shortcuts

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