← Catalog

pi-phoenix-otel

Pi coding agent extension that streams OpenTelemetry GenAI traces to Arize Phoenix. Zero dependencies.

Extension

Install

Install with PiG

pig install npm:pi-phoenix-otel

Install with Pi

pi install npm:pi-phoenix-otel
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.0 (README.md). PiG does not review it.

pi-phoenix-otel

Pi package

See everything your pi coding agent does, traced in Arize Phoenix. Every prompt, tool call, token, and cost — as a queryable trace waterfall.

Zero dependencies. No install scripts. One auditable file.

Install

pi install npm:pi-phoenix-otel

Restart pi (or run /reload).

Quick start

  1. Start Phoenix locally:

    uvx arize-phoenix serve     # UI at http://localhost:6006
    
  2. Send a message in pi. Traces land in the pi project automatically.

Phoenix not running? Use /otel-start and the extension launches it for you and waits until it's healthy.

What you get

One trace per session by default:

fix the login bug              (session root, CHAIN)
├── pi.run 1 · fix the login bug
│   ├── pi.turn 0        (tokens, cost, model)
│   │   ├── execute_tool read
│   │   └── execute_tool edit
│   └── pi.turn 1
├── pi.run 2 · now add caching
│   └── pi.turn 0 ── execute_tool bash
└── ...

Each trace captures:

  • Runs — prompts (including steers), final responses
  • Turns — tokens, cache reads, reasoning tokens, model, finish reason, cost
  • Tool calls — name, arguments, result, errors, duration

Spans use OpenInference/GenAI conventions, so Phoenix renders proper LLM and Tool panels. A clickable phoenix ↗ link in the status bar opens the session in Phoenix.

Configuration

Optional config at ~/.pi/agent/phoenix-otel.config.json:

{
	"endpoint": "http://localhost:6006/v1/traces",
	"service": "pi-coding-agent",
	"project": "my-project",
	"apiKey": "",
	"captureContent": true,
	"trace": "session",
	"maxTextBytes": 0,
	"maxToolResultBytes": 0,
	"maxParamsBytes": 0,
	"maxSystemPromptBytes": 0,
	"maxMessagesJsonBytes": 0,
	"maxJsonDepth": 0,
	"maxJsonItems": 0
}
KeyDefaultDescription
endpointhttp://localhost:6006/v1/tracesOTLP/HTTP endpoint
servicepi-coding-agentservice.name resource attribute
projectrepo namePhoenix project. Defaults to the enclosing git repository's directory name (pi outside a repo).
apiKeyunsetSent as Authorization: Bearer … for Phoenix Cloud or auth proxies
captureContenttruefalse = metadata-only (no prompt/response/tool text)
tracesessionsession = one trace per session · run = one trace per prompt
maxTextBytes0 (unlimited)Byte budget for prompts/responses.
maxToolResultBytes0 (unlimited)Byte budget for tool arguments and results.
maxParamsBytes0 (unlimited)Byte budget for invocation parameters.
maxSystemPromptBytes0 (unlimited)Byte budget for the system prompt.
maxMessagesJsonBytes0 (unlimited)Byte budget for the full input transcript; when capped, older turns are dropped.
maxJsonDepth0 (unlimited)Nested-JSON depth cap for structured values.
maxJsonItems0 (unlimited)Arrays/objects per JSON level.

A project-local .pi/phoenix-otel.config.json overrides only the keys it sets. Environment variables override both:

PHOENIX_OTEL_ENDPOINT, PHOENIX_SERVICE_NAME, PHOENIX_PROJECT, PHOENIX_API_KEY, PHOENIX_TRACE, PHOENIX_CAPTURE_CONTENT (0/false/no/off disables capture), PHOENIX_OTEL_ENABLED=0 (no-op mode).

Budgets are unlimited by default. To cap them, set maxTextBytes, maxToolResultBytes, maxParamsBytes, maxSystemPromptBytes, maxMessagesJsonBytes, maxJsonDepth, or maxJsonItems to a positive value (or use the matching PHOENIX_MAX_* env vars). 0 means unlimited.

When a cap does apply, cut text ends with …[+N bytes] so truncated content is never mistaken for complete content. If an export batch exceeds 4 MiB, the extension warns once with a hint to set a cap.

Commands

CommandAction
/otel-startStart Phoenix in the background via uvx
/otel-statusShow server, endpoint, project, and capture status
/otel-flushFlush pending spans now

Privacy

  • Zero dependencies — no supply-chain surface, one auditable source file.
  • No install-time code — runs only when pi loads it.
  • Local-first — spans are only sent to the endpoint you configure. Nothing else leaves your machine.
  • Content capture is on by default. Prompts, responses, and tool results can contain sensitive material. Set "captureContent": false for metadata-only tracing.
  • HTTPS is not enforced — use an HTTPS endpoint for anything non-local.

Requirements

License

MIT