Export full agent traces from OpenClaw to Phoenix (Arize) via OpenTelemetry.
- LLM prompts and responses (full input/output content)
- Tool calls with inputs, outputs, and errors
- Sub-agent lifecycle spans
- Token usage (prompt, completion, cache read/write)
- Cost metadata from diagnostic events
- Proper span hierarchy: AGENT → LLM → TOOL
- OpenInference semantic conventions for native Phoenix rendering
Already have OpenClaw? Ask your assistant: "Please read https://raw.githubusercontent.com/exiao/openclaw-phoenix-otel/main/SETUP.md and follow the instructions to install the Phoenix OTEL plugin."
git clone https://github.com/exiao/openclaw-phoenix-otel.git
cd openclaw-phoenix-otel
npm install
openclaw plugins install .Then add your Phoenix credentials to ~/.openclaw/openclaw.json:
{
"plugins": {
"allow": ["phoenix-otel"],
"entries": {
"phoenix-otel": {
"enabled": true,
"config": {
"endpoint": "https://app.phoenix.arize.com/s/your-space",
"apiKey": "your-phoenix-api-key",
"projectName": "openclaw",
"serviceName": "openclaw"
}
}
}
}
}Restart the gateway:
openclaw gateway restartFor detailed setup instructions, troubleshooting, and verification steps, see SETUP.md.
| Option | Default | Description |
|---|---|---|
endpoint |
https://app.phoenix.arize.com |
Phoenix collector endpoint |
apiKey |
— | Phoenix API key (Settings → API Keys) |
projectName |
openclaw |
Phoenix project name |
serviceName |
openclaw |
OTEL service name |
Environment variables PHOENIX_HOST, PHOENIX_API_KEY, and PHOENIX_PROJECT_NAME are also supported.
The plugin hooks into OpenClaw's plugin SDK events:
llm_input→ creates root AGENT span + child LLM span with prompt contentllm_output→ sets response content, token counts on LLM spanbefore_tool_call/after_tool_call→ creates TOOL spans with I/Oagent_end→ finalizes the trace with metadata and cost- Diagnostic
model.usageevents → accumulates cost/token metadata
Spans use OpenInference semantic conventions so Phoenix renders them natively with proper LLM trace visualization.
- Disable the built-in
diagnostics-otelplugin to avoid conflicts (two OTEL providers in the same process can interfere) - OTEL exports use
Authorization: Bearer <key>for the OTLP endpoint (notapi_keyheader) - The plugin initializes OTEL during
register()to ensure hooks can create spans immediately
Apache-2.0

