Sha256: ff1bb06f9cbf088f22454d15ef67b4354d38d39e7dfee1185e6f9e3d5eb14dfe

Contents?: true

Size: 1.42 KB

Versions: 3

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

require 'opentelemetry/context/propagation/composite_propagator'
require 'opentelemetry/context/propagation/noop_extractor'
require 'opentelemetry/context/propagation/noop_injector'
require 'opentelemetry/context/propagation/propagator'
require 'opentelemetry/context/propagation/text_map_getter'
require 'opentelemetry/context/propagation/text_map_setter'
require 'opentelemetry/context/propagation/rack_env_getter'

module OpenTelemetry
  class Context
    # The propagation module contains APIs and utilities to interact with context
    # and propagate across process boundaries.
    module Propagation
      extend self

      TEXT_MAP_GETTER = TextMapGetter.new
      TEXT_MAP_SETTER = TextMapSetter.new
      RACK_ENV_GETTER = RackEnvGetter.new

      private_constant :TEXT_MAP_GETTER, :TEXT_MAP_SETTER, :RACK_ENV_GETTER

      # Returns a {TextMapGetter} instance suitable for reading values from a
      # hash-like carrier
      def text_map_getter
        TEXT_MAP_GETTER
      end

      # Returns a {TextMapSetter} instance suitable for writing values into a
      # hash-like carrier
      def text_map_setter
        TEXT_MAP_SETTER
      end

      # Returns a {RackEnvGetter} instance suitable for reading values from a
      # Rack environment.
      def rack_env_getter
        RACK_ENV_GETTER
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opentelemetry-api-0.16.0 lib/opentelemetry/context/propagation.rb
opentelemetry-api-0.15.0 lib/opentelemetry/context/propagation.rb
opentelemetry-api-0.14.0 lib/opentelemetry/context/propagation.rb