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.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #build_env(request) ⇒ Object
-
#initialize(api, logger: Datadog.logger) ⇒ 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
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 |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
18 19 20 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 18 def logger @logger end |
Instance Method Details
#build_env(request) ⇒ Object
41 42 43 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 41 def build_env(request) Datadog::Core::Transport::HTTP::Env.new(request) end |
#send_request(request, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/datadog/core/remote/transport/http/client.rb', line 25 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}" logger.debug() Datadog::Core::Transport::InternalErrorResponse.new(e) end |