zipkin-tracer 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/zipkin-tracer/config.rb +4 -4
- data/lib/zipkin-tracer/version.rb +1 -1
- data/lib/zipkin-tracer/zipkin_logger_tracer.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDgzMzkwZTRmN2Y5OGI1ZDkyNGU3MjU2NjBkZThhOGYyYjVmOWM3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2JmODc5NTg2ODdiMWU2NzllNDNhOTY3OTFhMGZhZmRhOWFkOTFhYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2RkNGI0M2QyYjIwNjEzNDU1NmQ0OWRlY2FhZDY1ZDI1YjA1ZjNhNWYxMWYx
|
10
|
+
YTAwNWRmMmY5ZDViODgzZjQyZGYwNDg1ODU0ZjQwNmE4ZTA4MDFkMGM3M2Ji
|
11
|
+
NmY0ZjJhYjhiMjcyY2M4NTczMzZiNjgxZDBlNTBjMGQyZmJhMGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzUxNDYzNDkwZmFlZjYwOTM0MzRjMWNhYjg3MzJjYzEzYmMzYzZjOWJmMDIx
|
14
|
+
MTY3Y2RhNjI0ODBiNjk0NzlkYTE3MDA4NjM1YTk1NGFkYTRlMzJlZjMzNmY1
|
15
|
+
OTFhOTM4ODY4MDg4OWY5MDVjNGNhMTllMTVlYjk5M2ZmZDIzNGE=
|
data/lib/zipkin-tracer/config.rb
CHANGED
@@ -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 =
|
22
|
-
@
|
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
|
30
|
+
elsif !!@log_tracing
|
31
31
|
:logger
|
32
32
|
else
|
33
33
|
nil
|
@@ -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
|
-
@
|
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.
|
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-
|
16
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: faraday
|