Package io.opencensus.trace
Class Tracestate
java.lang.Object
io.opencensus.trace.Tracestate
- Direct Known Subclasses:
AutoValue_Tracestate
Carries tracing-system specific context in a list of key-value pairs. TraceState allows different
vendors propagate additional information and inter-operate with their legacy Id formats.
Implementation is optimized for a small list of key-value pairs.
Key is opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /.
Value is opaque string up to 256 characters printable ASCII RFC0020 characters (i.e., the range 0x20 to 0x7E) except comma , and =.
- Since:
- 0.16
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder class forMessageEvent
.static class
Immutable key-value pair forTracestate
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Tracestate.Builder
builder()
Returns aBuilder
based on an emptyTracestate
.private static Tracestate
create
(List<Tracestate.Entry> entries) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.abstract List
<Tracestate.Entry> Returns aList
view of the mappings contained in thisTraceState
.Returns aBuilder
based on thisTracestate
.private static boolean
validateKey
(String key) private static boolean
validateValue
(String value)
-
Field Details
-
KEY_MAX_SIZE
private static final int KEY_MAX_SIZE- See Also:
-
VALUE_MAX_SIZE
private static final int VALUE_MAX_SIZE- See Also:
-
MAX_KEY_VALUE_PAIRS
private static final int MAX_KEY_VALUE_PAIRS- See Also:
-
-
Constructor Details
-
Tracestate
Tracestate()
-
-
Method Details
-
get
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.- Parameters:
key
- with which the specified value is to be associated- Returns:
- the value to which the specified key is mapped, or null if this map contains no mapping for the key.
- Since:
- 0.16
-
getEntries
Returns aList
view of the mappings contained in thisTraceState
.- Returns:
- a
List
view of the mappings contained in thisTraceState
. - Since:
- 0.16
-
builder
Returns aBuilder
based on an emptyTracestate
.- Returns:
- a
Builder
based on an emptyTracestate
. - Since:
- 0.16
-
toBuilder
Returns aBuilder
based on thisTracestate
.- Returns:
- a
Builder
based on thisTracestate
. - Since:
- 0.16
-
validateKey
-
validateValue
-
create
-