Skip to content

Conversation

@punitmahes
Copy link
Contributor

@punitmahes punitmahes commented Dec 17, 2025

Description

This pull request resolves issue #4031, which reported that FastAPI instrumentation did not work with middleware-wrapped applications such as CORSMiddleware. The changes here ensure that the FastAPIInstrumentor can properly identify and instrument FastAPI or Starlette instances, even if wrapped by middleware.

Fixes #4031

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added test coverage for middleware-wrapped FastAPI apps.
  • Verified instrumentation works as expected with middleware layers.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: punitmahes / name: Punit Maheshwari (a85bee6)

@punitmahes punitmahes force-pushed the fix/cors-middleware-error branch from 3e478e3 to 9e3b02a Compare December 17, 2025 18:43
@punitmahes punitmahes requested a review from a team as a code owner December 17, 2025 18:43
@punitmahes punitmahes force-pushed the fix/cors-middleware-error branch 2 times, most recently from 23d5e85 to 9aa86ce Compare December 17, 2025 18:50
@punitmahes punitmahes force-pushed the fix/cors-middleware-error branch from 9aa86ce to a85bee6 Compare December 17, 2025 18:50
@xrmx xrmx moved this to Ready for review in @xrmx's Python PR digest Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Incompatible with CORSMiddleware app

1 participant