open-telemetry / open-telemetry/opentelemetry-python-genai

[opentelemetry-instrumentation-genai-langchain] Record unnamed agent invocations

Open
#742 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.