How do I switch from Arize Phoenix to Rius for tracing the Anthropic API?
To switch from Arize Phoenix to Rius for the Anthropic API, install the Rius Anthropic extra and call rius.init(), and each messages.create call is traced with model, tokens and cost. Rius reads the same OpenInference spans Phoenix does, so your Anthropic call sites do not change. The migration replaces the Phoenix registration with the Rius integration, and you can run both side by side before you cut over.
How it works
Rius reads OpenInference spans, and the Rius SDK bundles the same OpenInference instrumentation for Anthropic. Switching is therefore a routing change, not a re-instrumentation. The overall approach is in Migrate to Rius, and the full Phoenix walkthrough is in Migrate from Arize Phoenix.
- One call replaces the Phoenix setup.
rius.init()turns on every installed integration, so Anthropic is traced without an instrumentor call or anauto_instrumentflag. It is one of the libraries listed on the Integrations page. - Your Phoenix project becomes an agent. Rius groups traces by agent name, which defaults to
service.name. The Phoenix project attribute is stored but does not drive grouping, so set a service name. - Sessions and users keep their meaning. Phoenix
using_sessionandusing_usermap torius.sessionandrius.user, which stamp every span in scope, the root span included. - A smaller diff is also possible. You can keep
phoenix.otel.register()and re-point it at Rius by passing the Rius traces URL,protocol="http/protobuf", your key and aservice.name. The Phoenix guide shows that path.
Set it up
-
Install the Anthropic integration. The extra installs the instrumentation, not
anthropicitself, so a project that already calls Anthropic keeps its version. Ifanthropicis missing,init()logs aDependencyConflictand the integration stays off. Uninstallarize-phoenix-otelonce nothing else uses it.pip install "glassflow-rius[anthropic]" anthropic -
Replace the Phoenix registration with
rius.init(), andusing_sessionwithrius.session. Use your Rius API key, which starts withri_, or setRIUS_API_KEY.# Before from phoenix.otel import register from openinference.instrumentation import using_session register(project_name="my-agent", auto_instrument=True) with using_session(conversation_id): run_agent(message)# After import rius from anthropic import Anthropic rius.init(api_key="ri_...", service_name="my-agent") client = Anthropic() # use the client exactly as before with rius.session(conversation_id): run_agent(message) -
If you trace from TypeScript, install the Anthropic instrumentation package, version 0.2.7 or newer, and call
init(). Awaitreadyto see which integrations attached. In a CommonJS app, require@anthropic-ai/sdkbeforeinit(). In a short script, awaitrius.shutdown()before the process exits so queued spans are exported.npm install @arizeai/openinference-instrumentation-anthropicimport { init } from '@glassflow-ai/rius' import Anthropic from '@anthropic-ai/sdk' const rius = init({ apiKey: 'ri_...', serviceName: 'my-agent' }) console.log(await rius.ready) // should include anthropic const client = new Anthropic() // use the client exactly as before -
To evaluate before you switch, do this in place of steps 1 and 2: keep
register()pointed at Phoenix as today, keeparize-phoenix-otelinstalled, and add Rius as a second span processor withreplace_default_processor=False. Without that flag, the provider drops its Phoenix exporter. The Phoenix guide has the full example. Make the swap torius.init()once you have compared both backends. -
Make one Anthropic call and open the trace in the console. Check the model, token counts and cost. The Anthropic integration page covers setup details and blind spots.
What you get
- One span per call. Each
messages.createcall becomes an LLM-kind span with the model, such asclaude-haiku-4-5-20251001, input and output tokens including cache reads and writes, and the request and response messages. Rius reads it as a generation, so it gets model, token and cost analytics. - Cost computed for you. Rius computes cost server-side from the model and token counts. You never send a cost. Costs are list-price estimates in US dollars, and a model Rius does not know gets an empty cost, not zero.
- Readable messages. Text blocks become text parts and tool calls become
tool_callparts. The system prompt, which Anthropic takes as a separate parameter, appears as the leading system message. - Error types. A failed call records
error.typeas the error class, for exampleanthropic.NotFoundError. - Streamed calls with usage. Token usage is captured on streams. Time to first token is not available for auto-instrumented Anthropic streams.
- Live process view. With the Rius SDK you also see which agent processes are alive.
When something else fits
- Rius has no evals, datasets, experiments, prompt management or annotations. If your workflow depends on them, keep that part in your current tool and run both side by side instead of cutting over completely.
- Rius prices calls at public list prices and has no custom model prices. Existing Phoenix traces stay where they are, because Rius cannot import historical data and starts from the first span you send.
- If you want the smallest diff, keep your OpenInference setup and only re-point the exporter at Rius. Choose
rius.init()when you want the Rius SDK defaults, session and user scopes, and the live process view.