Closed audols closed 2 months ago
FYI, this is tied to existing issues with streaming - disabling streaming for the Agent removes this issue, but ideally we'd be able to enable it too.
@audols Are you sure this is related to opentelemetry at all? We don't have any langchain instrumentation and you haven't installed any instrumentation as far as I can see.
@xrmx Yes, this was using OpenTelemetry auto-instrumentation - disabling auto-instrumentation removed the error. We need not necessarily have traces for this part of the code, it would just be nice to have auto-instrumentation enabled w/o the application throwing an error.
On a side note, we are using Traceloop for Langchain-side instrumentation.
@audols What I am saying is that it is not opentelemetry-instrument that patches your libraries, but the single instrumentations do. So I would take a look at what the langchain instrumentation is doing instead.
@xrmx Interesting, I removed the opentelemetry-instrumentation-langchain
library from my build and still received the same error, so I thought for sure it had to be tied to the original OTel instrumentor interacting with LangChain. I can go ahead and open the issue on that side instead though - thanks for the guidance.
@audols do you have any update on this?
@xrmx I went ahead and opened a follow-up issue on the Traceloop repo, I'll close this issue and follow up here with any updates: https://github.com/traceloop/openllmetry/issues/1544.
Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.
Have tried both Python 3.11 and 3.12. Using
opentelemetry-instrumentation==0.46b0
and bothlangchain==0.2.1
andlangchain==0.2.2
.Steps to reproduce Describe exactly how to reproduce the error. Include a code sample if applicable.
Implement and make a call to any LangChain AgentExecutor, e.g. in the following LangServe context:
What is the expected behavior? No error - AgentExecutor chain should complete without issue, traces should be available at destination specified in instrumentation.
What is the actual behavior? What did you see instead?
Which links to the following LangChain agent code: https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/agents/agent.py#L560C18-L561C14
Additional context Exception is thrown across multiple agent types.