Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/PY/pinpointPy/libs/_requests/NextSpanPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def isSample(*args, **kwargs):

def onBefore(self, parentId, *args, **kwargs):
traceId, _args, _kwargs = super().onBefore(parentId, *args, **kwargs)
url = _args[1]
url = kwargs.get('url') or args[1]
target = urlparse(url).netloc
###############################################################
pinpoint.add_trace_header(
Expand Down
10 changes: 10 additions & 0 deletions plugins/PY/pinpointPy/libs/_requests/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ def test_request(self):
httpbin = create_http_bin_response(body.text)
self.assertIn(Defines.PP_HEADER_PINPOINT_SPANID, httpbin.headers)

@PinTransaction("testcase", GenTestHeader())
def test_request_kwargs(self):
import requests
parameters = {
'method': "POST", "url": 'http://httpbin/anything', "data": 'abc'
}
body = requests.request(**parameters)
httpbin = create_http_bin_response(body.text)
self.assertIn(Defines.PP_HEADER_PINPOINT_SPANID, httpbin.headers)

def test_request_no_transaction(self):
import requests
from threading import Thread
Expand Down
Loading