Module: Datadog::Tracing::Transport::HTTP
- Defined in:
- lib/datadog/tracing/transport/http.rb,
lib/datadog/tracing/transport/http/api.rb,
lib/datadog/tracing/transport/http/client.rb,
lib/datadog/tracing/transport/http/traces.rb,
lib/datadog/tracing/transport/http/builder.rb,
lib/datadog/tracing/transport/http/api/spec.rb,
lib/datadog/tracing/transport/http/statistics.rb,
lib/datadog/tracing/transport/http/api/instance.rb
Overview
Namespace for HTTP transport components
Defined Under Namespace
Modules: API, Statistics, Traces Classes: Builder, Client
Constant Summary collapse
- DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS =
NOTE: Due to… legacy reasons… This class likes having a default ‘AgentSettings` instance to fall back to. Because we generate this instance with an empty instance of `Settings`, the resulting `AgentSettings` below represents only settings specified via environment variables + the usual defaults.
DO NOT USE THIS IN NEW CODE, as it ignores any settings specified by users via ‘Datadog.configure`.
Datadog::Core::Configuration::AgentSettingsResolver.call( Datadog::Core::Configuration::Settings.new, logger: nil, )
Class Method Summary collapse
-
.default(agent_settings: DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS, **options) ⇒ Object
Builds a new Transport::HTTP::Client with default settings Pass a block to override any settings.
- .default_adapter ⇒ Object
- .default_headers ⇒ Object
-
.new(&block) ⇒ Object
Builds a new Transport::HTTP::Client.
Class Method Details
.default(agent_settings: DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS, **options) ⇒ Object
Builds a new Transport::HTTP::Client with default settings Pass a block to override any settings.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/datadog/tracing/transport/http.rb', line 39 def default( agent_settings: DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS, ** ) new do |transport| transport.adapter(agent_settings) transport.headers default_headers apis = API.defaults transport.api API::V4, apis[API::V4], fallback: API::V3, default: true transport.api API::V3, apis[API::V3] # Apply any settings given by options unless .empty? transport.default_api = [:api_version] if .key?(:api_version) transport.headers [:headers] if .key?(:headers) end # Call block to apply any customization, if provided yield(transport) if block_given? end end |
.default_adapter ⇒ Object
84 85 86 |
# File 'lib/datadog/tracing/transport/http.rb', line 84 def default_adapter Datadog::Core::Configuration::Ext::Agent::HTTP::ADAPTER end |
.default_headers ⇒ Object
.new(&block) ⇒ Object
Builds a new Transport::HTTP::Client
33 34 35 |
# File 'lib/datadog/tracing/transport/http.rb', line 33 def new(&block) Builder.new(&block).to_transport end |