claude-agent-sdk: report tool_calls / inference_calls counts on invoke_agent
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- observability
Research direction
Read the LocalAgentInvocation implementation and its _on_stream_end and _on_stream_error handlers. Check how ToolUseBlock.id and message_id are exposed across SDK versions, then verify that both counts are recorded when content capture is disabled. Done means unique tool and inference calls populate the corresponding gen_ai.invoke_agent metrics, with inference_calls left unset for older SDK releases.
Written by the indexing model from the issue text.
Description
Follow-up to #1060, from lmolkova's review there:
LocalAgentInvocation has tool_calls and inference_calls, recorded as the gen_ai.invoke_agent.tool_calls / gen_ai.invoke_agent.inference_calls metrics. Both are available regardless of content capture: count unique ToolUseBlock.ids and unique message_ids, and set them in _on_stream_end / _on_stream_error.
I'll send the PR once #1060 lands.
message_id is not available on older SDK releases (e.g. 0.1.19); inference_calls stays unset there.
- Dominant language
- Python
- Stars
- 52
- Forks
- 110
- Avg merge
- 2d 32m
- Merged PRs (30d)
- 96
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-python-genai
-
`opentelemetry-instrumentation-openai-v2` instrumentor entry point fails to loadPossibly taken @lmolkova claimed this 19 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
open-telemetry/opentelemetry-python-genai#997 · 2 comments ·
Maintainers usually reply within 1 day
-
Support disabling OpenAI Agents native trace export through an environment variablePossibly taken @123liuziming claimed this 29 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-telemetry/opentelemetry-python-genai#922 · 3 comments ·
Maintainers usually reply within 1 day
-
[genai-bedrock] invoke_model body passed as a file-like object: no request parameters or input messages are recordedPossibly taken @SyedTashfin claimed this 39 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-python-genai#848 ·
Maintainers usually reply within 1 day
-
util-genai: ToolInvocation._apply_finish never calls the completion hook, so tool arguments/results bypass redaction hooksPossibly taken @akshat-lakhera claimed this 27 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-python-genai#678 · 2 comments ·
Maintainers usually reply within 1 day
-
[anthropic] Capture tool definitions on chatMay be free again @rads-1996 claimed this 57 days ago, and no pull request is open. Openopeninference-migration
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-python-genai#553 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in open-telemetry/opentelemetry-python-genai
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
docling-project/docling-pipelines#669 ·
Maintainers usually reply within 1 day
-
blocked kind/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opendatahub-io/agent-eval-harness#329 · 2 comments · 1 reaction ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another drivePossibly taken @TrapsterDK claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
tweag/rules_haskell#2492 ·
Maintainers usually reply within 1 day