@@ -1683,6 +1683,17 @@ def test_query_string(self):
1683
1683
attrs [SpanAttributes .HTTP_URL ], "http://127.0.0.1/?foo=bar"
1684
1684
)
1685
1685
1686
+ def test_query_string_new_semconv (self ):
1687
+ self .scope ["query_string" ] = b"foo=bar"
1688
+ attrs = otel_asgi .collect_request_attributes (
1689
+ self .scope ,
1690
+ _HTTPStabilityMode .HTTP ,
1691
+ )
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" )
1696
+
1686
1697
def test_query_string_both_semconv (self ):
1687
1698
self .scope ["query_string" ] = b"foo=bar"
1688
1699
attrs = otel_asgi .collect_request_attributes (
@@ -1692,6 +1703,10 @@ def test_query_string_both_semconv(self):
1692
1703
self .assertEqual (
1693
1704
attrs [SpanAttributes .HTTP_URL ], "http://127.0.0.1/?foo=bar"
1694
1705
)
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" )
1695
1710
1696
1711
def test_query_string_percent_bytes (self ):
1697
1712
self .scope ["query_string" ] = b"foo%3Dbar"
0 commit comments