hs-opentelemetry-api-0.0.3.8: OpenTelemetry API for use by libraries for direct instrumentation or wrapper packages.
Copyright(c) Ian Duncan 2021
LicenseBSD-3
MaintainerIan Duncan
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTelemetry.Propagator

Description

Cross-cutting concerns send their state to the next process using Propagators, which are defined as objects used to read and write context data to and from messages exchanged by the applications. Each concern creates a set of Propagators for every supported Propagator type.

Propagators leverage the Context to inject and extract data for each cross-cutting concern, such as traces and Baggage.

Propagation is usually implemented via a cooperation of library-specific request interceptors and Propagators, where the interceptors detect incoming and outgoing requests and use the Propagator's extract and inject operations respectively.

The Propagators API is expected to be leveraged by users writing instrumentation libraries. However, users using the OpenTelemetry SDK may need to select appropriate propagators to work with existing 3rd party systems such as AWS.

Synopsis

Documentation

data Propagator context inboundCarrier outboundCarrier Source #

A carrier is the medium used by Propagators to read values from and write values to. Each specific Propagator type defines its expected carrier type, such as a string map or a byte array.

Constructors

Propagator 

Fields

Instances

Instances details
Monoid (Propagator c i o) Source # 
Instance details

Defined in OpenTelemetry.Propagator

Methods

mempty :: Propagator c i o #

mappend :: Propagator c i o -> Propagator c i o -> Propagator c i o #

mconcat :: [Propagator c i o] -> Propagator c i o #

Semigroup (Propagator c i o) Source # 
Instance details

Defined in OpenTelemetry.Propagator

Methods

(<>) :: Propagator c i o -> Propagator c i o -> Propagator c i o #

sconcat :: NonEmpty (Propagator c i o) -> Propagator c i o #

stimes :: Integral b => b -> Propagator c i o -> Propagator c i o #

extract Source #

Arguments

:: MonadIO m 
=> Propagator context i o 
-> i

The carrier that holds the propagation fields. For example, an incoming message or HTTP request.

-> context 
-> m context

a new Context derived from the Context passed as argument, containing the extracted value, which can be a SpanContext, Baggage or another cross-cutting concern context.

Extracts the value from an incoming request. For example, from the headers of an HTTP request.

If a value can not be parsed from the carrier, for a cross-cutting concern, the implementation MUST NOT throw an exception and MUST NOT store a new value in the Context, in order to preserve any previously existing valid value.

inject Source #

Arguments

:: MonadIO m 
=> Propagator context i o 
-> context 
-> o

The carrier that holds the propagation fields. For example, an outgoing message or HTTP request.

-> m o 

Injects the value into a carrier. For example, into the headers of an HTTP request.