-
Notifications
You must be signed in to change notification settings - Fork 437
feat: add Python 3.11 support to Dynamic Instrumentation #4854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Python 3.11 support to Dynamic Instrumentation #4854
Conversation
d4fab9a
to
0dbc0b9
Compare
This change adds Python 3.11 support to Dynamic Instrumentation by adapting the bytecode required for injecting hooks and wrapping functions at the bytecode level. It also adapts the compiler of the DI expression language for conditional probes and expressions.
0dbc0b9
to
7e11658
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than one small release note fix 🥳
releasenotes/notes/feat-debugging-py311-support-2160a5590048c7c3.yaml
Outdated
Show resolved
Hide resolved
…c3.yaml Co-authored-by: Yun Kim <[email protected]>
releasenotes/notes/feat-debugging-py311-support-2160a5590048c7c3.yaml
Outdated
Show resolved
Hide resolved
78f2117
to
d74acf2
Compare
5d1a5b4
to
49c02e8
Compare
49c02e8
to
91586b3
Compare
Codecov Report
@@ Coverage Diff @@
## 1.x #4854 +/- ##
==========================================
- Coverage 74.95% 74.85% -0.10%
==========================================
Files 824 824
Lines 63924 64043 +119
==========================================
+ Hits 47914 47942 +28
- Misses 16010 16101 +91
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mabdinur since this modifies the bytecode wrapping code that we use for GraphQL is there any additional testing/concerns we should check/test for this?
That seems to be the "major" impact this change would have cross-product. Otherwise, most changes are isolated to DI.
We'll need to update our riot configurations to run graphql and graphene tests with py3.11: Line 1803 in 8a9fec4
|
Is there any manual testing Gab (or you) could do to confirm this PR is ok to merge? I'd hate to merge this code, then find out it messed up GraphQL wrapping code after. |
I ran graphql-core and graphene tests with py3.11 and the changes in this branch, and most of the tests passed ( uses an itertable that was removed in py3.11). The failing tests were due graphql-core<2.3 using a deprecated type. I think we should be good to merge this change. |
… tests (#5037) ## Checklist Blocked by #4854. This change adds Python 3.11 testing to our graphql and graphene test suites. - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines) are followed. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library.
Description
This change adds Python 3.11 support to Dynamic Instrumentation by adapting the bytecode required for injecting hooks and wrapping functions at the bytecode level. It also adapts the compiler of the DI expression language for conditional probes and expressions.
Checklist
feat
andfix
pull requests.Motivation
Python 3.11 has been released and support for it has been added in the
bytecode
dependency. This means that we can now add Python 3.11 support to every part of the library that directly depend on features exposed by said dependency.Design
Python 3.11 support required consistent adaptation in the opcodes used to perform injection and wrapping. Most notably are the no-op instructions for specialisation and the new exception table for zero-cost exception handling.
Testing strategy
The existing test suite should already have enough test cases to provide a comprehensive coverage to ensure that all the necessary features have been adapted as necessary.
Reviewer Checklist
changelog/no-changelog
label added.