Skip to content

asyncio.gather tracing produces nested spans #772

@vmarkovtsev

Description

@vmarkovtsev

I've got the following code:

import asyncio
import sentry_sdk

async def foo():
    with sentry_sdk.start_span(op="foo"):
        await asyncio.sleep(1)

async def bar():
    with sentry_sdk.start_span(op="bar"):
        await asyncio.sleep(1)

with sentry_sdk.start_span(op="root"):
    await asyncio.gather(foo(), bar(), return_exceptions=True)

I see that bar is nested under foo, and foo is nested under root in the Performance UI.

root
    |- foo
         |- bar

Expected behavior: both foo and bar are nested under root and are on the same level.

root
    |- foo
    |- bar

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions