Incidents stay separate until Alertmanager groups their alerts, but a bad
release can break the API, the connection pool and a dozen pods in
different groups, and three months later each incident on its own says
little. An event is the context they share: a release, a change, a
maintenance window or an outage. Incidents attach to it, many to many,
and one of them can be marked as the trigger. Incidents are never merged,
so each keeps its own timeline, assignee and metrics; merging would have
thrown that away and could not be undone.
Nothing attaches by itself. An incident's page and
GET /api/incidents/{id}/related-events suggest events within two hours of
it, and a person decides. Events are team-scoped like incidents, kind is
a closed set (a CHECK constraint, so the UI can colour and filter by it),
and they are hard-deleted: the incidents stay and each one's timeline
records the detach. A repeated external_id returns the event already
recorded, so CI can post a release marker and retry safely. Figures such
as time to first ack and the first alarm to last resolution are computed
when an event is read and never stored.
The web UI gets an Events page and an event page with a merged timeline,
an Events card on the incident, and a tag on queue rows. make dev seeds a
release and a maintenance window.
All of it is additive. Migration 004 only creates tables, so v0.53.1
reads the same database and ignores them. The incident JSON gains
event_count (always present) and events (omitted when empty, so clients
detect support from event_count). terdut-tui keeps working unchanged and
simply does not show events yet; no TUI version is required and none is
excluded. The operator's client is untouched. The Prometheus allowlist, the CSP and the
resource limits do not change.