Documentation
¶
Overview ¶
Package obs wires the shared observability libraries to pg-autodump's domain: a metrics registry (github.com/cplieger/metrics/v2) exposed at /metrics, and a startup preflight used to decide the health-marker state. The orchestrator records through the narrow dump.Recorder interface it defines; this package supplies the concrete implementation, so the core stays testable against a fake or nil recorder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Preflight ¶
Preflight reports whether the liveness preconditions hold: the client binaries resolve on PATH, the dump directory is writable, and DB_SPECS lists at least one entry. It deliberately does NOT probe per-host database reachability (that is a per-dump, per-DB concern), so a transiently-down database never flips the container unhealthy. Returns nil when healthy, else a reason for the log.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics holds the registry and the pg-autodump metric set. It implements dump.Recorder. All names are registered without the "pg_autodump_" prefix; the registry prepends it (e.g. dump_db_total -> pg_autodump_dump_db_total).
func NewMetrics ¶
func NewMetrics() *Metrics
NewMetrics constructs and registers the metric set under the "pg_autodump" namespace.
func (*Metrics) IncRun ¶
func (m *Metrics) IncRun()
IncRun records that a dump run started. Called once per run by the trigger, not per database.
func (*Metrics) RecordResult ¶
RecordResult records one completed per-database outcome.
func (*Metrics) SetInFlight ¶
SetInFlight reports the current number of dumps actively running.