[opentelemetry-instrumentation-genai-anthropic] Capture reasoning token counts on messages - #779
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-01 17:09 UTC Status above doesn't look right?
|
ac1036f to
f0e392f
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds Anthropic reasoning-token telemetry using gen_ai.usage.reasoning.output_tokens.
Changes:
- Extracts
thinking_tokensfrom response usage. - Adds sync/async assertions and updated VCR fixtures.
- Adds a changelog entry.
| File | Description |
|---|---|
| instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_sync_messages.py | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_messages_extractors.py | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_async_messages.py | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/cassettes/test_sync_messages_create_captures_thinking_content.yaml | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/cassettes/test_async_messages_create_captures_thinking_content.yaml | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/src/opentelemetry/instrumentation/genai/anthropic/messages_extractors.py | Updated as part of this pull request. |
| instrumentation/opentelemetry-instrumentation-genai-anthropic/.changelog/779.added | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ba188bc to
4c1850c
Compare
eternalcuriouslearner
left a comment
There was a problem hiding this comment.
LGTM!! Should we add the attributes to conformance test suite?
So, this PR already verifies that the attribute is correctly emitted in the |
de30969 to
6ce633b
Compare

Type of change
Please delete options that are not relevant.
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. List any relevant details for your test
configuration.
Checklist
See CONTRIBUTING.md
for the style guide, changelog guidance, and more.