예제 #1
0
def make_jaeger_batch(spans, process):
    batch = ttypes.Batch(
        spans=[],
        process=process,
    )
    for span in spans:
        with span.update_lock:
            jaeger_span = make_jaeger_span(span)
        batch.spans.append(jaeger_span)
    return batch
예제 #2
0
def make_jaeger_batch(spans, process):
    batch = ttypes.Batch(
        spans=[],
        process=process,
    )
    for span in spans:
        with span.update_lock:
            jaeger_span = ttypes.Span(
                traceIdLow=id_to_int(_id_to_low(span.trace_id)),
                traceIdHigh=id_to_int(_id_to_high(span.trace_id)),
                spanId=id_to_int(span.span_id),
                parentSpanId=id_to_int(span.parent_id) or 0,
                operationName=span.operation_name,
                references=make_references(span.references),
                flags=span.context.flags,
                startTime=timestamp_micros(span.start_time),
                duration=timestamp_micros(span.end_time - span.start_time),
                tags=span.tags,  # TODO
                logs=span.logs,  # TODO
            )
        batch.spans.append(jaeger_span)
    return batch