Skip to Content

How do I move my production and staging environments from Traceloop to Rius?

Rius maps a Traceloop project and environment to an agent named by service.name, and you give production and staging each their own Rius workspace and API key. Then you re-point OpenLLMetry in each environment at Rius by changing the base URL and the auth header. Your decorators and instrumentation stay as they are, and you can run both backends side by side while you compare.

How it works

Traceloop’s SDK is OpenLLMetry, which is plain OpenTelemetry and exports OTLP to whichever endpoint you give it. Moving an environment is a settings change, not a re-instrumentation. This is how the concepts line up:

  • Project and environment become an agent. Rius groups traces by agent, named by service.name. The app_name (Python) or appName (TypeScript) you pass to Traceloop becomes that service.name.
  • Production versus staging becomes one workspace per environment. Each trace belongs to the workspace its API key points to, so a staging key keeps staging traces apart from production traces.
  • Decorators carry over. @workflow and @task show as generic CHAIN steps, @agent as an agent span and @tool as a tool span.
  • Conversations become sessions. OpenLLMetry writes gen_ai.conversation.id, which Rius reads as the session.
  • Association properties such as user_id and chat_id arrive as span attributes under traceloop.association.properties.*. You can inspect and filter on them, but Rius does not read them as users or sessions.

The full concept table is in Migrate from Traceloop to Rius, and the wider picture is in Migrate to Rius.

Set it up

  1. Create a workspace and an ingest API key for each environment. Make one for production and one for staging, and keep the two keys separate in your secrets store.

  2. Change the exporter settings in staging first. Set the Rius base URL and an Authorization header that carries the staging key, and turn off OpenLLMetry metrics in Python, because Rius ingests traces only:

    # Before: Traceloop export TRACELOOP_API_KEY="<your Traceloop API key>" # After: Rius export TRACELOOP_BASE_URL="https://ingest.eu.console.rius-glassflow.com" export TRACELOOP_HEADERS="Authorization=Bearer%20<your Rius API key>" export TRACELOOP_METRICS_ENABLED="false" # Python SDK only, see below
  3. Remove TRACELOOP_API_KEY from the deployment. The Rius header replaces it. In Python, TRACELOOP_BASE_URL and TRACELOOP_HEADERS override the arguments you pass to Traceloop.init(), so clear old values in every environment. In TypeScript the init arguments win instead.

  4. Use an http or https base URL. OpenLLMetry uses OTLP/HTTP for those URLs and gRPC otherwise, and Rius accepts OTLP/HTTP only.

  5. Verify one traced request in staging. Check that the trace tree shows your workflow, agent and tool spans, that the generation shows the model and token counts, that cost appears, and that traces with a conversation id share a session.

  6. Repeat in production with the production key. To compare before you commit, route OpenLLMetry through an OpenTelemetry Collector and export to both Traceloop and Rius, or re-point one service while the rest still report to Traceloop.

  7. Set user.id if you want users. OpenLLMetry does not set it, so add it inside your outermost decorated function:

    from opentelemetry import trace trace.get_current_span().set_attribute("user.id", user_id)

If your code calls get_prompt(), guardrails, feedback, datasets or experiments in Python, re-pointing the base URL stops them working. Keep OpenLLMetry pointed at Traceloop and add Rius through the Collector fan-out instead. The Traceloop migration guide has the Collector config and the optional move to the Rius SDK.

What you get

  • Production and staging traces stay separate, each in its own workspace.
  • Your existing OpenLLMetry spans keep their structure. Agents and tools show as such, and LLM calls show as generations with model, tokens and cost computed by Rius.
  • Cost is a list-price estimate in US dollars, so you do not send a cost value.
  • Conversations group into sessions, and users appear once you set user.id.
  • A safe cutover. You can send the same traces to both backends and switch only when Rius shows what you need.

Some things have no counterpart in Rius: Traceloop monitors and evaluators, guardrails, the prompt registry and playgrounds, datasets and experiments, user feedback and annotations, Traceloop Hub, and self-hosting. Rius is a managed service only. Existing traces stay in Traceloop, and Rius starts from the first span you send it.

When something else fits

  • If you rely on evaluators, guardrails, prompt management, datasets or experiments, keep Traceloop for those pieces and send traces to both through a Collector instead of cutting over fully.
  • If you want Rius-native session and user scopes, privacy controls or partial spans, swap OpenLLMetry for the Rius SDK. Remove OpenLLMetry in the same process, because running both duplicates LLM spans.

Still stuck? Get help

Last updated on