feat(timeline): one record of what happened to the infrastructure, newest first (#6348)
A stored log, timeline_entries, with one row per thing that happened. Each source writes its row in the same transaction as its own record, so the history outlives the 30/90/365-day retention of the tables it points to: - alert events (core/alerts._add_event): fired, resolved, acknowledged, went silent, readings back; - finished Ansible runs (executor, and the startup sweep of interrupted runs): changed something, changed nothing, failed, dry run; - audit rows (core/audit.log_audit): Steward's settings, users and access, sign-ins, backups. Actions another writer records are left to it. Entries carry a kind (fixed) and an area (Service, Host OS, Hardware, Storage, Network, Security, Monitoring). Settings → Timeline edits the areas and each type's area and visibility; both are applied when the timeline is read, so a change re-sorts past entries and a hidden type comes back when shown. Kept forever unless a retention is set. The first start fills the timeline from the last 90 days of records once, skipping any already covered. A host rename carries its entries. UI: Timeline in the sidebar (filter by host, area, kind; scrolls on), a History card on each host page. MCP: get_timeline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,17 @@ DEFAULTS: dict[str, Any] = {
|
||||
"data.retention_days": 90,
|
||||
# The audit log is a security record: kept longer than operational data.
|
||||
"audit.retention_days": 365,
|
||||
# The timeline is the record of what happened to the infrastructure: kept
|
||||
# until this many days are set (0 keeps it all). Its areas, and each entry
|
||||
# type's area and visibility, are Settings → Timeline (steward/timeline).
|
||||
"timeline.retention_days": 0,
|
||||
"timeline.areas": [["service", "Service"], ["host_os", "Host OS"], ["hardware", "Hardware"],
|
||||
["storage", "Storage"], ["network", "Network"], ["security", "Security"],
|
||||
["monitoring", "Monitoring"]],
|
||||
"timeline.types": {},
|
||||
"timeline.area_moved": {},
|
||||
# When the timeline was first filled from the records that predate it.
|
||||
"timeline.backfilled_at": "",
|
||||
"monitors.poll_interval_seconds": 60,
|
||||
# Root log level: DEBUG, INFO, WARNING or ERROR (steward/core/logging_setup.py).
|
||||
# WARNING also hides the per-request access lines.
|
||||
|
||||
Reference in New Issue
Block a user