Want your coding agent to do this for you? If you’re using Claude Code, Cursor, Copilot, or another AI coding assistant, try Agent-Assisted Setup to add Phoenix tracing automatically with a single command.
Before We Start
To follow along, you’ll need an OpenAI API key & a Serper Dev Key. We’ll be using OpenAI as our LLM provider & Serper as our Web Search Tool for our chatbot.Follow along with code: This guide has a companion notebook with runnable
code examples. Find it
here.
1
Start Phoenix
Before we can send traces anywhere, we need Phoenix running.Phoenix serves its UI and OTLP HTTP on port 6006, and OTLP gRPC on port 4317. For a local instance that’s http://localhost:6006 — leave it running while you work.
- Self-Host
- Local
- Container
Run Phoenix on your own infrastructure, backed by PostgreSQL so traces persist beyond a single process. This is the option to reach for once Phoenix is shared across a team or environment.The self-hosting guide covers Kubernetes, Helm, Railway, AWS CloudFormation, Google Cloud Run, Azure, and Render, plus authentication and configuration.
2
Configure your Environment
Now that Phoenix is running, we need to connect our application to it so we can start sending traces.In this step, we’ll install the required dependencies and configure a few environment variables. This setup is what allows Phoenix to receive trace data from our application. Once it’s in place, running the application will automatically create a project in the Phoenix UI and record each traced run there.We’ll now install both the CrewAI package and the OpenInference CrewAI auto-instrumentation package, which handles tracing for us without requiring manual instrumentation.At this point, your application is configured to send traces to Phoenix!
Install Your Packages
Set Your API Keys
Pointing at a deployment with authentication enabled? Set
PHOENIX_COLLECTOR_ENDPOINT to that deployment’s hostname and PHOENIX_API_KEY to an API key from its Settings page. A local phoenix serve needs neither.Register Your Project in Phoenix
Next, we’ll register a tracer provider linked to a project in Phoenix. This project is where your traces will show up in the UI.3
Create your Agent
Now that Phoenix is running and our environment is configured, we can start building the application so we can generate real execution and send traces to Phoenix.In this step, we’ll create a simple Financial Analysis and Research chatbot. This tutorial we will use CrewAI, but you can build agents in any of these different frameworks for auto-integration with Phoenix.This agent is made up of:At this point, we have a working CrewAI setup with multiple agents, tasks, and a tool. In the next step, we’ll run the crew and see how its execution shows up as a trace in Phoenix!
- Two sub-agents: a Research agent and a Writer agent
- Two tasks: one for financial research and one for generating a summary report
- One tool: SerperDevTool for real-time web search
Define the Agents
We’ll start by defining the two agents that make up our crew & the tool the agents may use.Define the Tasks & Tool
Next, we’ll define the tasks each agent is responsible for.Create and Run the Crew
Finally, we’ll wire the agents and tasks together and run them sequentially.4
Look at the Trace in Phoenix
Now that we’ve defined our chatbot, all that’s left to do is run it and see what Phoenix captures.To run the agent, execute the following:Once the run completes, head back to Phoenix and navigate to the Traces view. You should see a new trace corresponding to this run. Click into it to explore how the agents and tasks are executed.At this point, you can follow the full execution of the chatbot as a single trace in Phoenix.More importantly, you can now see how your application actually ran:
- Which agents were invoked and in what order
- How tasks flowed from one step to the next
- Where time was spent across the workflow

