Module: Protobuf::Opentracing::Extensions::Client
- Included in:
- Rpc::Client
- Defined in:
- lib/protobuf/rpc/extensions/client.rb
Instance Method Summary collapse
Instance Method Details
#operation_name ⇒ Object
17 18 19 |
# File 'lib/protobuf/rpc/extensions/client.rb', line 17 def operation_name @operation_name ||= "RPC #{[:service]}##{[:method]}" end |
#send_request ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/protobuf/rpc/extensions/client.rb', line 5 def send_request scope, span = start_span [:tracing_span] = span super ensure if scope scope.close else span.finish end end |
#start_span ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/protobuf/rpc/extensions/client.rb', line 21 def start_span = { "span.kind" => "client", "component" => "Protobuf", } if ::OpenTracing.active_span [nil, ::OpenTracing.start_span(operation_name, :tags => )] else scope = ::OpenTracing.start_active_span(operation_name, :tags => ) [scope, scope.span] end end |