zipkin-tracer 0.42.0 → 0.43.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: cb2d9d53fd72f39cda64ad32aa5d578c859bf2a7b711b276cda1b080470eb2c5
4
- data.tar.gz: b02443c6d58d469d6201ea61e7506c5548616362b54d4c2418955e640e059a25
3
+ metadata.gz: 70dbbd7dfea628ace63ca5a3b71e613bd8eacfc87cb85b6e5f22886d89ed5fbf
4
+ data.tar.gz: 2f6ba947c19e4b91b444aa83017cb30f974d3feec5658f83a5bba26ada0b7e8f
5
5
  SHA512:
6
- metadata.gz: '029f1d52918da350f097cef452dbb937dafd1fb12dcc42fd59c33985e2d15c9ef4a934a6f274d9b879ecd937638240773eceaec12b330cb3baacf1f72ec86f8b'
7
- data.tar.gz: 4ef5c85dccf8d5c8ff7f4ba04cb88c33d98e11de67f5fcd56e535a2542c032abd73102ba878c0a2681dcecd7930eff5df44a33a4b61a50964153adb24ba1b15d
6
+ metadata.gz: a1833916f188f9750222d1caf930be26ff3a4958f74fb6ee1fcb37229e38981ed2624ed44d7925eec0d3bb54eefb0dee3668e00b760e4f20910ca7db8f13404b
7
+ data.tar.gz: 7c9e303402a4954ea1391dcb8b07864173b0f33822c3d359a2ccb53ca58e2f444086c31d73e86ab2b3d87ca54068015501b30d3287436ccfe67f97a3c4c35606
@@ -1,14 +1,15 @@
1
1
  language: ruby
2
- dist: trusty
2
+ dist: bionic
3
3
  jdk:
4
- - oraclejdk8
4
+ - openjdk11
5
5
  rvm:
6
- - 2.6.3
7
- - 2.5.5
8
- - 2.4.6
9
- - 2.3.8
10
- - jruby-9.1.17.0
11
- - jruby-9.2.8.0
6
+ - 2.7
7
+ - 2.6
8
+ - 2.5
9
+ - 2.4
10
+ - 2.3
11
+ - jruby-9.1
12
+ - jruby-9.2
12
13
  deploy:
13
14
  provider: rubygems
14
15
  api_key:
@@ -17,7 +18,7 @@ deploy:
17
18
  on:
18
19
  tags: true
19
20
  repo: openzipkin/zipkin-ruby
20
- condition: "$TRAVIS_RUBY_VERSION == 2.6.3"
21
+ condition: "$TRAVIS_RUBY_VERSION == 2.6"
21
22
  notifications:
22
23
  webhooks:
23
24
  urls:
@@ -1,3 +1,6 @@
1
+ # 0.43.0
2
+ * Add the `PRODUCER` and `CONSUMER` span kinds.
3
+
1
4
  # 0.42.0
2
5
  * Reuse existing tracer(sender) in the TraceWrapper utility class.
3
6
 
@@ -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
@@ -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".freeze
169
- PATH = "http.path".freeze
170
- STATUS = "http.status_code".freeze
171
- LOCAL_COMPONENT = "lc".freeze # TODO: Remove LOCAL_COMPONENT and related methods when no longer needed
172
- ERROR = "error".freeze
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".freeze
177
- SERVER = "SERVER".freeze
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
 
@@ -1,3 +1,3 @@
1
1
  module ZipkinTracer
2
- VERSION = '0.42.0'.freeze
2
+ VERSION = '0.43.0'.freeze
3
3
  end
@@ -25,10 +25,10 @@ module Trace
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.
28
- if !span.has_parent_span? || span.kind == Trace::Span::Kind::SERVER
29
- flush!
30
- reset
31
- end
28
+ return if span.has_parent_span? && span.kind == Trace::Span::Kind::CLIENT
29
+
30
+ flush!
31
+ reset
32
32
  end
33
33
 
34
34
  def start_span(trace_id, name, timestamp = Time.now)
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.42.0
4
+ version: 0.43.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-11-23 00:00:00.000000000 Z
17
+ date: 2020-02-03 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: faraday