diff --git a/src/prometheus_fastapi_instrumentator/routing.py b/src/prometheus_fastapi_instrumentator/routing.py index 2c714d3..0725c0a 100644 --- a/src/prometheus_fastapi_instrumentator/routing.py +++ b/src/prometheus_fastapi_instrumentator/routing.py @@ -39,7 +39,7 @@ from typing import List, Optional -from starlette.requests import Request +from starlette.requests import HttpConnection from starlette.routing import Match, Mount, Route from starlette.types import Scope @@ -66,7 +66,7 @@ def _get_route_name( return None -def get_route_name(request: Request) -> Optional[str]: +def get_route_name(request: HttpConnection) -> Optional[str]: """Gets route name for given request taking mounts into account.""" app = request.app