zipkin-tracer 0.42.0 → 0.46.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 +4 -4
- data/.gitignore +6 -2
- data/.travis.yml +19 -11
- data/Appraisals +7 -0
- data/CHANGELOG.md +15 -0
- data/README.md +45 -8
- data/gemfiles/faraday_0.x.gemfile +18 -0
- data/gemfiles/faraday_1.x.gemfile +18 -0
- data/lib/zipkin-tracer/hostname_resolver.rb +8 -7
- data/lib/zipkin-tracer/sqs/adapter.rb +4 -0
- data/lib/zipkin-tracer/sqs/zipkin-tracer.rb +57 -0
- data/lib/zipkin-tracer/trace.rb +33 -15
- data/lib/zipkin-tracer/trace_wrapper.rb +13 -2
- data/lib/zipkin-tracer/version.rb +3 -1
- data/lib/zipkin-tracer/zipkin_sender_base.rb +13 -7
- data/zipkin-tracer.gemspec +3 -2
- metadata +31 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: facfab4311d80aff894d2c5dec5253ef122ee5206328d875e41d2174373d060e
|
4
|
+
data.tar.gz: eb036ff2009dc9b70933881c12a93cead129127679bbdf9c538e6df067dc04c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f99f5a59fdfd10c968fb99779aa0c7a97a559b45a36a787c886cac40845964e5cb98a5048313094ecab328d420ed3b01936cd66e1929389fef2e5eed1401b44
|
7
|
+
data.tar.gz: 5edb8af0059d1486a1105cf325ec21ce548f795f0a5078b67e8846d0cda23d05db2ab83075a27d1f6f46b173c10bd324af0683e26bc7ea5bd0695424e13880ba
|
data/.gitignore
CHANGED
@@ -9,16 +9,20 @@
|
|
9
9
|
/test/version_tmp/
|
10
10
|
/tmp/
|
11
11
|
|
12
|
-
|
12
|
+
# Documentation cache and generated files:
|
13
13
|
/.yardoc/
|
14
14
|
/_yardoc/
|
15
15
|
/doc/
|
16
16
|
/rdoc/
|
17
17
|
|
18
|
-
|
18
|
+
# Environment normalisation:
|
19
19
|
/.bundle/
|
20
20
|
/lib/bundler/man/
|
21
21
|
|
22
|
+
# Appraisal related files
|
23
|
+
/gemfiles/.bundle/
|
24
|
+
/gemfiles/*.gemfile.lock
|
25
|
+
|
22
26
|
# for a library or gem, you might want to ignore these files since the code is
|
23
27
|
# intended to run in multiple environments; otherwise, check them in:
|
24
28
|
# Gemfile.lock
|
data/.travis.yml
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
language: ruby
|
2
|
-
dist:
|
3
|
-
jdk:
|
4
|
-
|
2
|
+
dist: bionic
|
3
|
+
jdk: openjdk11
|
4
|
+
|
5
5
|
rvm:
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
-
|
11
|
-
- jruby-9.
|
6
|
+
- 2.3
|
7
|
+
- 2.4
|
8
|
+
- 2.5
|
9
|
+
- 2.6
|
10
|
+
- 2.7
|
11
|
+
- jruby-9.1
|
12
|
+
- jruby-9.2
|
13
|
+
|
14
|
+
gemfile:
|
15
|
+
- gemfiles/faraday_0.x.gemfile
|
16
|
+
- gemfiles/faraday_1.x.gemfile
|
17
|
+
|
18
|
+
script: bundle exec rspec
|
19
|
+
|
12
20
|
deploy:
|
13
21
|
provider: rubygems
|
14
22
|
api_key:
|
@@ -17,7 +25,8 @@ deploy:
|
|
17
25
|
on:
|
18
26
|
tags: true
|
19
27
|
repo: openzipkin/zipkin-ruby
|
20
|
-
condition:
|
28
|
+
condition: $TRAVIS_RUBY_VERSION == 2.7 && $BUNDLE_GEMFILE == $TRAVIS_BUILD_DIR/gemfiles/faraday_1.x.gemfile
|
29
|
+
|
21
30
|
notifications:
|
22
31
|
webhooks:
|
23
32
|
urls:
|
@@ -25,4 +34,3 @@ notifications:
|
|
25
34
|
- https://webhooks.gitter.im/e/e57478303f87ecd7bffc
|
26
35
|
on_success: change
|
27
36
|
on_failure: always
|
28
|
-
script: "bundle exec rspec"
|
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# 0.46.0
|
2
|
+
* Add Amazon SQS tracer.
|
3
|
+
|
4
|
+
# 0.45.0
|
5
|
+
* Add a `trace_context` option to the TraceWrapper utility class to retrieve trace data.
|
6
|
+
|
7
|
+
# 0.44.0
|
8
|
+
* Allow Faraday 1.x.
|
9
|
+
|
10
|
+
# 0.43.1
|
11
|
+
* Fix to not flush `PRODUCER` span when a server span is in the stack.
|
12
|
+
|
13
|
+
# 0.43.0
|
14
|
+
* Add the `PRODUCER` and `CONSUMER` span kinds.
|
15
|
+
|
1
16
|
# 0.42.0
|
2
17
|
* Reuse existing tracer(sender) in the TraceWrapper utility class.
|
3
18
|
|
data/README.md
CHANGED
@@ -43,11 +43,6 @@ use ZipkinTracer::RackHandler, config
|
|
43
43
|
|
44
44
|
### Sending traces on outgoing requests with Faraday
|
45
45
|
|
46
|
-
First, Faraday has to be part of your Gemfile:
|
47
|
-
```
|
48
|
-
gem 'faraday', '~> 0.8'
|
49
|
-
```
|
50
|
-
|
51
46
|
For the Faraday middleware to have the correct trace ID, the rack middleware should be used in your application as explained above.
|
52
47
|
|
53
48
|
Then include `ZipkinTracer::FaradayHandler` as a Faraday middleware:
|
@@ -56,10 +51,8 @@ Then include `ZipkinTracer::FaradayHandler` as a Faraday middleware:
|
|
56
51
|
require 'faraday'
|
57
52
|
require 'zipkin-tracer'
|
58
53
|
|
59
|
-
conn = Faraday.new(:
|
54
|
+
conn = Faraday.new(url: 'http://localhost:9292/') do |faraday|
|
60
55
|
faraday.use ZipkinTracer::FaradayHandler, 'service_name' # 'service_name' is optional (but recommended)
|
61
|
-
# default Faraday stack
|
62
|
-
faraday.request :url_encoded
|
63
56
|
faraday.adapter Faraday.default_adapter
|
64
57
|
end
|
65
58
|
```
|
@@ -88,6 +81,38 @@ end
|
|
88
81
|
|
89
82
|
By default workers aren't traced. You can specify the workers that you want to trace with traceable_workers config option. If you want all your workers to be traced pass [:all] to traceable_workers option (traceable_workers: [:all]).
|
90
83
|
|
84
|
+
### Tracing Amazon SQS messages
|
85
|
+
|
86
|
+
Amazon SQS tracing can be turned on by requiring [zipkin-tracer/sqs/adapter](lib/zipkin-tracer/sqs/adapter.rb):
|
87
|
+
```ruby
|
88
|
+
require 'zipkin-tracer/sqs/adapter'
|
89
|
+
```
|
90
|
+
|
91
|
+
This SQS adapter overrides the `send_message` and `send_message_batch` methods to add trace data as message attributes and to generate a producer span when the methods are called. Since all SQS messages are affected, it is not recommended to use this feature with the [SQS sender](lib/zipkin-tracer/zipkin_sqs_sender.rb).
|
92
|
+
|
93
|
+
When receiving messages, you need to pass the `message_attribute_names: ['All']` option to retrive message attributes:
|
94
|
+
```ruby
|
95
|
+
resp = sqs.receive_message(
|
96
|
+
queue_url: queue_url,
|
97
|
+
message_attribute_names: ['All']
|
98
|
+
)
|
99
|
+
```
|
100
|
+
|
101
|
+
Then you can utilize the [TraceWrapper](#tracewrapper) class to generate a consumer span:
|
102
|
+
```ruby
|
103
|
+
msg = resp.messages.first
|
104
|
+
trace_context = msg.message_attributes.each_with_object({}) { |(key, value), hsh| hsh[key.to_sym] = value.string_value }
|
105
|
+
|
106
|
+
TraceWrapper.wrap_in_custom_span(config, 'receive_message',
|
107
|
+
span_kind: Trace::Span::Kind::CONSUMER,
|
108
|
+
trace_context: trace_context
|
109
|
+
) do |span|
|
110
|
+
span.remote_endpoint = Trace::Endpoint.remote_endpoint(nil, 'amazon-sqs')
|
111
|
+
span.record_tag('queue.url', queue_url)
|
112
|
+
:
|
113
|
+
end
|
114
|
+
```
|
115
|
+
|
91
116
|
### Local tracing
|
92
117
|
|
93
118
|
`ZipkinTracer::TraceClient` provides an API to record local traces in your application.
|
@@ -249,6 +274,18 @@ TraceWrapper.wrap_in_custom_span(config, "custom span") do |span|
|
|
249
274
|
end
|
250
275
|
```
|
251
276
|
|
277
|
+
The `trace_context:` keyword argument can be used to retrieve trace data:
|
278
|
+
```ruby
|
279
|
+
trace_context = {
|
280
|
+
trace_id: '234555b04cf7e099',
|
281
|
+
span_id: '234555b04cf7e099',
|
282
|
+
sampled: 'true'
|
283
|
+
}
|
284
|
+
|
285
|
+
TraceWrapper.wrap_in_custom_span(config, "custom span", trace_context: trace_context) do |span|
|
286
|
+
:
|
287
|
+
end
|
288
|
+
```
|
252
289
|
|
253
290
|
## Development
|
254
291
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "faraday", "~> 0.13"
|
6
|
+
|
7
|
+
platforms :ruby do
|
8
|
+
gem "benchmark-ips"
|
9
|
+
gem "rbtrace"
|
10
|
+
gem "byebug"
|
11
|
+
gem "simplecov", require: false
|
12
|
+
end
|
13
|
+
|
14
|
+
platforms :jruby do
|
15
|
+
gem "hermann", "~> 0.27.0"
|
16
|
+
end
|
17
|
+
|
18
|
+
gemspec path: "../"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "faraday", "~> 1.0"
|
6
|
+
|
7
|
+
platforms :ruby do
|
8
|
+
gem "benchmark-ips"
|
9
|
+
gem "rbtrace"
|
10
|
+
gem "byebug"
|
11
|
+
gem "simplecov", require: false
|
12
|
+
end
|
13
|
+
|
14
|
+
platforms :jruby do
|
15
|
+
gem "hermann", "~> 0.27.0"
|
16
|
+
end
|
17
|
+
|
18
|
+
gemspec path: "../"
|
@@ -11,15 +11,17 @@ module ZipkinTracer
|
|
11
11
|
|
12
12
|
each_endpoint(spans) do |endpoint|
|
13
13
|
hostname = endpoint.ipv4
|
14
|
-
unless
|
15
|
-
|
16
|
-
|
14
|
+
next unless hostname
|
15
|
+
next if resolved_ip_address?(hostname.to_s)
|
16
|
+
|
17
|
+
endpoint.ipv4 = resolved_hosts[hostname]
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
21
|
private
|
22
|
+
|
21
23
|
LOCALHOST = '127.0.0.1'.freeze
|
22
|
-
LOCALHOST_I32 = 0x7f000001
|
24
|
+
LOCALHOST_I32 = 0x7f000001
|
23
25
|
MAX_I32 = ((2 ** 31) - 1)
|
24
26
|
MASK = (2 ** 32) - 1
|
25
27
|
IP_FIELD = 3
|
@@ -49,10 +51,9 @@ module ZipkinTracer
|
|
49
51
|
end
|
50
52
|
|
51
53
|
def resolve(hosts, ip_format)
|
52
|
-
hosts.
|
54
|
+
hosts.each_with_object({}) do |host, host_map|
|
53
55
|
hostname = host.ipv4 # This field has been temporarly used to store the hostname.
|
54
|
-
host_map[hostname]
|
55
|
-
host_map
|
56
|
+
host_map[hostname] = host_to_format(hostname, ip_format) if hostname
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module ZipkinTracer
|
2
|
+
# This module is designed to prepend to the SQS client to add trace data as message attributes.
|
3
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-sqs/lib/aws-sdk-sqs/client.rb
|
4
|
+
module SqsHandler
|
5
|
+
def send_message(params = {}, options = {})
|
6
|
+
zipkin_sqs_trace_wrapper(params, __method__) { |params_with_trace| super(params_with_trace, options) }
|
7
|
+
end
|
8
|
+
|
9
|
+
def send_message_batch(params = {}, options = {})
|
10
|
+
zipkin_sqs_trace_wrapper(params, __method__) { |params_with_trace| super(params_with_trace, options) }
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
ZIPKIN_KEYS = %i[trace_id parent_id span_id sampled].freeze
|
16
|
+
ZIPKIN_REMOTE_ENDPOINT_SQS = Trace::Endpoint.remote_endpoint(nil, 'amazon-sqs')
|
17
|
+
|
18
|
+
def zipkin_sqs_trace_wrapper(params, method_name)
|
19
|
+
trace_id = TraceGenerator.new.next_trace_id
|
20
|
+
zipkin_set_message_attributes(params, method_name, trace_id)
|
21
|
+
|
22
|
+
TraceContainer.with_trace_id(trace_id) do
|
23
|
+
if Trace.tracer && trace_id.sampled?
|
24
|
+
Trace.tracer.with_new_span(trace_id, method_name) do |span|
|
25
|
+
span.kind = Trace::Span::Kind::PRODUCER
|
26
|
+
span.remote_endpoint = ZIPKIN_REMOTE_ENDPOINT_SQS
|
27
|
+
span.record_tag('queue.url', params[:queue_url])
|
28
|
+
yield(params)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
yield(params)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def zipkin_set_message_attributes(params, method_name, trace_id)
|
37
|
+
attributes = zipkin_message_attributes(trace_id)
|
38
|
+
case method_name
|
39
|
+
when :send_message
|
40
|
+
params[:message_attributes] = attributes.merge(params[:message_attributes] || {})
|
41
|
+
when :send_message_batch
|
42
|
+
params[:entries].each do |entry|
|
43
|
+
entry[:message_attributes] = attributes.merge(entry[:message_attributes] || {})
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def zipkin_message_attributes(trace_id)
|
49
|
+
ZIPKIN_KEYS.each_with_object({}) do |zipkin_key, message_attributes|
|
50
|
+
zipkin_value = trace_id.send(zipkin_key)
|
51
|
+
next unless zipkin_value
|
52
|
+
|
53
|
+
message_attributes[zipkin_key] = { string_value: zipkin_value.to_s, data_type: 'String' }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/zipkin-tracer/trace.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'zipkin-tracer/zipkin_sender_base'
|
2
4
|
require 'zipkin-tracer/trace_container'
|
3
5
|
# Most of this code is copied from Finagle
|
@@ -113,21 +115,21 @@ module Trace
|
|
113
115
|
end
|
114
116
|
|
115
117
|
def next_id
|
116
|
-
TraceId.new(
|
118
|
+
TraceId.new(trace_id, span_id, ZipkinTracer::TraceGenerator.new.generate_id, sampled, flags)
|
117
119
|
end
|
118
120
|
|
119
121
|
# the debug flag is used to ensure the trace passes ALL samplers
|
120
122
|
def debug?
|
121
|
-
|
123
|
+
flags & Flags::DEBUG == Flags::DEBUG
|
122
124
|
end
|
123
125
|
|
124
126
|
def sampled?
|
125
|
-
debug? || [
|
127
|
+
debug? || %w[1 true].include?(sampled)
|
126
128
|
end
|
127
129
|
|
128
130
|
def to_s
|
129
|
-
"TraceId(trace_id = #{
|
130
|
-
" sampled = #{
|
131
|
+
"TraceId(trace_id = #{trace_id}, parent_id = #{parent_id}, span_id = #{span_id}," \
|
132
|
+
" sampled = #{sampled}, flags = #{flags}, shared = #{shared})"
|
131
133
|
end
|
132
134
|
end
|
133
135
|
|
@@ -165,16 +167,32 @@ module Trace
|
|
165
167
|
# A span may contain many annotations
|
166
168
|
class Span
|
167
169
|
module Tag
|
168
|
-
METHOD = "http.method"
|
169
|
-
PATH = "http.path"
|
170
|
-
STATUS = "http.status_code"
|
171
|
-
LOCAL_COMPONENT = "lc"
|
172
|
-
ERROR = "error"
|
170
|
+
METHOD = "http.method"
|
171
|
+
PATH = "http.path"
|
172
|
+
STATUS = "http.status_code"
|
173
|
+
LOCAL_COMPONENT = "lc" # TODO: Remove LOCAL_COMPONENT and related methods when no longer needed
|
174
|
+
ERROR = "error"
|
173
175
|
end
|
174
176
|
|
175
177
|
module Kind
|
176
|
-
CLIENT = "CLIENT"
|
177
|
-
SERVER = "SERVER"
|
178
|
+
CLIENT = "CLIENT"
|
179
|
+
SERVER = "SERVER"
|
180
|
+
|
181
|
+
# When present, "timestamp" is the moment a producer sent a message to a destination.
|
182
|
+
# "duration" represents delay sending the message, such as batching, while
|
183
|
+
# "remote_endpoint" indicates the destination, such as a broker.
|
184
|
+
#
|
185
|
+
# Unlike CLIENT, messaging spans never share a span ID. For example, the
|
186
|
+
# CONSUMER of the same message has "parent_id" set to this span's id.
|
187
|
+
PRODUCER = "PRODUCER"
|
188
|
+
|
189
|
+
# When present, "timestamp" is the moment a consumer received a message from an origin.
|
190
|
+
# "duration" represents delay consuming the message, such as from backlog,
|
191
|
+
# while "remote_endpoint" indicates the origin, such as a broker.
|
192
|
+
#
|
193
|
+
# Unlike SERVER, messaging spans never share a span ID. For example, the
|
194
|
+
# PRODUCER of this message is the "parent_id" of this span.
|
195
|
+
CONSUMER = "CONSUMER"
|
178
196
|
end
|
179
197
|
|
180
198
|
attr_accessor :name, :kind, :local_endpoint, :remote_endpoint, :annotations, :tags, :debug
|
@@ -211,7 +229,7 @@ module Trace
|
|
211
229
|
h[:remoteEndpoint] = @remote_endpoint.to_h unless @remote_endpoint.nil?
|
212
230
|
h[:annotations] = @annotations.map(&:to_h) unless @annotations.empty?
|
213
231
|
h[:tags] = @tags unless @tags.empty?
|
214
|
-
h[:shared] = true if @span_id.shared
|
232
|
+
h[:shared] = true if @span_id.shared && @kind == Kind::SERVER
|
215
233
|
h
|
216
234
|
end
|
217
235
|
|
@@ -259,8 +277,8 @@ module Trace
|
|
259
277
|
end
|
260
278
|
|
261
279
|
def self.remote_endpoint(url, remote_service_name)
|
262
|
-
service_name = remote_service_name || url
|
263
|
-
Endpoint.new(url
|
280
|
+
service_name = remote_service_name || url&.host&.split('.')&.first || UNKNOWN_URL # default to url-derived service name
|
281
|
+
Endpoint.new(url&.host, url&.port, service_name)
|
264
282
|
end
|
265
283
|
|
266
284
|
def to_h
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module ZipkinTracer
|
2
2
|
class TraceWrapper
|
3
|
-
|
3
|
+
REQUIRED_KEYS = %i[trace_id span_id].freeze
|
4
|
+
KEYS = %i[trace_id parent_id span_id sampled].freeze
|
5
|
+
|
6
|
+
def self.wrap_in_custom_span(config, span_name, span_kind: Trace::Span::Kind::SERVER, app: nil, trace_context: nil)
|
4
7
|
raise ArgumentError, "you must provide a block" unless block_given?
|
5
8
|
|
6
9
|
initialize_tracer(app, config)
|
7
|
-
trace_id =
|
10
|
+
trace_id = next_trace_id(trace_context)
|
8
11
|
|
9
12
|
ZipkinTracer::TraceContainer.with_trace_id(trace_id) do
|
10
13
|
if trace_id.sampled?
|
@@ -24,5 +27,13 @@ module ZipkinTracer
|
|
24
27
|
zipkin_config = ZipkinTracer::Config.new(app, config).freeze
|
25
28
|
ZipkinTracer::TracerFactory.new.tracer(zipkin_config)
|
26
29
|
end
|
30
|
+
|
31
|
+
def self.next_trace_id(trace_context)
|
32
|
+
if trace_context.is_a?(Hash) && REQUIRED_KEYS.all? { |key| trace_context.key?(key) }
|
33
|
+
Trace::TraceId.new(*trace_context.values_at(*KEYS), Trace::Flags::EMPTY).next_id
|
34
|
+
else
|
35
|
+
ZipkinTracer::TraceGenerator.new.next_trace_id
|
36
|
+
end
|
37
|
+
end
|
27
38
|
end
|
28
39
|
end
|
@@ -7,8 +7,7 @@ module Trace
|
|
7
7
|
# Senders dealing with zipkin should inherit from this class and implement the
|
8
8
|
# flush! method which actually sends the information
|
9
9
|
class ZipkinSenderBase
|
10
|
-
|
11
|
-
def initialize(options={})
|
10
|
+
def initialize(options = {})
|
12
11
|
@options = options
|
13
12
|
reset
|
14
13
|
end
|
@@ -25,10 +24,10 @@ module Trace
|
|
25
24
|
# If in a thread not handling incoming http requests, it will not have Kind::SERVER, so the span
|
26
25
|
# will never be flushed and will cause memory leak.
|
27
26
|
# If no parent span, then current span needs to flush when it ends.
|
28
|
-
if
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
return if skip_flush?(span)
|
28
|
+
|
29
|
+
flush!
|
30
|
+
reset
|
32
31
|
end
|
33
32
|
|
34
33
|
def start_span(trace_id, name, timestamp = Time.now)
|
@@ -38,6 +37,14 @@ module Trace
|
|
38
37
|
span
|
39
38
|
end
|
40
39
|
|
40
|
+
def skip_flush?(span)
|
41
|
+
return true if span.kind == Trace::Span::Kind::CLIENT && span.has_parent_span?
|
42
|
+
|
43
|
+
if span.kind == Trace::Span::Kind::PRODUCER
|
44
|
+
return true if spans.any? { |s| s.kind == Trace::Span::Kind::SERVER || s.kind == Trace::Span::Kind::CONSUMER }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
41
48
|
def flush!
|
42
49
|
raise "not implemented"
|
43
50
|
end
|
@@ -57,6 +64,5 @@ module Trace
|
|
57
64
|
def reset
|
58
65
|
Thread.current[THREAD_KEY] = []
|
59
66
|
end
|
60
|
-
|
61
67
|
end
|
62
68
|
end
|
data/zipkin-tracer.gemspec
CHANGED
@@ -24,16 +24,17 @@ Gem::Specification.new do |s|
|
|
24
24
|
end
|
25
25
|
s.require_paths = ['lib']
|
26
26
|
|
27
|
-
s.add_dependency 'faraday', '
|
27
|
+
s.add_dependency 'faraday', '>= 0.13', '< 2.0'
|
28
28
|
s.add_dependency 'rack', '>= 1.0'
|
29
29
|
s.add_dependency 'sucker_punch', '~> 2.0'
|
30
30
|
|
31
|
+
s.add_development_dependency 'appraisal'
|
31
32
|
s.add_development_dependency 'aws-sdk-sqs', '~> 1.0'
|
32
33
|
s.add_development_dependency 'excon', '~> 0.53'
|
33
34
|
s.add_development_dependency 'rspec', '~> 3.8'
|
34
35
|
s.add_development_dependency 'rspec-json_expectations', '~> 2.2'
|
35
36
|
s.add_development_dependency 'rack-test', '~> 1.1'
|
36
|
-
s.add_development_dependency 'rake', '~>
|
37
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
37
38
|
s.add_development_dependency 'timecop', '~> 0.8'
|
38
39
|
s.add_development_dependency 'webmock', '~> 3.0'
|
39
40
|
s.add_development_dependency 'simplecov', '~> 0.16'
|
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.46.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Hu
|
@@ -14,22 +14,28 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: faraday
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
-
- - "
|
23
|
+
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: '0.13'
|
26
|
+
- - "<"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '2.0'
|
26
29
|
type: :runtime
|
27
30
|
prerelease: false
|
28
31
|
version_requirements: !ruby/object:Gem::Requirement
|
29
32
|
requirements:
|
30
|
-
- - "
|
33
|
+
- - ">="
|
31
34
|
- !ruby/object:Gem::Version
|
32
35
|
version: '0.13'
|
36
|
+
- - "<"
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '2.0'
|
33
39
|
- !ruby/object:Gem::Dependency
|
34
40
|
name: rack
|
35
41
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,6 +64,20 @@ dependencies:
|
|
58
64
|
- - "~>"
|
59
65
|
- !ruby/object:Gem::Version
|
60
66
|
version: '2.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: appraisal
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
61
81
|
- !ruby/object:Gem::Dependency
|
62
82
|
name: aws-sdk-sqs
|
63
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,14 +154,14 @@ dependencies:
|
|
134
154
|
requirements:
|
135
155
|
- - "~>"
|
136
156
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
157
|
+
version: '13.0'
|
138
158
|
type: :development
|
139
159
|
prerelease: false
|
140
160
|
version_requirements: !ruby/object:Gem::Requirement
|
141
161
|
requirements:
|
142
162
|
- - "~>"
|
143
163
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
164
|
+
version: '13.0'
|
145
165
|
- !ruby/object:Gem::Dependency
|
146
166
|
name: timecop
|
147
167
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,6 +220,7 @@ files:
|
|
200
220
|
- ".gitignore"
|
201
221
|
- ".rspec"
|
202
222
|
- ".travis.yml"
|
223
|
+
- Appraisals
|
203
224
|
- CHANGELOG.md
|
204
225
|
- Gemfile
|
205
226
|
- LICENSE
|
@@ -209,6 +230,8 @@ files:
|
|
209
230
|
- Rakefile
|
210
231
|
- bin/console
|
211
232
|
- bin/setup
|
233
|
+
- gemfiles/faraday_0.x.gemfile
|
234
|
+
- gemfiles/faraday_1.x.gemfile
|
212
235
|
- lib/zipkin-tracer.rb
|
213
236
|
- lib/zipkin-tracer/application.rb
|
214
237
|
- lib/zipkin-tracer/config.rb
|
@@ -218,6 +241,8 @@ files:
|
|
218
241
|
- lib/zipkin-tracer/rack/zipkin-tracer.rb
|
219
242
|
- lib/zipkin-tracer/rack/zipkin_env.rb
|
220
243
|
- lib/zipkin-tracer/sidekiq/middleware.rb
|
244
|
+
- lib/zipkin-tracer/sqs/adapter.rb
|
245
|
+
- lib/zipkin-tracer/sqs/zipkin-tracer.rb
|
221
246
|
- lib/zipkin-tracer/trace.rb
|
222
247
|
- lib/zipkin-tracer/trace_client.rb
|
223
248
|
- lib/zipkin-tracer/trace_container.rb
|