open-telemetry / open-telemetry/opentelemetry-python-genai
[opentelemetry-instrumentation-genai-langchain] Record unnamed agent invocations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 63
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 175
Description
LangChain agents created without an explicit name (e.g. create_agent without lc_agent_name or create_react_agent with default graph name) currently do not record invoke_agent spans in the callback handler unless explicitly announced via claim_agent(). Even when announced, an unnamed agent has no fallback name and its span may be dropped or left unnamed.
We should ensure unnamed LangChain agents are recorded consistently (e.g. with appropriate fallback naming or recording without gen_ai.agent.name per semantic conventions) so agent execution and hierarchy are preserved.
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 in the LangChain callback handler, tracing the existing claim_agent() path and the handling of invoke_agent spans. Reproduce the issue with create_agent without lc_agent_name and create_react_agent using its default graph name. Done means both unnamed-agent forms consistently produce an invoke_agent span and preserve the execution hierarchy without an invalid or missing required name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100