Comments (4)
appear in 2.0.1.
not appear in 1.20.16.
assume this is a problem only in datadog >= 2.0.0
from dd-trace-py.
@zdyj3170101136 could you please try
import ddtrace.auto # noqa
from ddtrace import patch
patch(gevent=True)
import gevent
gevent.monkey.patch_all()
def test_context():
def f():
a = "foo"
gevent.spawn(f).join()
More details about this are available from the docs.
However, I see that you are trying to patch gevent during a test run. In that case, I think your better option is to ensure the ddtrace
plugin for pytest
is enabled.
from dd-trace-py.
@zdyj3170101136你可以试试吗
import ddtrace.auto # noqa from ddtrace import patch patch(gevent=True) import gevent gevent.monkey.patch_all() def test_context(): def f(): a = "foo" gevent.spawn(f).join()
有关此内容的更多详细信息可以从文档中获得。
但是,我发现您正在尝试在测试运行期间修补 gevent。在这种情况下,我认为您更好的选择是确保启用
ddtrace
插件。pytest
after imported, event ddtrace 1.14.0 could not work.
pytest y.py
========================================================================= test session starts =========================================================================
platform linux -- Python 3.7.7, pytest-7.4.4, pluggy-1.2.0
rootdir: /root
plugins: ddtrace-1.14.0
collected 0 items / 1 error
=============================================================================== ERRORS ================================================================================
________________________________________________________________________ ERROR collecting y.py ________________________________________________________________________
/usr/lib/python3.7/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1006: in _gcd_import
???
<frozen importlib._bootstrap>:983: in _find_and_load
???
<frozen importlib._bootstrap>:967: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:682: in _load_unlocked
???
/usr/lib/python3.7/site-packages/ddtrace/internal/module.py:246: in __getitem__
return self._modules.__getitem__(item)
E KeyError: 'root.y'
======================================================================= short test summary info =======================================================================
ERROR y.py - KeyError: 'root.y'
python3.7 -m pytest y.py
========================================================================= test session starts =========================================================================
platform linux -- Python 3.7.7, pytest-7.4.4, pluggy-1.2.0
rootdir: /root
plugins: ddtrace-2.5.0
collected 0 items / 1 error
=============================================================================== ERRORS ================================================================================
________________________________________________________________________ ERROR collecting y.py ________________________________________________________________________
/usr/lib/python3.7/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1006: in _gcd_import
???
<frozen importlib._bootstrap>:983: in _find_and_load
???
<frozen importlib._bootstrap>:152: in __exit__
???
<frozen importlib._bootstrap>:107: in release
???
E RuntimeError: cannot release un-acquired lock
======================================================================= short test summary info =======================================================================
ERROR y.py - RuntimeError: cannot release un-acquired loc
from dd-trace-py.
Closing as a duplicate of #8281
from dd-trace-py.
Related Issues (20)
- Upgrading from v2.4.0 to v2.8.1 changes tracking from `trace.django.request` to `trace.django.middleware` HOT 3
- ddtrace breaks Bedrock Cohere Command R models
- grpc integration causes exception with grpc.aio streaming HOT 1
- ModuleWatchdog is installed unconditionally when ddtrace is imported HOT 1
- Elastic Search Quantization not always effective and does not match Datadog agent's
- Segmentation Fault in dd-trace-py on Python 3.12 HOT 3
- OpenAI: TypeError: 'NoneType' object cannot be interpreted as an integer HOT 4
- The gRPC AIO server integration fails to set the gRPC status code for the span HOT 1
- Langchain patch assumes that you have langchain_community installed HOT 3
- Errors parsing DSNs when using both psycopg2 and psycopg
- Feature Request: [LLMObs] Support Automatic spans for `langchain_community`'s tools and retriever. HOT 3
- High CPU utilization causing kubernetes pod scaling with ddtrace > 2.3.0 HOT 2
- Cannot override the `service_name` for the `requests` integration HOT 1
- Boto3 Bedrock Client - Propogate Http x-datadog headers HOT 2
- Langchain v0.2+: ModuleNotFoundError: No module named 'langchain_community' HOT 2
- How to handle deprecation of `ddtrace.context.Context` when it is still present in public API? HOT 1
- Using ddtrace-run together with `gUnicorn` causes all `Spyne` SOAP endpoints to break. HOT 1
- Python 3.12 / ddtrace-run combined with psycopg3 AsyncConnectionPool leads to `TypeError: 'async for' requires an object with __aiter__ method, got Psycopg3TracedAsyncCursor` when consuming iterator HOT 1
- Add handled exceptions to error tracking
- TypeError: unhashable type: 'dict' thrown from cache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dd-trace-py.