lib/kafka/tracer.rb in kafka-opentracing-0.1.0 vs lib/kafka/tracer.rb in kafka-opentracing-0.2.0

- old
+ new

@@ -11,9 +11,14 @@ attr_accessor :ignore_message, :tracer IngoreMessage = ->(_value, _key, _headers, _topic, _partition, _partition_key) { false } def instrument(tracer: OpenTracing.global_tracer, ignore_message: IngoreMessage) + begin + require 'kafka' + rescue LoadError + return + end raise IncompatibleGemVersion unless compatible_version? @ignore_message = ignore_message @tracer = tracer patch_producer_produce