Class SpanFlags
java.lang.Object
io.opentelemetry.exporter.internal.otlp.traces.SpanFlags
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 Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote flag bit on.static int
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 TraceFlags
getTraceFlags
(int flags) Returns the W3CTraceFlags
(least significant 8 bits) portion from the given 32 bit span flags fields.static boolean
isKnownWhetherParentIsRemote
(int flags) Checks whether the given flags contain information about parent context being remote or not.static boolean
isParentRemote
(int flags) Checks whether in the given flags the parent is marked as remote.static int
withParentIsRemoteFlags
(TraceFlags traceFlags, boolean isParentRemote) Returns the int (fixed32) representation of theTraceFlags
enriched with the flags indicating a remote parent.
-
Field Details
-
CONTEXT_HAS_IS_REMOTE_BIT
static final int CONTEXT_HAS_IS_REMOTE_BIT- See Also:
-
CONTEXT_IS_REMOTE_BIT
static final int CONTEXT_IS_REMOTE_BIT- See Also:
-
CONTEXT_IS_REMOTE_MASK
static final int CONTEXT_IS_REMOTE_MASK- See Also:
-
-
Constructor Details
-
SpanFlags
private SpanFlags()
-
-
Method Details
-
withParentIsRemoteFlags
Returns the int (fixed32) representation of theTraceFlags
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
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.
-