Skip to Content

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 an auto_instrument flag. 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_session and using_user map to rius.session and rius.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 a service.name. The Phoenix guide shows that path.

Set it up

  1. Install the Anthropic integration. The extra installs the instrumentation, not anthropic itself, so a project that already calls Anthropic keeps its version. If anthropic is missing, init() logs a DependencyConflict and the integration stays off. Uninstall arize-phoenix-otel once nothing else uses it.

    pip install "glassflow-rius[anthropic]" anthropic
  2. Replace the Phoenix registration with rius.init(), and using_session with rius.session. Use your Rius API key, which starts with ri_, or set RIUS_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)
  3. If you trace from TypeScript, install the Anthropic instrumentation package, version 0.2.7 or newer, and call init(). Await ready to see which integrations attached. In a CommonJS app, require @anthropic-ai/sdk before init(). In a short script, await rius.shutdown() before the process exits so queued spans are exported.

    npm install @arizeai/openinference-instrumentation-anthropic
    import { 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
  4. To evaluate before you switch, do this in place of steps 1 and 2: keep register() pointed at Phoenix as today, keep arize-phoenix-otel installed, and add Rius as a second span processor with replace_default_processor=False. Without that flag, the provider drops its Phoenix exporter. The Phoenix guide has the full example. Make the swap to rius.init() once you have compared both backends.

  5. 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.create call becomes an LLM-kind span with the model, such as claude-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_call parts. The system prompt, which Anthropic takes as a separate parameter, appears as the leading system message.
  • Error types. A failed call records error.type as the error class, for example anthropic.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.

Still stuck? Get help

Last updated on