Class SpanFlags
- java.lang.Object
-
- io.opentelemetry.exporter.internal.otlp.traces.SpanFlags
-
public final class SpanFlags extends java.lang.ObjectRepresents 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 Summary
Fields Modifier and Type Field Description (package private) static intCONTEXT_HAS_IS_REMOTE_BIT(package private) static intCONTEXT_IS_REMOTE_BIT(package private) static intCONTEXT_IS_REMOTE_MASK
-
Constructor Summary
Constructors Modifier Constructor Description privateSpanFlags()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetHasParentIsRemoteMask()Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote flag bit on.static intgetParentIsRemoteMask()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.static TraceFlagsgetTraceFlags(int flags)Returns the W3CTraceFlags(least significant 8 bits) portion from the given 32 bit span flags fields.static booleanisKnownWhetherParentIsRemote(int flags)Checks whether the given flags contain information about parent context being remote or not.static booleanisParentRemote(int flags)Checks whether in the given flags the parent is marked as remote.static intwithParentIsRemoteFlags(TraceFlags traceFlags, boolean isParentRemote)Returns the int (fixed32) representation of theTraceFlagsenriched with the flags indicating a remote parent.
-
-
-
Field Detail
-
CONTEXT_HAS_IS_REMOTE_BIT
static final int CONTEXT_HAS_IS_REMOTE_BIT
- See Also:
- Constant Field Values
-
CONTEXT_IS_REMOTE_BIT
static final int CONTEXT_IS_REMOTE_BIT
- See Also:
- Constant Field Values
-
CONTEXT_IS_REMOTE_MASK
static final int CONTEXT_IS_REMOTE_MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
withParentIsRemoteFlags
public static int withParentIsRemoteFlags(TraceFlags traceFlags, boolean isParentRemote)
Returns the int (fixed32) representation of theTraceFlagsenriched with the flags indicating a remote parent.- Parameters:
isParentRemote- indicates whether the parent context is remote- Returns:
- the int (fixed32) representation of the
TraceFlagsenriched 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 W3CTraceFlags(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.
-
-