You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a fastapi app,
During async stream call to a LLM,
Using Langgraph lib, somehow when reaching this def trace_to_thread(self, func: callable): a partial func is send, without name attribute :
So, the statement if func.__name__ in self._to_thread_name_to_trace is raising an exception, and killing the whole process (not the server)
Steps to Reproduce
The point is I don't own the langgraph lib so I don't know (and I could not figure out) how it's done.
But the problem is pretty easy to understand.
Expected Result
As a telemetry tool, I don't want it to break my app.
worst is it doesn't do the metrics BUT error log it.
Actual Result
Exception raised
Additional context
Can be fix easily like :
func_name = func.__name__ if hasattr(func, "__name__") and func.__name__ in self._to_thread_name_to_trace else None
span = (
self._tracer.start_span(
f"{ASYNCIO_PREFIX} to_thread-" + func_name
)
if func_name and func_name in self._to_thread_name_to_trace
else None
)
attr = {"type": "to_thread", "name": func_name}
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered:
Describe your environment
OS: macos
Python version: 3.11.9
SDK version: 1.27.0
API version: 0.48b0
What happened?
On a fastapi app,
During async stream call to a LLM,
Using Langgraph lib, somehow when reaching this
def trace_to_thread(self, func: callable):
a partial func is send, without name attribute :So, the statement
if func.__name__ in self._to_thread_name_to_trace
is raising an exception, and killing the whole process (not the server)Steps to Reproduce
The point is I don't own the langgraph lib so I don't know (and I could not figure out) how it's done.
But the problem is pretty easy to understand.
Expected Result
As a telemetry tool, I don't want it to break my app.
worst is it doesn't do the metrics BUT error log it.
Actual Result
Exception raised
Additional context
Can be fix easily like :
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: