Skip to content

Conversation

@wangzlei
Copy link
Contributor

@wangzlei wangzlei commented Nov 16, 2025

Issue #, if available:

When a Starlette user registers an ASGI app via the route registration method, the ADOT Python SDK’s Starlette instrumentation mistakenly treats it as a regular synchronous function. As a result, the patched ASGI app cannot be properly registered in Starlette, preventing Starlette from starting the app. This leads clients to receive 405 Method Not Allowed errors.

Since FastMCP registers ASGI apps with Starlette, this bug causes MPC services built with FastMCP to fail to start.

Description of changes:
The PR contains 2 changes:

  1. When the Code Attributes wrapper receives a callable that is neither a function nor a method, the ADOT Python SDK leaves it unmodified.
  2. Code Attributes is off by default as an experimental feature. Users can enable the by environment variable OTEL_AWS_EXPERIMENTAL_CODE_ATTRIBUTES=true

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wangzlei wangzlei requested a review from a team as a code owner November 16, 2025 06:44
@wangzlei wangzlei added the skip changelog doesn't need a CHANGELOG entry label Nov 16, 2025
@wangzlei wangzlei enabled auto-merge (squash) November 16, 2025 19:03
vastin
vastin previously approved these changes Nov 18, 2025
@vastin
Copy link
Contributor

vastin commented Nov 18, 2025

The contract tests failed and need to be updated because code attribute feature is disabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants