File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
src/asgi_monitor/integrations
tests/integration/litestar Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 3333
3434
3535def _get_default_span_details (scope : Scope ) -> tuple [str , dict [str , Any ]]:
36- route_handler_fn_name = scope ["route_handler" ]. handler_name
37- return route_handler_fn_name , {SpanAttributes .HTTP_ROUTE : route_handler_fn_name }
36+ method , path = scope ["method" ], scope [ "path" ]
37+ return f" { method } { path } " , {SpanAttributes .HTTP_ROUTE : path }
3838
3939
4040@dataclass (slots = True , frozen = True )
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ def _get_route_details(scope: Scope) -> str | None:
4040 match , _ = starlette_route .matches (scope )
4141 if match == Match .FULL :
4242 route = starlette_route .path
43- elif match == Match .PARTIAL :
43+ break
44+ if match == Match .PARTIAL :
4445 route = starlette_route .path
4546 return route
4647
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ async def test_tracing() -> None:
5555 "http.method" : "GET" ,
5656 "http.server_name" : "testserver.local" ,
5757 "http.user_agent" : "testclient" ,
58- "http.route" : "index " ,
58+ "http.route" : "/ " ,
5959 "http.status_code" : 200 ,
6060 "net.peer.ip" : "testclient" ,
6161 "net.peer.port" : 50000 ,
You can’t perform that action at this time.
0 commit comments