Skip to content

Add LangChain invoke workflow and invoke agent span support#25

Merged
lmolkova merged 21 commits into
open-telemetry:mainfrom
wrisa:chains-langchain
May 21, 2026
Merged

Add LangChain invoke workflow and invoke agent span support#25
lmolkova merged 21 commits into
open-telemetry:mainfrom
wrisa:chains-langchain

Conversation

@wrisa

@wrisa wrisa commented May 17, 2026

Copy link
Copy Markdown
Contributor

Brought from old repo: open-telemetry/opentelemetry-python-contrib#4449

Note: Current PR generates invoke_agent spans when genuine react agent eg: create_react_agent. Opened issue to discuss which span we want when there are plain langgraph nodes(without any actual agent)

Copilot AI review requested due to automatic review settings May 17, 2026 22:56
@wrisa
wrisa requested a review from a team as a code owner May 17, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@aabmass

aabmass commented May 18, 2026

Copy link
Copy Markdown
Member

FYI if your PR needs a changelog entry, please update it to use towncrier #16

Comment thread instrumentation/opentelemetry-instrumentation-langchain/pyproject.toml Outdated

@lmolkova lmolkova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good! I've read #28 and agree with this modeling. Just a few minor concerns.

# Most instrumentations should have agent.id; flag it as always-emit.
_invoke_agent_expected := {
"gen_ai.operation.name",
"gen_ai.provider.name",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have gen_ai.t.name here instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmolkova it is optional in semcov

Comment thread tox.ini Outdated
@lmolkova
lmolkova merged commit 30a60eb into open-telemetry:main May 21, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants