Class: ZipkinTracer::Config
- Inherits:
-
Object
- Object
- ZipkinTracer::Config
- Defined in:
- lib/zipkin-tracer/config.rb
Instance Attribute Summary collapse
-
#annotate_plugin ⇒ Object
readonly
Returns the value of attribute annotate_plugin.
-
#filter_plugin ⇒ Object
readonly
Returns the value of attribute filter_plugin.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#sample_rate ⇒ Object
readonly
Returns the value of attribute sample_rate.
-
#scribe_max_buffer ⇒ Object
readonly
Returns the value of attribute scribe_max_buffer.
-
#scribe_server ⇒ Object
readonly
Returns the value of attribute scribe_server.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#service_port ⇒ Object
readonly
Returns the value of attribute service_port.
-
#whitelist_plugin ⇒ Object
readonly
Returns the value of attribute whitelist_plugin.
-
#zookeeper ⇒ Object
readonly
Returns the value of attribute zookeeper.
Instance Method Summary collapse
-
#initialize(app, config_hash) ⇒ Config
constructor
A new instance of Config.
- #using_kafka? ⇒ Boolean
- #using_scribe? ⇒ Boolean
Constructor Details
#initialize(app, config_hash) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/zipkin-tracer/config.rb', line 8 def initialize(app, config_hash) config = config_hash || app_config(app) @service_name = config[:service_name] @service_port = config[:service_port] @scribe_server = config[:scribe_server] @zookeeper = config[:zookeeper] @sample_rate = config[:sample_rate] || DEFAULTS[:sample_rate] @scribe_max_buffer = config[:scribe_max_buffer] || DEFAULTS[:scribe_max_buffer] @annotate_plugin = config[:annotate_plugin] # call for trace annotation @filter_plugin = config[:filter_plugin] # skip tracing if returns false @whitelist_plugin = config[:whitelist_plugin] # force sampling if returns true @logger = config[:logger] || fallback_logger end |
Instance Attribute Details
#annotate_plugin ⇒ Object (readonly)
Returns the value of attribute annotate_plugin.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def annotate_plugin @annotate_plugin end |
#filter_plugin ⇒ Object (readonly)
Returns the value of attribute filter_plugin.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def filter_plugin @filter_plugin end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def logger @logger end |
#sample_rate ⇒ Object (readonly)
Returns the value of attribute sample_rate.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def sample_rate @sample_rate end |
#scribe_max_buffer ⇒ Object (readonly)
Returns the value of attribute scribe_max_buffer.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def scribe_max_buffer @scribe_max_buffer end |
#scribe_server ⇒ Object (readonly)
Returns the value of attribute scribe_server.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def scribe_server @scribe_server end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def service_name @service_name end |
#service_port ⇒ Object (readonly)
Returns the value of attribute service_port.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def service_port @service_port end |
#whitelist_plugin ⇒ Object (readonly)
Returns the value of attribute whitelist_plugin.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def whitelist_plugin @whitelist_plugin end |
#zookeeper ⇒ Object (readonly)
Returns the value of attribute zookeeper.
5 6 7 |
# File 'lib/zipkin-tracer/config.rb', line 5 def zookeeper @zookeeper end |
Instance Method Details
#using_kafka? ⇒ Boolean
26 27 28 |
# File 'lib/zipkin-tracer/config.rb', line 26 def using_kafka? !!(@zookeeper && RUBY_PLATFORM == 'java' && defined?(::Hermann)) end |
#using_scribe? ⇒ Boolean
22 23 24 |
# File 'lib/zipkin-tracer/config.rb', line 22 def using_scribe? !!(@scribe_server && defined?(::Scribe)) end |