request-tracer 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b82817157d008ef420c1fdc8d9444b03452beb24
4
- data.tar.gz: 7cfb4576ad0287ea3e1773fc73eb998463e77611
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTgyMTNkZjI4NjExMWNkOWVjOWRhZWZiMjkwMGUxYTMxOTYxNGZmZQ==
5
+ data.tar.gz: !binary |-
6
+ ZTlhODA5YmRkM2E1ZDZjOTU2YWE3ZWRiZGJiYjZmNmQ5YWU1ZmYyYg==
5
7
  SHA512:
6
- metadata.gz: 2dbb6820a5d0ff673a2be0c56d891a25f6ee2d5318068d14487d4845a9a6a9770fdb65e94db0f55b6d09237fba252bdac8f2103abd29af9befda68d83b1929bb
7
- data.tar.gz: ff8caf385a6fd146b5a77d1cfc4b143d0aa1734c489c19546dacd2a7681b100f5f71498a97d6871e89ad58cd4c4ee1824942804eb143217aaa1efef28f729982
8
+ metadata.gz: !binary |-
9
+ YTU3Mzc2MTZmNWMyOTc1ZGNlNTBiNjliZTA5NGQ4M2E1MTQ0NjlhMDA5NWY1
10
+ MTlmNmZmZDNmMjhiY2UyODU4ZTY4OWJiOGI5ZDJlYjFlZGQyNjc5ZDQ5MWYx
11
+ NzQ2NzU1MmE2YzM5ZWFmZGY1YTBmZTVlZDMyNzU2YTI4ZTc5MzQ=
12
+ data.tar.gz: !binary |-
13
+ NzI3NGFjNGZiNmQ1MDE0NjhkODUzNjI5NWVmODIwNTRkZmZhMWUxM2NmNjQ5
14
+ OWVhMzYwNTZmY2MyOGYwYWE1NzQxOTM1OTUzNjYzMjBiYzgxYzY0M2Q3YmI1
15
+ MjcxYzliYWE2MjMzMTlkODQ5MzAyNzdjZDQyNWY5ZDdjOTc0ZmU=
data/README.md CHANGED
@@ -42,12 +42,3 @@ add the following call:
42
42
  ```ruby
43
43
  RequestTracer.integrate_with(:rest_client)
44
44
  ```
45
-
46
- Google Dapper Paper
47
- -------------------
48
- http://static.googleusercontent.com/media/research.google.com/en/pubs/archive/36356.pdf
49
-
50
-
51
- Scala Tests
52
- -----------
53
- https://github.com/openzipkin/zipkin/blob/master/zipkin-common/src/test/scala/com/twitter/zipkin/common/SpanTest.scala
@@ -0,0 +1,26 @@
1
+ require_relative 'base'
2
+ require_relative '../trace'
3
+ require 'faraday'
4
+
5
+ module RequestTracer
6
+ module Integration
7
+ module FaradayHandler
8
+ extend self
9
+ def activate
10
+ ::Faraday::Request.register_middleware(nil, tracing: FaradayTracing)
11
+ builder = Faraday::RackBuilder.new
12
+ builder.insert 0, FaradayTracing
13
+ Faraday.default_connection_options.builder = builder
14
+ end
15
+ end
16
+ class FaradayTracing < ::Faraday::Middleware
17
+ include Base
18
+ def call(env)
19
+ Trace.record do |trace|
20
+ env[:request_headers].merge!(extract_headers_from_fields(trace))
21
+ @app.call(env)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module RequestTracer
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ["lib"]
18
18
 
19
19
  spec.add_development_dependency 'rest-client'
20
+ spec.add_development_dependency 'faraday'
20
21
  spec.add_development_dependency 'sidekiq'
21
22
  spec.add_development_dependency 'bundler', '~> 1.7'
22
23
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -0,0 +1,27 @@
1
+
2
+ require 'rack/test'
3
+ require 'request_tracer/trace'
4
+ require 'request_tracer/integration/faraday_handler'
5
+ require 'webmock/rspec'
6
+
7
+ describe RequestTracer::Integration::FaradayHandler do
8
+ include RequestTracer::Integration::Base
9
+ RequestTracer.integrate_with(:faraday)
10
+ before(:all) { WebMock.disable_net_connect! }
11
+
12
+ let(:trace) { RequestTracer::Trace.create }
13
+
14
+ before do
15
+ RequestTracer::Trace.clear
16
+ stub_request(:any, "www.example.com")
17
+ allow(RequestTracer::Trace).to receive(:record) {|&block| block.call(trace) }
18
+ Faraday.new("http://www.example.com/").get
19
+ end
20
+
21
+ context "when no previous trace existed on the stack" do
22
+ it "sets fresh trace headers on the outgoing call" do
23
+ expect(WebMock).to have_requested(:get, "www.example.com").
24
+ with(headers: extract_headers_from_fields(trace.to_h))
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,209 +1,223 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Mauch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sidekiq
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ">="
45
+ - - ! '>='
32
46
  - !ruby/object:Gem::Version
33
47
  version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ">="
52
+ - - ! '>='
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
61
  version: '1.7'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.7'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
