5858 SERVER_PORT ,
5959)
6060from opentelemetry .semconv .attributes .url_attributes import (
61- URL_FULL ,
6261 URL_PATH ,
6362 URL_QUERY ,
6463 URL_SCHEME ,
@@ -410,7 +409,6 @@ def validate_outputs(
410409 SERVER_ADDRESS : "127.0.0.1" ,
411410 NETWORK_PROTOCOL_VERSION : "1.0" ,
412411 URL_PATH : "/" ,
413- URL_FULL : "http://127.0.0.1/" ,
414412 CLIENT_ADDRESS : "127.0.0.1" ,
415413 CLIENT_PORT : 32767 ,
416414 HTTP_RESPONSE_STATUS_CODE : 200 ,
@@ -447,7 +445,6 @@ def validate_outputs(
447445 SERVER_ADDRESS : "127.0.0.1" ,
448446 NETWORK_PROTOCOL_VERSION : "1.0" ,
449447 URL_PATH : "/" ,
450- URL_FULL : "http://127.0.0.1/" ,
451448 CLIENT_ADDRESS : "127.0.0.1" ,
452449 CLIENT_PORT : 32767 ,
453450 HTTP_RESPONSE_STATUS_CODE : 200 ,
@@ -693,7 +690,6 @@ def update_expected_server(expected):
693690 {
694691 SERVER_ADDRESS : "0.0.0.0" ,
695692 SERVER_PORT : 80 ,
696- URL_FULL : "http://0.0.0.0/" ,
697693 }
698694 )
699695 return expected
@@ -721,7 +717,6 @@ def update_expected_server(expected):
721717 SpanAttributes .HTTP_URL : "http://0.0.0.0/" ,
722718 SERVER_ADDRESS : "0.0.0.0" ,
723719 SERVER_PORT : 80 ,
724- URL_FULL : "http://0.0.0.0/" ,
725720 }
726721 )
727722 return expected
@@ -1009,7 +1004,6 @@ def test_websocket_new_semconv(self):
10091004 SERVER_ADDRESS : self .scope ["server" ][0 ],
10101005 NETWORK_PROTOCOL_VERSION : self .scope ["http_version" ],
10111006 URL_PATH : self .scope ["path" ],
1012- URL_FULL : f'{ self .scope ["scheme" ]} ://{ self .scope ["server" ][0 ]} { self .scope ["path" ]} ' ,
10131007 CLIENT_ADDRESS : self .scope ["client" ][0 ],
10141008 CLIENT_PORT : self .scope ["client" ][1 ],
10151009 HTTP_RESPONSE_STATUS_CODE : 200 ,
@@ -1095,7 +1089,6 @@ def test_websocket_both_semconv(self):
10951089 SERVER_ADDRESS : self .scope ["server" ][0 ],
10961090 NETWORK_PROTOCOL_VERSION : self .scope ["http_version" ],
10971091 URL_PATH : self .scope ["path" ],
1098- URL_FULL : f'{ self .scope ["scheme" ]} ://{ self .scope ["server" ][0 ]} { self .scope ["path" ]} ' ,
10991092 CLIENT_ADDRESS : self .scope ["client" ][0 ],
11001093 CLIENT_PORT : self .scope ["client" ][1 ],
11011094 HTTP_RESPONSE_STATUS_CODE : 200 ,
@@ -1639,7 +1632,6 @@ def test_request_attributes_new_semconv(self):
16391632 SERVER_ADDRESS : "127.0.0.1" ,
16401633 URL_PATH : "/" ,
16411634 URL_QUERY : "foo=bar" ,
1642- URL_FULL : "http://127.0.0.1/?foo=bar" ,
16431635 SERVER_PORT : 80 ,
16441636 URL_SCHEME : "http" ,
16451637 NETWORK_PROTOCOL_VERSION : "1.0" ,
@@ -1676,7 +1668,6 @@ def test_request_attributes_both_semconv(self):
16761668 SERVER_ADDRESS : "127.0.0.1" ,
16771669 URL_PATH : "/" ,
16781670 URL_QUERY : "foo=bar" ,
1679- URL_FULL : "http://127.0.0.1/?foo=bar" ,
16801671 SERVER_PORT : 80 ,
16811672 URL_SCHEME : "http" ,
16821673 NETWORK_PROTOCOL_VERSION : "1.0" ,
@@ -1698,18 +1689,24 @@ def test_query_string_new_semconv(self):
16981689 self .scope ,
16991690 _HTTPStabilityMode .HTTP ,
17001691 )
1701- self .assertEqual (attrs [URL_FULL ], "http://127.0.0.1/?foo=bar" )
1692+ self .assertEqual (attrs [URL_SCHEME ], "http" )
1693+ self .assertEqual (attrs [SERVER_ADDRESS ], "127.0.0.1" )
1694+ self .assertEqual (attrs [URL_PATH ], "/" )
1695+ self .assertEqual (attrs [URL_QUERY ], "foo=bar" )
17021696
17031697 def test_query_string_both_semconv (self ):
17041698 self .scope ["query_string" ] = b"foo=bar"
17051699 attrs = otel_asgi .collect_request_attributes (
17061700 self .scope ,
17071701 _HTTPStabilityMode .HTTP_DUP ,
17081702 )
1709- self .assertEqual (attrs [URL_FULL ], "http://127.0.0.1/?foo=bar" )
17101703 self .assertEqual (
17111704 attrs [SpanAttributes .HTTP_URL ], "http://127.0.0.1/?foo=bar"
17121705 )
1706+ self .assertEqual (attrs [URL_SCHEME ], "http" )
1707+ self .assertEqual (attrs [SERVER_ADDRESS ], "127.0.0.1" )
1708+ self .assertEqual (attrs [URL_PATH ], "/" )
1709+ self .assertEqual (attrs [URL_QUERY ], "foo=bar" )
17131710
17141711 def test_query_string_percent_bytes (self ):
17151712 self .scope ["query_string" ] = b"foo%3Dbar"
0 commit comments