Skip to content

Commit

Permalink
Fix to around sig and delegate calls
Browse files Browse the repository at this point in the history
  • Loading branch information
splittingred committed May 4, 2017
1 parent 2b67d94 commit 97cf7fc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/gruf/zipkin/hook.rb
Expand Up @@ -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
Expand All @@ -48,7 +54,7 @@ def span_prefix
##
# @return [String]
#
def span_key
def span_key(call_signature)
"#{span_prefix}#{service_key}.#{call_signature}"
end

Expand Down

0 comments on commit 97cf7fc

Please sign in to comment.