Skip to content

v0.4.0

Choose a tag to compare

@lai3d lai3d released this 13 Apr 01:33
· 26 commits to main since this release

0.4.0 — 2026-04-13

Audit-log hardening. The audit.Logger has existed since v0.1.0 but was
never actually instantiated by cmd/main.go — a gap this release closes,
alongside a retention policy and metrics so the audit_log table
doesn't grow forever.

Added

  • cmd/main.go flags: --audit-dsn (or TSDB_AUDIT_DSN env),
    --audit-retention-days. When DSN is set, the logger is opened on
    startup and handed to the REST API server, so
    GET /api/clusters/:name/audit and the auto-recorded entries on
    create/delete/backup routes actually work.
  • audit.Logger.Prune(ctx, before) deletes rows older than the given
    cutoff and returns the count.
  • audit.Logger.Start(ctx) is a manager.Runnable pruner. Runs every
    hour (configurable via PruneInterval) plus once on startup so the
    effect is visible immediately. No-op when RetentionDays == 0.
  • Metrics: tsdb_operator_audit_record_total{cluster,result},
    tsdb_operator_audit_prune_total, tsdb_operator_audit_rows.
  • Helm chart: features.audit, audit.dsnSecretRef,
    audit.retentionDays. DSN is plumbed via TSDB_AUDIT_DSN env from
    a Secret.
  • Tests for Prune, RowCount, and pruner-start no-op using
    DATA-DOG/go-sqlmock.