diff --git a/thriftpy/contrib/tracking/__init__.py b/thriftpy/contrib/tracking/__init__.py index 5e80b40..7c4f0f4 100644 --- a/thriftpy/contrib/tracking/__init__.py +++ b/thriftpy/contrib/tracking/__init__.py @@ -69,6 +69,7 @@ def _negotiation(self): self._oprot.write_message_begin(track_method, TMessageType.CALL, self._seqid) args = track_thrift.UpgradeArgs() + self.tracker.init_handshake_info(args) args.write(self._oprot) self._oprot.write_message_end() self._oprot.trans.flush() @@ -148,6 +149,7 @@ def _try_upgrade(self, iprot): args = track_thrift.UpgradeArgs() args.read(iprot) + self.tracker.handle_handshake_info(args) result = track_thrift.UpgradeReply() result.oneway = False diff --git a/thriftpy/contrib/tracking/tracker.py b/thriftpy/contrib/tracking/tracker.py index 2f70c69..d0025e5 100644 --- a/thriftpy/contrib/tracking/tracker.py +++ b/thriftpy/contrib/tracking/tracker.py @@ -101,6 +101,12 @@ def get_request_id(self): return ctx.header.request_id return str(uuid.uuid4()) + def init_handshake_info(self, handshake_obj): + pass + + def handle_handshake_info(self, handshake_obj): + pass + class ConsoleTracker(TrackerBase): def record(self, header, exception): diff --git a/thriftpy/contrib/tracking/tracking.thrift b/thriftpy/contrib/tracking/tracking.thrift index 5e129e5..f4aaebc 100644 --- a/thriftpy/contrib/tracking/tracking.thrift +++ b/thriftpy/contrib/tracking/tracking.thrift @@ -11,4 +11,6 @@ struct RequestHeader { * This is the struct that a successful upgrade will reply with. */ struct UpgradeReply {} -struct UpgradeArgs {} +struct UpgradeArgs { + 1: string app_id +}