Top Description Methods
io.opentelemetry.api.trace

public Interface TraceFlags

Known Direct Implementers
io.opentelemetry.api.trace.ImmutableTraceFlags
Annotations
@Immutable
Imports
javax.annotation.concurrent.Immutable

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 Summary

Modifier and TypeMethod and Description
public byte

Returns:

the byte representation of the TraceFlags.
asByte
()

Returns the byte representation of this TraceFlags.

public String

Returns:

the byte representation of the TraceFlags.
asHex
()

Returns the lowercase hex (base16) representation of this TraceFlags.

public static TraceFlags

Returns:

the TraceFlags converted from the given byte representation.
fromByte
(byte
the byte representation of the TraceFlags.
traceFlagsByte
)

Returns the TraceFlags converted from the given byte representation.

public static TraceFlags

Returns:

the TraceFlags converted from the given lowercase hex (base16) representation.
fromHex
(CharSequence
the buffer where the hex (base16) representation of the TraceFlags is.
src
,
int
the offset int buffer.
srcOffset
)

Returns the TraceFlags converted from the given lowercase hex (base16) representation.

public static TraceFlags

Returns:

the default (with all flag bits off) byte representation of the TraceFlags.
getDefault
()

Returns the default (with all flag bits off) byte representation of the TraceFlags.

public static int

Returns:

the length of the lowercase hex (base16) representation of the TraceFlags.
getLength
()

Returns the length of the lowercase hex (base16) representation of the TraceFlags.

public static TraceFlags

Returns:

the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.
getSampled
()

Returns the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.

public boolean

Returns:

true if the sampling bit is on for this TraceFlags, otherwise * false.
isSampled
()

Returns true if the sampling bit is on for this TraceFlags, otherwise false.

Method Detail

asByteback to summary
public byte asByte()

Returns the byte representation of this TraceFlags.

Returns:byte

the byte representation of the TraceFlags.

asHexback to summary
public String asHex()

Returns the lowercase hex (base16) representation of this TraceFlags.

Returns:String

the byte representation of the TraceFlags.

fromByteback to summary
public static TraceFlags fromByte(byte traceFlagsByte)

Returns the TraceFlags converted from the given byte representation.

Parameters
traceFlagsByte:byte

the byte representation of the TraceFlags.

Returns:TraceFlags

the TraceFlags converted from the given byte representation.

fromHexback to summary
public 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:CharSequence

the buffer where the hex (base16) representation of the TraceFlags is.

srcOffset:int

the offset int buffer.

Returns:TraceFlags

the TraceFlags converted from the given lowercase hex (base16) representation.

getDefaultback to summary
public static TraceFlags getDefault()

Returns the default (with all flag bits off) byte representation of the TraceFlags.

Returns:TraceFlags

the default (with all flag bits off) byte representation of the TraceFlags.

getLengthback to summary
public static int getLength()

Returns the length of the lowercase hex (base16) representation of the TraceFlags.

Returns:int

the length of the lowercase hex (base16) representation of the TraceFlags.

getSampledback to summary
public static TraceFlags getSampled()

Returns the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.

Returns:TraceFlags

the lowercase hex (base16) representation of the TraceFlags with the sampling flag bit on.

isSampledback to summary
public boolean isSampled()

Returns true if the sampling bit is on for this TraceFlags, otherwise false.

Returns:boolean

true if the sampling bit is on for this TraceFlags, otherwise * false.