@@ -184,17 +184,23 @@ async def sentry_app_handle(
184184 )
185185 if filtered_query_string :
186186 url_attributes ["url.query" ] = filtered_query_string
187+ url_attributes ["url.full" ] += (
188+ "?" + filtered_query_string
189+ )
190+
187191 elif should_send_default_pii ():
188- url_attributes [ "url.full" ] = "%s://%s%s" % (
192+ url_full = "%s://%s%s" % (
189193 request .scheme ,
190194 request .host ,
191195 request .path ,
192196 )
193- url_attributes ["url.path" ] = request .path
194-
195197 if request .query_string :
198+ url_full += "?" + request .query_string
196199 url_attributes ["url.query" ] = request .query_string
197200
201+ url_attributes ["url.full" ] = url_full
202+ url_attributes ["url.path" ] = request .path
203+
198204 client_address_attributes = {}
199205 if should_send_default_pii () and request .remote :
200206 client_address_attributes ["client.address" ] = request .remote
@@ -387,12 +393,9 @@ async def on_request_start(
387393 }
388394 if parsed_url is not None :
389395 if has_data_collection_enabled (client .options ):
390- attributes [ "url.full" ] = parsed_url .url
396+ url_full = parsed_url .url
391397 attributes ["url.path" ] = params .url .path
392398
393- if parsed_url .fragment :
394- attributes ["url.fragment" ] = parsed_url .fragment
395-
396399 if parsed_url .query :
397400 filtered_query = (
398401 _apply_data_collection_filtering_to_query_string (
@@ -404,15 +407,26 @@ async def on_request_start(
404407 )
405408 if filtered_query :
406409 attributes ["url.query" ] = filtered_query
410+ url_full += "?" + filtered_query
411+
412+ if parsed_url .fragment :
413+ attributes ["url.fragment" ] = parsed_url .fragment
414+ url_full += "#" + parsed_url .fragment
415+
416+ attributes ["url.full" ] = url_full
407417 elif should_send_default_pii ():
408- attributes [ "url.full" ] = parsed_url .url
418+ url_full = parsed_url .url
409419 attributes ["url.path" ] = params .url .path
410420
411421 if parsed_url .query :
422+ url_full += "?" + parsed_url .query
412423 attributes ["url.query" ] = parsed_url .query
413424 if parsed_url .fragment :
425+ url_full += "#" + parsed_url .fragment
414426 attributes ["url.fragment" ] = parsed_url .fragment
415427
428+ attributes ["url.full" ] = url_full
429+
416430 span = sentry_sdk .traces .start_span (
417431 name = span_name , attributes = attributes
418432 )
0 commit comments