From 64db0c222adc0d6b5c52501e896e9d599e27fabe Mon Sep 17 00:00:00 2001 From: Ben Fitzhardinge Date: Wed, 20 Feb 2019 11:57:23 +0800 Subject: [PATCH] updated sampling_decision to match AWS Xray SDK expectations --- apistar_aws_xray/event_hooks/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apistar_aws_xray/event_hooks/__init__.py b/apistar_aws_xray/event_hooks/__init__.py index 92102d8..52cf175 100644 --- a/apistar_aws_xray/event_hooks/__init__.py +++ b/apistar_aws_xray/event_hooks/__init__.py @@ -25,13 +25,18 @@ def on_request(self, xray_header = construct_xray_header(headers) name = calculate_segment_name(host, self._recorder) + + sampling_req = { + 'host': host, + 'method': method, + 'path': path, + 'service': name, + } sampling_decision = calculate_sampling_decision( trace_header=xray_header, recorder=self._recorder, - service_name=host, - method=method, - path=path + sampling_req=sampling_req, ) segment = self._recorder.begin_segment(