Assemble the context
When PagerDuty opens an incident, the pipeline takes a snapshot of the evidence before it disappears: logs from Splunk, metrics from Datadog, the alert timeline and anything that changed recently. Each tool has its own format, so I designed one six-field schema that every source is reshaped into before the model sees it. A source that comes back empty or stale is recorded as a gap, not quietly skipped. Four decisions set what goes in.
- Which services
- The one that alerted and the services one step away from it. That catches a bad neighbour without pulling in the whole system.
- How far back
- Logs from a 30-minute window around the alert. Deploys and config changes from the last 24 hours, because a change can land hours before anything breaks.
- Messy logs
- About 85% of logs follow a known format, so plain code translates them. The other 15% is free text. A small model call tidies that up, which beat writing a parser for every format.
- Privacy and safety
- Every pull is a fixed, read-only query the model never writes. Emails, IPs and tokens are stripped by pattern, names and keys by a second scanner, before anything reaches a model. Log text goes in marked as untrusted, so an error message that reads like an instruction can't steer the draft.
