Sha256: bfa95c71743d8b25a71265d093fc9c3f65910cca1dfe0ae6c3532908afff63a4
Contents?: true
Size: 1.17 KB
Versions: 5
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true require_relative '../../../../ddtrace/transport/http/env' # TODO: Decouple transport/http/client # # The standard one does `include Transport::HTTP::Statistics` and performs # stats updates, which may or may not be desirable in general. module Datadog module Core module Transport module HTTP # Routes, encodes, and sends tracer data to the trace agent via HTTP. class Client attr_reader :api def initialize(api) @api = api end def send_request(request, &block) # Build request into env env = build_env(request) # Get responses from API yield(api, env) rescue StandardError => e message = "Internal error during #{self.class.name} request. Cause: #{e.class.name} #{e.message} " \ "Location: #{Array(e.backtrace).first}" Datadog.logger.error(message) Datadog::Transport::InternalErrorResponse.new(e) end def build_env(request) Datadog::Transport::HTTP::Env.new(request) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems