Skip to content
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

ddtrace masks asyncio debug logs #10975

Open
j-dutton-alphasights opened this issue Oct 8, 2024 · 0 comments
Open

ddtrace masks asyncio debug logs #10975

j-dutton-alphasights opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
Tracing Distributed Tracing

Comments

@j-dutton-alphasights
Copy link

I'm looking to use asyncio debug mode to understand some issues with blocked event loops. The way that ddtrace patches asyncio leads to the name of each coroutine being masked.

Here's an example of the logs I get out without ddtrace:

Executing <Task finished name='Task-1' coro=<my_function() done, defined at /app/src/block.py:5> result=None created at /usr/lib64/python3.12/asyncio/runners.py:100> took 2.002 seconds

And with ddtrace-run:

Executing <Task finished name='Task-1' coro=<_wrapped_create_task_py37.<locals>.traced_coro() done, defined at /usr/local/lib64/python3.12/site-packages/ddtrace/contrib/asyncio/patch.py:47> result=None created at /usr/local/lib64/python3.12/site-packages/ddtrace/contrib/asyncio/patch.py:53> took 2.008 seconds

Note the _wrapped_create_task_py37.<locals>.traced_coro() is really unhelpful here, and I'd much rather see the reference to the original function.

Here's the minimal example:

test.py:

async def my_function():
    time.sleep(2)


if __name__ == "__main__":
    asyncio.run(my_function())

Run with: PYTHONASYNCIODEBUG=1 ddtrace-run python3 test.py.

@mabdinur mabdinur self-assigned this Oct 22, 2024
@mabdinur mabdinur added the Tracing Distributed Tracing label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tracing Distributed Tracing
Projects
None yet
Development

No branches or pull requests

2 participants