Module: Datadog::Profiling::Transport::HTTP
- Defined in:
- lib/ddtrace/profiling/transport/http.rb,
lib/ddtrace/profiling/transport/http/api.rb,
lib/ddtrace/profiling/transport/http/client.rb,
lib/ddtrace/profiling/transport/http/builder.rb,
lib/ddtrace/profiling/transport/http/api/spec.rb,
lib/ddtrace/profiling/transport/http/response.rb,
lib/ddtrace/profiling/transport/http/api/endpoint.rb,
lib/ddtrace/profiling/transport/http/api/instance.rb
Overview
HTTP transport behavior for profiling
Defined Under Namespace
Modules: API Classes: Builder, Client, Response
Class Method Summary collapse
-
.default(profiling_upload_timeout_seconds:, agent_settings:, site: nil, api_key: nil, agentless_allowed: agentless_allowed? ) ⇒ Object
Builds a new Transport::HTTP::Client with default settings.
- .default_headers ⇒ Object
-
.new(&block) ⇒ Object
Builds a new Transport::HTTP::Client.
Class Method Details
.default(profiling_upload_timeout_seconds:, agent_settings:, site: nil, api_key: nil, agentless_allowed: agentless_allowed? ) ⇒ Object
Builds a new Transport::HTTP::Client with default settings
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ddtrace/profiling/transport/http.rb', line 26 def self.default( profiling_upload_timeout_seconds:, agent_settings:, site: nil, api_key: nil, agentless_allowed: agentless_allowed? ) new do |transport| transport.headers default_headers # Configure adapter & API if site && api_key && agentless_allowed configure_for_agentless( transport, profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, site: site, api_key: api_key ) else configure_for_agent( transport, profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, agent_settings: agent_settings ) end end end |
.default_headers ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ddtrace/profiling/transport/http.rb', line 54 def self.default_headers { Datadog::Ext::Transport::HTTP::HEADER_META_LANG => Core::Environment::Ext::LANG, Datadog::Ext::Transport::HTTP::HEADER_META_LANG_VERSION => Core::Environment::Ext::LANG_VERSION, Datadog::Ext::Transport::HTTP::HEADER_META_LANG_INTERPRETER => Core::Environment::Ext::LANG_INTERPRETER, Datadog::Ext::Transport::HTTP::HEADER_META_TRACER_VERSION => Core::Environment::Ext::TRACER_VERSION }.tap do |headers| # Add container ID, if present. container_id = Datadog::Core::Environment::Container.container_id headers[Datadog::Ext::Transport::HTTP::HEADER_CONTAINER_ID] = container_id unless container_id.nil? end end |
.new(&block) ⇒ Object
Builds a new Transport::HTTP::Client
21 22 23 |
# File 'lib/ddtrace/profiling/transport/http.rb', line 21 def self.new(&block) Builder.new(&block).to_transport end |