Skip to content

Commit

Permalink
Merge pull request #2 from splittingred/ARCH-299
Browse files Browse the repository at this point in the history
ARCH-299: Handle case when tracer is not initialized upon trace request
  • Loading branch information
splittingred committed May 22, 2017
2 parents 8835723 + 33d3607 commit 5acc08f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog for the gruf-zipkin gem.

h3. 0.10.1

- Handle case when tracer is not yet initialized before trace executes

h3. 0.10.0

- Initial public release
7 changes: 7 additions & 0 deletions lib/gruf/zipkin/trace.rb
Expand Up @@ -37,6 +37,13 @@ def initialize(method, service_key, options = {})
#
def trace!(tracer, &block)
raise ArgumentError, 'no block given' unless block_given?
# If for some reason we don't have a tracer, let's just proceed as normal
# and not cause the request to fail
unless tracer
Gruf.logger.warn "Failed to log trace for #{method.request_class}.#{method.signature.classify} because Tracer was not found!" if Gruf.logger
return block.call(method.request, method.active_call)
end

result = nil

tracer.with_new_span(trace_id, component) do |span|
Expand Down
2 changes: 1 addition & 1 deletion lib/gruf/zipkin/version.rb
Expand Up @@ -29,6 +29,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module Gruf
module Zipkin
VERSION = '0.10.0'.freeze
VERSION = '0.10.1'.freeze
end
end

0 comments on commit 5acc08f

Please sign in to comment.