/** * Returns the last 8 bytes of this id as a {@code long}. * <p> * The least significant bits (the right part) of an id is preferred to be used for making random sampling decisions. * </p> * <p> * "There are systems that make random sampling decisions based on the value of trace-id. * So to increase interoperability it is recommended to keep the random part on the right side of trace-id value." * </p> * @see <a href="https://github.com/w3c/distributed-tracing/blob/master/trace_context/HTTP_HEADER_FORMAT.md#trace-id">W3C trace context spec</a> * @return the last 8 bytes of this id as a {@code long} */ public long getLeastSignificantBits() { return readLong(data.length - 8); }