We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 144accf + c1d8c5f commit e473985Copy full SHA for e473985
1 file changed
timing_asgi/integrations/starlette.py
@@ -1,4 +1,4 @@
1
-from starlette.routing import Match
+from starlette.routing import Match, Route, Mount
2
3
from timing_asgi.interfaces import MetricNamer
4
from timing_asgi.utils import PathToName
@@ -27,7 +27,9 @@ def __call__(self, scope):
27
if r.matches(scope)[0] == Match.FULL:
28
route = r
29
break
30
- if route is not None:
+ if isinstance(route, Route):
31
return f"{self.prefix}.{route.endpoint.__module__}.{route.name}"
32
+ elif isinstance(route, Mount):
33
+ return f"{self.prefix}.__mount__.{route.name}"
34
else:
35
return self.fallback(scope)
0 commit comments