Skip to content

Commit 3142b16

Browse files
authored
fix(boto3): Guard setting method (#6288)
### Description Check that `request.method` is not `None` before setting it. We do this in the span streaming path but not in legacy tracing. #### Issues - Closes https://linear.app/getsentry/issue/PY-2406/guard-setting-requestmethod-in-boto3-integration - Closes #6212 #### Reminders - Please add tests to validate your changes, and lint your code using `tox -e linters`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
1 parent 66824a4 commit 3142b16

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sentry_sdk/integrations/boto3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def _sentry_request_created(
9999

100100
span.set_tag("aws.service_id", service_id.hyphenize())
101101
span.set_tag("aws.operation_name", operation_name)
102-
span.set_data(SPANDATA.HTTP_METHOD, request.method)
102+
if request.method is not None:
103+
span.set_data(SPANDATA.HTTP_METHOD, request.method)
103104

104105
# We do it in order for subsequent http calls/retries be
105106
# attached to this span.

0 commit comments

Comments
 (0)