java.lang.Object
io.opentelemetry.exporter.internal.otlp.traces.SpanFlags

public final class SpanFlags extends Object
Represents the 32 bit span flags as specified in the proto definition.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Field Details

  • Constructor Details

    • SpanFlags

      private SpanFlags()
  • Method Details

    • withParentIsRemoteFlags

      public static int withParentIsRemoteFlags(TraceFlags traceFlags, boolean isParentRemote)
      Returns the int (fixed32) representation of the TraceFlags enriched with the flags indicating a remote parent.
      Parameters:
      isParentRemote - indicates whether the parent context is remote
      Returns:
      the int (fixed32) representation of the TraceFlags enriched with the flags indicating a remote parent.
    • getHasParentIsRemoteMask

      public static int getHasParentIsRemoteMask()
      Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote flag bit on.
      Returns:
      the int (fixed32) representation of the 4 bytes flags with the * has_parent_context_is_remote flag bit on.
    • isKnownWhetherParentIsRemote

      public static boolean isKnownWhetherParentIsRemote(int flags)
      Checks whether the given flags contain information about parent context being remote or not.
      Parameters:
      flags - The int representation of the 32 bit span flags field defined in proto.
      Returns:
      True, if the given flags contain information about the span's parent context being remote, otherwise, false.
    • getParentIsRemoteMask

      public static int getParentIsRemoteMask()
      Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote and parent_context_is_remote flag bits on.
      Returns:
      the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote and parent_context_is_remote flag bits on.
    • isParentRemote

      public static boolean isParentRemote(int flags)
      Checks whether in the given flags the parent is marked as remote.
      Parameters:
      flags - The int representation of the 32 bit span flags field defined in proto.
      Returns:
      True, if the given flags contain information about the span's parent context and the parent is marked as remote, otherwise false.
    • getTraceFlags

      public static TraceFlags getTraceFlags(int flags)
      Returns the W3C TraceFlags (least significant 8 bits) portion from the given 32 bit span flags fields.
      Parameters:
      flags - The int representation of the 32 bit span flags field defined in proto.
      Returns:
      the W3C TraceFlags (least significant 8 bits) portion from the given 32 bit span flags fields.