-
Notifications
You must be signed in to change notification settings - Fork 395
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
asyncio context does not chain sub-tasks #247
Comments
Thank you @thehesiod for notifying this use case! we'll plan updating our code so that |
btw, working on this right now along with adding support for aiopg + aiobotocore, PR coming out soon |
It would be great if you can contribute on that! thank you a lot! About the monkey-patching, while it's our common approach for third-party libraries, we usually prefer not to touch Python internals unless it's safe and supported by the language. But we're happy to see your proposal and continue this discussion whenever the PR is out! Thanks a lot! |
ok, have a PR in progress: #248 |
ok, PR works, but having some issues setting up the test system |
while browsing the code I noticed in https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/contrib/asyncio/provider.py#L34 where it's associating a context with the current task, note that when doing things like
asyncio.gather
it will create new tasks so you won't be able to retrieve the context for the sub-tasks. In our product I wrote a monkeypatch to the task constructor to ensure that sub-tasks get associated with their "parent" tasks.The text was updated successfully, but these errors were encountered: