lib/elastic/enterprise-search/client.rb in elastic-enterprise-search-8.1.0 vs lib/elastic/enterprise-search/client.rb in elastic-enterprise-search-8.1.1

- old
+ new

@@ -56,10 +56,12 @@ # @option options [Numeric] :overall_timeout overall timeout for requests in seconds (default: 15s) # @option options [Numeric] :open_timeout the number of seconds Net::HTTP (default: 15s) will wait while opening a connection before raising a Timeout::Error # @option options [String] :proxy url of proxy to use, ex: "http://localhost:8888" # @option options [Boolean] :log Use the default logger (disabled by default) # @option arguments [Object] :logger An instance of a Logger-compatible object + # @option arguments [Boolean] :trace Use the default tracer (disabled by default) + # @option arguments [Object] :tracer An instance of a Logger-compatible object # @option arguments [Symbol] :adapter A specific adapter for Faraday (e.g. `:patron`) # @option enable_meta_header [Boolean] :enable_meta_header Enable sending the meta data header to Cloud. # (Default: true) def initialize(options = {}) @options = options @@ -75,11 +77,13 @@ request_timeout: overall_timeout, adapter: adapter, transport_options: { request: { open_timeout: open_timeout } }, - enable_meta_header: @options[:enable_meta_header] || true + enable_meta_header: @options[:enable_meta_header] || true, + trace: trace, + tracer: tracer ) end def open_timeout @options[:open_timeout] || DEFAULT_TIMEOUT @@ -105,9 +109,17 @@ @options[:logger] end def adapter @options[:adapter] + end + + def tracer + @options[:tracer] + end + + def trace + @options[:trace] end def host return DEFAULT_HOST unless @options[:host]