zipkin-tracer 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGI3MWNlMzU2NDUzNzdiYjg3MmEyNzFiZjIyZGQ0NmE2NzQzNjg3ZQ==
4
+ ZDgzMzkwZTRmN2Y5OGI1ZDkyNGU3MjU2NjBkZThhOGYyYjVmOWM3Zg==
5
5
  data.tar.gz: !binary |-
6
- MjZlZDcxMGYyNTY4NDdhMWQxZWNlMDg4YzY2YTI5Y2I5M2UyNTNkOA==
6
+ N2JmODc5NTg2ODdiMWU2NzllNDNhOTY3OTFhMGZhZmRhOWFkOTFhYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2NiZjRiYTA3MmUwMTViZGFkNDZiYWFkNzRkY2U1ZmNlYjhjOTE4ZTkwYjY1
10
- YzAzYjVlOGM5OGQyMWY0ZDAwYzFiN2QzNDA5MWFkMDdjMWU5Y2VlZTdjMGY3
11
- YmVkNjVmYmNiNDkzZmYzM2ViYjdiNjUyOTUzMzM2MTA2MDVhYTI=
9
+ Y2RkNGI0M2QyYjIwNjEzNDU1NmQ0OWRlY2FhZDY1ZDI1YjA1ZjNhNWYxMWYx
10
+ YTAwNWRmMmY5ZDViODgzZjQyZGYwNDg1ODU0ZjQwNmE4ZTA4MDFkMGM3M2Ji
11
+ NmY0ZjJhYjhiMjcyY2M4NTczMzZiNjgxZDBlNTBjMGQyZmJhMGM=
12
12
  data.tar.gz: !binary |-
13
- ZWRkY2VhZjNmZTM5MjY1YjJiN2FhMjM3N2I1MTQ0MDhlNzhjZmEzNDYxMzhm
14
- ODYzN2JlN2YyMWRlNDVmMTgwMTlmYmU4NTQwYTJlNTRkNzBhNDUyODRlZDQ4
15
- NzBlYjJiM2MxN2E3MjM1Yzg5ZTEzMTY2ZmYzNjg2YWY3MjlkM2Q=
13
+ YzUxNDYzNDkwZmFlZjYwOTM0MzRjMWNhYjg3MzJjYzEzYmMzYzZjOWJmMDIx
14
+ MTY3Y2RhNjI0ODBiNjk0NzlkYTE3MDA4NjM1YTk1NGFkYTRlMzJlZjMzNmY1
15
+ OTFhOTM4ODY4MDg4OWY5MDVjNGNhMTllMTVlYjk5M2ZmZDIzNGE=
@@ -5,7 +5,7 @@ module ZipkinTracer
5
5
  # Configuration of this gem. It reads the configuration and provides default values
6
6
  class Config
7
7
  attr_reader :service_name, :service_port, :json_api_host,
8
- :zookeeper, :sample_rate, :logger,
8
+ :zookeeper, :sample_rate, :logger, :log_tracing,
9
9
  :annotate_plugin, :filter_plugin, :whitelist_plugin
10
10
 
11
11
  def initialize(app, config_hash)
@@ -18,8 +18,8 @@ module ZipkinTracer
18
18
  @annotate_plugin = config[:annotate_plugin] # call for trace annotation
19
19
  @filter_plugin = config[:filter_plugin] # skip tracing if returns false
20
20
  @whitelist_plugin = config[:whitelist_plugin] # force sampling if returns true
21
- @logger = config[:logger] || Application.logger
22
- @logger_setup = config[:logger] # Was the logger in fact setup by the client?
21
+ @logger = Application.logger
22
+ @log_tracing = config[:log_tracing] # Was the logger in fact setup by the client?
23
23
  end
24
24
 
25
25
  def adapter
@@ -27,7 +27,7 @@ module ZipkinTracer
27
27
  :json
28
28
  elsif present?(@zookeeper) && RUBY_PLATFORM == 'java'
29
29
  :kafka
30
- elsif @logger_setup
30
+ elsif !!@log_tracing
31
31
  :logger
32
32
  else
33
33
  nil
@@ -12,5 +12,5 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  module ZipkinTracer
15
- VERSION = '0.17.0'.freeze
15
+ VERSION = '0.18.0'.freeze
16
16
  end
@@ -1,17 +1,24 @@
1
1
  require 'zipkin-tracer/zipkin_tracer_base'
2
2
  require 'zipkin-tracer/hostname_resolver'
3
+ require 'json'
3
4
 
4
5
  module Trace
5
6
  class ZipkinLoggerTracer < ZipkinTracerBase
7
+ TRACING_KEY = 'Tracing information'
6
8
 
7
9
  def initialize(options)
8
10
  @logger = options[:logger]
11
+ @logger_accepts_data = @logger.respond_to?(:info_with_data)
9
12
  super(options)
10
13
  end
11
14
 
12
15
  def flush!
13
16
  formatted_spans = ::ZipkinTracer::HostnameResolver.new.spans_with_ips(spans).map(&:to_h)
14
- @logger.info "ZIPKIN SPANS: #{formatted_spans}"
17
+ if @logger_accepts_data
18
+ @logger.info_with_data(TRACING_KEY, formatted_spans)
19
+ else
20
+ @logger.info({ TRACING_KEY => formatted_spans }.to_json)
21
+ end
15
22
  end
16
23
  end
17
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipkin-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franklin Hu
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-04-13 00:00:00.000000000 Z
16
+ date: 2016-05-06 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: faraday