diff --git a/lib/gruf/zipkin/hook.rb b/lib/gruf/zipkin/hook.rb index 87af597..87178e2 100644 --- a/lib/gruf/zipkin/hook.rb +++ b/lib/gruf/zipkin/hook.rb @@ -30,9 +30,15 @@ module Gruf module Zipkin class Hook < Gruf::Hooks::Base - def around(_call_signature, _req, _call, &block) - ZipkinTracer::TraceClient.local_component_span(span_key) do |ztc| - ztc.record span_key + ## + # @param [Symbol] call_signature + # @param [Object] _req + # @param [GRPC::ActiveCall] _call + # + def around(call_signature, _req, _call, &block) + sk = span_key(call_signature) + ZipkinTracer::TraceClient.local_component_span(sk) do |ztc| + ztc.record(sk) yield if block_given? end end @@ -48,7 +54,7 @@ def span_prefix ## # @return [String] # - def span_key + def span_key(call_signature) "#{span_prefix}#{service_key}.#{call_signature}" end