Break a data platform on purpose. Watch an AI agent detect, triage and explain it in Slack.
Airflow + PySpark + Trino Β· Prometheus / Alertmanager / Grafana Β· PagerDuty-style incidents Β· custom MCP server Β· Slack Bolt Β· βΉ0 to run
Results Β· Quick start Β· Architecture Β· MCP server Β· Deep dive Β· Built with Claude Code Β· Try it in Codespaces
On a data platform, the support loop is always the same. A job breaks, an alert fires, and someone digs through metrics, task logs and runbooks, then posts an update in Slack and chases the incident to resolution. PlatformPulse rebuilds that loop at laptop scale and hands the digging to an agent.
You run a small data platform, break it in one of four realistic ways, and watch it work:
- π₯ Detect. Airflow metrics flow through StatsD into Prometheus, and an alert rule fires.
- π¨ Open. Alertmanager sends a webhook to a PagerDuty-style incident service (open β ack β resolve).
- π€ Triage. An LLM agent calls its own MCP server to read DAG state, task logs, metrics and runbooks, then classifies the failure.
- π¬ Explain. The diagnosis lands in the incident's Slack thread with evidence, a next step and the matching runbook.
- π Measure. Grafana shows platform health, MTTA/MTTR and how often the agent resolved things without a human.

