dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

[BUG]: ddtrace breaks langgraph ABC subclassing

Open jsandovalc opened this issue 1 month ago • 1 comments

Tracer Version(s)

3.19..0, 3.18.0, 3.17.0, 3.16.0

Python Version(s)

3.11.10

Pip Version(s)

pip 25.3

Bug Report

This was tested with langgraph 1.0.4, 1.0.3, 1.0.2, and even lower versions.


None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/Users/jsandoval/workspace/canary/backend/canary/.venv/lib/python3.11/site-packages/wrapt/importer.py", line 184, in _self_exec_module
    self.__wrapped__.exec_module(module)
  File "/Users/jsandoval/workspace/.venv/lib/python3.11/site-packages/langgraph/graph/__init__.py", line 2, in <module>
    from langgraph.graph.message import MessageGraph, MessagesState, add_messages
  File "/Users/jsandoval/workspace/.venv/lib/python3.11/site-packages/langgraph/graph/message.py", line 28, in <module>
    from langgraph.graph.state import StateGraph
  File "/Users/jsandoval/workspace/.venv/lib/python3.11/site-packages/langgraph/graph/state.py", line 27, in <module>
    from langgraph.cache.base import BaseCache
  File "/Users/jsandoval/workspace/venv/lib/python3.11/site-packages/langgraph/cache/base/__init__.py", line 8, in <module>
    from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
  File "/Users/jsandoval/workspace/venv/lib/python3.11/site-packages/langgraph/checkpoint/serde/jsonplus.py", line 34, in <module>
    from langgraph.store.base import Item
  File "/Users/jsandoval/workspace/.venv/lib/python3.11/site-packages/langgraph/store/base/__init__.py", line 29, in <module>
    from langgraph.store.base.embed import (
  File "/Users/jsandoval/workspace/.venv/lib/python3.11/site-packages/langgraph/store/base/embed.py", line 105, in <module>
    class EmbeddingsLambda(Embeddings):
  File "<frozen abc>", line 106, in __new__
TypeError: missing 1 required positional argument

Reproduction Code

DD_TRACE_ENABLED=true ddtrace-run python -c "from langgraph.graph import StateGraph; print('OK')"

Error Logs

No response

Libraries in Use

  • ddtrace: 3.19.0 (also fails on 3.16.2, 3.18.1)
  • Python: 3.11
  • langgraph: 1.0.4
  • langchain-core: 1.0.7

Operating System

Darwin 25.1.0

jsandovalc avatar Dec 03 '25 16:12 jsandovalc

Hi @jsandovalc, thanks for opening this bug report!

I have tried this out locally with the dependencies you've specified:

$ python --version                                                                                 
Python 3.11.10

$ pip freeze | grep -e langgraph -e ddtrace -e langchain-core                                      
ddtrace==3.19.0
langchain-core==1.0.7
langgraph==1.0.4
langgraph-checkpoint==3.0.1
langgraph-prebuilt==1.0.5
langgraph-sdk==0.2.15

$ DD_TRACE_ENABLED=true ddtrace-run python -c "from langgraph.graph import StateGraph; print('OK')"
OK

would you mind pasting the rest of your dependency versions? maybe specifically wrapt - we have seen other issues where there are incompatibilities with certain wrapt versions so I'd like to rule that out 😄 here's mine that's running above for references (resolved from ddtrace directly)

$ pip freeze | grep wrapt
wrapt==2.0.1

sabrenner avatar Dec 15 '25 19:12 sabrenner

Hi @sabrenner,

$ pip freeze | grep wrapt
wrapt==1.16.0

Thanks for your answer!

jsandovalc avatar Dec 20 '25 18:12 jsandovalc