Use this after the README quickstart and before treating audit capture as production-ready. It complements brownfield-continuity.md for existing data.
1. Capture and triggers
- [ ]
mix threadline.installandmix threadline.gen.triggersmigrations applied in the target environment. - [ ]
MIX_ENVmatches between trigger regeneration and runtime (mix threadline.gen.triggersloadsapp.config). - [ ]
config :threadline, :verify_coverage, expected_tables: [...]lists every audited table;mix threadline.verify_coveragepasses in CI and on a production-like host. - [ ]
Threadline.Health.trigger_coverage/1is wired into health checks or release checks where you need fast failure on drift.
2. Actor bridge and semantics
- [ ] Request paths set
threadline.actor_refinside the sameEcto.Multi/Repo.transactionas audited writes (transaction-local GUC; safe under PgBouncer transaction pooling — see README PgBouncer section). - [ ] Background jobs use
Threadline.Job(or equivalent) so jobs and HTTP requests both attribute actors consistently. - [ ] Where you need intent beyond row diffs,
Threadline.record_action/2is called with:repoand a validActorRef.
3. Redaction and sensitive columns
- [ ]
config :threadline, :trigger_capture, tables: %{"users" => [exclude: ..., mask: ...]}reviewed with security; no column in bothexcludeandmask. - [ ]
mix threadline.gen.triggers --dry-runused after config changes; migrations applied before relying on new trigger SQL. - [ ] JSON/JSONB columns: remember masking replaces the whole value (no field-level redaction in current releases).
4. Retention and purge
- [ ]
config :threadline, :retentionvalidated (keep_daysormax_age_seconds, not both; positive window). - [ ] Destructive purge only with
enabled: trueafter ops sign-off; alwaysmix threadline.retention.purge --dry-runfirst. - [ ] Production:
MIX_ENV=prod mix threadline.retention.purge --execute(requires explicit--execute). - [ ] Batch size and
max_batchestuned so each run finishes under lock/latency budgets; schedule often enough that volume per run stays bounded. - [ ] Backups / point-in-time recovery: purges are permanent deletes of
audit_changes(and optionally emptyaudit_transactions); align retention with compliance needs.
5. Export and investigation
- [ ] Exports use the same filter keys as
Threadline.timeline/2(:repo,:table,:actor_ref,:from,:toonly). Unknown keys raiseArgumentErrorwith a message pointing atThreadline.Query. - [ ] Large exports: respect default
max_rowsandtruncatedmetadata, or useThreadline.Export.stream_changes/2withStream.take/2intentionally.
6. Observability
- [ ]
:telemetryhandlers for Threadline events are attached where you need metrics or logs. - [ ] Retention purge logs (
threadline retention purge batch, etc.) visible to operators when purge runs.
7. Brownfield and continuity
- [ ] If tables already had rows before capture: read
brownfield-continuity.md; runmix threadline.continuitywhere applicable; document the honest “gap until first audited write” for stakeholders.
See also
- Domain reference — schema, retention semantics, export behavior.
- HexDocs —
Threadline,Threadline.Export,Threadline.Retention,Threadline.Query.