Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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]
Exemplo n.º 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