Class W3CTraceContextEncoding
- java.lang.Object
-
- io.opentelemetry.api.trace.propagation.internal.W3CTraceContextEncoding
-
@Immutable public final class W3CTraceContextEncoding extends java.lang.ObjectImplementation of thetracestateheader encoding and decoding as defined by the W3C Trace Context recommendation.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 private static charTRACESTATE_ENTRY_DELIMITERprivate static java.util.regex.PatternTRACESTATE_ENTRY_DELIMITER_SPLIT_PATTERNprivate static charTRACESTATE_KEY_VALUE_DELIMITERprivate static intTRACESTATE_MAX_MEMBERSprivate static intTRACESTATE_MAX_SIZE
-
Constructor Summary
Constructors Modifier Constructor Description privateW3CTraceContextEncoding()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TraceStatedecodeTraceState(java.lang.String traceStateHeader)Decodes a trace state header into aTraceStateobject.static java.lang.StringencodeTraceState(TraceState traceState)Return the trace state encoded as a string according to the W3C specification.
-
-
-
Field Detail
-
TRACESTATE_MAX_SIZE
private static final int TRACESTATE_MAX_SIZE
- See Also:
- Constant Field Values
-
TRACESTATE_MAX_MEMBERS
private static final int TRACESTATE_MAX_MEMBERS
- See Also:
- Constant Field Values
-
TRACESTATE_KEY_VALUE_DELIMITER
private static final char TRACESTATE_KEY_VALUE_DELIMITER
- See Also:
- Constant Field Values
-
TRACESTATE_ENTRY_DELIMITER
private static final char TRACESTATE_ENTRY_DELIMITER
- See Also:
- Constant Field Values
-
TRACESTATE_ENTRY_DELIMITER_SPLIT_PATTERN
private static final java.util.regex.Pattern TRACESTATE_ENTRY_DELIMITER_SPLIT_PATTERN
-
-
Method Detail
-
decodeTraceState
public static TraceState decodeTraceState(java.lang.String traceStateHeader)
Decodes a trace state header into aTraceStateobject.- Throws:
java.lang.IllegalArgumentException- iftraceStateHeaderdoes not comply with the specification
-
encodeTraceState
public static java.lang.String encodeTraceState(TraceState traceState)
Return the trace state encoded as a string according to the W3C specification.
-
-