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 +4 -4
- data/.travis.yml +10 -9
- data/CHANGELOG.md +3 -0
- data/lib/zipkin-tracer/trace.rb +26 -8
- data/lib/zipkin-tracer/version.rb +1 -1
- data/lib/zipkin-tracer/zipkin_sender_base.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70dbbd7dfea628ace63ca5a3b71e613bd8eacfc87cb85b6e5f22886d89ed5fbf
|
4
|
+
data.tar.gz: 2f6ba947c19e4b91b444aa83017cb30f974d3feec5658f83a5bba26ada0b7e8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1833916f188f9750222d1caf930be26ff3a4958f74fb6ee1fcb37229e38981ed2624ed44d7925eec0d3bb54eefb0dee3668e00b760e4f20910ca7db8f13404b
|
7
|
+
data.tar.gz: 7c9e303402a4954ea1391dcb8b07864173b0f33822c3d359a2ccb53ca58e2f444086c31d73e86ab2b3d87ca54068015501b30d3287436ccfe67f97a3c4c35606
|
data/.travis.yml
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
language: ruby
|
2
|
-
dist:
|
2
|
+
dist: bionic
|
3
3
|
jdk:
|
4
|
-
-
|
4
|
+
- openjdk11
|
5
5
|
rvm:
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
-
|
11
|
-
- jruby-9.
|
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
|
21
|
+
condition: "$TRAVIS_RUBY_VERSION == 2.6"
|
21
22
|
notifications:
|
22
23
|
webhooks:
|
23
24
|
urls:
|
data/CHANGELOG.md
CHANGED
data/lib/zipkin-tracer/trace.rb
CHANGED
@@ -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"
|
169
|
-
PATH = "http.path"
|
170
|
-
STATUS = "http.status_code"
|
171
|
-
LOCAL_COMPONENT = "lc"
|
172
|
-
ERROR = "error"
|
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"
|
177
|
-
SERVER = "SERVER"
|
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
|
|
@@ -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
|
29
|
-
|
30
|
-
|
31
|
-
|
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.
|
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:
|
17
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: faraday
|