Skip to content

Commit 3d95ef4

Browse files
committed
fix(boto3): overwrite server attributes when request URL is resolved
1 parent d47c779 commit 3d95ef4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎sentry_sdk/integrations/boto3/_instrumentation.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _get_server_attributes(endpoint_url: "Optional[str]") -> "Attributes":
6969
}
7070

7171
except (TypeError, UnicodeError, ValueError):
72-
# Invalid client metadata must not prevent the AWS call from running.
72+
# invalid client metadata must not prevent the AWS call from running.
7373
return {}
7474

7575

@@ -280,6 +280,9 @@ def _set_request_attributes(
280280
with capture_internal_exceptions():
281281
parsed_url = parse_url(request.url, sanitize=False)
282282

283+
# overwrite server attributes when actual request URL is resolved.
284+
_set_span_attributes(span, _get_server_attributes(request.url))
285+
283286
if isinstance(span, StreamedSpan):
284287
span.set_attributes(get_url_attributes(client, parsed_url))
285288
if request.method is not None:

0 commit comments

Comments
 (0)