How do I name my agent with OpenLLMetry?
Rius files each OpenLLMetry span under an agent name, and you set that name with the gen_ai.main_agent.name resource attribute. If you set nothing, Rius falls back to other names it finds on the span or resource, ending with service.name. Set the resource attribute when you want a name that does not depend on those fallbacks.
How it works
Rius picks the agent name for a span from the first of these that is set and is not a placeholder such as unknown_service:
- The resource attribute
gen_ai.main_agent.name. - The resource attribute
rius.main_agent.name. It is deprecated, but Rius still reads it, so telemetry that sends only this key keeps its agent name. - The resource attribute
gen_ai.agent.name. - The span’s own
gen_ai.agent.name. service.name.
The Rius SDKs send the main agent attributes for you. An OpenLLMetry setup does not use the Rius SDK, so you add gen_ai.main_agent.name yourself.
OpenLLMetry also contributes a name without any change. When you decorate a function with a Traceloop agent decorator, Rius turns the decorated function’s name into the invoked agent name on that span. That is item 4 in the list, so a resource-level name always wins over it. A span from a tool decorator gets the decorated function’s name as its tool name instead.
The resource attribute names the agent your process runs. The span-level name describes which agent a single step invoked. Use the resource attribute for the name you want on the Agents page and in filters.
Set it up
-
Point OpenLLMetry at Rius if you have not yet. Traceloop uses the
app_namevalue below asservice.name. The OpenLLMetry page covers the exporter 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>"}, ) -
Run one traced call and open the trace in the console. Look at the agent name Rius shows for it.
-
If the name is missing, a placeholder or not the one you want, add
gen_ai.main_agent.nameas a resource attribute.Traceloop.inittakes resource attributes directly. Put the name on the resource, not on individual spans, because the resource attribute is the first one Rius checks.Traceloop.init( app_name="my-agent", api_endpoint="https://ingest.eu.console.rius-glassflow.com", headers={"Authorization": "Bearer <your API key>"}, resource_attributes={"gen_ai.main_agent.name": "my-agent"}, ) -
Optionally add
gen_ai.main_agent.descriptionto say what the agent does. Rius’s own SDKs send the description only alongsidegen_ai.main_agent.id, so keep the two together if you add both. -
Always keep
service.nameset to a real value as well. It is the service every trace view and filter groups by, and it is the last fallback for the agent name. -
Run another traced call and confirm the new name appears on the trace.
The Span attribute reference lists every resource attribute Rius reads, and Trace LLM calls with OpenTelemetry compares the ways to send OpenTelemetry traces to Rius.
What you get
- Traces from OpenLLMetry grouped under one agent name you chose, instead of a placeholder service name.
- A name that stays stable even when your decorated functions have different names, because the resource attribute outranks the span-level name.
- Agent decorator names still available per span, so each step shows which agent it invoked.
- The same model, token and cost analytics as other traces. Rius normalizes OpenLLMetry’s attribute versions onto its standard keys at ingest, and it computes cost itself, so you send no cost value.
When something else fits
- If you use the Rius SDK instead of OpenLLMetry, you do not set these attributes by hand. It sends the main agent attributes from its configuration, and
RIUS_AGENT_NAMEsets the name the agent is grouped under. - If you only need a service-level name and are happy for it to double as the agent name, setting
service.nameto a real value is enough, since Rius falls back to it.