75
  version: '10.0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
82
  version: '10.0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ~>
74
88
  - !ruby/object:Gem::Version
75
89
  version: '3.4'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ~>
81
95
  - !ruby/object:Gem::Version
82
96
  version: '3.4'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: generative
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - ">="
101
+ - - ! '>='
88
102
  - !ruby/object:Gem::Version
89
103
  version: '0'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - ">="
108
+ - - ! '>='
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rack-test
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - "~>"
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0.6'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - "~>"
122
+ - - ~>
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0.6'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: webmock
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - ! '>='
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - ! '>='
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: guard
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - "~>"
143
+ - - ~>
130
144
  - !ruby/object:Gem::Version
131
145
  version: '2.13'
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - "~>"
150
+ - - ~>
137
151
  - !ruby/object:Gem::Version
138
152
  version: '2.13'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: guard-rspec
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - "~>"
157
+ - - ~>
144
158
  - !ruby/object:Gem::Version
145
159
  version: '4.6'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - "~>"
164
+ - - ~>
151
165
  - !ruby/object:Gem::Version
152
166
  version: '4.6'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: guard-bundler
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
- - - "~>"
171
+ - - ~>
158
172
  - !ruby/object:Gem::Version
159
173
  version: '2.1'
160
174
  type: :development
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
- - - "~>"
178
+ - - ~>
165
179
  - !ruby/object:Gem::Version
166
180
  version: '2.1'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: geminabox
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
- - - ">="
185
+ - - ! '>='
172
186
  - !ruby/object:Gem::Version
173
187
  version: '0'
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
- - - ">="
192
+ - - ! '>='
179
193
  - !ruby/object:Gem::Version
180
194
  version: '0'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: gem-release
183
197
  requirement: !ruby/object:Gem::Requirement
184
198
  requirements:
185
- - - ">="
199
+ - - ! '>='
186
200
  - !ruby/object:Gem::Version
187
201
  version: '0'
188
202
  type: :development
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
- - - ">="
206
+ - - ! '>='
193
207
  - !ruby/object:Gem::Version
194
208
  version: '0'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: pry
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
- - - ">="
213
+ - - ! '>='
200
214
  - !ruby/object:Gem::Version
201
215
  version: '0'
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
- - - ">="
220
+ - - ! '>='
207
221
  - !ruby/object:Gem::Version
208
222
  version: '0'
209
223
  description: This is a tracer that hooks into several components to allow tracing
@@ -214,10 +228,10 @@ executables: []
214
228
  extensions: []
215
229
  extra_rdoc_files: []
216
230
  files:
217
- - ".gemrelease"
218
- - ".gitignore"
219
- - ".rspec"
220
- - ".travis.yml"
231
+ - .gemrelease
232
+ - .gitignore
233
+ - .rspec
234
+ - .travis.yml
221
235
  - Gemfile
222
236
  - Guardfile
223
237
  - LICENSE
@@ -225,6 +239,7 @@ files:
225
239
  - Rakefile
226
240
  - lib/request_tracer.rb
227
241
  - lib/request_tracer/integration/base.rb
242
+ - lib/request_tracer/integration/faraday_handler.rb
228
243
  - lib/request_tracer/integration/rack_handler.rb
229
244
  - lib/request_tracer/integration/rest_client_handler.rb
230
245
  - lib/request_tracer/integration/sidekiq_handler.rb
@@ -232,6 +247,7 @@ files:
232
247
  - lib/request_tracer/version.rb
233
248
  - request-tracer.gemspec
234
249
  - spec/integration/integration_spec.rb
250
+ - spec/lib/request_tracer/integration/faraday_handler_spec.rb
235
251
  - spec/lib/request_tracer/integration/rack_handler_spec.rb
236
252
  - spec/lib/request_tracer/integration/rest_client_handler_spec.rb
237
253
  - spec/lib/request_tracer/integration/sidekiq_handler_spec.rb
@@ -249,22 +265,23 @@ require_paths:
249
265
  - lib
250
266
  required_ruby_version: !ruby/object:Gem::Requirement
251
267
  requirements:
252
- - - ">="
268
+ - - ! '>='
253
269
  - !ruby/object:Gem::Version
254
270
  version: '0'
255
271
  required_rubygems_version: !ruby/object:Gem::Requirement
256
272
  requirements:
257
- - - ">="
273
+ - - ! '>='
258
274
  - !ruby/object:Gem::Version
259
275
  version: '0'
260
276
  requirements: []
261
277
  rubyforge_project:
262
- rubygems_version: 2.5.1
278
+ rubygems_version: 2.4.5
263
279
  signing_key:
264
280
  specification_version: 4
265
281
  summary: Traces requests using the Zipkin HTTP headers
266
282
  test_files:
267
283
  - spec/integration/integration_spec.rb
284
+ - spec/lib/request_tracer/integration/faraday_handler_spec.rb
268
285
  - spec/lib/request_tracer/integration/rack_handler_spec.rb
269
286
  - spec/lib/request_tracer/integration/rest_client_handler_spec.rb
270
287
  - spec/lib/request_tracer/integration/sidekiq_handler_spec.rb