A real, unedited run: chaos.py oom β alert at t+80s β posted to Slack β agent classifies oom in 24s, with Grafana updating live.
Frames were captured automatically from the running stack, and the thread text is the agent's actual output.
- Results
- Features
- Architecture
- Quick start
- Break it on purpose
- The MCP server
- Slack experience
- Project structure
- Built with Claude Code
- Docs
Measured, not estimated. pulse/eval.py runs the full loop for every case: inject the failure β the alert fires β an incident opens β the agent triages it. Raw rows: eval/results.csv.
| Failure type | Model | Runs | Accuracy | Median detect | Median time-to-summary | p90 time-to-summary |
|---|---|---|---|---|---|---|
| π₯ OOM | gpt-oss-120b |
4 | 100% | 28.4 s | 27.5 s | 34.7 s |
| π§© Bad schema | gpt-oss-120b |
4 | 100% | 26.7 s | 19.4 s | 30.0 s |
| β±οΈ Timeout | gpt-oss-120b |
4 | 100% | 107.8 s | 8.1 s | 8.5 s |
| π§ Stuck DAG | gpt-oss-20b |
5 | 80% | 46.1 s | 57.4 s | 147.7 s |
| All | mixed | 17 | 94% | 40.6 s | 19.4 s | 34.7 s |
How to read these numbers (and what's excluded)
- Detect is the time from injecting the failure to the incident row. For timeout it includes the job's 90 s
execution_timeoutby design. - Time-to-summary is how long the agent takes to triage once the incident is open.
gpt-oss-120b's Groq free tier allows 200k tokens a day, and it ran out mid-eval. The stuck runs therefore usedgpt-oss-20b, and the model is recorded on every row.- One stuck run crashed inside the agent and is counted as a miss.
- Three stuck runs recorded under an eval-harness bug (the pool was restored before triage) are excluded. They're kept in
eval/stuck_runs_invalid.csv, and the bug is explained in REVIEW_LOG #9. - Eval incidents are resolved as
evaland never count toward the dashboard's deflection rate.
| π§ͺ Chaos on demand | chaos.py injects a Spark OOM, a schema mismatch, a task timeout, or a stuck DAG (a 0-slot pool) |
| π Observability as code | StatsD mapping, 5 Prometheus rules, an Alertmanager webhook, and a Grafana dashboard JSON, all provisioned on up |
| π¨ PagerDuty-style incidents | FastAPI + SQLite: dedupe on fingerprint + start time, open β ack β resolve, resolved_by=agent|human |
| π§° Custom MCP server | 6 read-only tools over 4 backends: Prometheus, the Airflow REST API, the incident DB, and Trino |
| π€ Tool-calling agent | MCP stdio client + Groq, strict JSON output, retries on 429 and malformed tool calls |
| π Runbook search | 12 runbooks, embedded locally with fastembed (bge-small), no API cost |
| π¬ Slack app | Alerts with buttons, an auto-triage thread, /pulse, @mention Q&A with Solved / Escalate, and an App Home tab |
| π CX metrics | MTTA, MTTR, agent time-to-summary, support requests by category, and deflection rate |
| πͺΆ Laptop-sized | One docker compose up, about 5.8 GB of memory caps, about 2.2 GB idle, βΉ0 to run |

The provisioned Grafana "Customer Experience" dashboard: platform health, task outcomes, pool slots, incidents, support and agent latency.
flowchart TB
CH["π§ͺ chaos.py<br/>oom Β· bad_schema Β· timeout Β· stuck"] -.->|breaks| AF
subgraph Platform["ποΈ Mini data platform"]
direction LR
AF["Airflow 2.10<br/>LocalExecutor"] -->|runs| SP["PySpark<br/>local mode"]
AF --- PG[("Airflow<br/>Postgres")]
TR["Trino 470"] -->|SQL| PG
end
subgraph Obs["π Observability"]
direction LR
SE["statsd-exporter"] --> PR["Prometheus<br/>5 alert rules"] --> AM["Alertmanager"]
PR --> GF["π Grafana CX"]
end
AF -->|StatsD| SE
AM -->|webhook| IS["π¨ Incident service<br/>FastAPI + SQLite"]
IS -->|"/metrics: MTTA Β· MTTR Β· deflection"| PR
subgraph Pulse["π€ pulse container"]
direction LR
SL["Slack app<br/>Bolt Β· Socket Mode"] --> AG["Agent<br/>Groq gpt-oss"] <-->|stdio| MCP["MCP server Β· 6 read-only tools<br/>Prometheus Β· Airflow Β· incidents Β· Trino"]
end
IS -->|new incidents| SL
SL <--> SK(("π¬ Slack"))
Services, ports and memory budget
| Service | Role | Port | Mem cap |
|---|---|---|---|
| airflow | standalone, LocalExecutor, JDK 17 + PySpark |
8080 | 2.5 GB |
| trino | SQL over tpch + the Airflow metadata DB, 1 GB heap |
8081 | 1.5 GB |
| postgres | Airflow metadata | β | 256 MB |
| statsd-exporter | StatsD β Prometheus | 9102 | 64 MB |
| prometheus | 5 s scrapes, alert rules | 9090 | 300 MB |
| alertmanager | webhook to the incident service | 9093 | 64 MB |
| incident | incident lifecycle + /metrics |
8000 | 128 MB |
| grafana | provisioned dashboard | 3000 | 256 MB |
| pulse | Slack app + agent + MCP server + eval | β | 768 MB |
The design decisions are written up in ARCHITECTURE.md and DESIGN.md.
This spins up the whole stack in your own free cloud VM (4 cores / 16 GB). The first build takes about 8β10 minutes, after which Grafana, Airflow, Prometheus and the incident API open as forwarded ports in the Ports tab.
- When asked for secrets, add a free Groq key as
GROQ_API_KEYso the agent can run. The Slack tokens are optional. - Free GitHub accounts get 120 core-hours a month, which is about 30 hours of this 4-core machine. Stop the codespace when you're done.
- In the codespace terminal, run
python chaos.py oomand watch the dashboard.
You need Docker Desktop (8 GB for WSL2/VM), a free Groq API key and, optionally, a free Slack workspace.
git clone https://github.com/Vaibhav2824/PlatformPulse.git && cd PlatformPulse
cp .env.example .env # add GROQ_API_KEY (Slack tokens optional)
docker compose up -d --buildSetting up the Slack app (5 minutes)
- Go to api.slack.com/apps β Create New App β From a manifest, choose YAML, and paste
slack_manifest.yml. - Under Basic Information β App-Level Tokens, generate a token with
connections:writeand put it inSLACK_APP_TOKEN(xapp-β¦). - Under Install App, install the app to your workspace and put the bot token in
SLACK_BOT_TOKEN(xoxb-β¦). - Create a public
#platform-alertschannel and run/invite @PlatformPulse. - Run
docker compose up -d pulse.
Socket Mode means you don't need a public URL or tunnel.
python chaos.py oom # Spark driver Java heap OOM β sales_daily
python chaos.py bad_schema # renamed input columns β AnalysisException β events_ingest
python chaos.py timeout # job hangs β AirflowTaskTimeout β user_metrics
python chaos.py stuck # spark_pool set to 0 slots β task never starts
python chaos.py restore # put the pool backWithin about 30 s an alert fires, an incident opens, Slack gets the alert with Ack Β· Summarize Β· Runbook Β· Resolve buttons, and the agent posts its diagnosis in the thread.
To reproduce the eval yourself (it uses a lot of Groq tokens):
docker compose run --rm --no-deps pulse python eval.py 5pulse/mcp_server.py is a standard stdio MCP server built with FastMCP. Every tool is read-only.
| Tool | Backend | What the agent uses it for |
|---|---|---|
get_dag_status |
Airflow REST | latest runs, task states, try numbers, pool slots |
get_task_logs |
Airflow REST | error lines + the log tail (the evidence) |
query_prometheus |
Prometheus | live metrics, firing alerts |
get_incidents |
Incident service | open/recent incidents |
search_runbooks |
fastembed (local) | semantic search over 12 runbooks |
run_trino_query |
Trino β Airflow DB | run history via SQL (single SELECT/SHOW/DESCRIBE/EXPLAIN/WITH only, 50-row cap) |
Any MCP client can use it, including Claude Desktop:
{ "mcpServers": { "platformpulse": {
"command": "docker",
"args": ["compose", "-f", "<repo>/docker-compose.yml", "run", "--rm", "-i", "--no-deps", "pulse", "python", "mcp_server.py"] } } }Example triage output (a real run)
{
"category": "timeout",
"summary": "The user_metrics.run_spark task failed due to an AirflowTaskTimeout. The Spark job exceeded its execution_timeout and the subprocess was killed, so the run was marked FAILED.",
"evidence": ["{timeout.py:68} ERROR - Process timed out, PID: 1360",
"airflow.exceptions.AirflowTaskTimeout: Timeout, PID: 1360"],
"runbook": "rb-task-timeout",
"next_step": "Check upstream source latency; if the runtime is expected, raise execution_timeout and add retries with backoff.",
"tools_used": ["get_dag_status", "get_task_logs", "search_runbooks"]
}| Surface | What it does |
|---|---|
| π¨ Alert post | severity, alert, DAG/task, incident # and status, with Ack Β· Summarize Β· Runbook Β· Resolve (agent) Β· Resolve (human) buttons |
| π§΅ Auto-triage thread | category, summary, evidence, next step, runbook id and agent latency |
/pulse |
service health, task failures in the last hour, MTTA/MTTR, deflection, open incidents |
@PlatformPulse β¦ |
Q&A backed by live tools, with Solved β / Escalate π buttons that feed the deflection rate |
| π App Home | the same health view, refreshed whenever the tab is opened |
PlatformPulse/
βββ airflow/ # Dockerfile (slim + JDK17 + PySpark), 3 DAGs, Spark job with chaos hooks
βββ observability/ # statsd mapping, prometheus.yml, 5 alert rules, alertmanager.yml
βββ incident_service/ # FastAPI + SQLite incident lifecycle, /metrics, pytest suite
βββ pulse/
β βββ mcp_server.py # 6-tool MCP server
β βββ agent.py # Groq tool-calling loop over MCP stdio
β βββ slack_app.py # Bolt app: alerts, buttons, /pulse, @mention, App Home
β βββ eval.py # chaos β incident β triage benchmark
β βββ runbooks/ # 12 markdown runbooks
βββ grafana/ # provisioning + customer_experience.json
βββ trino/ # 1 GB heap, tpch + postgresql catalogs
βββ notebooks/ # postmortem analysis of eval + incidents
βββ eval/ # results.csv, results.md
βββ chaos.py # stdlib-only failure injector
βββ docker-compose.yml
PlatformPulse was built in one 5-hour sprint with Claude Code as the pair programmer. I owned the scope, the design calls and the verification. Claude Code wrote most of the code, and nothing was accepted until it had run against the real stack.
How the work was split
| Step | Claude Code | Me |
|---|---|---|
| Plan | turned the brief into a phase-gated plan, then the PRD, ARCHITECTURE and DESIGN before any code | set scope (full spec in 5 h), LLM provider, hosting, folder |
| Build | wrote the compose stack, DAGs, chaos, alert rules, incident service, MCP server, agent and Slack app | created the Slack app and Groq key, approved each phase gate |
| Verify | ran every phase live: injected each failure, checked the log signature, the alert, the incident row and the agent verdict | checked the Slack flow by hand (alert, thread, Ack, /pulse, @mention) |
| Measure | wrote and ran the eval, and fixed the harness when it was wrong | decided how to handle the quota limit (switch models, label every row) |
Critical review, not autopilot. Every time Claude Code's output was wrong, the fix and the reason went into REVIEW_LOG.md. There are 13 entries, and most of them only showed up when the real stack ran, never in code review:
| # | What looked fine | What running it revealed |
|---|---|---|
| 5 | a "stuck pool" alert on airflow_pool_starving_tasks |
it stays 0 for a truly stuck pool, and fired on normal contention |
| 7 | the default LLM llama-3.3-70b-versatile |
404 model_not_found: the provider had retired it |
| 9 | the eval harness | it restored the pool before the agent triaged, so it was measuring a healed system |
| 10 | resolving eval incidents as agent |
it inflated dashboard "deflection" to 95%, so test traffic was polluting KPIs |
| 11 | dashboard JSON edited via PowerShell | a hidden UTF-8 BOM, so Grafana silently kept the old dashboard |
| 13 | a "first failure" alert rule | on a fresh stack it opened 3 false incidents that never showed locally |
Other design choices: the agent is read-only by design (it recommends and humans remediate), every image and package version is pinned, and the incident service has a pytest suite (docker compose run --rm incident pytest).
| Doc | What's in it |
|---|---|
| PRD.md | problem, users, goals, success metrics, JD-gap mapping |
| ARCHITECTURE.md | components, data flow, memory budget, design rationale |
| DESIGN.md | metrics, alert rules, DB schema, API, MCP contracts, Slack UX |
| REVIEW_LOG.md | every correction made to Claude Code's output, with the reason |
| notebooks/postmortem.ipynb | postmortem analysis |
Built by @Vaibhav2824 Β· MIT License Β· β back to top