Install
Configure Environment
First, start Phoenix:- Local
- Container
- Self-Host
pip install arize-phoenix && phoenix serve does the same thing. See Terminal setup for customization..env file that points your app at it:
PHOENIX_COLLECTOR_ENDPOINT is the Phoenix server URL. register() appends /v1/traces when that path is missing.
Add the Scalekit credentials from Dashboard → Developers → API credentials to the same .env file:
Setup
Callregister() before the tool runs. It reads PHOENIX_COLLECTOR_ENDPOINT and PHOENIX_API_KEY. The run command loads .env with --env-file before the script starts. The project name is PHOENIX_PROJECT_NAME, or scalekit-agentkit when that variable is unset.
client.actions.executeTool with traceTool from @arizeai/phoenix-otel. The span name is the tool name. The span records the call arguments and the result.
identifier is the connected account the tool runs as.
A thrown error is recorded as status ERROR. A call that returns normally is status OK, including when the failure sits inside
result.data. traceTool ends the span before the next line runs, so a later setStatus does not change it. The demo marks those resolved failures ERROR on a span it owns.Running Your Application
The three files above are the example. From the directory that contains them:Observe
Phoenix lists the turn underPHOENIX_PROJECT_NAME. In this example the tool span is the root span. A thrown error shows status ERROR. In the demo, the tool span and the model span are siblings under the agent span run_agent.
Resources
Scalekit tracing demo
npm run dev. Its tracer is in lib/arize.ts, and it calls client.tools.executeTool. Resolved error payloads are marked ERROR in lib/traced-tools.ts.
Scalekit connectors: https://docs.scalekit.com/agentkit/connectors/.
