zipkin-tracer 0.38.0 → 0.39.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05de91c3ee2300d261bd19d481b4fe602e818f48ddce33294791543c04579f20
4
- data.tar.gz: 883b5cc753bae954ab8fe432975a40899f617a0771b7352adfefffbc8cb1b0df
3
+ metadata.gz: cf818d32f099a76bd255711ed8ba02236a9503c3204eaeafb2e12cc964bbee6d
4
+ data.tar.gz: ea89c8c32b6d4c4f5afd658460a8244dc097df91b13793722c60846384e691e5
5
5
  SHA512:
6
- metadata.gz: e0c80c681f43960a95f03c28e34b506d7bf7161fd7b0c5d6ae185a8295ff31782ff99abcb6a43adf0a2053909200cd4f36808122c8e2bf3e20d13d946b4461f3
7
- data.tar.gz: 743a4f9c0274c51beab9532cb6603d66499568ecc6c7fde0327fa72786be792653b45b333de970ec78285f2e367ee76d59489f27822d156d78e92d07f7eb20f5
6
+ metadata.gz: 272ca85ee84852c6855f6d5cca01be22904532bf04de0c2d78430a1f980709ce1c73ef0346ce62e3ad8d23f64a588f5c68e558e0561ce644c9715b4e385ad3bc
7
+ data.tar.gz: 6b9c5d89c7114f4e3361383ed030a2719bdea42657e95e5f70c8ebb25d0813ef99c1853b64fc59b11de3bec0bcb5dbc34c5fc3cb171d2234210aa956aa75e1f9
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ dist: trusty
2
3
  jdk:
3
4
  - oraclejdk8
4
5
  rvm:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.39.0
2
+ * Allow clients to provide an explicit timestamp when starting and stopping spans
3
+
1
4
  # 0.38.0
2
5
  * Add RabbitMQ sender
3
6
 
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
@@ -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(Time.now)
191
+ @timestamp = to_microseconds(timestamp)
192
192
  @duration = UNKNOWN_DURATION
193
193
  end
194
194
 
195
- def close
196
- @duration = to_microseconds(Time.now) - @timestamp
195
+ def close(timestamp = Time.now)
196
+ @duration = to_microseconds(timestamp) - @timestamp
197
197
  end
198
198
 
199
199
  def to_h
@@ -1,3 +1,3 @@
1
1
  module ZipkinTracer
2
- VERSION = '0.38.0'.freeze
2
+ VERSION = '0.39.0'.freeze
3
3
  end
@@ -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.38.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-07-16 00:00:00.000000000 Z
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.4
257
+ rubygems_version: 3.0.6
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: Ruby tracing via Zipkin