TextMapPropagator

org.typelevel.otel4s.context.propagation.TextMapPropagator
See theTextMapPropagator companion object
trait TextMapPropagator[Ctx]

The process of propagating data across process boundaries involves injecting and extracting values in the form of text into carriers that travel in-band.

The encoding used for this process is expected to conform to HTTP Header Field semantics, and values are commonly encoded as request headers for RPC/HTTP requests.

The carriers used for propagating the data are typically HTTP requests, and the process is often implemented using library-specific request interceptors. On the client side, values are injected into the carriers, while on the server side, values are extracted from them.

Type parameters

Ctx

the context to use to extract or inject data

Attributes

Companion
object
Source
TextMapPropagator.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PassThroughPropagator[Ctx, K]

Members list

Value members

Abstract methods

def extract[A : TextMapGetter](ctx: Ctx, carrier: A): Ctx

Extracts key-value pairs from the given carrier and adds them to the given context.

Extracts key-value pairs from the given carrier and adds them to the given context.

Type parameters

A

the type of the carrier object

Value parameters

carrier

holds propagation fields

ctx

the context object to which the key-value pairs are added

Attributes

Returns

the new context with stored key-value pairs

Source
TextMapPropagator.scala

The collection of propagation fields.

The collection of propagation fields.

Attributes

Source
TextMapPropagator.scala
def inject[A : TextMapUpdater](ctx: Ctx, carrier: A): A

Injects data from the context into a copy of the given immutable carrier for downstream consumers, for example as HTTP headers.

Injects data from the context into a copy of the given immutable carrier for downstream consumers, for example as HTTP headers.

This method is an extension to the OpenTelemetry specification to support immutable carrier types.

Type parameters

A

the type of the carrier

Value parameters

carrier

holds propagation fields

ctx

the context containing the value to be injected

Attributes

Returns

a copy of the carrier, with new fields injected

Source
TextMapPropagator.scala