Module: Datadog::Transport::HTTP
- Includes:
- Kernel
- Defined in:
- lib/ddtrace/transport/http.rb,
lib/ddtrace/transport/http/api.rb,
lib/ddtrace/transport/http/env.rb,
lib/ddtrace/transport/http/client.rb,
lib/ddtrace/transport/http/traces.rb,
lib/ddtrace/transport/http/api/map.rb,
lib/ddtrace/transport/http/builder.rb,
lib/ddtrace/transport/http/api/spec.rb,
lib/ddtrace/transport/http/response.rb,
lib/ddtrace/transport/http/statistics.rb,
lib/ddtrace/transport/http/adapters/net.rb,
lib/ddtrace/transport/http/api/endpoint.rb,
lib/ddtrace/transport/http/api/instance.rb,
lib/ddtrace/transport/http/adapters/test.rb,
lib/ddtrace/transport/http/api/fallbacks.rb,
lib/ddtrace/transport/http/adapters/registry.rb,
lib/ddtrace/transport/http/adapters/unix_socket.rb
Overview
Namespace for HTTP transport components
Defined Under Namespace
Modules: API, Adapters, Response, Statistics, Traces
Classes: Builder, Client, Env
Class Method Summary
collapse
Class Method Details
.default(agent_settings: Datadog::Configuration::AgentSettingsResolver::ENVIRONMENT_AGENT_SETTINGS, **options) ⇒ Object
Builds a new Transport::HTTP::Client with default settings
Pass a block to override any settings.
31
32
33
34
35
36
37
38
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/ddtrace/transport/http.rb', line 31
def default(agent_settings: Datadog::Configuration::AgentSettingsResolver::ENVIRONMENT_AGENT_SETTINGS, **options)
new do |transport|
transport.adapter(agent_settings)
transport.
if agent_settings.deprecated_for_removal_transport_configuration_options
options = options.merge(**agent_settings.deprecated_for_removal_transport_configuration_options)
end
apis = API.defaults
transport.api API::V4, apis[API::V4], fallback: API::V3, default: true
transport.api API::V3, apis[API::V3], fallback: API::V2
transport.api API::V2, apis[API::V2]
unless options.empty?
transport.default_api = options[:api_version] if options.key?(:api_version)
transport. options[:headers] if options.key?(:headers)
end
if agent_settings.deprecated_for_removal_transport_configuration_proc
agent_settings.deprecated_for_removal_transport_configuration_proc.call(transport)
end
yield(transport) if block_given?
end
end
|
.default_adapter ⇒ Object
.default_hostname(logger: Datadog.logger) ⇒ Object
80
81
82
83
84
85
86
87
|
# File 'lib/ddtrace/transport/http.rb', line 80
def default_hostname(logger: Datadog.logger)
logger.warn(
'Deprecated for removal: Using #default_hostname for configuration is deprecated and will ' \
'be removed on a future ddtrace release.'
)
Datadog::Configuration::AgentSettingsResolver::ENVIRONMENT_AGENT_SETTINGS.hostname
end
|
.default_port(logger: Datadog.logger) ⇒ Object
89
90
91
92
93
94
95
96
|
# File 'lib/ddtrace/transport/http.rb', line 89
def default_port(logger: Datadog.logger)
logger.warn(
'Deprecated for removal: Using #default_hostname for configuration is deprecated and will ' \
'be removed on a future ddtrace release.'
)
Datadog::Configuration::AgentSettingsResolver::ENVIRONMENT_AGENT_SETTINGS.port
end
|
.default_url(logger: Datadog.logger) ⇒ Object
98
99
100
101
102
103
104
105
|
# File 'lib/ddtrace/transport/http.rb', line 98
def default_url(logger: Datadog.logger)
logger.warn(
'Deprecated for removal: Using #default_url for configuration is deprecated and will ' \
'be removed on a future ddtrace release.'
)
nil
end
|
.new(&block) ⇒ Object
Builds a new Transport::HTTP::Client
25
26
27
|
# File 'lib/ddtrace/transport/http.rb', line 25
def new(&block)
Builder.new(&block).to_transport
end
|