Skip to content

Please release the merged OpenTelemetry 1.43 support for FastAPI 0.137+ #2087

Description

@itssimon

Description

Logfire 4.37.0 constrains opentelemetry-sdk and opentelemetry-exporter-otlp-proto-http to <1.43.0. This keeps compatible environments on the OpenTelemetry 1.42 / instrumentation 0.63 release family.

opentelemetry-instrumentation-fastapi 0.63 is incompatible with the _IncludedRouter representation introduced in FastAPI 0.137. For requests that partially match a route added through include_router()—notably CORS preflight OPTIONS requests—the instrumentation can raise:

AttributeError: '_IncludedRouter' object has no attribute 'path'

Because this occurs in the OpenTelemetry ASGI middleware before the request reaches the application or CORS middleware, the request returns a 500.

This was reported in #2041 and fixed by the merged #2042, which raises Logfire's OpenTelemetry ceiling to <1.44.0 and allows opentelemetry-instrumentation-fastapi 0.64b0, where the FastAPI routing issue is fixed. However, the latest published Logfire release is still 4.37.0 and does not contain that change.

Could you please publish a Logfire release containing #2042? This would allow applications using recent FastAPI versions to resolve the fixed OpenTelemetry instrumentation without pinning FastAPI below 0.137.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions