Skip to content

Commit e0a5492

Browse files
ref(tracing): Remove unused get_url_attributes_legacy (#8156)
### Description Removes `get_url_attributes_legacy()` from `sentry_sdk/tracing_utils.py`. Nothing on `major/3.0` calls it anymore. Its callers were the outgoing HTTP client integrations (pyreqwest, httpx, httpx2). It handled their old `send_default_pii` behavior. When #7698, #7819 and #7830 dropped `send_default_pii` support from those integrations, each one removed its calls and switched to `get_url_attributes()`. The legacy helper was left behind. **Evidence** - On `major/3.0`, `git grep -w get_url_attributes_legacy` matches only the definition. There are no callers in `sentry_sdk`, `tests`, `scripts` or `docs`. - No open PR mentions it. The function doesn't exist on `master`, so a future `master` → `major/3.0` merge can't bring it back. `get_url_attributes()` and `_apply_data_collection_filtering_to_query_string` are still used, so they stay. #### Issues n/a <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
1 parent 202b023 commit e0a5492

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

‎sentry_sdk/tracing_utils.py‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -166,39 +166,6 @@ def add_http_breadcrumb(status_code: "Optional[int]", data: "dict[str, Any]") ->
166166
sentry_sdk.add_breadcrumb(**kwargs)
167167

168168

169-
def get_url_attributes_legacy(
170-
client: "sentry_sdk.client.BaseClient",
171-
parsed_url: "Optional[ParsedUrl]",
172-
) -> "Attributes":
173-
"""Build the `url.*` span attributes for an outgoing HTTP request.
174-
175-
The query string is filtered according to `data_collection`.
176-
"""
177-
attributes: "Attributes" = {}
178-
if parsed_url is None:
179-
return attributes
180-
181-
query: "Optional[str]" = None
182-
if parsed_url.query:
183-
query = _apply_data_collection_filtering_to_query_string(
184-
query_string=parsed_url.query,
185-
behaviour=client.options["data_collection"]["url_query_params"],
186-
)
187-
188-
url_full = parsed_url.url
189-
if query:
190-
attributes[SPANDATA.URL_QUERY] = query
191-
url_full += "?" + query
192-
193-
if parsed_url.fragment:
194-
attributes[SPANDATA.URL_FRAGMENT] = parsed_url.fragment
195-
url_full += "#" + parsed_url.fragment
196-
197-
attributes[SPANDATA.URL_FULL] = url_full
198-
199-
return attributes
200-
201-
202169
def get_url_attributes(
203170
client: "sentry_sdk.client.BaseClient",
204171
parsed_url: "Optional[ParsedUrl]",

0 commit comments

Comments
 (0)