Skip to content

FastAPI Instrumentation Bypasses Middleware for Custom Router #3671

@lannuttia

Description

@lannuttia

Describe your environment

OS: Fedora 42
Python: 3.12.11
SDK Version: 1.35.0
API Version: 1.35.0

What happened?

It appears that if I use anything after splunk-opentelemetry version 2.4.0 to auto-instrument my application, the middleware for my application is bypassed when using my custom router. When the application is ran without being auto-instrumented, the middleware is not bypassed and everything works as expected.

Steps to Reproduce

Follow the steps in the README.md for my minimal issue recreation repository

Expected Result

When the application is instrumented, middleware is not bypassed for requests that use a custom API route.

Actual Result

When the application is instrumented, middleware is bypassed for requests that use a custom API route

Additional context

I am unsure of exactly where this issue is coming from but I suspect that it is related to changes made in #3529.

Would you like to implement a fix?

None

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