What does the service.name attribute mean in Rius?
In Rius, service.name is the resource attribute that names your service, and every trace view and filter groups by it. You set it once per process, and Rius also uses it as the agent name when nothing more specific is set. Always set it, because a missing value falls back to the placeholder unknown_service.
How it works
- What it holds. The name of the service that produced the spans, for example
my-agent. It is an OpenTelemetry resource attribute, so you set it once for the process instead of on each span. - What Rius does with it. Trace views and filters group by
service.name. It is the first thing to check when you cannot find traces: traces from different services sit under different names. - Agent name fallback. Rius files a span under the first of these that is set and is not a placeholder such as
unknown_service: the resourcegen_ai.main_agent.name, the resourcerius.main_agent.name, the resourcegen_ai.agent.name, the span’sgen_ai.agent.name, and finallyservice.name. If you set none of the agent keys, your service name is the agent name on the Agents page. - SDK default for the agent name. In the Rius SDKs, the agent name setting
RIUS_AGENT_NAMEdefaults to the service name. - Default value. When you set nothing, the SDKs send
unknown_service. Rius treats that as a placeholder, so it does not make a useful agent name. - Related resource attributes.
service.versionrecords the build or release the process runs.service.instance.ididentifies the process that produced the span, and the SDKs send the same id in their heartbeats, which joins traces to the Agents view. Together they separate versions and instances of one service without changing its name.
The full list of attributes Rius reads is on the span attribute reference.
Set it up
- Pick a stable, readable name for each service or agent, such as
support-agentorbilling-worker. Keep it the same across deployments so traces from every release land in one group. Put the release inservice.version, not in the name. - If you use the Rius SDK, pass the name to
init. The Python SDK takesservice_name, and the TypeScript SDK takesserviceName.
import rius
client = rius.init(
api_key="ri_...",
service_name="my-agent",
)- Or set it from the environment, which the SDKs read as
RIUS_SERVICE_NAME:
export RIUS_SERVICE_NAME=my-agent- If you send spans from a vanilla OpenTelemetry SDK, a collector or another language, set
service.nameas a resource attribute in your own exporter setup. The attribute reference lists it with the other resource attributes, and Trace LLM calls with OpenTelemetry walks through the senders. - If you want the Agents page to show a different name from the service, set
RIUS_AGENT_NAMEin the SDK. Without the SDK, setgen_ai.main_agent.nameas a resource attribute. Either one takes priority overservice.namefor the agent name. - Send a trace and check that the name you chose appears in the trace list filter.
What you get
- Trace views and filters that group by the service name you chose.
- An agent entry on the Agents page named after your service when you set no other agent name.
- A clear way to separate services: one
service.nameper service, withservice.versionandservice.instance.idtelling releases and processes apart inside it. - Spans from SDK and non-SDK senders that group together, as long as they use the same
service.name.
When something else fits
- If one service runs several differently named agents, set the agent name separately with
RIUS_AGENT_NAMEorgen_ai.main_agent.name, so the Agents page shows each agent and not one service name. - If you want to group traces by conversation or by end user, use
session.idoruser.id. They are separate attributes, andservice.namedoes not replace them.
Related
Still stuck? Get help
Last updated on