Copyright | (c) Ian Duncan 2021 |
---|---|
License | BSD-3 |
Maintainer | Ian Duncan |
Stability | experimental |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Distributed tracing is a methodology implemented by tracing tools to follow, analyze and debug a transaction across multiple software components. Typically, a distributed trace traverses more than one component which requires it to be uniquely identifiable across all participating systems. Trace context propagation passes along this unique identification. Today, trace context propagation is implemented individually by each tracing vendor. In multi-vendor environments, this causes interoperability problems, like:
- Traces that are collected by different tracing vendors cannot be correlated as there is no shared unique identifier.
- Traces that cross boundaries between different tracing vendors can not be propagated as there is no uniformly agreed set of identification that is forwarded.
- Vendor specific metadata might be dropped by intermediaries.
- Cloud platform vendors, intermediaries and service providers, cannot guarantee to support trace context propagation as there is no standard to follow.
- In the past, these problems did not have a significant impact as most applications were monitored by a single tracing vendor and stayed within the boundaries of a single platform provider. Today, an increasing number of applications are highly distributed and leverage multiple middleware services and cloud platforms.
- This transformation of modern applications calls for a distributed tracing context propagation standard.
This module therefore provides support for tracing context propagation in accordance with the W3C tracing context propagation specifications: https://www.w3.org/TR/trace-context/
Synopsis
- data TraceParent = TraceParent {
- version :: !Word8
- traceId :: !TraceId
- parentId :: !SpanId
- traceFlags :: !TraceFlags
- decodeSpanContext :: Maybe ByteString -> Maybe ByteString -> Maybe SpanContext
- traceparentParser :: Parser TraceParent
- encodeSpanContext :: Span -> IO (ByteString, ByteString)
- w3cTraceContextPropagator :: Propagator Context RequestHeaders ResponseHeaders
Documentation
data TraceParent Source #
TraceParent | |
|
Instances
Show TraceParent Source # | |
Defined in OpenTelemetry.Propagator.W3CTraceContext showsPrec :: Int -> TraceParent -> ShowS # show :: TraceParent -> String # showList :: [TraceParent] -> ShowS # |
:: Maybe ByteString |
|
-> Maybe ByteString |
|
-> Maybe SpanContext |
Attempt to decode a SpanContext
from optional traceparent
and tracestate
header inputs.
Since: 0.0.1.0
encodeSpanContext :: Span -> IO (ByteString, ByteString) Source #
Encoded the given Span
into a traceparent
, tracestate
tuple.
Since: 0.0.1.0
w3cTraceContextPropagator :: Propagator Context RequestHeaders ResponseHeaders Source #
Propagate trace context information via headers using the w3c specification format
Since: 0.0.1.0