fn convert_otel_span_into_jaeger_span(
    span: trace::SpanData,
    export_instrument_lib: bool,
) -> jaeger::Span {
    let trace_id = span.span_context.trace_id().to_u128();
    let trace_id_high = (trace_id >> 64) as i64;
    let trace_id_low = trace_id as i64;
    jaeger::Span {
        trace_id_low,
        trace_id_high,
        span_id: span.span_context.span_id().to_u64() as i64,
        parent_span_id: span.parent_span_id.to_u64() as i64,
        operation_name: span.name,
        references: links_to_references(span.links),
        flags: span.span_context.trace_flags() as i32,
        start_time: span
            .start_time
            .duration_since(SystemTime::UNIX_EPOCH)
            .unwrap_or_else(|_| Duration::from_secs(0))
            .as_micros() as i64,
        duration: span
            .end_time
            .duration_since(span.start_time)
            .unwrap_or_else(|_| Duration::from_secs(0))
            .as_micros() as i64,
        tags: build_span_tags(
            span.attributes,
            if export_instrument_lib {
                Some(span.instrumentation_lib)
            } else {
                None
            },
            span.status_code,
            span.status_message,
            span.span_kind,
        ),
        logs: events_to_logs(span.message_events),
    }
}
/// Convert spans to jaeger thrift span for exporting.
Convert spans to jaeger thrift span for exporting.
Convert spans to jaeger thrift span for exporting .
fn convert_otel_span_into_jaeger_span(
    span: trace::SpanData,
    export_instrument_lib: bool,
) -> jaeger::Span {
    let trace_id = span.span_context.trace_id().to_u128();
    let trace_id_high = (trace_id >> 64) as i64;
    let trace_id_low = trace_id as i64;
    jaeger::Span {
        trace_id_low,
        trace_id_high,
        span_id: span.span_context.span_id().to_u64() as i64,
        parent_span_id: span.parent_span_id.to_u64() as i64,
        operation_name: span.name,
        references: links_to_references(span.links),
        flags: span.span_context.trace_flags() as i32,
        start_time: span
            .start_time
            .duration_since(SystemTime::UNIX_EPOCH)
            .unwrap_or_else(|_| Duration::from_secs(0))
            .as_micros() as i64,
        duration: span
            .end_time
            .duration_since(span.start_time)
            .unwrap_or_else(|_| Duration::from_secs(0))
            .as_micros() as i64,
        tags: build_span_tags(
            span.attributes,
            if export_instrument_lib {
                Some(span.instrumentation_lib)
            } else {
                None
            },
            span.status_code,
            span.status_message,
            span.span_kind,
        ),
        logs: events_to_logs(span.message_events),
    }
}
fn convert_otel_span_into_jaeger_span ( span : trace :: SpanData , export_instrument_lib : bool , ) -> jaeger :: Span { let trace_id = span . span_context . trace_id ( ) . to_u128 ( ) ; let trace_id_high = ( trace_id >> 64 ) as i64 ; let trace_id_low = trace_id as i64 ; jaeger :: Span { trace_id_low , trace_id_high , span_id : span . span_context . span_id ( ) . to_u64 ( ) as i64 , parent_span_id : span . parent_span_id . to_u64 ( ) as i64 , operation_name : span . name , references : links_to_references ( span . links ) , flags : span . span_context . trace_flags ( ) as i32 , start_time : span . start_time . duration_since ( SystemTime :: UNIX_EPOCH ) . unwrap_or_else ( | _ | Duration :: from_secs ( 0 ) ) . as_micros ( ) as i64 , duration : span . end_time . duration_since ( span . start_time ) . unwrap_or_else ( | _ | Duration :: from_secs ( 0 ) ) . as_micros ( ) as i64 , tags : build_span_tags ( span . attributes , if export_instrument_lib { Some ( span . instrumentation_lib ) } else { None } , span . status_code , span . status_message , span . span_kind , ) , logs : events_to_logs ( span . message_events ) , } }
Convert spans to jaeger thrift span for exporting.
Convert spans to jaeger thrift span for exporting .
span
trace::SpanData
export_instrument_lib
bool
span
trace::SpanData
export_instrument_lib
bool