I trace LangChain with Langfuse. How do I switch to Rius?
Rius traces LangChain through its own integration, so you replace the Langfuse setup with one call to rius.init() and run your chains exactly as before. In Python you install one extra, and in TypeScript one instrumentation package. If your LangChain traces already leave through an OpenTelemetry exporter, you can instead re-point that exporter at Rius. Either way, you can run Langfuse and Rius side by side until you cut over, as described in Migrate to Rius.
How it works
The Rius LangChain integration hooks LangChain’s callback system. Anything that runs through it is traced: LCEL chains, agents and LangGraph nodes. You do not wrap your chains or add a handler to each call.
Which path you take depends on how Langfuse receives your traces today:
- You use the Langfuse SDK. Swap it for the Rius SDK and the LangChain integration. The Rius SDK has the same shape as Langfuse’s (decorators, context managers, sessions), so the swap is mostly mechanical. You cannot point the Langfuse SDK itself at Rius, because its exporter and auth are Langfuse’s own.
- You send OpenTelemetry to Langfuse. Keep your instrumentation and change only where the exporter sends traces. Langfuse authenticates with Basic auth from a key pair. Rius takes a single API key as a Bearer token over OTLP/HTTP.
The full Langfuse concept mapping and cutover checklist are in Migrate from Langfuse to Rius.
Set it up
-
Create a Rius workspace and API key. Keys start with
ri_. New organizations start on a trial of 30 days or 500,000 spans, whichever comes first, with no card. -
Install the LangChain integration. In Python, the extra installs the instrumentation and not
langchainitself, so the package is named for a fresh environment:
pip install "glassflow-rius[langchain]" langchainIn TypeScript, install the instrumentation package. It also needs @langchain/core, which a LangChain.js application already has, and Node 20 or newer for @langchain/core 1.x:
npm install @arizeai/openinference-instrumentation-langchain- Replace the Langfuse initialization with
init(). Remove the Langfuse client setup and any per-call Langfuse hooks you added, then initialize Rius once at startup. The rest of your chain code stays as it is:
import rius
rius.init(api_key="ri_...", service_name="my-agent")
# build and run your chains exactly as beforeIn TypeScript, init() finds @langchain/core’s callback manager and patches it, so you pass nothing else. await rius.ready resolves with the integrations that attached, so you can check that langchain is among them. See LangChain for both languages.
-
Carry over sessions and users. Replace Langfuse’s
propagate_attributes(session_id=...)withwith rius.session(session_id):, andpropagate_attributes(user_id=...)withwith rius.user(user_id):. In TypeScript, usewithSessionandwithUser. -
Or re-point your exporter. If your LangChain traces already go out as OpenTelemetry, change only the exporter settings:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.eu.console.rius-glassflow.com"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer <your API key>"- Run both while you compare. With OTLP, add Rius as a second exporter in your Collector and both backends see identical spans. With the SDK swap, run the Rius setup in one service while the others still report to Langfuse. When the traces match what you need, remove the Langfuse SDK or exporter and revoke its keys.
What you get
Run one chain that calls a model, then open the trace in the console. You see:
- One span per step, typed by what the step is. Chains are CHAIN spans, tool calls are TOOL spans, retrievers are RETRIEVER spans, and model calls are LLM spans with the model, token usage and messages.
- Nesting that follows your chain structure. The trace reads like your execution graph, including LangGraph nodes.
- Cost on every model call. Rius computes it from the model and token counts, as a list-price estimate in US dollars, so you send no cost value.
- Client detail under the framework span. If you also install a client extra such as
openai, the LangChain chat model span wraps the client library’s span. You get both framework context and client detail, and each model call is counted once in tokens and cost. The LangChain span still shows the run’s total. - Sessions and users. Traces group by session, and each user’s traces, failures and cost appear on the Users page.
Step inputs, outputs and messages are content attributes, so the SDK’s privacy controls apply to the whole tree. One known gap: text-completion models, which are BaseLLM subclasses such as langchain_openai.OpenAI, are still counted twice.
Some Langfuse features have no Rius equivalent: scores, annotation queues, evals, datasets and prompt management. Your existing traces also stay in Langfuse, because Rius starts from the first span you send it. Rius is a managed service only.
When something else fits
- If scores, evals, datasets or prompt management are part of how you work, keep Langfuse for those and send your traces to both tools.
- If you need to import historical traces, or to self-host your observability backend, Rius does not cover that.
- To see how the LangChain integration sits among the others, browse Integrations.