alertmanager

package
v0.12.17 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrantDriftCheckEvent = "grant_drift_check"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertManager

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

func New

func New(notificationSender NotificationSender, logger log.Logger) *AlertManager

func (*AlertManager) NotifyDriftCheck

func (m *AlertManager) NotifyDriftCheck(ctx context.Context, req NotifyDriftCheckRequest) error

NotifyDriftCheck sends a single summary alert to adminTeam listing all drifted dedup_key: drift-check:admin:{hash(sorted accountIDs)}

type AlertManagerConfig

type AlertManagerConfig struct {
	Provider    string `mapstructure:"provider" default:"siren"`
	Endpoint    string `mapstructure:"endpoint"`
	Environment string `mapstructure:"environment" default:"development"`
}

type Event

type Event struct {
	Title    string
	Summary  string
	Data     map[string]interface{}
	DedupKey string
	Team     string
	Severity string
	Labels   map[string]string
}

type NoOpSender

type NoOpSender struct{}

func (*NoOpSender) Send

func (s *NoOpSender) Send(_ context.Context, _ Event) error

type NotificationSender

type NotificationSender interface {
	Send(ctx context.Context, event Event) error
}

NotificationSender is the interface for delivering events to a notifier.

func GetAlertManagerSender

func GetAlertManagerSender(cfg AlertManagerConfig) NotificationSender

type NotifyDriftCheckRequest

type NotifyDriftCheckRequest struct {
	DryRun            bool
	AdminTeam         string
	Issues            []domain.GrantDriftIssue
	OnSuccessSeverity string
	OnFailureSeverity string
}

type PDClient

type PDClient struct{}

func NewPDClient

func NewPDClient() *PDClient

func (*PDClient) Send

func (c *PDClient) Send(ctx context.Context, event Event) error

Send delivers a trigger event to PagerDuty via Events API v2.

type SirenClient

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

func NewSirenClient

func NewSirenClient(host string, environment string) *SirenClient

func (*SirenClient) Send

func (c *SirenClient) Send(ctx context.Context, event Event) error

Jump to

Keyboard shortcuts

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