Class: OpenTracing::Instrumentation::Hutch::ConsumeOperationNameBuilder
- Inherits:
-
Object
- Object
- OpenTracing::Instrumentation::Hutch::ConsumeOperationNameBuilder
- Defined in:
- lib/opentracing/instrumentation/hutch/consume_operation_name_builder.rb
Overview
ConsumeOperationNameBuilder build span operation name of Hutch ConsumeTracer
Constant Summary collapse
- DEFAULT_OPERATION_NAME_PATTERN =
'hutch_consume(consumer_class=%<consumer_class>s)'
Instance Method Summary collapse
-
#build_operation_name(consumer, message) ⇒ String
Operation_name.
-
#initialize(routing_key_sanitazer: Bunny::RegexpRoutingKeySanitazer.new, operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN) ⇒ ConsumeOperationNameBuilder
constructor
A new instance of ConsumeOperationNameBuilder.
Constructor Details
#initialize(routing_key_sanitazer: Bunny::RegexpRoutingKeySanitazer.new, operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN) ⇒ ConsumeOperationNameBuilder
Returns a new instance of ConsumeOperationNameBuilder.
14 15 16 17 18 19 20 |
# File 'lib/opentracing/instrumentation/hutch/consume_operation_name_builder.rb', line 14 def initialize( routing_key_sanitazer: Bunny::RegexpRoutingKeySanitazer.new, operation_name_pattern: DEFAULT_OPERATION_NAME_PATTERN ) @routing_key_sanitazer = routing_key_sanitazer @operation_name_pattern = operation_name_pattern end |
Instance Method Details
#build_operation_name(consumer, message) ⇒ String
Returns operation_name.
25 26 27 28 |
# File 'lib/opentracing/instrumentation/hutch/consume_operation_name_builder.rb', line 25 def build_operation_name(consumer, ) format_args = build_format_args(consumer, ) format(@operation_name_pattern, format_args) end |