Method: Aws::Xray::Configuration#initialize
- Defined in:
- lib/aws/xray/configuration.rb
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/aws/xray/configuration.rb', line 22 def initialize @logger = ::Logger.new($stdout).tap {|l| l.level = Logger::INFO } @name = ENV['AWS_XRAY_NAME'] = begin option = (ENV['AWS_XRAY_LOCATION'] || '').split(':') host = option[0] port = option[1] if (host && !host.empty?) && (port && !port.empty?) { host: host, port: Integer(port) } else { sock: NullSocket.new } end end @excluded_paths = (ENV['AWS_XRAY_EXCLUDED_PATHS'] || '').split(',') @version = VersionDetector.new.call @default_annotation = DEFAULT_ANNOTATION = DEFAULT_METADATA @segment_sending_error_handler = DefaultErrorHandler.new($stderr) @worker = Aws::Xray::Worker::Configuration.new @sampling_rate = Float(ENV['AWS_XRAY_SAMPLING_RATE'] || 1.0) @solr_hook_name = 'solr' @record_caller_of_http_requests = false end |