Sha256: fbc5d7681b96c334f16ca2a0decd8462ec61d4429be83f6a1ea1889ba7be03dd

Contents?: true

Size: 1.36 KB

Versions: 3

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

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

require_relative './single/text_map_extractor'
require_relative './single/text_map_injector'

# OpenTelemetry is an open source observability framework, providing a
# general-purpose API, SDK, and related tools required for the instrumentation
# of cloud-native software, frameworks, and libraries.
#
# The OpenTelemetry module provides global accessors for telemetry objects.
# See the documentation for the `opentelemetry-api` gem for details.
module OpenTelemetry
  # Namespace for OpenTelemetry propagator extension libraries
  module Propagator
    # Namespace for OpenTelemetry B3 propagation
    module B3
      # Namespace for OpenTelemetry b3 single header encoding
      module Single
        extend self

        B3_CONTEXT_KEY = 'b3'
        TEXT_MAP_EXTRACTOR = TextMapExtractor.new
        TEXT_MAP_INJECTOR = TextMapInjector.new

        private_constant :B3_CONTEXT_KEY, :TEXT_MAP_INJECTOR, :TEXT_MAP_EXTRACTOR

        # Returns an extractor that extracts context in the B3 single header
        # format
        def text_map_injector
          TEXT_MAP_INJECTOR
        end

        # Returns an injector that injects context in the B3 single header
        # format
        def text_map_extractor
          TEXT_MAP_EXTRACTOR
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opentelemetry-propagator-b3-0.16.0 lib/opentelemetry/propagator/b3/single.rb
opentelemetry-propagator-b3-0.15.0 lib/opentelemetry/propagator/b3/single.rb
opentelemetry-propagator-b3-0.14.0 lib/opentelemetry/propagator/b3/single.rb