def extract(self, carrier: 'Carrier') -> 'Span': if carrier is None: return self self.context.segment.relate(ID(carrier.trace_id)) self.context._correlation = carrier.correlation_carrier.correlation return self
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 __init__(self): self.segment_id = ID() # type: ID self.spans = [] # type: List[Span] self.timestamp = int(time.time() * 1000) # type: int self.related_traces = [_NewID()] # type: List[ID]
def __init__(self): self.trace_id = ID() # type: ID self.segment_id = ID() # type: ID self.spans = [] # type: List[Span] self.timestamp = int(time.time() * 1000) # type: int