Class: Datadog::Tracing::Contrib::HTTP::Distributed::Propagation

Inherits:
Distributed::Propagation show all
Defined in:
lib/datadog/tracing/contrib/http/distributed/propagation.rb

Overview

Extracts and injects propagation through HTTP headers.

Instance Method Summary collapse

Methods inherited from Distributed::Propagation

#extract, #inject!

Constructor Details

#initialize(propagation_style_inject:, propagation_style_extract:, propagation_extract_first:) ⇒ Propagation

Returns a new instance of Propagation.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/datadog/tracing/contrib/http/distributed/propagation.rb', line 18

def initialize(
  propagation_style_inject:,
  propagation_style_extract:,
  propagation_extract_first:
)
  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
    },
    propagation_style_inject: propagation_style_inject,
    propagation_style_extract: propagation_style_extract,
    propagation_extract_first: propagation_extract_first
  )
end