Interface TraceFlags


@Immutable public interface TraceFlags
A valid trace flags is a byte or 2 character lowercase hex (base16) String.

These options are propagated to all child spans. These determine features such as whether a Span should be traced.

  • Method Details

    • getLength

      static int getLength()
      Returns the length of the lowercase hex (base16) representation of the TraceFlags.
      Returns:
      the length of the lowercase hex (base16) representation of the TraceFlags.
    • getDefault

      static TraceFlags getDefault()
      Returns the default (with all flag bits off) byte representation of the TraceFlags.
      Returns:
      the default (with all flag bits off) byte representation of the TraceFlags.
    • getSampled

      static TraceFlags getSampled()
      Returns the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.
      Returns:
      the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.
    • fromHex

      static TraceFlags fromHex(CharSequence src, int srcOffset)
      Returns the TraceFlags converted from the given lowercase hex (base16) representation.

      This may throw runtime exceptions if the input is invalid.

      Parameters:
      src - the buffer where the hex (base16) representation of the TraceFlags is.
      srcOffset - the offset int buffer.
      Returns:
      the TraceFlags converted from the given lowercase hex (base16) representation.
    • fromByte

      static TraceFlags fromByte(byte traceFlagsByte)
      Returns the TraceFlags converted from the given byte representation.
      Parameters:
      traceFlagsByte - the byte representation of the TraceFlags.
      Returns:
      the TraceFlags converted from the given byte representation.
    • isSampled

      boolean isSampled()
      Returns true if the sampling bit is on for this TraceFlags, otherwise false.
      Returns:
      true if the sampling bit is on for this TraceFlags, otherwise * false.
    • asHex

      String asHex()
      Returns the lowercase hex (base16) representation of this TraceFlags.
      Returns:
      the byte representation of the TraceFlags.
    • asByte

      byte asByte()
      Returns the byte representation of this TraceFlags.
      Returns:
      the byte representation of the TraceFlags.