def continued(self, snapshot: 'Snapshot'): if snapshot is None: return None if not snapshot.is_from_current(self) and snapshot.is_valid(): ref = SegmentRef.build_ref(snapshot) span = self.active_span() span.refs.append(ref) self.segment.relate(ID(ref.trace_id)) self._correlation.update(snapshot.correlation)
def extract(self, carrier: 'Carrier') -> 'Span': Span.extract(self, carrier) if carrier is None or not carrier.is_valid: return self ref = SegmentRef(carrier=carrier) if ref not in self.refs: self.refs.append(ref) return self