diff --git a/skywalking/trace/segment/__init__.py b/skywalking/trace/segment/__init__.py index bf1a71ee842c7c1d208e467635875b2b3cb2d28f..4a8d905e58ab1f7805aec3b2deec86b83f481a20 100644 --- a/skywalking/trace/segment/__init__.py +++ b/skywalking/trace/segment/__init__.py @@ -37,6 +37,18 @@ class SegmentRef(object): self.endpoint = carrier.endpoint # type: str self.client_address = carrier.client_address # type: str + def __eq__(self, other): + if not isinstance(other, SegmentRef): + raise NotImplementedError + return self.ref_type == other.ref_type and \ + self.trace_id == other.trace_id and \ + self.segment_id == other.segment_id and \ + self.span_id == other.span_id and \ + self.service == other.service and \ + self.service_instance == other.service_instance and \ + self.endpoint == other.endpoint and \ + self.client_address == other.client_address + class _NewID(ID): pass