diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py index 15785b0dc4..e9f83d1a39 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -450,7 +450,9 @@ def _get_route_details(scope, app=None): route = starlette_route.path # Capture the full route template break if match == Match.PARTIAL: - route = starlette_route.path # Fallback, though this is rare in FastAPI + route = ( + starlette_route.path + ) # Fallback, though this is rare in FastAPI return route