From c4e3664d1cb983dcec9c7a8d3ff95bc924bbdd4b Mon Sep 17 00:00:00 2001 From: Matthieu Devlin Date: Fri, 23 Jun 2023 07:47:00 -0700 Subject: [PATCH] fix: review 2 changes --- sentry_sdk/integrations/aiohttp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/integrations/aiohttp.py b/sentry_sdk/integrations/aiohttp.py index 5d360b79eb..c6f26cace9 100644 --- a/sentry_sdk/integrations/aiohttp.py +++ b/sentry_sdk/integrations/aiohttp.py @@ -23,6 +23,7 @@ transaction_from_function, HAS_REAL_CONTEXTVARS, CONTEXTVARS_ERROR_MESSAGE, + SENSITIVE_DATA_SUBSTITUTE, AnnotatedValue, ) @@ -203,14 +204,16 @@ async def on_request_start(session, trace_config_ctx, params): parsed_url = parse_url(str(params.url), sanitize=False) span = hub.start_span( - op=OP.HTTP_CLIENT, description="%s %s" % (method, parsed_url) + op=OP.HTTP_CLIENT, + description="%s %s" + % (method, parsed_url.url if parsed_url else SENSITIVE_DATA_SUBSTITUTE), ) span.set_data(SPANDATA.HTTP_METHOD, method) span.set_data("url", parsed_url.url) span.set_data(SPANDATA.HTTP_QUERY, parsed_url.query) span.set_data(SPANDATA.HTTP_FRAGMENT, parsed_url.fragment) - if should_propagate_trace(hub, parsed_url.url): + if should_propagate_trace(hub, str(params.url)): for key, value in hub.iter_trace_propagation_headers(span): logger.debug( "[Tracing] Adding `{key}` header {value} to outgoing request to {url}.".format(