module OpenTelemetry::Context::Propagation

The propagation module contains APIs and utilities to interact with context and propagate across process boundaries.

The API implicitly defines 3 interfaces: TextMapPropagator, TextMapInjector and TextMapExtractor. Concrete implementations of TextMapPropagator are provided. Custom text map propagators can leverage these implementations or simply implement the expected interface. The interfaces are described below.

The TextMapPropagator interface:

inject(carrier, context:, setter:)
extract(carrier, context:, getter:) -> Context
fields -> Array<String>

The TextMapInjector interface:

inject(carrier, context:, setter:)
fields -> Array<String>

The TextMapExtractor interface:

extract(carrier, context:, getter:) -> Context

The API provides 3 TextMapPropagator implementations:

Constants

RACK_ENV_GETTER
TEXT_MAP_GETTER
TEXT_MAP_SETTER

Public Instance Methods

rack_env_getter() click to toggle source

Returns a {RackEnvGetter} instance suitable for reading values from a Rack environment.

# File lib/opentelemetry/context/propagation.rb, line 72
def rack_env_getter
  RACK_ENV_GETTER
end
text_map_getter() click to toggle source

Returns a {TextMapGetter} instance suitable for reading values from a hash-like carrier

# File lib/opentelemetry/context/propagation.rb, line 60
def text_map_getter
  TEXT_MAP_GETTER
end
text_map_setter() click to toggle source

Returns a {TextMapSetter} instance suitable for writing values into a hash-like carrier

# File lib/opentelemetry/context/propagation.rb, line 66
def text_map_setter
  TEXT_MAP_SETTER
end