def get_upper_long_from_trace_id(trace_id):
    """Returns the upper 8 bytes of the trace ID as a long value, assuming
    little endian order.

    :rtype: long
    :returns: Upper 8 bytes of trace ID
    """
    upper_bytes = trace_id[:16]
    upper_long = int(upper_bytes, 16)

    return upper_long