What does the gen_ai.usage.reasoning.output_tokens attribute mean in Rius?
In Rius, gen_ai.usage.reasoning.output_tokens is an integer on a model-call span that holds the reasoning tokens in that call. Those tokens are a subset of the span’s output token count, not an extra amount on top of it. You set it next to gen_ai.usage.output_tokens, and Rius stores it under that key.
Rius computes cost on its own from the request model and the token counts, so you never send a cost value. The Span attribute reference lists the key with the other usage counts.
How it works
- What the key holds. A whole number of reasoning tokens for one model call, such as the tokens a reasoning model spends thinking before it answers.
- A subset, not an addition.
gen_ai.usage.output_tokensalready includes the reasoning tokens. If a call has 900 output tokens and 600 of them are reasoning, you send 900 and 600. Do not add 600 to the output count. - Which spans carry it. The span for a model call, next to
gen_ai.request.model,gen_ai.usage.input_tokensandgen_ai.usage.output_tokens. The cache counts,gen_ai.usage.cache_read.input_tokensandgen_ai.usage.cache_write.input_tokens, are subsets of the input count in the same way. A span that is not a model call has no tokens to report. - Cost. Rius prices a span from
gen_ai.request.modeland the input, output, cache read and cache write counts, each at its own rate. Reasoning tokens are already inside the output count, so you never send a cost attribute. A span with no model, a model the price catalog does not know, or none of the counts gets no cost. Costs are list-price estimates in US dollars. - Older names. Pydantic AI reports usage details under
gen_ai.usage.details.reasoning_tokens,thinking_tokensorthoughts_tokens, and OpenInference reports reasoning as a detail ofllm.token_count.*. Rius moves those values ontogen_ai.usage.reasoning.output_tokenswhen it ingests the span and removes the source keys. A nativegen_ai.*key always wins, because normalization fills gaps and never overwrites. - Searching. Filter on
gen_ai.usage.reasoning.output_tokens, the key the value is stored under. A filter on the Pydantic AI source name matches nothing. - Who defines it. It is an OpenTelemetry GenAI convention key, listed in the registry.
Set it up
- Send the reasoning count only when your provider or instrumentation reports it. A span with no reasoning count is still a valid model-call span, and Rius reads any usage count a span leaves out as 0 for cost.
- Put the reasoning count on the same span as the request model and the output count, and keep it at or below the output count. A call with 1,200 prompt tokens, 900 output tokens and 600 reasoning tokens carries these attributes. The values are examples, so use your own model name and counts:
{
"gen_ai.request.model": "your-model-name",
"gen_ai.usage.input_tokens": 1200,
"gen_ai.usage.output_tokens": 900,
"gen_ai.usage.reasoning.output_tokens": 600
}- If you emit spans without the Rius SDK, the Span attribute reference shows where to send them (
https://ingest.eu.console.rius-glassflow.com/v1/traces, over OTLP/HTTP with an API key as a Bearer header) and which other attributes to set. For the full tracing setup, see Trace LLM calls with OpenTelemetry. - If you use Pydantic AI, send nothing extra. Rius normalizes its
gen_ai.usage.details.reasoning_tokensvalue at ingest.
What you get
- A reasoning token count stored on the model-call span, under one key, whenever the sender supplies a reasoning count in a form Rius reads.
- Output and reasoning counts that stay consistent, because reasoning is a subset of output and is never double counted in the output total.
- Cost from the model and the input, output and cache counts. The reasoning tokens are already part of the output count, so nothing extra is needed.
- Reasoning tokens as a measure in custom alert rules, next to input and output tokens. Tokens sit on model-call spans, so filter such a rule by Model, or by Span kind LLM, to measure them.
- One search key. Pydantic AI usage details are moved to
gen_ai.usage.reasoning.output_tokens, so a single filter covers them.
When something else fits
- If your provider does not report reasoning tokens, there is nothing to set. The output count still drives cost.
- If you only need the total completion size, send
gen_ai.usage.output_tokensand skip the reasoning key. - If you are sending spans from another convention, such as OpenInference or OpenLLMetry, the Span attribute reference shows how each is normalized to the keys Rius searches.
Related
Last updated on