Skip to content

Click Instrumentation Bypass Issue #3846

@lannuttia

Description

@lannuttia

Describe your environment

OS: Fedora 42
Python version: 3.12
Package version: 0.57b0

What happened?

I was running a FastAPI application using python -m uvicorn instead of using the uvicorn executable directly and was seeing all of my requests going under a top-level python -m uvicorn span.

Steps to Reproduce

Attempt to run a FastAPI application using python -m uvicorn instead of uvicorn.

Expected Result

Each separate request should get it's own span instead of every request's span going under a top-level span.

Actual Result

Each separate request's span goes under a single top-level span when starting with python -m uvicorn

Additional context

I did some pre-emptive looking into this problem and have found that it is caused by the click Instrumentation failing to sniff out that it is being ran in a FastAPI application.

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions