Copyright | (c) Ian Duncan 2021 |
---|---|
License | BSD-3 |
Maintainer | Ian Duncan |
Stability | experimental |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The main purpose of the tracestate HTTP header is to provide additional vendor-specific trace identification information across different distributed tracing systems and is a companion header for the traceparent field. It also conveys information about the request’s position in multiple distributed tracing graphs.
The tracestate field may contain any opaque value in any of the keys. Tracestate MAY be sent or received as multiple header fields. Multiple tracestate header fields MUST be handled as specified by RFC7230 Section 3.2.2 Field Order. The tracestate header SHOULD be sent as a single field when possible, but MAY be split into multiple header fields. When sending tracestate as multiple header fields, it MUST be split according to RFC7230. When receiving multiple tracestate header fields, they MUST be combined into a single header according to RFC7230.
See the W3C specification https://www.w3.org/TR/trace-context/#tracestate-header for more details.
Synopsis
- data TraceState
- newtype Key = Key Text
- newtype Value = Value Text
- empty :: TraceState
- insert :: Key -> Value -> TraceState -> TraceState
- update :: Key -> (Value -> Value) -> TraceState -> TraceState
- delete :: Key -> TraceState -> TraceState
- toList :: TraceState -> [(Key, Value)]
Documentation
data TraceState Source #
Data structure compliant with the storage and serialization needs of
the W3C tracestate
header.
Instances
Eq TraceState Source # | |
Defined in OpenTelemetry.Trace.TraceState (==) :: TraceState -> TraceState -> Bool # (/=) :: TraceState -> TraceState -> Bool # | |
Ord TraceState Source # | |
Defined in OpenTelemetry.Trace.TraceState compare :: TraceState -> TraceState -> Ordering # (<) :: TraceState -> TraceState -> Bool # (<=) :: TraceState -> TraceState -> Bool # (>) :: TraceState -> TraceState -> Bool # (>=) :: TraceState -> TraceState -> Bool # max :: TraceState -> TraceState -> TraceState # min :: TraceState -> TraceState -> TraceState # | |
Show TraceState Source # | |
Defined in OpenTelemetry.Trace.TraceState showsPrec :: Int -> TraceState -> ShowS # show :: TraceState -> String # showList :: [TraceState] -> ShowS # |
empty :: TraceState Source #
An empty TraceState
key-value pair dictionary
insert :: Key -> Value -> TraceState -> TraceState Source #
Add a key-value pair to a TraceState
O(n)
update :: Key -> (Value -> Value) -> TraceState -> TraceState Source #
Update a value in the TraceState
. Does nothing if
the value associated with the given key doesn't exist.
O(n)
delete :: Key -> TraceState -> TraceState Source #
Remove a key-value pair for the given key.
O(n)
toList :: TraceState -> [(Key, Value)] Source #
Convert the TraceState
to a list.
O(1)