Skip to Content

What does the gen_ai.operation.name attribute mean in Rius?

Rius reads gen_ai.operation.name as the type of step a span records, using the OpenTelemetry GenAI operation taxonomy, with values such as chat, execute_tool, invoke_agent and retrieval. Rius uses it to classify the span in trace views and to count LLM calls. Set it, or set openinference.span.kind, and Rius derives the other one for you.

How it works

The attribute holds one operation name per span. The values Rius lists are chat, text_completion, generate_content, embeddings, execute_tool, invoke_agent, create_agent, retrieval, invoke_workflow and plan. The attribute reference lists more values after these.

Rius pairs each operation with a span kind, the classification shown in trace views and used by per-kind analytics:

  • chat, text_completion and generate_content are LLM.
  • invoke_agent and create_agent are AGENT.
  • execute_tool is TOOL.
  • embeddings is EMBEDDING.
  • retrieval is RETRIEVER.
  • invoke_workflow and plan are CHAIN.

The pairing works both ways. A span with only openinference.span.kind gets its operation derived, and a span with only gen_ai.operation.name gets its kind derived. The exception is CHAIN: a generic step has no operation in the GenAI conventions, so a CHAIN span gets none. The Rius SDKs set both attributes on every span they emit.

The operation also decides what counts as an LLM call in the console and in alerts. A span is an LLM call when its kind is LLM, set directly or derived from chat, text_completion or generate_content. A span with neither a kind nor an operation counts when it carries gen_ai.request.model. Agent, tool and retrieval spans are not LLM calls even when they carry a model. Embedding calls are not either, but their cost still appears in the per-model breakdown and the cost totals.

The operation also tells you which companion attributes belong on the span:

  • invoke_agent spans carry gen_ai.agent.name, the agent being invoked.
  • execute_tool spans carry gen_ai.tool.name, gen_ai.tool.call.id and gen_ai.tool.type. A tool called over MCP is an execute_tool span that also carries mcp.method.name.
  • retrieval spans carry gen_ai.data_source.id.

For reranking steps, the SDKs send OpenInference’s RERANKER kind with the rerank operation. Rius has no reranker category yet, so such a span shows as LLM when it carries gen_ai.request.model, and as Other when it does not.

Producers that do not send gen_ai.operation.name are still classified. Rius maps their own keys into the same taxonomy at ingest: OpenInference’s span kind, OpenLLMetry’s Traceloop decorator kinds and llm.request.type, Laminar’s lmnr.span.type, and the Vercel AI SDK’s ai.operationId. Native gen_ai.* keys always win over these mapped values. Upstream gen_ai.* keys, gen_ai.operation.name among them, are listed on the upstream registry page.

Set it up

  1. With the Rius SDKs, do nothing. They set gen_ai.operation.name and the span kind for you. The Trace LLM calls with OpenTelemetry guide covers the SDK-free paths.
  2. If you emit spans from a plain OpenTelemetry SDK or a collector pipeline, set gen_ai.operation.name on each span to the value that matches the step. Use chat for a model call, execute_tool for a tool, invoke_agent for an agent and retrieval for a lookup.
  3. Name each span the way the GenAI conventions ask, the operation followed by what it acted on: chat gpt-4o, execute_tool get_weather, invoke_agent planner, retrieval product-kb. Rius does not require it, but the SDKs emit it, so mixed fleets read alike.
  4. Add the companion attributes from the list above for each operation. For chat spans, add gen_ai.request.model and the gen_ai.usage.* token counts. Rius computes cost from them, so never send a cost attribute.
  5. Send the spans to the ingest endpoint over OTLP/HTTP:
POST https://ingest.eu.console.rius-glassflow.com/v1/traces Authorization: Bearer <your API key> Content-Type: application/x-protobuf
  1. Open the trace in the console and check the kind on each span. A span you expected to be an LLM call that shows as Other has neither a recognized operation nor a request model.

What you get

  • Each span appears in trace views under the right kind (LLM, agent, tool, retriever, embedding or chain), so the kind filters and per-kind analytics work for spans you emit yourself.
  • LLM calls are counted consistently in the console and in alerts, because the operation decides what counts as an inference call.
  • You can send either the operation or the OpenInference kind and still get both, so one attribute is enough.
  • Spans from OpenInference, OpenLLMetry, Laminar and the Vercel AI SDK land in the same taxonomy without you renaming anything.

When something else fits

  • If your instrumentation already sends openinference.span.kind and you cannot change it, leave it. Rius derives the operation from it.
  • If a step is a generic piece of glue code, CHAIN is the right kind and it carries no operation by design.
  • For the full list of attributes to set, see the attribute reference.

Still stuck? Get help

Last updated on