zipkin-tracer 0.22.0 → 0.23.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e370dd751832be287e591eb227b01384f939a87
4
- data.tar.gz: 1c14cb00ffa226c6f301130e543ac6bd4e4b81a4
3
+ metadata.gz: 17ea0ff62e644d02b42274491b09f3227c8e8609
4
+ data.tar.gz: ce92768b4d619d4a72c729af05246c9aafc4edf4
5
5
  SHA512:
6
- metadata.gz: 5403b8f35d8ae2c2b63e84b8b205bd89f54790c2ccada5e60e83c6d5f64cdd3315b28a765149d47269327f9bca1d07229dfb59c248b7959032fc5e6d4bad47c2
7
- data.tar.gz: bc38a24c9a4dcc616f662bf9009009abd437e967d519e93b68d9a015a3a1fb08627755d7a396d710726d96b4c185c03d69cb4b6917e58ae6b0a0cfd3a81e6a80
6
+ metadata.gz: c5f70bce1a97b561a1b68937d6674ad7854574ab786360c6970ac7cf7124aecd0c36a95724f4ca2d8a80b34e64e4351af32a7ab0f0a2f8bafa47e917288a97cd
7
+ data.tar.gz: 640149e01616e7d9f4e1867608e539c8a54e1b7b552e9217c65c7223c86985b189218ad225cae874cd025846b9b7b77f3ebbefdc37bbe8e9bb5f3364789449d6
@@ -38,6 +38,7 @@ module ZipkinTracer
38
38
  )
39
39
  end
40
40
  span.record(Trace::Annotation::CLIENT_RECV, local_endpoint)
41
+ Trace.tracer.end_span(span)
41
42
  end
42
43
 
43
44
  super(datum)
@@ -78,15 +79,14 @@ module ZipkinTracer
78
79
  url = URI(url_string)
79
80
  service_name = service_name(datum, url.host)
80
81
 
81
- Trace.tracer.with_new_span(trace_id, datum[:method].to_s.downcase) do |span|
82
- # annotate with method (GET/POST/etc.) and uri path
83
- span.record_tag(Trace::BinaryAnnotation::PATH, url.path, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
84
- span.record_tag(Trace::BinaryAnnotation::SERVER_ADDRESS, SERVER_ADDRESS_SPECIAL_VALUE, Trace::BinaryAnnotation::Type::BOOL, remote_endpoint(url, service_name))
85
- span.record(Trace::Annotation::CLIENT_SEND, local_endpoint)
82
+ span = Trace.tracer.start_span(trace_id, datum[:method].to_s.downcase)
83
+ # annotate with method (GET/POST/etc.) and uri path
84
+ span.record_tag(Trace::BinaryAnnotation::PATH, url.path, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
85
+ span.record_tag(Trace::BinaryAnnotation::SERVER_ADDRESS, SERVER_ADDRESS_SPECIAL_VALUE, Trace::BinaryAnnotation::Type::BOOL, remote_endpoint(url, service_name))
86
+ span.record(Trace::Annotation::CLIENT_SEND, local_endpoint)
86
87
 
87
- # store the span in the datum hash so it can be used in the response_call
88
- datum[:span] = span
89
- end
88
+ # store the span in the datum hash so it can be used in the response_call
89
+ datum[:span] = span
90
90
  rescue ArgumentError, URI::Error => e
91
91
  # Ignore URI errors, don't trace if there is no URI
92
92
  end
@@ -1,3 +1,3 @@
1
1
  module ZipkinTracer
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.23.0'.freeze
3
3
  end
@@ -4,8 +4,18 @@ module Trace
4
4
  # the NullTracer also.
5
5
  class NullTracer
6
6
  def with_new_span(trace_id, name)
7
- span = Span.new(name, trace_id)
8
- yield span
7
+ span = start_span(trace_id, name)
8
+ result = yield span
9
+ end_span(span)
10
+ result
11
+ end
12
+
13
+ def start_span(trace_id, name)
14
+ Span.new(name, trace_id)
15
+ end
16
+
17
+ def end_span(span)
18
+ span.close if span.respond_to?(:close)
9
19
  end
10
20
 
11
21
  def flush!
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.22.0
4
+ version: 0.23.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: 2017-04-26 00:00:00.000000000 Z
16
+ date: 2017-05-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: faraday