-
Notifications
You must be signed in to change notification settings - Fork 65
Add support for python asyncio #966
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #966 +/- ##
==========================================
- Coverage 47.29% 47.29% -0.01%
==========================================
Files 261 261
Lines 27448 27472 +24
==========================================
+ Hits 12982 12993 +11
- Misses 13600 13611 +11
- Partials 866 868 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
de423f7 to
f0310ae
Compare
internal/test/integration/components/pythonasync/async_context_test.py
Outdated
Show resolved
Hide resolved
|
@marctc, I think what would really help is some simple diagram showing what happens at what point and how do we track the context, or an explanation step by step. The reason that I'm confused is that the original logs shown by the bpftrace program that Aaron wrote, things are not the same here in this implementation. What I understood from those logs is that:
|
aa29621 to
1ae8db3
Compare
1ae8db3 to
71e2500
Compare
| func testPythonAsyncSequential(t *testing.T) { | ||
| waitForTestComponentsSub(t, "http://localhost:8391", "/health") | ||
|
|
||
| ti.DoHTTPGet(t, "http://localhost:8391/sequential", 200) |
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.
Can you modify these tests to run simultaneous requests in parallel, like testHTTPTracesNestedNginxSQL or testHTTPTracesNestedNginx in red_test_ruby.go. This will ensure that the context matching truly works even when there are multiple requests in play.
Same for testPythonAsyncToThread.
| return {"calls": 2, "status_codes": [r1, r2]} | ||
|
|
||
|
|
||
| if __name__ == "__main__": |
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.
Both endpoints (/sequential and /to-thread) run client requests sequentially: The await suspends the main thread until the client call is done, only then the next client call is scheduled.
It might be good to have a test that actually runs multiple requests in parallel.
This PR adds support to track context creation of python asyncio framework in order to add this information of trace context propagation.
Thanks @aabmass for the guidance.
Paired with @grcevski
Fixes #931