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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2QxNTk2MzUxOTIwZTBkNTI0OTJmNzAxNzYzOTJmNTQ2MTgwZWE4Ng==
4
+ ZjJlYjkyOTE2Yjg2ZDMzYTE4MGU4MWRmM2FkYWY3NThmOGNlOWVlYQ==
5
5
  data.tar.gz: !binary |-
6
- NjZhNTUyYWY0YmQyOTZjNDM5ZTVhNDE2MzRmZTYxYWE1Yzc3MDhjYQ==
6
+ OTFhNTYzY2ViYzMyMzViNzExNmFjMjdmYTk5MTExYzJkODc0ZmYzMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWI5NDExYTlmYWNmOWU5NGVkMzhjM2M2MGUxZjk3ZGFkYjRlYjE2YjFmOWY3
10
- OTdiZDBjNjA4M2U3ZTczNTUyMzkzZjBiYmIzYmU0M2VmYzI3Y2JlMGRlMDgx
11
- ZmZkZTRkNjk0M2RkMzUzMmZiNTU4MmVmYTQ0MWY3MTY4Y2Q4YWQ=
9
+ MmUwNjNjZDRhMGU2OTUxNzg1ZWY0NmFiMmMzNTJkNmU3NThhMWU0MDYyYTdm
10
+ OWViNGFiODc5N2ZkMzI1YjQ3OWRiNjcxMWE1NWEwYTRkZmFmNDZlZjQ1ZDRm
11
+ ZGVhNTkwNDkxYjc2ZjZjZWMzNzE4Yzg5MWJjZWM0NTliYjBhNDQ=
12
12
  data.tar.gz: !binary |-
13
- MGRlZmU0ZWU5N2VjNWRkYzcyMmZhZjQyMjk1NTc0MmU4MTczOGYxMTYwNTcw
14
- NDc4MmZhZWUwZGZjZjIyMGQ2YTA4NTRjNzkxMDRmNTY2ZTk3NzRlN2I1Nzdl
15
- OWNjMjAyMDQ2N2RkYmJjNmFhOGRjNzVmZWI4ZjZjYjFhMjhmNmE=
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.1.0 initial implementation of client trace code
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
- TODO:
10
- v0.3.0 - Upgrade to finagle-thrift v1.3.0
10
+ v0.1.0 initial implementation of client trace code
@@ -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.2.0"
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
- trace_id = ::Trace.id
28
- ::Trace.push(trace_id.next_id) do
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
@@ -1,5 +1,5 @@
1
1
  module Faraday
2
2
  module Zipkin
3
- VERSION = "0.2.3"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.3
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-17 00:00:00.000000000 Z
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.2.0
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.2.0
54
+ version: 1.3.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement