Class: OpenTracing::Instrumentation::Redis::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/opentracing/instrumentation/redis/config.rb

Overview

Redis tracing mixin config

Constant Summary collapse

DEFAULT_OPERATION_NAME_PATTERN =
'redis(command=%<command>s)'
DEFAULT_LOG_ARGS =

Safe by default

false
DEFAULT_LOG_REPLY =
false
DEFAULT_COMPONENT =
'kv'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tracer: OpenTracing.global_tracer, operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN, log_args: DEFAULT_LOG_ARGS, log_reply: DEFAULT_LOG_REPLY, component: DEFAULT_COMPONENT) {|_self| ... } ⇒ Config

Returns a new instance of Config.

Yields:

  • (_self)

Yield Parameters:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/opentracing/instrumentation/redis/config.rb', line 23

def initialize(
  tracer: OpenTracing.global_tracer,
  operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN,
  log_args: DEFAULT_LOG_ARGS,
  log_reply: DEFAULT_LOG_REPLY,
  component: DEFAULT_COMPONENT
)
  @tracer = tracer
  @operation_name_pattern = operation_name_pattern
  @log_args = log_args
  @log_reply = log_reply
  @component = component

  yield self if block_given?
end

Instance Attribute Details

#componentObject

Returns the value of attribute component.



17
18
19
# File 'lib/opentracing/instrumentation/redis/config.rb', line 17

def component
  @component
end

#log_argsObject

Returns the value of attribute log_args.



17
18
19
# File 'lib/opentracing/instrumentation/redis/config.rb', line 17

def log_args
  @log_args
end

#log_replyObject

Returns the value of attribute log_reply.



17
18
19
# File 'lib/opentracing/instrumentation/redis/config.rb', line 17

def log_reply
  @log_reply
end

#operation_name_patternObject

Returns the value of attribute operation_name_pattern.



17
18
19
# File 'lib/opentracing/instrumentation/redis/config.rb', line 17

def operation_name_pattern
  @operation_name_pattern
end

#tracerObject

Returns the value of attribute tracer.



17
18
19
# File 'lib/opentracing/instrumentation/redis/config.rb', line 17

def tracer
  @tracer
end