예제 #1
0
    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
예제 #2
0
 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)
예제 #3
0
 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]
예제 #4
0
 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