faraday-zipkin 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +6 -6
- data/faraday-zipkin.gemspec +1 -1
- data/lib/faraday-zipkin/trace_headers.rb +5 -3
- data/lib/faraday-zipkin/version.rb +1 -1
- data/spec/zipkin_trace_headers_spec.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjJlYjkyOTE2Yjg2ZDMzYTE4MGU4MWRmM2FkYWY3NThmOGNlOWVlYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTFhNTYzY2ViYzMyMzViNzExNmFjMjdmYTk5MTExYzJkODc0ZmYzMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmUwNjNjZDRhMGU2OTUxNzg1ZWY0NmFiMmMzNTJkNmU3NThhMWU0MDYyYTdm
|
10
|
+
OWViNGFiODc5N2ZkMzI1YjQ3OWRiNjcxMWE1NWEwYTRkZmFmNDZlZjQ1ZDRm
|
11
|
+
ZGVhNTkwNDkxYjc2ZjZjZWMzNzE4Yzg5MWJjZWM0NTliYjBhNDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWFhNzhmNmU3ZTQ2NjYwMzFlODM3YmI1MGRmY2ZkNjE5YzQyNjJmMjA5ODdm
|
14
|
+
Mzg2NTJiOGM3NmQ0ZTYzZGI4ZWE2YmNlYWNiMDg2N2Q1NWIyNWYxYjU5NDMw
|
15
|
+
NmRmM2IzNzk4N2JhMDU2YmNkYWU1YWFmMDg2NDUzZTdlOTY5ZWQ=
|
data/CHANGELOG
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
+
v0.3.0 - Upgrade to finagle-thrift v1.3.1
|
3
|
+
|
2
4
|
Supporting finagle-thrift v1.2.0
|
3
|
-
v0.
|
5
|
+
v0.2.3 minor gem cleanup, travis support; fix raise on DNS
|
6
|
+
v0.2.2 fix serialization of response code
|
7
|
+
v0.2.1 add annotation for http uri, method, response code
|
4
8
|
v0.2.0 added the optional service_name parameter, annotate correctly
|
5
|
-
v0.2.1 add annotation for http uri, method, response code
|
6
|
-
v0.2.2 fix serialization of response code
|
7
|
-
v0.2.3 minor gem cleanup, travis support; fix raise on DNS
|
8
9
|
|
9
|
-
|
10
|
-
v0.3.0 - Upgrade to finagle-thrift v1.3.0
|
10
|
+
v0.1.0 initial implementation of client trace code
|
data/faraday-zipkin.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "faraday", ">= 0.8"
|
22
22
|
spec.add_dependency "thrift", "~> 0.9.0"
|
23
|
-
spec.add_dependency "finagle-thrift", "~> 1.
|
23
|
+
spec.add_dependency "finagle-thrift", "~> 1.3.1"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.6"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -10,7 +10,8 @@ module Faraday
|
|
10
10
|
:trace_id => "X-B3-TraceId",
|
11
11
|
:parent_id => "X-B3-ParentSpanId",
|
12
12
|
:span_id => "X-B3-SpanId",
|
13
|
-
:sampled => "X-B3-Sampled"
|
13
|
+
:sampled => "X-B3-Sampled",
|
14
|
+
:flags => "X-B3-Flags"
|
14
15
|
}.freeze
|
15
16
|
|
16
17
|
def initialize(app, service_name=nil)
|
@@ -24,8 +25,9 @@ module Faraday
|
|
24
25
|
service_name = @service_name || url.host.split('.').first # default to url-derived service name
|
25
26
|
endpoint = ::Trace::Endpoint.new(host_ip_for(url.host), url.port, service_name)
|
26
27
|
|
27
|
-
|
28
|
-
|
28
|
+
::Trace.unwind do
|
29
|
+
trace_id = ::Trace.id
|
30
|
+
::Trace.push(trace_id.next_id)
|
29
31
|
B3_HEADERS.each do |method, header|
|
30
32
|
env[:request_headers][header] = ::Trace.id.send(method).to_s
|
31
33
|
end
|
@@ -62,7 +62,7 @@ describe Faraday::Zipkin::TraceHeaders do
|
|
62
62
|
HEX_REGEX = RUBY_VERSION >= "1.9.2" ? '\h' : '[0-9a-fA-F]'
|
63
63
|
|
64
64
|
context 'with tracing id' do
|
65
|
-
let(:trace_id) { ::Trace::TraceId.new(1, 2, 3, true) }
|
65
|
+
let(:trace_id) { ::Trace::TraceId.new(1, 2, 3, true, ::Trace::Flags::DEBUG) }
|
66
66
|
|
67
67
|
it 'sets the X-B3 request headers' do
|
68
68
|
expect_tracing
|
@@ -75,6 +75,7 @@ describe Faraday::Zipkin::TraceHeaders do
|
|
75
75
|
expect(result[:request_headers]['X-B3-SpanId']).not_to eq('0000000000000003')
|
76
76
|
expect(result[:request_headers]['X-B3-SpanId']).to match(/^#{HEX_REGEX}{16}$/)
|
77
77
|
expect(result[:request_headers]['X-B3-Sampled']).to eq('true')
|
78
|
+
expect(result[:request_headers]['X-B3-Flags']).to eq('1')
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
@@ -88,6 +89,7 @@ describe Faraday::Zipkin::TraceHeaders do
|
|
88
89
|
expect(result[:request_headers]['X-B3-ParentSpanId']).to match(/^#{HEX_REGEX}{16}$/)
|
89
90
|
expect(result[:request_headers]['X-B3-SpanId']).to match(/^#{HEX_REGEX}{16}$/)
|
90
91
|
expect(result[:request_headers]['X-B3-Sampled']).to match(/(true|false)/)
|
92
|
+
expect(result[:request_headers]['X-B3-Flags']).to eq('0')
|
91
93
|
end
|
92
94
|
end
|
93
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-zipkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariel Salomon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.3.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.3.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|