Skip to content

Commit 25c79a2

Browse files
authored
Update patch.py for requests
Patching the `send` function instead of `request` (this achieves the same affect)
1 parent 17b033e commit 25c79a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_xray_sdk/ext/requests/patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def patch():
99

1010
wrapt.wrap_function_wrapper(
1111
'requests',
12-
'Session.request',
12+
'Session.send',
1313
_xray_traced_requests
1414
)
1515

@@ -22,7 +22,7 @@ def patch():
2222

2323
def _xray_traced_requests(wrapped, instance, args, kwargs):
2424

25-
url = kwargs.get('url') or args[1]
25+
url = args[1].url
2626

2727
return xray_recorder.record_subsegment(
2828
wrapped, instance, args, kwargs,

0 commit comments

Comments
 (0)