Closed Yun-Kim closed 1 year ago
Currently running into a problem with gevent failing to build properly with Python 3.11. I suspect it has to do with gevent's vendored version of greenlet, and I've made an issue on gevent's github page here.
Note that I've separated the profiler changes into a separate PR #4343 so that it can unblock the tracer PR #4125.
docker python just updated to 3.11 wheel fails to build if used with python 3 latest
Status Update: The tracer has preliminary support for Python 3.11 as of version 1.6.0. This unfortunately does not yet include integrations for asyncpg, graphene, graphql, celery
, and grpcio
with pytest-asyncio
, as well as the profiler and dynamic instrumentation.
FYI, the new version of bytecode
supporting 3.11 was just released: https://github.com/MatthieuDartiailh/bytecode/blob/main/doc/changelog.rst#2022-11-30-version-0140
A version of asyncpg
with prebuild wheels has also been released.
We're running into this as well. Would love a fix!
Hi @bryanhelmig, could you clarify what problem you're running into? As of right now, the ddtrace library supports tracing and most instrumented libraries on Python 3.11, with profiling and dynamic instrumentation not yet supported. Thanks!
We're currently block by the support of pytest-asyncio
with the following error raised on our tests:
AttributeError: module 'asyncio.coroutines' has no attribute '_DEBUG'
Hi @eqperes, would you mind opening up a new issue so we can look into it in more detail? Adding a more detailed traceback/error log would be helpful. Thanks!
I'm running several of the not yet supported integrations. I'm happy to create a bug report with what errors I am getting or post here if that would help.
@BobACollins thanks for reaching out, please do open up a new issue with your bug report!
So, just to make it clear - what is not supported yet in python3.11? Does "dynamic instrumentation" meaning manual instrumentation of the application? Or only the code profiling?
@AlonMorgen we've had reports of persisting issues when the profiler is on with Python 3.11. We have fixed a couple of those that were caused by the profiler directly. There might still be issues when using the profiler with CPython 3.11 which might be indirectly caused by dd-trace-py
. Because of the number of issues related how CPython 3.11 handles frame objects that have been fixed recently, we suspect that in some cases our profiler is triggering unexpected behaviour in CPython. Our advice would be to ensure that you are always running with the latest release of CPython 3.11 to ensure that you have those fixes in your environments as they come out. If you notice unexpected behaviour while using the profiler with the latest release of CPython 3.11, our advice is to temporarily turn it off, and open a new issue if one does not exist already that matches the problem you are witnessing.
@AlonMorgen other than profiling as @P403n1x87 mentioned above, all core ddtrace
components (i.e. Tracing, Dynamic Instrumentation) support 3.11, along with almost all tracing integrations (with the exception of celery
, which itself does not yet support Python 3.11).
Of course, if you run into errors while running any of our integrations with Python 3.11, please open a support issue so we can resolve it.
Hi there
After upgrading to python 3.11
and ddtrace 1.8 (from 1.6)
. We stopped receiving the graphql.request
traces, this is very critical for our business.
Not sure if it's related but I found this in the logs:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.11/site-packages/ddtrace/internal/periodic.py", line 73, in run
self._target()
File "/usr/local/lib/python3.11/site-packages/ddtrace/profiling/collector/__init__.py", line 42, in periodic
for events in self.collect():
and
Exception in thread ddtrace.profiling.collector.memalloc:MemoryCollector:
A screenshot showing that we stopped receiving traced for graphql.request:
Is it something planned to be fixed soon or should we roll back to python 3.10 ...?
Is ddtrace 1.9 fixing this? Any eta for the release?
Hi @ayyoubelamrani4, the PR to add support for graphql/graphene in Python 3.11 has not yet been released, and should be in 1.9. In the meantime, I'd suggest roll backing to Python 3.10 until 1.9 is released.
The goal is to get 1.9 released officially by EOW next week or early the week after. If the issue still persists after upgrading, please open a new support issue.
Hi @Yun-Kim I'm just upgrading our python version to 3.11.2 and I'm facing the following error with dd-trace:
File "/usr/local/lib/python3.11/site-packages/ddtrace/internal/module.py", line 216, in _exec_module
self.loader.exec_module(module)
File "/usr/local/lib/python3.11/site-packages/ddtrace/contrib/aiopg/__init__.py", line 25, in <module>
from .patch import patch
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "/usr/local/lib/python3.11/site-packages/ddtrace/internal/module.py", line 216, in _exec_module
self.loader.exec_module(module)
File "/usr/local/lib/python3.11/site-packages/ddtrace/contrib/aiopg/patch.py", line 7, in <module>
from ddtrace.contrib.aiopg.connection import AIOTracedConnection
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "/usr/local/lib/python3.11/site-packages/ddtrace/internal/module.py", line 216, in _exec_module
self.loader.exec_module(module)
File "/usr/local/lib/python3.11/site-packages/ddtrace/contrib/aiopg/connection.py", line 22, in <module>
class AIOTracedCursor(wrapt.ObjectProxy):
File "/usr/local/lib/python3.11/site-packages/ddtrace/contrib/aiopg/connection.py", line 30, in AIOTracedCursor
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
After checking the codebase I can still see the @asyncio.coroutine
decorator being used instead of async def
as instructed in: Official Python documentation
Can we hope to get a fix for this issue?
Hi @lanprijatelj, thanks for reaching out.
It looks like aiopg==1.4.0
is the first known version to support Python 3.11, but we don't currently support aiopg>=1.0
. I suspect the asyncio.coroutine
syntax error is not the only thing blocking our support for aiopg==1.4.0
and Python 3.11. In the meantime, I would recommend you to avoid upgrading to Python 3.11, or feel free to open an issue for a feature request to support aiopg>=1.0
.
Is python 3.11 supported or not?
The documentation suggests that it is here: https://ddtrace.readthedocs.io/en/stable/release_notes.html#v1-9-0 -> dynamic instrumentation: Python 3.11 is now supported.
and here: https://docs.datadoghq.com/tracing/trace_collection/compatibility/python/ -> RUNTIME VERSION - 2.7, 3.5-3.11
But this issue is still opened, which suggests that it is not.
If 3.11 is supported, close this issue. If it’s not, correct your documentation.
@brentleeper we use 3.11 and we use datadog too. I guess you have to check which libraries you need support for (top post in this thread).
Thank you @fredrikaverpil.
@Datadog If there is only partial support, update your documentation to include a notice since this could mislead customers into thinking that 3.11 is FULLY supported.
Hi @brentleeper, sorry for the confusion. The core components checklist in the top post in this thread indicate that ddtrace fully supports Python 3.11. However, certain integrations (most notably celery) are not yet compatible with Python 3.11, which is outside our control.
Since this issue was meant to track the core components of ddtrace, which fully supports Python 3.11, and it's out of our control when celery will be releasing a Python 3.11-compatible version (we expected earlier in 2022 but alas), I'll be closing this issue to avoid further confusion.
For any 3.11 support issues in the future, please create a new issue.
❌ celery: getting a AttributeError: '_Code' object has no attribute 'co_positions' error for 2 celery tests, failing tests marked as flaky but they are constantly failing with PR https://github.com/DataDog/dd-trace-py/pull/4125
- Skipping testing with Python 3.11 for now as celery's dependency billiard is not yet Python 3.11 compatible. See https://github.com/celery/billiard/issues/377
- Waiting for celery to release a Python 3.11 compatible version, should be released in celery=5.3.0
Celery 5.3.0 is released now, and Celery supports Python 3.11. Any plans to support it and fix the tests? Thanks!
@Yun-Kim
Hi @danyi1212, could you create a separate issue for supporting celery? This issue is closed and will be difficult to respond to support requests through this issue. Thank you!
Hi @lanprijatelj, thanks for reaching out. It looks like
aiopg==1.4.0
is the first known version to support Python 3.11, but we don't currently supportaiopg>=1.0
. I suspect theasyncio.coroutine
syntax error is not the only thing blocking our support foraiopg==1.4.0
and Python 3.11. In the meantime, I would recommend you to avoid upgrading to Python 3.11, or feel free to open an issue for a feature request to supportaiopg>=1.0
.
FWIW I filed #8229 for this
This issue is to track our progress in supporting Python 3.11.
Update (April 3, 2023): The
ddtrace
library now supports Python 3.11, with the exception of certain integrations for which libraries are not themselves compatible with Python 3.11. This includes celery, which should be resolved once they release version 5.3.The dd-trace-py library currently does not support Python 3.11, which is scheduled to be released October 24 2022. We have several integrations and core components that are failing to build or failing tests with #4125.
Checklist for dd-trace-py core components:
greenlet
. ~bytecode
module which doesn't support Python 3.11 yet, so the debugger and internal test suites won't pass.~bytecode
supports Python 3.11.~hypothesis.provisional
, and create a separate test suite using tox to test it separately.Checklist for integrations:
AttributeError: '_Code' object has no attribute 'co_positions'
error for 2 celery tests, failing tests marked as flaky but they are constantly failing with PR #4125inspect.getargspec()
has been deprecated since Python 3.0 and was now removed in Python 3.11.~getargspec()
in version 4.1~inspect.getargspec()
has been deprecated since Python 3.0 and was now removed in Python 3.11.~inspect.formatargspec()
has been deprecated since Python 3.5 and was now removed in Python 3.11.)~gettext.py
module removed a deprecated function argumentcodeset
as of Python 3.11.~TypeError: Passing coroutines is forbidden, use tasks explicitly.
errors from asyncio~bytecode
supports Python 3.11.~test_unary_exception
andtest_unary_cancellation
test cases. You can reproduce this using this gist. Thus I am skipping Python 3.11 tests with grpcio and pytest-asyncio.~include "longintrepr.h"` error during install process
TypeError: duplicate base class "TimeoutError"
~~=2..8.0, ~=2.9.0, latest
~