Class: Aws::Xray::Configuration
- Inherits:
-
Object
- Object
- Aws::Xray::Configuration
- Defined in:
- lib/aws/xray/configuration.rb
Overview
thread-unsafe, suppose to be used only in initialization phase.
Constant Summary collapse
- DEFAULT_HOST =
option ? option.split(':').first : nil
- DEFAULT_PORT =
option ? Integer(option.split(':').last) : nil
- DEFAULT_NAME =
name_option ? name_option : nil
- DEFAULT_EXCLUDED_PATHS =
path_option ? path_option.split(',') : []
- DEFAULT_ANNOTATION =
{ hostname: Socket.gethostname, }.freeze
- DEFAULT_METADATA =
{ tracing_sdk: { name: 'aws-xray', version: Aws::Xray::VERSION, } }.freeze
Instance Attribute Summary collapse
-
#client_options ⇒ Hash
Client_options For xray-agent client.
-
#default_metadata ⇒ Hash
Default metadata.
- #excluded_paths ⇒ Array<String>
-
#name ⇒ String
Name Logical service name for this application.
Instance Method Summary collapse
-
#default_annotation ⇒ Hash
Default annotation with key-value format.
- #default_annotation=(annotation) ⇒ Object
- #version ⇒ String
- #version=(v) ⇒ Object
Instance Attribute Details
#client_options ⇒ Hash
Returns client_options For xray-agent client.
-
host: e.g. ‘127.0.0.1’
-
port: e.g. 2000.
28 29 30 31 32 33 34 35 |
# File 'lib/aws/xray/configuration.rb', line 28 def ||= if DEFAULT_HOST && DEFAULT_PORT { host: DEFAULT_HOST, port: DEFAULT_PORT } else { sock: NullSocket.new } end end |
#default_metadata ⇒ Hash
Returns Default metadata.
73 74 75 |
# File 'lib/aws/xray/configuration.rb', line 73 def ||= DEFAULT_METADATA end |
#excluded_paths ⇒ Array<String>
39 40 41 |
# File 'lib/aws/xray/configuration.rb', line 39 def excluded_paths @excluded_paths ||= DEFAULT_EXCLUDED_PATHS end |
#name ⇒ String
Returns name Logical service name for this application.
20 21 22 |
# File 'lib/aws/xray/configuration.rb', line 20 def name @name ||= DEFAULT_NAME end |
Instance Method Details
#default_annotation ⇒ Hash
Returns default annotation with key-value format.
58 59 60 |
# File 'lib/aws/xray/configuration.rb', line 58 def default_annotation @default_annotation ||= DEFAULT_ANNOTATION end |
#default_annotation=(annotation) ⇒ Object
62 63 64 |
# File 'lib/aws/xray/configuration.rb', line 62 def default_annotation=(annotation) @default_annotation = AnnotationNormalizer.call(annotation) end |
#version ⇒ String
45 46 47 |
# File 'lib/aws/xray/configuration.rb', line 45 def version @version ||= VersionDetector.new.call end |
#version=(v) ⇒ Object
50 51 52 |
# File 'lib/aws/xray/configuration.rb', line 50 def version=(v) @version = v.respond_to?(:call) ? v.call : v end |