fix: tracing middleware to not start for lifespan events

This commit is contained in:
Dinesh Yeduguru 2025-03-20 13:47:09 -07:00
parent ea6a4a14ce
commit 8e6f2dd797

View file

@ -226,6 +226,8 @@ class TracingMiddleware:
self.app = app
async def __call__(self, scope, receive, send):
if scope.get("type") == "lifespan":
return await self.app(scope, receive, send)
path = scope.get("path", "")
await start_trace(path, {"__location__": "server"})
try: