zipkin-tracer 0.38.0 → 0.39.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/.travis.yml +1 -0
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/zipkin-tracer/trace.rb +4 -4
- data/lib/zipkin-tracer/version.rb +1 -1
- data/lib/zipkin-tracer/zipkin_null_sender.rb +4 -4
- data/lib/zipkin-tracer/zipkin_sender_base.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf818d32f099a76bd255711ed8ba02236a9503c3204eaeafb2e12cc964bbee6d
|
4
|
+
data.tar.gz: ea89c8c32b6d4c4f5afd658460a8244dc097df91b13793722c60846384e691e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 272ca85ee84852c6855f6d5cca01be22904532bf04de0c2d78430a1f980709ce1c73ef0346ce62e3ad8d23f64a588f5c68e558e0561ce644c9715b4e385ad3bc
|
7
|
+
data.tar.gz: 6b9c5d89c7114f4e3361383ed030a2719bdea42657e95e5f70c8ebb25d0813ef99c1853b64fc59b11de3bec0bcb5dbc34c5fc3cb171d2234210aa956aa75e1f9
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ use ZipkinTracer::RackHandler, config
|
|
22
22
|
* `:sample_rate` (default: 0.1) - the ratio of requests to sample, from 0 to 1
|
23
23
|
* `:sampled_as_boolean` - When set to true (default but deprecrated), it uses true/false for the `X-B3-Sampled` header. When set to false uses 1/0 which is preferred.
|
24
24
|
* `:trace_id_128bit` - When set to true, high 8-bytes will be prepended to trace_id. The upper 4-bytes are epoch seconds and the lower 4-bytes are random. This makes it convertible to Amazon X-Ray trace ID format v1. (See http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-request-tracing.html)
|
25
|
-
* `:async` - By default senders will flush traces asynchronously. Set to `false` to make that process synchronous. Only supported by the HTTP and SQS senders.
|
25
|
+
* `:async` - By default senders will flush traces asynchronously. Set to `false` to make that process synchronous. Only supported by the HTTP, RabbitMQ, and SQS senders.
|
26
26
|
* `:logger` - The default logger for Rails apps is `Rails.logger`, else it is `STDOUT`. Use this option to pass a custom logger.
|
27
27
|
|
28
28
|
#### Sender specific
|
data/lib/zipkin-tracer/trace.rb
CHANGED
@@ -179,7 +179,7 @@ module Trace
|
|
179
179
|
|
180
180
|
attr_accessor :name, :kind, :local_endpoint, :remote_endpoint, :annotations, :tags, :debug
|
181
181
|
|
182
|
-
def initialize(name, span_id)
|
182
|
+
def initialize(name, span_id, timestamp = Time.now)
|
183
183
|
@name = name
|
184
184
|
@span_id = span_id
|
185
185
|
@kind = nil
|
@@ -188,12 +188,12 @@ module Trace
|
|
188
188
|
@annotations = []
|
189
189
|
@tags = {}
|
190
190
|
@debug = span_id.debug?
|
191
|
-
@timestamp = to_microseconds(
|
191
|
+
@timestamp = to_microseconds(timestamp)
|
192
192
|
@duration = UNKNOWN_DURATION
|
193
193
|
end
|
194
194
|
|
195
|
-
def close
|
196
|
-
@duration = to_microseconds(
|
195
|
+
def close(timestamp = Time.now)
|
196
|
+
@duration = to_microseconds(timestamp) - @timestamp
|
197
197
|
end
|
198
198
|
|
199
199
|
def to_h
|
@@ -7,12 +7,12 @@ module Trace
|
|
7
7
|
result
|
8
8
|
end
|
9
9
|
|
10
|
-
def start_span(trace_id, name)
|
11
|
-
Span.new(name, trace_id)
|
10
|
+
def start_span(trace_id, name, timestamp = Time.now)
|
11
|
+
Span.new(name, trace_id, timestamp)
|
12
12
|
end
|
13
13
|
|
14
|
-
def end_span(span)
|
15
|
-
span.close if span.respond_to?(:close)
|
14
|
+
def end_span(span, timestamp = Time.now)
|
15
|
+
span.close(timestamp) if span.respond_to?(:close)
|
16
16
|
end
|
17
17
|
|
18
18
|
def flush!
|
@@ -20,8 +20,8 @@ module Trace
|
|
20
20
|
result
|
21
21
|
end
|
22
22
|
|
23
|
-
def end_span(span)
|
24
|
-
span.close
|
23
|
+
def end_span(span, timestamp = Time.now)
|
24
|
+
span.close(timestamp)
|
25
25
|
# If in a thread not handling incoming http requests, it will not have Kind::SERVER, so the span
|
26
26
|
# will never be flushed and will cause memory leak.
|
27
27
|
# If no parent span, then current span needs to flush when it ends.
|
@@ -31,8 +31,8 @@ module Trace
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def start_span(trace_id, name)
|
35
|
-
span = Span.new(name, trace_id)
|
34
|
+
def start_span(trace_id, name, timestamp = Time.now)
|
35
|
+
span = Span.new(name, trace_id, timestamp)
|
36
36
|
span.local_endpoint = Trace.default_endpoint
|
37
37
|
store_span(trace_id, span)
|
38
38
|
span
|
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.39.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Hu
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2019-
|
17
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: faraday
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
- !ruby/object:Gem::Version
|
255
255
|
version: '0'
|
256
256
|
requirements: []
|
257
|
-
rubygems_version: 3.0.
|
257
|
+
rubygems_version: 3.0.6
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: Ruby tracing via Zipkin
|