Skip to main content
Combine Restate and Arize Phoenix to get full observability into your agent executions. Phoenix traces every LLM call, tool invocation, token usage, and cost. Restate traces every durable step, so you see agentic steps alongside regular workflow steps in a single trace. You don’t need to change your agent code. You only add the Phoenix instrumentation to your entry point.

Arize Phoenix Documentation

Learn more about Arize Phoenix’s observability and evaluation features.

Instrumentation setup

Initialize Arize Phoenix and wrap the tracer with RestateTracerProvider to correlate AI spans with Restate’s execution journal. Here is an example of how to do it for the OpenAI Agents SDK:
__main__.py
from phoenix.otel import register
from opentelemetry import trace as trace_api
from openinference.instrumentation import OITracer, TraceConfig
from openinference.instrumentation.openai_agents._processor import (
    OpenInferenceTracingProcessor,
)
from agents import set_trace_processors
from restate.ext.tracing import RestateTracerProvider

# Initialize Arize Phoenix (sets up the global OTEL tracer provider + exporter).
register()
tracer = OITracer(
    RestateTracerProvider(trace_api.get_tracer_provider()).get_tracer(
        "openinference.openai_agents"
    ),
    config=TraceConfig(),
)
set_trace_processors([OpenInferenceTracingProcessor(tracer)])
Prerequisites: Arize Phoenix account and API key, OpenAI API key, Restate installed.Get the example:
restate example python-openai-agents-examples && cd python-openai-agents-examples/arize_phoenix
Add your API keys to an .env file:
echo 'OPENAI_API_KEY=sk-proj-...' > .env
echo 'PHOENIX_COLLECTOR_ENDPOINT=https://app.phoenix.arize.com/s/your-account-name' >> .env
echo 'PHOENIX_API_KEY=...' >> .env
echo 'PHOENIX_PROJECT_NAME=...' >> .env
Start the agent service:
uv run --env-file .env .
Start Restate:
source .env
export RESTATE_TRACING_HEADERS__AUTHORIZATION="Bearer ${PHOENIX_API_KEY}"
restate-server --tracing-endpoint otlp+https://app.phoenix.arize.com/s/your-account-name/v1/traces
Replace your-account-name with the name of your Phoenix account.Go to the Restate UI at http://localhost:9070, register the service at http://localhost:9080, click on the handler to go to the playground, and send the default request.
Other Agent SDKsThis example uses the OpenAI Agents SDK in combination with Restate and Arize Phoenix. You can use any other AI agent framework, in a similar way by swapping out the OpenInference library for the one for your framework. Visit the Arize Phoenix Integration docs for more details. If you get stuck, please reach out to us via Discord or Slack.

What you see in Arize Phoenix

Once you send a request, you can inspect the trace in Arize Phoenix. You see the agentic steps (LLM calls, tool invocations) alongside regular workflow steps (e.g. currency conversion, reimbursement), with inputs, outputs, model configuration, and token usage for each LLM call. Restate manages the execution, starts the parent span, and exports the full journal as OpenTelemetry traces. The AI-specific spans and metadata get attached under Restate’s parent span.
Arize Phoenix trace
Restate’s Tracer Provider flattens the Arize Phoenix spans to make them appear consistently structured with the Restate spans in the UI. We are working on a next iteration of the integration which will respect the Arize Phoenix span nesting and puts the Restate spans at the right depths inside them.