TraceState class
Key-value pairs carried along with a span context. TraceState follows the W3C Trace Context specification.
Constructors
- TraceState.empty()
-
Creates an empty TraceState.
factory
-
TraceState.fromMap(Map<
String, String> entries) -
Creates a new TraceState from a list of key-value pairs.
factory
- TraceState.fromString(String? headerValue)
-
Create TraceState from a W3C trace context header string
factory
Properties
-
entries
→ Map<
String, String> -
Returns an unmodifiable view of all key-value entries in this trace state.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEmpty → bool
-
Returns true if there are no entries.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asMap(
) → Map< String, String> - Returns an immutable map of the key-value pairs in this trace state.
-
get(
String key) → String? - Returns the value for the given key, or null if not present.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
String key, String value) → TraceState - Creates a new TraceState with the given key-value pair added. If adding this pair would exceed the 32 key-value pair limit, the oldest entries are removed to make room.
-
remove(
String key) → TraceState -
Creates a new TraceState with the given
key
removed. -
toString(
) → String -
Convert to W3C trace context header string
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override