Skip to content

genai: define reasoning tokens attribute#3383

Merged
lmolkova merged 1 commit intoopen-telemetry:mainfrom
verdie-g:gen-ai-reasoning-tokens
Apr 27, 2026
Merged

genai: define reasoning tokens attribute#3383
lmolkova merged 1 commit intoopen-telemetry:mainfrom
verdie-g:gen-ai-reasoning-tokens

Conversation

@verdie-g
Copy link
Copy Markdown
Contributor

@verdie-g verdie-g commented Feb 3, 2026

Fixes #3194

Changes

This PR adds a new GenAI attribute to represent reasoning tokens: gen_ai.usage.reasoning.output_tokens.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@verdie-g verdie-g requested review from a team as code owners February 3, 2026 15:14
@github-actions github-actions Bot added enhancement New feature or request area:gen-ai labels Feb 3, 2026
@lmolkova lmolkova moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Feb 5, 2026
Comment thread docs/gen-ai/anthropic.md Outdated
Comment thread model/gen-ai/spans.yaml Outdated
@verdie-g verdie-g requested a review from lmolkova February 7, 2026 11:30
@lmolkova lmolkova moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Feb 8, 2026
@lmolkova lmolkova moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Feb 9, 2026
Comment thread docs/gen-ai/azure-ai-inference.md Outdated
Comment thread docs/gen-ai/azure-ai-inference.md Outdated
@verdie-g
Copy link
Copy Markdown
Contributor Author

verdie-g commented Mar 2, 2026

@lmolkova what else is needed to get this merged?

@lmolkova
Copy link
Copy Markdown
Member

lmolkova commented Mar 3, 2026

@verdie-g could you please follow up on #3383 (comment) ? we should have reasoning attributes on common GenAI span

@verdie-g verdie-g force-pushed the gen-ai-reasoning-tokens branch from d90b659 to 482776f Compare March 5, 2026 13:03
@verdie-g verdie-g requested a review from lmolkova March 5, 2026 13:06
@DylanRussell
Copy link
Copy Markdown

this LGTM now

Comment thread docs/gen-ai/aws-bedrock.md Outdated
Comment thread docs/gen-ai/aws-bedrock.md
Comment thread docs/gen-ai/aws-bedrock.md
Comment thread model/gen-ai/spans.yaml Outdated
@verdie-g verdie-g force-pushed the gen-ai-reasoning-tokens branch from ee7c351 to b978fab Compare March 9, 2026 21:43
@verdie-g verdie-g requested a review from lmolkova March 9, 2026 21:44
Comment thread model/gen-ai/spans.yaml Outdated
@verdie-g verdie-g force-pushed the gen-ai-reasoning-tokens branch from b978fab to cb9033c Compare March 16, 2026 12:53
Comment thread docs/gen-ai/google.md Outdated
@trask
Copy link
Copy Markdown
Member

trask commented Apr 7, 2026

thanks @verdie-g! I posted a prototype for this at trask/genai-otel-conformance#143

Comment thread docs/gen-ai/aws-bedrock.md
@lmolkova
Copy link
Copy Markdown
Member

@verdie-g thanks for the contribution! would you be interested in making final fixes on this PR? It seems there are some unintentional changes that are blocking it. Let me know if you need any help, thanks!

@verdie-g verdie-g force-pushed the gen-ai-reasoning-tokens branch from cb9033c to 5b3b199 Compare April 27, 2026 13:17
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 27, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: verdie-g / name: Grégoire Verdier (7712cc8)

Add reasoning output tokens attribute to track tokens used for
reasoning (chain-of-thought, extended thinking). The attribute is
added to the common GenAI inference client attributes and to the
OpenAI-specific span with a mapping note.
@verdie-g verdie-g force-pushed the gen-ai-reasoning-tokens branch from 5b3b199 to 7712cc8 Compare April 27, 2026 13:21
@verdie-g
Copy link
Copy Markdown
Contributor Author

@lmolkova I've reverted the changes to the specific providers so it doesn't create unrelated changes.

@lmolkova lmolkova moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Apr 27, 2026
@lmolkova lmolkova enabled auto-merge April 27, 2026 13:46
@lmolkova lmolkova added this pull request to the merge queue Apr 27, 2026
Merged via the queue into open-telemetry:main with commit c1212d9 Apr 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gen-ai enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

Add usage.reasoning_tokens to span attributes

7 participants