def make_process(service_name, tags, max_length):
    return ttypes.Process(
        serviceName=service_name,
        tags=make_tags(tags=tags,
                       max_length=max_length,
                       max_traceback_length=MAX_TRACEBACK_LENGTH),
    )
def _marshall_span(span):
    class TestTrans(TMemoryBuffer):
        def now_reading(self):
            """
            Thrift TMemoryBuffer is not read-able AND write-able,
            it's one or the other (really? yes.). This will convert
            us from write-able to read-able.
            """
            self._buffer = BytesIO(self.getvalue())

    batch = thrift.make_jaeger_batch(
        spans=[span], process=ttypes.Process(serviceName='x', tags={}))

    # write and read them to test encoding
    args = Agent.emitBatch_args(batch)
    t = TestTrans()
    prot = TCompactProtocol(t)
    args.write(prot)
    t.now_reading()
    args.read(prot)
Example #3
0
def make_process(service_name, tags, max_length):
    return ttypes.Process(
        serviceName=service_name,
        tags=make_tags(tags=tags, max_length=max_length),
    )