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
Yun-Kim
left a comment
There was a problem hiding this comment.
LGTM other than one small release note fix 🥳
…c3.yaml Co-authored-by: Yun Kim <[email protected]>
78f2117 to
d74acf2
Compare
5d1a5b4 to
49c02e8
Compare
49c02e8 to
91586b3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 1.x #4854 +/- ##
==========================================
- Coverage 74.98% 74.90% -0.09%
==========================================
Files 827 827
Lines 64051 64170 +119
==========================================
+ Hits 48031 48064 +33
- Misses 16020 16106 +86 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
brettlangdon
left a comment
There was a problem hiding this comment.
@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
featandfixpull requests.Motivation
Python 3.11 has been released and support for it has been added in the
bytecodedependency. 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-changeloglabel added.