Skip to Content

What does the gen_ai.response.id attribute mean in Rius?

In Rius, gen_ai.response.id is a string attribute that holds the provider’s completion id for a model call. Rius stores it on the span exactly as you send it, so you can match a span to the response the provider returned. Rius does not use it to compute cost or to classify the span.

How it works

  • What it holds: the provider’s completion id, a string. It sits in the LLM analytics group of attributes, next to gen_ai.provider.name and gen_ai.response.model, which describe the provider and the model that answered.
  • Which spans carry it: the span for a model call. Agent, tool and retrieval spans describe other work, so they have no completion id to report.
  • What Rius does with it: it stores the value as sent. Rius does not move it to another key or rewrite it. To find a span by its completion id, search and filter on gen_ai.response.id.
  • What Rius does not compute from it: cost comes from gen_ai.request.model plus the gen_ai.usage.* token counts. The span kind comes from openinference.span.kind or gen_ai.operation.name. The response id plays no part in either.
  • Older names: send it under its own name. Rius lists no older spelling for this key.

The key comes from the OpenTelemetry GenAI conventions, which define it as “the unique identifier for the completion”, a string such as chatcmpl-123, at Development stability. Rius reads it as the conventions define it. Its registry entry links to the upstream definition. The id is metadata, not content, so it stays on the span when content capture is off.

Set it up

  1. Send traces to Rius over OTLP/HTTP at https://ingest.eu.console.rius-glassflow.com/v1/traces with your API key in an Authorization Bearer header. The attribute reference has the full contract and the status codes. If you trace with an OpenTelemetry SDK, a collector or another language, the Trace LLM calls with OpenTelemetry guide covers each sender.
  2. On the span for each model call, set the completion id from the provider’s response. Use the id the provider gives you, not one you generate. The span below shows the attributes of one model call, with example values in place of your own:
{ "gen_ai.operation.name": "chat", "gen_ai.provider.name": "openai", "gen_ai.request.model": "gpt-4o", "gen_ai.response.model": "gpt-4o", "gen_ai.response.id": "chatcmpl-abc123", "gen_ai.usage.input_tokens": 120, "gen_ai.usage.output_tokens": 45 }
  1. Keep sending the model name and token counts too. Those are what Rius prices. Never send a cost attribute, because Rius computes cost on its side.
  2. Check a span in the trace view. The attribute is stored under gen_ai.response.id, so a search on that key finds it.

What you get

  • A completion id stored on each model-call span, as you sent it, so you can tie a Rius span to the provider’s response.
  • A key you can search and filter on in trace inspection, with no renaming step.
  • No effect on the analytics around it. Cost, token totals, time to first token and the LLM call count work the same with or without the id. A span with the request model and token counts is priced either way.
  • Spans from the same trace still group by session.id and user.id. The response id does not group anything, because each completion has its own id.

When something else fits

  • To group several calls into one conversation, use session.id, or gen_ai.conversation.id when you follow the GenAI conventions. A response id identifies a single completion, not a conversation.
  • To tie a tool execution to the model call that requested it, use gen_ai.tool.call.id on the execute_tool span. That key holds the id of the model’s tool call, not the completion id.

Still stuck? Get help

Last updated on