What does the gen_ai.main_agent.id attribute mean in Rius?
In Rius, gen_ai.main_agent.id is a resource attribute holding the stable identifier of the agent your process runs, taken from the OpenTelemetry GenAI conventions. The Rius SDKs set it from your configured main agent id, or from the agent name if you configured no id. Its older name, rius.main_agent.id, is deprecated, and the SDKs send both keys during the deprecation window.
How it works
The key sits on the resource, which describes the process that produced the spans, not on any single span. You set it once per process. It is a stable identifier for the agent that process runs.
What the SDKs send:
- The configured main agent id, which you set with
RIUS_MAIN_AGENT_ID. - Otherwise the agent name.
RIUS_AGENT_NAMEsets that name, and it defaults to the service name. - No
gen_ai.main_agent.*key at all when they have neither.
Two companion keys, gen_ai.main_agent.name and gen_ai.main_agent.description, are sent only alongside the id. RIUS_MAIN_AGENT_DESCRIPTION sets the description.
Rius files a span under an agent by name, not by id. It takes the first of these that is set and is not a placeholder such as unknown_service:
- The resource
gen_ai.main_agent.name - The resource
rius.main_agent.name - The resource
gen_ai.agent.name - The span’s own
gen_ai.agent.name service.name
The older names are deprecated in favor of the gen_ai.main_agent.* keys. rius.main_agent.id is the old form of this key. It carries only an id you configured, never the agent name, so it can be absent when gen_ai.main_agent.id is present. rius.main_agent.description is the old form of the description. rius.main_agent.name is the old form of the name, and Rius still reads it, second after gen_ai.main_agent.name. rius.main_agent.version is not deprecated, because the GenAI conventions have no equivalent. It holds the version of the agent’s definition (prompt, tools, policy), which the Agents page compares.
This key comes from the OpenTelemetry GenAI conventions. Its full definition is in the upstream registry.
Set it up
-
With the Rius SDK, set the id through the environment before the process starts. The values below are your own agent’s:
export RIUS_MAIN_AGENT_ID=support-agent export RIUS_AGENT_NAME=support-agent export RIUS_MAIN_AGENT_VERSION=2026-10-26RIUS_MAIN_AGENT_VERSIONfillsrius.main_agent.version, the version the Agents page compares. The variables are read byrius.init()in Python andinit()in TypeScript. See SDK installation. -
Leave the old keys alone. The SDKs send
rius.main_agent.idnext togen_ai.main_agent.id, so you do not set both. -
Without the SDK, with a vanilla OpenTelemetry SDK or a collector, set
gen_ai.main_agent.idas a resource attribute on your own telemetry. Also setgen_ai.main_agent.name, because that is the key Rius reads first to name your agent. The attribute reference lists every resource attribute Rius reads. For the end-to-end route, see Trace LLM calls with OpenTelemetry. -
Never send a cost attribute with it. Rius computes cost from the model and token counts.
What you get
- A stable identifier for the agent travels with the process’s spans, on the resource, so you do not repeat it per span.
- The id comes with the agent name, and with a description when you set
RIUS_MAIN_AGENT_DESCRIPTION. - Spans are grouped under an agent name by the order above, so telemetry that sends only
rius.main_agent.nameorservice.namestill lands under a sensible agent. - Version comparison on the Agents page uses
rius.main_agent.version, which you set withRIUS_MAIN_AGENT_VERSION. - Telemetry from older SDK releases that sends only the
rius.main_agent.*keys keeps its agent name.
When something else fits
- To identify one invoked agent, such as a hosted agent, use
gen_ai.agent.idandgen_ai.agent.versiononinvoke_agentspans instead of this process-level key. - If you only need a display name for the agent, set
gen_ai.main_agent.nameor rely onservice.name, since Rius groups by name.