open-telemetry / open-telemetry/opentelemetry-python-genai
Add agent call count metrics (gen_ai.invoke_agent.inference_calls, gen_ai.invoke_agent.tool_calls)
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 63
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 175
Description
Semantic conventions define two counter metrics for agent invocations:
gen_ai.invoke_agent.inference_calls: Number of inference calls made during the agent invocation.gen_ai.invoke_agent.tool_calls: Number of tool calls executed during the agent invocation.
opentelemetry-util-genai does not currently track or record these counters on AgentInvocation.
Tracking sub-issues
- Add utils support to track and record counter metrics on
AgentInvocation - #598 -
opentelemetry-instrumentation-genai-langchain - #599 -
opentelemetry-instrumentation-genai-llama-index - #600 -
opentelemetry-instrumentation-genai-agno - #601 -
opentelemetry-instrumentation-genai-openai-agents - #602 -
opentelemetry-instrumentation-genai-qwen-agent
Contributor 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.
Research direction
Start by locating the opentelemetry-util-genai implementation of AgentInvocation and its existing metric or invocation tracking. Add support for recording the inference_calls and tool_calls counters, then verify that both metrics are recorded for an agent invocation using the project's existing tests or validation commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100