Sha256: 8fd2dfed705a82f828648cd0129c6458f98cfe5a59317f7b43a9772c5c895db0

Contents?: true

Size: 1.82 KB

Versions: 24

Compression:

Stored size: 1.82 KB

Contents

# frozen_string_literal: true

require_relative 'fetcher'
require_relative '../../../distributed/b3_multi'
require_relative '../../../distributed/b3_single'
require_relative '../../../distributed/datadog'
require_relative '../../../distributed/none'
require_relative '../../../distributed/propagation'
require_relative '../../../distributed/trace_context'

module Datadog
  module Tracing
    module Contrib
      module GRPC
        module Distributed
          # Extracts and injects propagation through gRPC metadata.
          # @see https://github.com/grpc/grpc-go/blob/v1.50.1/Documentation/grpc-metadata.md
          class Propagation < Tracing::Distributed::Propagation
            def initialize
              super(
                propagation_styles: {
                  Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER =>
                    Tracing::Distributed::B3Multi.new(fetcher: Fetcher),
                  Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER =>
                    Tracing::Distributed::B3Single.new(fetcher: Fetcher),
                  Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG =>
                    Tracing::Distributed::Datadog.new(fetcher: Fetcher),
                  Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_TRACE_CONTEXT =>
                    Tracing::Distributed::TraceContext.new(fetcher: Fetcher),
                  Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_NONE => Tracing::Distributed::None.new
                })
            end

            # DEV: Singleton kept until a larger refactor is performed.
            # DEV: See {Datadog::Tracing::Distributed::Propagation#initialize} for more information.
            INSTANCE = Propagation.new
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.19.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.18.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.17.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.16.2 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.16.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.16.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.15.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.14.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.13.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.13.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.12.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/grpc/distributed/propagation.rb