> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Arize Phoenix via OpenInference (Local Collector)

## Overview

This example demonstrates how to instrument your Agno agent with OpenInference and send traces to a local Arize Phoenix collector.

## Code

```python theme={null}
import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from phoenix.otel import register

# Set the local collector endpoint for Arize Phoenix
os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "http://localhost:6006"

# Configure the Phoenix tracer
tracer_provider = register(
    project_name="agno-stock-price-agent",  # Default is 'default'
    auto_instrument=True,  # Automatically use the installed OpenInference instrumentation
)

# Create and configure the agent
agent = Agent(
    name="Stock Price Agent",
    model=OpenAIChat(id="gpt-4o-mini"),
    tools=[DuckDuckGoTools(search=True, news=True)],
    instructions="You are a stock price agent. Answer questions in the style of a stock analyst.",
    debug_mode=True,
)

# Use the agent
agent.print_response("What is the current price of Tesla?")
```

## Usage

<Steps>
  <Step title="Install Dependencies">
    ```bash theme={null}
    pip install agno arize-phoenix openai openinference-instrumentation-agno opentelemetry-sdk opentelemetry-exporter-otlp
    ```
  </Step>

  <Step title="Start Local Collector">
    Run the following command to start the local collector:

    ```bash theme={null}
    phoenix serve
    ```
  </Step>

  <Step title="Run the Agent">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/observability/arize_phoenix_via_openinference_local.py
      ```

      ```bash Windows theme={null}
      python cookbook/observability/arize_phoenix_via_openinference_local.py
      ```
    </CodeGroup>
  </Step>
</Steps>
