Skip to Content

How does Rius read OpenLLMetry conversation id attributes?

Rius groups OpenLLMetry traces into a session from session.id, or from gen_ai.conversation.id when session.id is absent. The platform reads both keys as sent, with no renaming. A span with neither is grouped by its trace id, so each trace is its own session.

How it works

Rius has two session keys, and it reads them on each span:

  • session.id is the first choice. It groups the traces of one session, such as a conversation or an agent run.
  • gen_ai.conversation.id is the OpenTelemetry GenAI conventions’ session key. Rius reads it as the session when session.id is absent, so spans that follow those conventions group into sessions without session.id.
  • With neither key, the span falls back to its trace id.

The platform reads the session per span, not per trace. Put the key on every span of the trace, not only the root.

OpenLLMetry traces go through Rius’s OpenLLMetry normalization at ingest. It maps these inputs onto Rius’s canonical keys:

  • traceloop.span.kind and llm.request.type become the span taxonomy.
  • traceloop.entity.* becomes the tool or agent name, and traceloop.entity.input and output become input.value and output.value.
  • The older usage spellings, gen_ai.usage.prompt_tokens and completion_tokens, move to their current keys.
  • The older flattened gen_ai.prompt.* and gen_ai.completion.* messages are reassembled into the GenAI message shape.

This mapping does not rename any key into a session or conversation key. OpenLLMetry’s @conversation, set_conversation_id() and withConversation() write gen_ai.conversation.id directly, so they group sessions with no mapping. OpenLLMetry’s association properties, such as traceloop.association.properties.session_id, are not read as the session. Native gen_ai.* keys always win over normalized ones, and normalization only fills gaps. An attribute under any other name is stored as sent, and it does not group traces into a session.

The full mapping is in the span attribute reference, and the sender setup is on the OpenLLMetry page.

Set it up

  1. Point OpenLLMetry’s exporter at Rius. This is the only setup step, and the OpenLLMetry page covers it in full.
from traceloop.sdk import Traceloop Traceloop.init( app_name="my-agent", api_endpoint="https://ingest.eu.console.rius-glassflow.com", headers={"Authorization": "Bearer <your API key>"}, )
  1. Make sure each span of a conversation carries the same value under session.id or gen_ai.conversation.id. OpenLLMetry’s conversation helpers do this for you; How do I group spans into sessions with OpenLLMetry? walks through them. Set the id before the root span starts, because the trace list shows each trace under the session of its root span.
  2. Run one traced call, then open the trace in the console. Check that the span shows a model name and token counts, and that the trace appears under the session you expect.
  3. When you search or filter in trace inspection, use the stored key. Use gen_ai.usage.input_tokens rather than gen_ai.usage.prompt_tokens, and session.id or gen_ai.conversation.id as you sent them.

For the wider picture of sender paths, see Trace LLM calls with OpenTelemetry. The interoperability overview lists the other ways to send traces.

What you get

  • Traces from one conversation group into a single session, so you can follow a multi-turn exchange across traces.
  • OpenLLMetry’s older and newer attribute spellings land on the same canonical keys. Model, token and cost analytics work across versions.
  • Spans with no session key still show up. Each trace stands as its own session instead of being dropped.
  • Searches use one stable set of keys. You filter on gen_ai.conversation.id or session.id as sent, and on canonical keys for everything Rius normalizes.

When something else fits

  • If your app keeps its conversation id under another attribute name, copy that value into session.id or gen_ai.conversation.id before export. OpenLLMetry association properties are not mapped to sessions.
  • If you use the Rius SDK instead of an OpenLLMetry exporter, its session scopes (rius.session in Python, withSession in TypeScript) stamp session.id for you.

Still stuck? Get help

Last updated on