hs-opentelemetry-api-0.2.0.0: 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.Context

Description

The ability to correlate events across service boundaries is one of the principle concepts behind distributed tracing. To find these correlations, components in a distributed system need to be able to collect, store, and transfer metadata referred to as context.

A context will often have information identifying the current span and trace, and can contain arbitrary correlations as key-value pairs.

Propagation is the means by which context is bundled and transferred in and across services, often via HTTP headers.

Together, context and propagation represent the engine behind distributed tracing.

Synopsis

Documentation

data Key a Source #

Keys are used to allow cross-cutting concerns to control access to their local state. They are unique such that other libraries which may use the same context cannot accidentally use the same key. It is recommended that concerns mediate data access via an API, rather than provide direct public access to their keys.

newKey :: MonadIO m => Text -> m (Key a) Source #

data Context Source #

A Context is a propagation mechanism which carries execution-scoped values across API boundaries and between logically associated execution units. Cross-cutting concerns access their data in-process using the same shared Context object

Instances

Instances details
Monoid Context Source # 
Instance details

Defined in OpenTelemetry.Context.Types

Semigroup Context Source # 
Instance details

Defined in OpenTelemetry.Context.Types

class HasContext s where Source #

Methods

contextL :: Lens' s Context Source #

insert :: Key a -> a -> Context -> Context Source #

adjust :: (a -> a) -> Key a -> Context -> Context Source #