zipkin-tracer 0.29.1 → 0.30.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: 0f48284c20b1d1377110cb94a3f61f8e242869c9e4c029097d664351af9e1969
4
- data.tar.gz: ae64fe7cbf4c23fbbadf28dd5661582446032dfd2bfcf53bda7a096f0d18465b
3
+ metadata.gz: b3baf1dff1d2fa511cec7a66a040c4e817bb100d4e8984834d0471f8a1118d51
4
+ data.tar.gz: b2047d302ad9d4c50f265c33f640a03d02a6223379707c8146995667812dc023
5
5
  SHA512:
6
- metadata.gz: 92eb06e30a0602fc08f499c6088decc6608a6009b14e232f74a5142824c47803905c03fb0b7643fdd756b656b1a47094aacd4c2a9b7a2e47c3b1c370fe0ddffd
7
- data.tar.gz: df64ae864cc61accfd51ac4e71cff367a09e854ae46a181af098e2297b6e46a2ebd835dc445b0723bebf97acbba7171100a70a53b2abb4283c512375f41a14b6
6
+ metadata.gz: 9bfaaf722dcdad67fcb795db85cbaac6ab5b6234e76569d17982098ec38059e9d7f9fb5167ed0c0e177ff9857d987dbe68ab780e8dbfef0fc18e220dbb784664
7
+ data.tar.gz: 8ddb0aba5a360756b11015aea6d13949a14d4653de0123664f7e7264c8e67655544cea722002d098358bef67e476be7ecdc6747a214b93886fdab9a76828997d
@@ -80,12 +80,14 @@ module ZipkinTracer
80
80
  end
81
81
 
82
82
  def trace!(datum, trace_id)
83
+ method = datum[:method].to_s
83
84
  url_string = Excon::Utils::request_uri(datum)
84
85
  url = URI(url_string)
85
86
  service_name = service_name(datum, url.host)
86
87
 
87
- span = Trace.tracer.start_span(trace_id, datum[:method].to_s.downcase)
88
+ span = Trace.tracer.start_span(trace_id, method.downcase)
88
89
  # annotate with method (GET/POST/etc.) and uri path
90
+ span.record_tag(Trace::BinaryAnnotation::METHOD, method.upcase, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
89
91
  span.record_tag(Trace::BinaryAnnotation::PATH, url.path, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
90
92
  span.record_tag(Trace::BinaryAnnotation::SERVER_ADDRESS, SERVER_ADDRESS_SPECIAL_VALUE, Trace::BinaryAnnotation::Type::BOOL, remote_endpoint(url, service_name))
91
93
  span.record(Trace::Annotation::CLIENT_SEND, local_endpoint)
@@ -44,12 +44,14 @@ module ZipkinTracer
44
44
  def trace!(env, trace_id)
45
45
  response = nil
46
46
  # handle either a URI object (passed by Faraday v0.8.x in testing), or something string-izable
47
+ method = env[:method].to_s
47
48
  url = env[:url].respond_to?(:host) ? env[:url] : URI.parse(env[:url].to_s)
48
49
  local_endpoint = Trace.default_endpoint # The rack middleware set this up for us.
49
50
  remote_endpoint = Trace::Endpoint.remote_endpoint(url, @service_name, local_endpoint.ip_format) # The endpoint we are calling.
50
- Trace.tracer.with_new_span(trace_id, env[:method].to_s.downcase) do |span|
51
+ Trace.tracer.with_new_span(trace_id, method.downcase) do |span|
51
52
  @span = span # So we can record on exceptions
52
53
  # annotate with method (GET/POST/etc.) and uri path
54
+ span.record_tag(Trace::BinaryAnnotation::METHOD, method.upcase, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
53
55
  span.record_tag(Trace::BinaryAnnotation::PATH, url.path, Trace::BinaryAnnotation::Type::STRING, local_endpoint)
54
56
  span.record_tag(Trace::BinaryAnnotation::SERVER_ADDRESS, SERVER_ADDRESS_SPECIAL_VALUE, Trace::BinaryAnnotation::Type::BOOL, remote_endpoint)
55
57
  span.record(Trace::Annotation::CLIENT_SEND, local_endpoint)
@@ -151,6 +151,7 @@ module Trace
151
151
  class BinaryAnnotation
152
152
  SERVER_ADDRESS = 'sa'.freeze
153
153
  URI = 'http.uri'.freeze
154
+ METHOD = 'http.method'.freeze
154
155
  PATH = 'http.path'.freeze
155
156
  STATUS = 'http.status'.freeze
156
157
  LOCAL_COMPONENT = 'lc'.freeze
@@ -1,3 +1,3 @@
1
1
  module ZipkinTracer
2
- VERSION = '0.29.1'.freeze
2
+ VERSION = '0.30.0'.freeze
3
3
  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.29.1
4
+ version: 0.30.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: 2018-11-15 00:00:00.000000000 Z
16
+ date: 2018-12-06 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: faraday