Incident enrichment: ideas from brainstorm (topology, what-changed, alert-declared queries, history) #44

Open
opened 2026-10-14 19:38:31 +00:00 by niklas · 1 comment
Owner

Background

Incidents are created from Alertmanager webhooks, grouped by groupKey, with a timeline and metadata. This issue collects ideas for adding context that helps operators while an incident is open.

Core principle: don't guess relevance. Let the alert's labels, the Kubernetes topology and the rule author's annotations decide what to fetch. Snapshot at incident-open time, since pods, logs and events disappear afterward.

Suggested priority

  1. Topology-based events and pod-state snapshot
  2. "What changed" timeline markers
  3. Alert annotations that declare queries to run
  4. Similar past incidents + resolution notes

1. Topology-driven enrichment

  • Resolve the owner chain from alert labels: Pod → ReplicaSet → Deployment → Service → Ingress, plus node.
  • Blast radius: services/ingresses depending on the objects, other alerts firing on the same objects.
  • K8s events for involved objects (OOMKilled, FailedScheduling, ImagePullBackOff, probe failures, evictions).
  • Pod state snapshot: restart counts, last termination reason/exit code, container status, requests/limits vs usage.

2. "What changed" correlation

  • Deploys/rollouts, image tag changes, ConfigMap/Secret changes, HPA scaling, node pool changes.
  • Helm / ArgoCD / Flux sync history with git commit and author.
  • Shown as timeline markers, e.g. "Deployment X rolled out 7 min before first alert".

3. Alert-declared context

  • Annotations: runbook_url, logs_query, dashboard_url, metrics_queries (list of PromQL).
  • Server runs the queries at incident time and embeds results (small graph, top N log lines).
  • Fallback defaults by alert type (CPU: usage, throttling, requests/limits; crashloop: previous logs + events).

4. Logs and metrics (cheap)

  • Loki: dedupe/cluster repeated lines into patterns with counts, highlight errors, show what is new vs the previous hour; fetch --previous logs for crashes immediately.
  • Sparklines for golden signals of the affected service, with comparison to yesterday / last week.
  • Snapshot everything at incident time for postmortems.

5. Operational memory

  • Similar past incidents (alert name, labels, fingerprint): how resolved, duration, who.
  • One-line "what fixed it" prompt at resolve time, surfaced on later matching alerts.
  • Flapping/recurrence detection ("fired 6 times this week, around 02:00").
  • Ownership from labels, service catalog or CODEOWNERS.

6. Actions

  • Safe one-click actions: restart pod, scale, rollback, cordon node, silence in Alertmanager with expiry; all logged to the timeline.
  • Read-only diagnostic probes (exec, curl health endpoint) with output attached.
  • Dependent-alert grouping ("node X NotReady; these 14 incidents are likely symptoms").

7. Optional AI triage

  • Summary with the evidence shown, postmortem draft from timeline/actions/notes.
  • Pluggable and local-model friendly so logs stay in the cluster.

8. Smaller items

  • Per-incident status page / Slack channel with periodic summaries.
  • Human timeline annotations next to machine events.
  • SLO / error-budget impact.
  • MTTA/MTTR per team.
  • Noise scoring for alerts that auto-resolve or never lead to action.

Open questions

  • Annotation convention design (names, templating, limits).
  • Topology resolver: the server needs Kubernetes API access; interplay with terdut-operator (already in-cluster).
  • Security/permissions for actions and probes.
  • Version coupling: any new endpoint/JSON shape must be mirrored in terdut-tui internal/api/client.go and, if used, terdut-operator tdclient.
## Background Incidents are created from Alertmanager webhooks, grouped by groupKey, with a timeline and metadata. This issue collects ideas for adding context that helps operators while an incident is open. Core principle: don't guess relevance. Let the alert's labels, the Kubernetes topology and the rule author's annotations decide what to fetch. Snapshot at incident-open time, since pods, logs and events disappear afterward. ## Suggested priority 1. Topology-based events and pod-state snapshot 2. "What changed" timeline markers 3. Alert annotations that declare queries to run 4. Similar past incidents + resolution notes ## 1. Topology-driven enrichment - Resolve the owner chain from alert labels: Pod → ReplicaSet → Deployment → Service → Ingress, plus node. - Blast radius: services/ingresses depending on the objects, other alerts firing on the same objects. - K8s events for involved objects (OOMKilled, FailedScheduling, ImagePullBackOff, probe failures, evictions). - Pod state snapshot: restart counts, last termination reason/exit code, container status, requests/limits vs usage. ## 2. "What changed" correlation - Deploys/rollouts, image tag changes, ConfigMap/Secret changes, HPA scaling, node pool changes. - Helm / ArgoCD / Flux sync history with git commit and author. - Shown as timeline markers, e.g. "Deployment X rolled out 7 min before first alert". ## 3. Alert-declared context - Annotations: `runbook_url`, `logs_query`, `dashboard_url`, `metrics_queries` (list of PromQL). - Server runs the queries at incident time and embeds results (small graph, top N log lines). - Fallback defaults by alert type (CPU: usage, throttling, requests/limits; crashloop: previous logs + events). ## 4. Logs and metrics (cheap) - Loki: dedupe/cluster repeated lines into patterns with counts, highlight errors, show what is new vs the previous hour; fetch `--previous` logs for crashes immediately. - Sparklines for golden signals of the affected service, with comparison to yesterday / last week. - Snapshot everything at incident time for postmortems. ## 5. Operational memory - Similar past incidents (alert name, labels, fingerprint): how resolved, duration, who. - One-line "what fixed it" prompt at resolve time, surfaced on later matching alerts. - Flapping/recurrence detection ("fired 6 times this week, around 02:00"). - Ownership from labels, service catalog or CODEOWNERS. ## 6. Actions - Safe one-click actions: restart pod, scale, rollback, cordon node, silence in Alertmanager with expiry; all logged to the timeline. - Read-only diagnostic probes (exec, curl health endpoint) with output attached. - Dependent-alert grouping ("node X NotReady; these 14 incidents are likely symptoms"). ## 7. Optional AI triage - Summary with the evidence shown, postmortem draft from timeline/actions/notes. - Pluggable and local-model friendly so logs stay in the cluster. ## 8. Smaller items - Per-incident status page / Slack channel with periodic summaries. - Human timeline annotations next to machine events. - SLO / error-budget impact. - MTTA/MTTR per team. - Noise scoring for alerts that auto-resolve or never lead to action. ## Open questions - Annotation convention design (names, templating, limits). - Topology resolver: the server needs Kubernetes API access; interplay with terdut-operator (already in-cluster). - Security/permissions for actions and probes. - Version coupling: any new endpoint/JSON shape must be mirrored in terdut-tui `internal/api/client.go` and, if used, terdut-operator `tdclient`.
niklas added the enhancement label 2026-10-14 19:39:01 +00:00
Author
Owner

Item 1 (topology-driven enrichment) is now designed in #45: a separate in-cluster terdut-collector binary, namespace-label based team scoping, typed field allowlist. Design only, nothing implemented yet.

Item 1 (topology-driven enrichment) is now designed in #45: a separate in-cluster `terdut-collector` binary, namespace-label based team scoping, typed field allowlist. Design only, nothing implemented yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: niklas/terdut-server#44