Skip to Content
Rius

How do I move my sessions from Langfuse to Rius?

Rius groups traces into sessions the way Langfuse does, so you carry sessions over by setting session.id on your spans, or by wrapping your code in rius.session in the Rius SDK. Sessions are a one-to-one concept, so the change is small. Past sessions stay in Langfuse, and Rius starts from the first span you send it. The full walkthrough is in Migrate from Langfuse to Rius.

How it works

A Langfuse session and a Rius session are the same idea: a group of traces that belong to one conversation or task. Rius groups traces by the session.id attribute. The Langfuse call that sets the session maps to a Rius call like this:

  • In Python, propagate_attributes(session_id=...) becomes with rius.session(session_id):.
  • In TypeScript, you use withSession.
  • For a whole process, you can set RIUS_SESSION_ID instead of calling anything in code.
  • If your own OpenTelemetry instrumentation sets attributes, set session.id on every span of the trace, the root span included.

If you set no session id, each trace is its own session. If you also tag users, the user mapping follows the same pattern: propagate_attributes(user_id=...) becomes with rius.user(user_id):, and the user is stored as user.id.

If you already send OpenTelemetry traces to Langfuse, you can keep your instrumentation and re-point the exporter at Rius. Only the session attribute needs checking. If you use the Langfuse SDK, you swap it for the Rius SDK, which has the same shape: decorators, context managers and a session scope. The migration overview explains how to choose between the two paths.

Set it up

  1. Initialize the Rius SDK once, in place of your Langfuse client. The Langfuse guide covers installation and exporter settings in full.
import rius rius.init(api_key="ri_...", service_name="my-agent")
  1. Replace the Langfuse session scope with the Rius one. Your own session id value stays the same, so a conversation keeps one id across both tools.
# Langfuse with propagate_attributes(session_id=session_id): handle(query)
# Rius with rius.session(session_id): handle(query)
  1. In TypeScript, wrap the same code with withSession instead.
  2. If a whole process is one session, such as a single batch job, skip the code change and set the id in the environment:
export RIUS_SESSION_ID=my-session-id
  1. If you keep your OpenTelemetry instrumentation and only re-point the exporter, make sure session.id is on every span of each trace, the root span included. Rius reads session.id per span, and a span without it falls back to gen_ai.conversation.id, then to its trace id.
  2. During evaluation, send the same traces to both backends. Add Rius as a second exporter in your Collector, or run the swapped SDK in one service while the others still report to Langfuse. Open one conversation in both tools and check that the same traces appear under one session before you cut over.
  3. Once nothing depends on Langfuse, remove its exporter or SDK and revoke its keys.

What you get

  • Your traces grouped by session, so a multi-turn conversation or a long task reads as one unit.
  • Session grouping alongside server-side cost, computed by Rius from the model and token counts on each span. Your code never sends a cost value.
  • Users mapped the same way, with each user’s cost, failures and traces on the Users page.
  • A clean start: Rius begins at the first span you send, with no old and new data mixed under one id.

Some Langfuse features have no counterpart in Rius. Scores and annotation queues, LLM-as-judge evals, datasets and experiment runs, and prompt management are not available. If you attach scores to sessions today, keep that workflow in Langfuse and send your traces to both tools. Existing Langfuse sessions are not imported, so they stay readable there. Rius is a managed service only, and it cannot be self-hosted.

When something else fits

  • If your work with sessions depends on scores, evals, datasets or prompt management, keep Langfuse for those and use Rius alongside it for tracing and cost.
  • If you need your old sessions in the new tool, Rius cannot import them, so plan to keep Langfuse read-only for history.

Still stuck? Get help

Last updated on