Skip to content

Commit eb14dd0

Browse files
committed
Update the value set on to include the query string
1 parent adc69e9 commit eb14dd0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

sentry_sdk/integrations/_asgi_common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ def _get_request_attributes(asgi_scope: "Any") -> "dict[str, Any]":
126126
if query:
127127
attributes["http.query"] = query
128128

129-
attributes["url.full"] = _get_url(
129+
url_without_query_string = _get_url(
130130
asgi_scope, "http" if ty == "http" else "ws", headers.get("host")
131131
)
132+
query_string = _get_query(asgi_scope)
133+
attributes["url.full"] = f"{url_without_query_string}?{query_string}"
132134

133135
client = asgi_scope.get("client")
134136
if client and should_send_default_pii():

tests/integrations/asgi/test_asgi.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ async def test_capture_transaction(
217217
)
218218

219219
if should_send_pii:
220-
assert span["attributes"]["url.full"] == "http://localhost/some_url"
220+
assert (
221+
span["attributes"]["url.full"]
222+
== "http://localhost/some_url?somevalue=123"
223+
)
221224
assert span["attributes"]["http.query"] == "somevalue=123"
222225

223226
else:

0 commit comments

Comments
 (0)