lib/ddtrace/transport/http.rb
# Builds a new Transport::HTTP::Client with default settings
# Pass a block to override any settings.
Builds a new Transport::HTTP::Client with default settings
Pass a block to override any settings.
Builds a new Transport :: HTTP :: Client with default settings Pass a block to override any settings .
def default(options = {})
        new do |transport|
          transport.adapter :net_http, default_hostname, default_port
          transport.headers default_headers
          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?
            if options.key?(:hostname) || options.key?(:port)
              hostname = options.fetch(:hostname, default_hostname)
              port = options.fetch(:port, default_port)
              transport.adapter :net_http, hostname, port
            end
            transport.default_api = options[:api_version] if options.key?(:api_version)
            transport.headers options[:headers] if options.key?(:headers)
            options[:on_build].call(transport) if options[:on_build].is_a?(Proc)
          end
          yield(transport) if block_given?
        end
      end
def default ( options = { } ) new do | transport | transport . adapter :net_http , default_hostname , default_port transport . headers default_headers 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? if options . key? ( :hostname ) || options . key? ( :port ) hostname = options . fetch ( :hostname , default_hostname ) port = options . fetch ( :port , default_port ) transport . adapter :net_http , hostname , port end transport . default_api = options [ :api_version ] if options . key? ( :api_version ) transport . headers options [ :headers ] if options . key? ( :headers ) options [ :on_build ] . call ( transport ) if options [ :on_build ] . is_a? ( Proc ) end yield ( transport ) if block_given? end end
Builds a new Transport::HTTP::Client with default settings
Pass a block to override any settings.
Builds a new Transport :: HTTP :: Client with default settings Pass a block to override any settings .
# Apply any settings given by options # Change hostname/port # Change default API # Add headers # Execute on_build callback # Call block to apply any customization, if provided.
options
<not_specific>