What does the gen_ai.tool.name attribute mean in Rius?
In Rius, gen_ai.tool.name holds the tool’s own name, such as get_weather, and it is set on execute_tool spans, the spans that record a tool running. It is never the span name. Rius reads it, together with the tool call id and tool type, to tell you which tool a span ran.
How it works
- What it holds. The tool’s own name, for example
get_weatherorcalculator. The OpenTelemetry GenAI conventions define it, at Development stability, as the name of the tool used by the agent. Its registry entry links to the upstream definition. The span name is a separate thing: by the GenAI naming convention a tool span is calledexecute_tool get_weather, and the attribute carries onlyget_weather. - Which spans carry it. Spans for tool executions, the ones whose
gen_ai.operation.nameisexecute_toolor whoseopeninference.span.kindisTOOL. Set either one and Rius derives the other. Model-call spans do not carry it. They carrygen_ai.tool.definitionsinstead, the tool definitions the model was shown. - Attributes that sit beside it.
gen_ai.tool.call.idis the id of the model’s tool call that this execution answers.gen_ai.tool.typeis a value such asfunction,extensionordatastore. On anexecute_toolspan,gen_ai.agent.nameis the agent executing the tool. - MCP tools. A tool called over the Model Context Protocol is an
execute_toolspan like any other, withmcp.method.nameset totools/call. Rius uses that attribute to tell MCP tools from local ones when it reports how many context tokens MCP tools took. - Tool arguments and results. The arguments and result of a tool call arrive as
gen_ai.tool.call.argumentsandgen_ai.tool.call.result. Rius moves them toinput.valueandoutput.value, so you search on those two keys. - Other conventions. For OpenLLMetry (Traceloop) spans, Rius turns the decorated entity’s name into the tool name at ingest. If you send spans from OpenLLMetry, you do not need to set the attribute yourself. Native
gen_ai.*keys always win, and normalization only fills gaps. - No cost from it. Cost comes from the request model and the token counts on model-call spans, not from tool attributes. Never send a cost attribute.
Set it up
- Send spans to Rius over OTLP/HTTP with your API key. The full contract is on the span attribute reference.
POST https://ingest.eu.console.rius-glassflow.com/v1/traces
Authorization: Bearer <your API key>
Content-Type: application/x-protobuf- For each tool execution, create a span and set
gen_ai.operation.nametoexecute_tool. Alternatively setopeninference.span.kindtoTOOL. Rius derives the other attribute. - Set
gen_ai.tool.nameto the tool’s own name, and name the span the way the conventions ask, the operation followed by the tool:execute_tool get_weather. - Add
gen_ai.tool.call.idwith the id from the model’s tool call, andgen_ai.tool.typeif you know it. - If the tool runs over MCP, also set
mcp.method.nametotools/call. - In the model-call span that requested the tool, put the tool call in
gen_ai.output.messagesas atool_callpart. The part’snameandidlive inside that JSON message. They are not span attributes, and the latertool_call_responsepart refers back to the sameid:
[
{
"role": "assistant",
"parts": [
{"type": "tool_call", "id": "call_1", "name": "calculator", "arguments": "{\"expr\": \"2+2\"}"}
]
},
{
"role": "tool",
"parts": [{"type": "tool_call_response", "id": "call_1", "response": "4"}]
}
]For a full walkthrough of sending traces from any OpenTelemetry source, see Trace LLM calls with OpenTelemetry.
What you get
- Tool spans that are identified by the tool’s own name, separate from the span name, so you can search and read them consistently.
- A link between each tool execution and the model’s tool call it answers, through
gen_ai.tool.call.id. - Tool spans classified as
TOOLin trace views, so the kind filters pick them up. - Tool input and output rendered like any other span’s, because the arguments and result are moved to
input.valueandoutput.value. - For MCP tools, a report of how many context tokens they took and their share of the total, when at least one span in the trace carries
mcp.method.name. Without it the MCP share is unknown, not zero.
When something else fits
- If your tool spans come from OpenLLMetry or another supported convention, you can send them as they are, since Rius normalizes them at ingest.
- If you want to know what a model was offered rather than what ran, read
gen_ai.tool.definitionson the model-call span, notgen_ai.tool.name.
Related
Last updated on