@@ -44,6 +44,10 @@ async def hi():
4444 capture_message ("hi" )
4545 return "ok"
4646
47+ @app .route ("/nomessage" )
48+ async def nomessage ():
49+ return "ok"
50+
4751 @app .route ("/message/<message_id>" )
4852 async def hi_with_id (message_id ):
4953 capture_message ("hi with id" )
@@ -682,6 +686,22 @@ async def test_span_origin(sentry_init, capture_events):
682686 assert event ["contexts" ]["trace" ]["origin" ] == "auto.http.quart"
683687
684688
689+ @pytest .mark .asyncio
690+ async def test_request_url (sentry_init , capture_events ):
691+ sentry_init (
692+ traces_sample_rate = 1.0 ,
693+ integrations = [quart_sentry .QuartIntegration ()],
694+ )
695+ app = quart_app_factory ()
696+ client = app .test_client ()
697+
698+ events = capture_events ()
699+ await client .get ("/root/nomessage" , root_path = "/root" )
700+
701+ (event ,) = events
702+ assert event ["request" ]["url" ] == "http://localhost/root/nomessage"
703+
704+
685705@pytest .mark .asyncio
686706async def test_span_streaming_basic (sentry_init , capture_items ):
687707 sentry_init (
@@ -966,3 +986,28 @@ async def test_span_streaming_sensitive_header_passthrough_with_pii(
966986 segment ["attributes" ]["http.request.header.authorization" ]
967987 == "Bearer secret-token"
968988 )
989+
990+
991+ @pytest .mark .asyncio
992+ async def test_span_streaming_request_url (sentry_init , capture_items ):
993+ sentry_init (
994+ traces_sample_rate = 1.0 ,
995+ send_default_pii = True ,
996+ integrations = [quart_sentry .QuartIntegration ()],
997+ _experiments = {
998+ "trace_lifecycle" : "stream" ,
999+ },
1000+ )
1001+ app = quart_app_factory ()
1002+ client = app .test_client ()
1003+
1004+ items = capture_items ("span" )
1005+ await client .get ("/root/nomessage" , root_path = "/root" )
1006+
1007+ sentry_sdk .flush ()
1008+ spans = [item .payload for item in items ]
1009+
1010+ (server_span ,) = (
1011+ span for span in spans if span ["attributes" ].get ("sentry.op" ) == "http.server"
1012+ )
1013+ assert server_span ["attributes" ]["url.full" ] == "http://localhost/root/nomessage"
0 commit comments