Releases: automa-saga/daemonkit
Releases · automa-saga/daemonkit
Release list
v0.4.0
v0.3.0
v0.2.0
v0.1.1
v0.1.0
daemonkit v0.1.0
First public release of daemonkit — a small, framework-neutral kernel for
building long-running Go daemons. It factors out the concerns every production
daemon re-implements (and usually gets slightly wrong): supervising work loops,
exposing health to operators, gating startup on host preconditions, and keeping
a durable audit trail — with a deliberately minimal dependency surface
(standard library + errorx + golang.org/x/sync/errgroup).
Packages
| Package | Import | Responsibility |
|---|---|---|
daemonkit |
github.com/automa-saga/daemonkit |
Supervised monitor loop, Unix-socket HTTP control plane, probe framework, sd_notify + watchdog |
eventlog |
github.com/automa-saga/daemonkit/eventlog |
Append-only JSONL milestone/audit logger |
filepruner |
github.com/automa-saga/daemonkit/filepruner |
Strategy-driven retention pruning of files |
The three packages are independent and can be adopted individually.
Highlights
- Supervised monitors —
SupervisedMonitorruns eachMonitorRunnerin a
restart loop with exponential back-off (5 s → 5 min cap), stable-run reset, and
aMonitorDegradedescalation after repeated crashes. Clean shutdown vs. crash
is unambiguous. - Operator-first control plane — a
net/httpserver on a Unix domain socket
exposes/health(liveness) and/status(live per-monitor state via an
injectedStatusFn), plus component-scoped routes. Local-only by construction,
no port or auth to manage. - Health-carrying heartbeat — opt-in periodic
MonitorHeartbeatrecords
(withhealthy+ connectivity details forConnectivityMonitors), so remote
observability can alert on the absence of a signal — catching the
alive-but-wedged case that liveness alone misses. - Probe framework — concurrent prerequisite checks (
Probe,
CompositeProbe, built-in disk probes) that fail before partial work with a
stable, operator-actionable reason/resolution. - systemd integration —
NotifyReady/NotifyStopping, plus an opt-in
Watchdogkeepalive forWatchdogSec=units (nogo-systemddependency). - Audit & retention —
eventlogwrites fsync'd, append-only JSONL
milestones with required-field validation;fileprunerenforces age/size
retention with a hard cap and protects files whose eligibility is uncertain. - Backend-agnostic logging — drives
log/slog; silent by default
(slog.DiscardHandler), pluggable into any handler (e.g.logxfor
zerolog + lumberjack) and exportable to OTLP via a local collector.
Requirements
- Go 1.26+
Install
go get github.com/automa-saga/daemonkit@v0.1.0