Install
Option 1 — Instrument with @span
Add @span decorators to the functions you want to trace. Each
decorated function becomes one span in the captured trace:
Option 2 — Adapt existing logs
If your agent already emits OpenClaw JSONL or OpenTelemetry spans, skip the decorators and parse the logs directly:Option 3 — Intercept MCP sessions
Wrap an MCPClientSession to auto-capture every tool call:
Inspect the trace
Mark spans for Reflex
Setoptimize=True and a prompt_id on any span whose prompt you want
Reflex to improve. Spans sharing the same prompt_id are treated as
instances of the same prompt across steps:
Next steps
Adapters
Import OpenClaw JSONL and OTel spans
MCP interceptor
Auto-capture MCP tool calls
Trace schema
Full AgentTrace and TraceNode field reference
Origin
Feed your trace to Origin for failure attribution