How to use the aiozipkin.record.Record function in aiozipkin

To help you get started, we’ve selected a few aiozipkin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aiozipkin / tests / test_record.py View on Github external
def test_basic_ctr():
    context = TraceContext('string', 'string', 'string', True, True, True)
    local_endpoint = Endpoint('string', 'string', 'string', 0)
    remote_endpoint = Endpoint('string', 'string', 'string', 0)
    record = (Record(context, local_endpoint)
              .start(0)
              .name('string')
              .set_tag('additionalProp1', 'string')
              .set_tag('additionalProp2', 'string')
              .set_tag('additionalProp3', 'string')
              .kind('CLIENT')
              .annotate('string', 0)
              .remote_endpoint(remote_endpoint)
              .finish(0)
              )
    dict_record = record.asdict()
    expected = {
        'traceId': 'string',
        'name': 'string',
        'parentId': 'string',
        'id': 'string',
github aio-libs / aiozipkin / aiozipkin / tracer.py View on Github external
def __init__(self,
                 transport: TransportABC,
                 sampler: SamplerABC,
                 local_endpoint: Endpoint) -> None:
        super().__init__()
        self._records: Dict[TraceContext, Record] = {}
        self._transport = transport
        self._sampler = sampler
        self._local_endpoint = local_endpoint
github aio-libs / aiozipkin / aiozipkin / transport.py View on Github external
def __init__(self, queue_length: int = 100) -> None:
        logger.info('Zipkin address was not provided, using stub transport')
        self.records: Deque[Record] = deque(maxlen=queue_length)
github aio-libs / aiozipkin / aiozipkin / tracer.py View on Github external
def to_span(self, context: TraceContext) -> SpanAbc:
        if not context.sampled:
            return NoopSpan(self, context)

        record = Record(context, self._local_endpoint)
        self._records[context] = record
        return Span(self, context, record)