---
name: obistack-runbook
description: Work an ObiStack incident step by step, from the firing alert to a timeline of what happened and a likely cause, narrating each query as you go. Use when an alert is firing, the user asks what is wrong with a service, or they want an incident investigated or written up.
license: MIT
metadata:
  version: "1.0.0"
---

# Investigate an ObiStack incident

Build a timeline of what happened, one query at a time, and say what each
step showed before you take the next. The user wants to follow your
reasoning, so do not jump to a conclusion the data has not shown yet.

Use the ObiStack MCP tools when they are connected, and the `obi` command line
otherwise. Everything here only reads, except the last step, which needs the
user's agreement.

## 1. Find the incident

MCP: `list_incidents`, then `get_incident`. Command line:

```bash
obi get incidents --status open
obi describe incident 12
```

Note when it started, which alert rules fired, and whether anyone has
acknowledged it.

## 2. Read the alert that fired

MCP: `get_alert_rule` and `get_alert_events`. Command line:

```bash
obi describe alert payments-errors
obi get alert-events --alert payments-errors
```

Write down the rule's query, its condition, and when it first fired. That
query is your starting point.

## 3. See the shape of the problem

Run the rule's query over a window that starts well before the first firing,
and chart it, so you can see when it began and whether it is still going:

```obiql
service="payments" level="error" | timechart span=1m count()
```

```bash
obi search 'service="payments" level="error" | timechart span=1m count()' --from now-3h
```

Say what you see: a step change, a slow climb, a burst that has ended.

## 4. Find what changed

Look at what the errors say, grouped by shape so one noisy message does not
hide the rest:

```obiql
service="payments" level="error" | stats count() by _pattern
```

Compare it with the hour before the incident started. A pattern that is new
is a stronger lead than one that has always been there.

Then widen the search to neighbouring services over the same minutes:

```obiql
level="error" | stats count() by service
```

A deploy, a restart or a configuration change often shows up as an info
event just before the errors start:

```obiql
service="payments" ("deploy" OR "starting" OR "config")
```

## 5. Follow one request

Pick one failing event, take its `trace_id`, and read everything that request
touched:

```obiql
trace_id="4bf92f3577b34da6a3ce929d0e0e4736" | fields timestamp, service, level, message
```

Use the real trace id from the event, not this one.

## 6. Check the dashboards

MCP: `list_dashboards`, then `get_dashboard` for the service's dashboard.
Command line:

```bash
obi get dashboards
```

Latency, saturation or a dependency's error rate often moves before the
service's own errors do.

## 7. Write the timeline

Give the user a short, ordered timeline with times in UTC:

- when the first sign appeared, and what it was,
- when the alert fired,
- what changed just before, if anything,
- what is still happening now,
- your best explanation, and how sure you are.

For every claim, include the query that shows it, so the user can run it
themselves. With MCP, include the Explorer link `run_query` returns.

## 8. Update the incident, only when asked

Do not acknowledge, resolve or reassign an incident unless the user tells you
to. MCP: `set_incident_status` proposes the change for the user to approve.
Command line, which takes effect at once:

```bash
obi ack incident 12
obi resolve incident 12
```

If the cause will happen again, offer to write an alert rule that catches it
earlier, using the `obistack-alerts` skill.
