monitor

package
v0.9.718 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package monitor implements the synthetic-monitoring runner — periodic HTTP probes + heartbeat liveness checks. State changes (up→down / down→up) get routed through the existing alert / Problem path so the notification stack delivers them with no monitor-specific plumbing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeAddr added in v0.8.283

func NormalizeAddr(target, defaultPort string) (string, error)

NormalizeAddr turns an operator-typed target into a canonical host:port for net.Dial / tls.Dial. Tolerates a pasted URL (scheme + path stripped) and appends defaultPort when no port is present. A defaultPort of "" means the port is mandatory (tcp monitors — there is no sane default port to guess). Validates the port is a number in 1..65535 so a typo fails at create/update time rather than every 60s in the probe loop.

Types

type Runner

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

func New

func New(store *chstore.Store, notifier *notify.Notifier, lock cache.Lock) *Runner

func (*Runner) Start

func (r *Runner) Start(ctx context.Context)

Start runs the runner loop until ctx is canceled. Per-tick: try to acquire the leader lock; if won, fetch all enabled monitors and probe whichever are due.

Jump to

Keyboard shortcuts

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