Class: Datadog::Core::Remote::Transport::HTTP::Client
- Inherits:
-
Object
- Object
- Datadog::Core::Remote::Transport::HTTP::Client
- Defined in:
- lib/datadog/core/remote/transport/http/client.rb
Overview
Routes, encodes, and sends tracer data to the trace agent via HTTP.
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
Instance Method Summary collapse
- #build_env(request) ⇒ Object
-
#initialize(api) ⇒ Client
constructor
A new instance of Client.
- #send_request(request, &block) ⇒ Object
Methods included from Negotiation::Client
Methods included from Datadog::Core::Remote::Transport::HTTP::Config::Client
Constructor Details
#initialize(api) ⇒ Client
Returns a new instance of Client.
20 21 22 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 20 def initialize(api) @api = api end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
18 19 20 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 18 def api @api end |
Instance Method Details
#build_env(request) ⇒ Object
40 41 42 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 40 def build_env(request) Datadog::Core::Transport::HTTP::Env.new(request) end |
#send_request(request, &block) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 24 def send_request(request, &block) # Build request into env env = build_env(request) # Get responses from API yield(api, env) rescue StandardError => e = "Internal error during #{self.class.name} request. Cause: #{e.class.name} #{e.} " \ "Location: #{Array(e.backtrace).first}" Datadog.logger.debug() Datadog::Core::Transport::InternalErrorResponse.new(e) end |