alertchecker

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package alertchecker implements the "business logic" of prommsd. It checks that alerts (heartbeats) are received regularly and raises alerts for instances that are missing regular heartbeats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertChecker

type AlertChecker struct {
	// Lock when accessing monitored. Needed because status runs in a different
	// goroutine.
	sync.RWMutex
	// contains filtered or unexported fields
}

AlertChecker implements the alerthook.AlertHandler interface, it receives alerts and applies this package's business logic to them.

func New

func New(registerer prometheus.Registerer, externalURL string) *AlertChecker

New returns a new AlertChecker. It is only expected there is one instance of this per binary as it runs a goroutine in the background.

func (*AlertChecker) HandleAlert

func (ac *AlertChecker) HandleAlert(ctx context.Context, alert *alertmanager.Alert) error

HandleAlert receives a single alert from the alerts sent to an alertmanager webhook. It parses the annotations as configuration and then sends a "handleAlert" struct to handleChan, which the checker goroutine receives and calls updateInstance.

func (*AlertChecker) Healthy

func (ac *AlertChecker) Healthy() bool

Jump to

Keyboard shortcuts

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