ddtrace 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +456 -0
  3. data/.circleci/images/primary/Dockerfile-1.9.3 +69 -0
  4. data/.circleci/images/primary/Dockerfile-2.0.0 +69 -0
  5. data/.circleci/images/primary/Dockerfile-2.1.10 +69 -0
  6. data/.circleci/images/primary/Dockerfile-2.2.10 +69 -0
  7. data/.circleci/images/primary/Dockerfile-2.3.7 +73 -0
  8. data/.circleci/images/primary/Dockerfile-2.4.4 +73 -0
  9. data/.env +21 -11
  10. data/.rubocop.yml +4 -1
  11. data/Appraisals +439 -66
  12. data/CHANGELOG.md +25 -2
  13. data/Rakefile +256 -75
  14. data/ddtrace.gemspec +6 -6
  15. data/docker-compose.yml +222 -37
  16. data/docs/GettingStarted.md +13 -1
  17. data/gemfiles/contrib_old.gemfile +1 -0
  18. data/gemfiles/rails30_postgres.gemfile +1 -0
  19. data/gemfiles/rails30_postgres_sidekiq.gemfile +1 -0
  20. data/gemfiles/rails32_mysql2.gemfile +1 -0
  21. data/gemfiles/rails32_postgres.gemfile +1 -0
  22. data/gemfiles/rails32_postgres_redis.gemfile +1 -0
  23. data/gemfiles/rails32_postgres_sidekiq.gemfile +1 -0
  24. data/gemfiles/rails5_mysql2.gemfile +1 -1
  25. data/gemfiles/rails5_postgres.gemfile +1 -1
  26. data/gemfiles/rails5_postgres_redis.gemfile +1 -1
  27. data/gemfiles/rails5_postgres_sidekiq.gemfile +1 -1
  28. data/lib/ddtrace/configuration.rb +2 -2
  29. data/lib/ddtrace/contrib/active_record/patcher.rb +10 -10
  30. data/lib/ddtrace/contrib/aws/instrumentation.rb +2 -2
  31. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +2 -2
  32. data/lib/ddtrace/contrib/http/patcher.rb +18 -16
  33. data/lib/ddtrace/contrib/rails/action_controller_patch.rb +77 -0
  34. data/lib/ddtrace/contrib/rails/action_view.rb +0 -65
  35. data/lib/ddtrace/contrib/rails/active_support.rb +9 -8
  36. data/lib/ddtrace/contrib/rails/core_extensions.rb +74 -115
  37. data/lib/ddtrace/tracer.rb +4 -1
  38. data/lib/ddtrace/utils.rb +10 -2
  39. data/lib/ddtrace/version.rb +1 -1
  40. metadata +11 -4
  41. data/circle.yml +0 -69
data/CHANGELOG.md CHANGED
@@ -4,6 +4,28 @@
4
4
 
5
5
  ## [Unreleased (beta)]
6
6
 
7
+ ## [0.12.1] - 2018-06-12
8
+
9
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.1
10
+
11
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.12.1
12
+
13
+ ### Changed
14
+ - Cache configuration `Proxy` objects (#446)
15
+ - `freeze` more constant strings, to improve memory usage (#446)
16
+ - `Utils#truncate` to use slightly less memory (#446)
17
+
18
+ ### Fixed
19
+ - Net/HTTP integration not permitting `service_name` to be overridden. (#407, #430) (@undergroundwebdesigns)
20
+ - Block not being passed through Elasticsearch client initialization. (#421) (@shayonj)
21
+ - Devise raising `NoMethodError` when bad login attempts are made. (#419, #420) (@frsantos)
22
+ - AWS spans using wrong resource name (#374, #377) (@jfrancoist)
23
+ - ActionView `NoMethodError` on very long traces. (#445, #447) (@jvalanen)
24
+
25
+ ### Refactored
26
+ - ActionController patching strategy using modules. (#439)
27
+ - ActionView tracing strategy. (#445, #447)
28
+
7
29
  ## [0.12.0] - 2018-05-08
8
30
 
9
31
  Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0
@@ -285,8 +307,9 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
285
307
 
286
308
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
287
309
 
288
- [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...master
289
- [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...0.13-dev
310
+ [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.1...master
311
+ [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.1...0.13-dev
312
+ [0.12.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.12.1
290
313
  [0.12.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0
291
314
  [0.12.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
292
315
  [0.12.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
data/Rakefile CHANGED
@@ -142,7 +142,7 @@ end
142
142
  if RUBY_VERSION >= '2.1.0'
143
143
  RuboCop::RakeTask.new(:rubocop) do |t|
144
144
  t.options << ['-D']
145
- t.patterns = ['lib/**/*.rb', 'test/**/*.rb', 'Gemfile', 'Rakefile']
145
+ t.patterns = ['lib/**/*.rb', 'test/**/*.rb', 'spec/**/*.rb', 'Gemfile', 'Rakefile']
146
146
  end
147
147
  end
148
148
 
@@ -196,81 +196,262 @@ task :'release:docs' => :docs do
196
196
  sh "aws s3 cp --recursive doc/ s3://#{S3_BUCKET}/#{S3_DIR}/docs/"
197
197
  end
198
198
 
199
- desc 'CI dependent task; it runs all parallel tests'
199
+ # rubocop:disable Style/YodaCondition
200
+ desc 'CI task; it runs all tests for current version of Ruby'
200
201
  task :ci do
201
- # CircleCI uses this environment to store the node index (starting from 0)
202
- # check: https://circleci.com/docs/parallel-manual-setup/#env-splitting
203
- case ENV['CIRCLE_NODE_INDEX'].to_i
204
- when 0
205
- sh 'rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do rake test:main'
206
- # RSpec
207
- sh 'rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do rake spec:main'
208
- when 1
209
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch'
210
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http'
211
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra'
212
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:rack'
213
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:grape'
214
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:aws'
215
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:mongodb'
216
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sucker_punch'
217
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:resque'
218
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:monkey'
219
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:elasticsearch'
220
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:http'
221
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sinatra'
222
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:rack'
223
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:aws'
224
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:mongodb'
225
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sucker_punch'
226
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:resque'
227
- # RSpec
228
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_record'
229
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_support'
230
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:dalli'
231
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:faraday'
232
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:graphql'
233
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:racecar'
234
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:redis'
235
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_record'
236
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_support'
237
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:dalli'
238
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:faraday'
239
- sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:redis'
240
- when 2
241
- sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sidekiq'
242
- sh 'rvm $SIDEKIQ_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sidekiq'
243
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake test:rails'
244
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake test:railsdisableenv'
245
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-mysql2 rake test:rails'
246
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake test:rails'
247
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres-redis rake test:railsredis'
248
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake test:railsdisableenv'
249
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-mysql2 rake test:rails'
250
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake test:rails'
251
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres-redis rake test:railsredis'
252
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake test:railsdisableenv'
253
- sh 'rvm $RAILS3_SIDEKIQ_VERSIONS --verbose do appraisal rails30-postgres-sidekiq rake test:railssidekiq'
254
- sh 'rvm $RAILS3_SIDEKIQ_VERSIONS --verbose do appraisal rails32-postgres-sidekiq rake test:railssidekiq'
255
- sh 'rvm $RAILS4_SIDEKIQ_VERSIONS --verbose do appraisal rails4-postgres-sidekiq rake test:railssidekiq'
256
- sh 'rvm $RAILS4_SIDEKIQ_VERSIONS --verbose do appraisal rails4-postgres-sidekiq rake test:railsactivejob'
257
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake test:rails'
258
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:rails'
259
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake test:railsredis'
260
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-sidekiq rake test:railssidekiq'
261
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-sidekiq rake test:railsactivejob'
262
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:railsdisableenv'
263
- # RSpec
264
- sh 'rvm $LAST_STABLE --verbose do rake benchmark'
265
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake spec:rails'
266
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-mysql2 rake spec:rails'
267
- sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake spec:rails'
268
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-mysql2 rake spec:rails'
269
- sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake spec:rails'
270
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake spec:rails'
271
- sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake spec:rails'
272
- else
273
- puts 'Too many workers than parallel tasks'
202
+ if RUBY_VERSION < '1.9.3'
203
+ raise NotImplementedError, 'Ruby versions < 1.9.3 are not supported!'
204
+ elsif '1.9.3' <= RUBY_VERSION && RUBY_VERSION < '2.0.0'
205
+ # Main library
206
+ sh 'rake test:main'
207
+ sh 'rake spec:main'
208
+
209
+ if RUBY_PLATFORM != 'java'
210
+ # Contrib minitests
211
+ sh 'appraisal contrib-old rake test:aws'
212
+ sh 'appraisal contrib-old rake test:elasticsearch'
213
+ sh 'appraisal contrib-old rake test:http'
214
+ sh 'appraisal contrib-old rake test:mongodb'
215
+ sh 'appraisal contrib-old rake test:monkey'
216
+ sh 'appraisal contrib-old rake test:rack'
217
+ sh 'appraisal contrib-old rake test:resque'
218
+ sh 'appraisal contrib-old rake test:sinatra'
219
+ sh 'appraisal contrib-old rake test:sucker_punch'
220
+ # Contrib specs
221
+ sh 'appraisal contrib-old rake spec:active_record'
222
+ sh 'appraisal contrib-old rake spec:active_support'
223
+ sh 'appraisal contrib-old rake spec:dalli'
224
+ sh 'appraisal contrib-old rake spec:faraday'
225
+ sh 'appraisal contrib-old rake spec:http'
226
+ sh 'appraisal contrib-old rake spec:redis'
227
+ # Rails minitests
228
+ sh 'appraisal rails30-postgres rake test:rails'
229
+ sh 'appraisal rails30-postgres rake test:railsdisableenv'
230
+ sh 'appraisal rails32-mysql2 rake test:rails'
231
+ sh 'appraisal rails32-postgres rake test:rails'
232
+ sh 'appraisal rails32-postgres-redis rake test:railsredis'
233
+ sh 'appraisal rails32-postgres rake test:railsdisableenv'
234
+ # Rails specs
235
+ sh 'appraisal rails30-postgres rake spec:rails'
236
+ sh 'appraisal rails32-mysql2 rake spec:rails'
237
+ sh 'appraisal rails32-postgres rake spec:rails'
238
+ end
239
+ elsif '2.0.0' <= RUBY_VERSION && RUBY_VERSION < '2.1.0'
240
+ # Main library
241
+ sh 'rake test:main'
242
+ sh 'rake spec:main'
243
+
244
+ if RUBY_PLATFORM != 'java'
245
+ # Contrib minitests
246
+ sh 'appraisal contrib-old rake test:aws'
247
+ sh 'appraisal contrib-old rake test:elasticsearch'
248
+ sh 'appraisal contrib-old rake test:http'
249
+ sh 'appraisal contrib-old rake test:mongodb'
250
+ sh 'appraisal contrib-old rake test:monkey'
251
+ sh 'appraisal contrib-old rake test:rack'
252
+ sh 'appraisal contrib-old rake test:resque'
253
+ sh 'appraisal contrib-old rake test:sinatra'
254
+ sh 'appraisal contrib-old rake test:sucker_punch'
255
+ # Contrib specs
256
+ sh 'appraisal contrib-old rake spec:active_record'
257
+ sh 'appraisal contrib-old rake spec:active_support'
258
+ sh 'appraisal contrib-old rake spec:dalli'
259
+ sh 'appraisal contrib-old rake spec:faraday'
260
+ sh 'appraisal contrib-old rake spec:http'
261
+ sh 'appraisal contrib-old rake spec:redis'
262
+ # Rails minitests
263
+ sh 'appraisal contrib-old rake test:sidekiq'
264
+ sh 'appraisal rails30-postgres rake test:rails'
265
+ sh 'appraisal rails30-postgres rake test:railsdisableenv'
266
+ sh 'appraisal rails32-mysql2 rake test:rails'
267
+ sh 'appraisal rails32-postgres rake test:rails'
268
+ sh 'appraisal rails32-postgres-redis rake test:railsredis'
269
+ sh 'appraisal rails32-postgres rake test:railsdisableenv'
270
+ sh 'appraisal rails30-postgres-sidekiq rake test:railssidekiq'
271
+ sh 'appraisal rails32-postgres-sidekiq rake test:railssidekiq'
272
+ # Rails specs
273
+ sh 'appraisal rails30-postgres rake spec:rails'
274
+ sh 'appraisal rails32-mysql2 rake spec:rails'
275
+ sh 'appraisal rails32-postgres rake spec:rails'
276
+ end
277
+ elsif '2.1.0' <= RUBY_VERSION && RUBY_VERSION < '2.2.0'
278
+ # Main library
279
+ sh 'rake test:main'
280
+ sh 'rake spec:main'
281
+
282
+ if RUBY_PLATFORM != 'java'
283
+ # Contrib minitests
284
+ sh 'appraisal contrib-old rake test:aws'
285
+ sh 'appraisal contrib-old rake test:elasticsearch'
286
+ sh 'appraisal contrib-old rake test:http'
287
+ sh 'appraisal contrib-old rake test:mongodb'
288
+ sh 'appraisal contrib-old rake test:monkey'
289
+ sh 'appraisal contrib-old rake test:rack'
290
+ sh 'appraisal contrib-old rake test:resque'
291
+ sh 'appraisal contrib-old rake test:sinatra'
292
+ sh 'appraisal contrib-old rake test:sucker_punch'
293
+ # Contrib specs
294
+ sh 'appraisal contrib-old rake spec:active_record'
295
+ sh 'appraisal contrib-old rake spec:active_support'
296
+ sh 'appraisal contrib-old rake spec:dalli'
297
+ sh 'appraisal contrib-old rake spec:faraday'
298
+ sh 'appraisal contrib-old rake spec:http'
299
+ sh 'appraisal contrib-old rake spec:redis'
300
+ # Rails minitests
301
+ sh 'appraisal contrib-old rake test:sidekiq'
302
+ sh 'appraisal rails30-postgres rake test:rails'
303
+ sh 'appraisal rails30-postgres rake test:railsdisableenv'
304
+ sh 'appraisal rails32-mysql2 rake test:rails'
305
+ sh 'appraisal rails32-postgres rake test:rails'
306
+ sh 'appraisal rails32-postgres-redis rake test:railsredis'
307
+ sh 'appraisal rails32-postgres rake test:railsdisableenv'
308
+ sh 'appraisal rails4-mysql2 rake test:rails'
309
+ sh 'appraisal rails4-postgres rake test:rails'
310
+ sh 'appraisal rails4-postgres-redis rake test:railsredis'
311
+ sh 'appraisal rails4-postgres rake test:railsdisableenv'
312
+ sh 'appraisal rails30-postgres-sidekiq rake test:railssidekiq'
313
+ sh 'appraisal rails32-postgres-sidekiq rake test:railssidekiq'
314
+ # Rails specs
315
+ sh 'appraisal rails30-postgres rake spec:rails'
316
+ sh 'appraisal rails32-mysql2 rake spec:rails'
317
+ sh 'appraisal rails32-postgres rake spec:rails'
318
+ sh 'appraisal rails4-mysql2 rake spec:rails'
319
+ sh 'appraisal rails4-postgres rake spec:rails'
320
+ end
321
+ elsif '2.2.0' <= RUBY_VERSION && RUBY_VERSION < '2.3.0'
322
+ # Main library
323
+ sh 'rake test:main'
324
+ sh 'rake spec:main'
325
+
326
+ if RUBY_PLATFORM != 'java'
327
+ # Contrib minitests
328
+ sh 'appraisal contrib rake test:aws'
329
+ sh 'appraisal contrib rake test:elasticsearch'
330
+ sh 'appraisal contrib rake test:grape'
331
+ sh 'appraisal contrib rake test:http'
332
+ sh 'appraisal contrib rake test:mongodb'
333
+ sh 'appraisal contrib rake test:rack'
334
+ sh 'appraisal contrib rake test:resque'
335
+ sh 'appraisal contrib rake test:sucker_punch'
336
+ # Contrib specs
337
+ sh 'appraisal contrib rake spec:active_record'
338
+ sh 'appraisal contrib rake spec:active_support'
339
+ sh 'appraisal contrib rake spec:dalli'
340
+ sh 'appraisal contrib rake spec:faraday'
341
+ sh 'appraisal contrib rake spec:graphql'
342
+ sh 'appraisal contrib rake spec:http'
343
+ sh 'appraisal contrib rake spec:racecar'
344
+ sh 'appraisal contrib rake spec:redis'
345
+ # Rails minitests
346
+ sh 'appraisal contrib rake test:sidekiq'
347
+ sh 'appraisal rails30-postgres rake test:rails'
348
+ sh 'appraisal rails30-postgres rake test:railsdisableenv'
349
+ sh 'appraisal rails32-mysql2 rake test:rails'
350
+ sh 'appraisal rails32-postgres rake test:rails'
351
+ sh 'appraisal rails32-postgres-redis rake test:railsredis'
352
+ sh 'appraisal rails32-postgres rake test:railsdisableenv'
353
+ sh 'appraisal rails4-mysql2 rake test:rails'
354
+ sh 'appraisal rails4-postgres rake test:rails'
355
+ sh 'appraisal rails4-postgres-redis rake test:railsredis'
356
+ sh 'appraisal rails4-postgres rake test:railsdisableenv'
357
+ sh 'appraisal rails4-postgres-sidekiq rake test:railssidekiq'
358
+ sh 'appraisal rails4-postgres-sidekiq rake test:railsactivejob'
359
+ sh 'appraisal rails5-mysql2 rake test:rails'
360
+ sh 'appraisal rails5-postgres rake test:rails'
361
+ sh 'appraisal rails5-postgres-redis rake test:railsredis'
362
+ sh 'appraisal rails5-postgres-sidekiq rake test:railssidekiq'
363
+ sh 'appraisal rails5-postgres-sidekiq rake test:railsactivejob'
364
+ sh 'appraisal rails5-postgres rake test:railsdisableenv'
365
+ # Rails specs
366
+ sh 'appraisal rails30-postgres rake spec:rails'
367
+ sh 'appraisal rails32-mysql2 rake spec:rails'
368
+ sh 'appraisal rails32-postgres rake spec:rails'
369
+ sh 'appraisal rails4-mysql2 rake spec:rails'
370
+ sh 'appraisal rails4-postgres rake spec:rails'
371
+ sh 'appraisal rails5-mysql2 rake spec:rails'
372
+ sh 'appraisal rails5-postgres rake spec:rails'
373
+ end
374
+ elsif '2.3.0' <= RUBY_VERSION && RUBY_VERSION < '2.4.0'
375
+ # Main library
376
+ sh 'rake test:main'
377
+ sh 'rake spec:main'
378
+
379
+ if RUBY_PLATFORM != 'java'
380
+ # Contrib minitests
381
+ sh 'appraisal contrib rake test:aws'
382
+ sh 'appraisal contrib rake test:elasticsearch'
383
+ sh 'appraisal contrib rake test:grape'
384
+ sh 'appraisal contrib rake test:http'
385
+ sh 'appraisal contrib rake test:mongodb'
386
+ sh 'appraisal contrib rake test:rack'
387
+ sh 'appraisal contrib rake test:resque'
388
+ sh 'appraisal contrib rake test:sucker_punch'
389
+ # Contrib specs
390
+ sh 'appraisal contrib rake spec:active_record'
391
+ sh 'appraisal contrib rake spec:active_support'
392
+ sh 'appraisal contrib rake spec:dalli'
393
+ sh 'appraisal contrib rake spec:faraday'
394
+ sh 'appraisal contrib rake spec:graphql'
395
+ sh 'appraisal contrib rake spec:graphql'
396
+ sh 'appraisal contrib rake spec:racecar'
397
+ sh 'appraisal contrib rake spec:redis'
398
+ # Rails minitests
399
+ sh 'appraisal contrib rake test:sidekiq'
400
+ sh 'appraisal rails30-postgres rake test:rails'
401
+ sh 'appraisal rails30-postgres rake test:railsdisableenv'
402
+ sh 'appraisal rails32-mysql2 rake test:rails'
403
+ sh 'appraisal rails32-postgres rake test:rails'
404
+ sh 'appraisal rails32-postgres-redis rake test:railsredis'
405
+ sh 'appraisal rails32-postgres rake test:railsdisableenv'
406
+ sh 'appraisal rails4-mysql2 rake test:rails'
407
+ sh 'appraisal rails4-postgres rake test:rails'
408
+ sh 'appraisal rails4-postgres-redis rake test:railsredis'
409
+ sh 'appraisal rails4-postgres rake test:railsdisableenv'
410
+ sh 'appraisal rails4-postgres-sidekiq rake test:railssidekiq'
411
+ sh 'appraisal rails4-postgres-sidekiq rake test:railsactivejob'
412
+ sh 'appraisal rails5-mysql2 rake test:rails'
413
+ sh 'appraisal rails5-postgres rake test:rails'
414
+ sh 'appraisal rails5-postgres-redis rake test:railsredis'
415
+ sh 'appraisal rails5-postgres-sidekiq rake test:railssidekiq'
416
+ sh 'appraisal rails5-postgres-sidekiq rake test:railsactivejob'
417
+ sh 'appraisal rails5-postgres rake test:railsdisableenv'
418
+ # Rails specs
419
+ sh 'appraisal rails30-postgres rake spec:rails'
420
+ sh 'appraisal rails32-mysql2 rake spec:rails'
421
+ sh 'appraisal rails32-postgres rake spec:rails'
422
+ sh 'appraisal rails4-mysql2 rake spec:rails'
423
+ sh 'appraisal rails4-postgres rake spec:rails'
424
+ sh 'appraisal rails5-mysql2 rake spec:rails'
425
+ sh 'appraisal rails5-postgres rake spec:rails'
426
+ end
427
+ elsif '2.4.0' <= RUBY_VERSION
428
+ # Main library
429
+ sh 'rake test:main'
430
+ sh 'rake spec:main'
431
+
432
+ if RUBY_PLATFORM != 'java'
433
+ # Contrib minitests
434
+ sh 'appraisal contrib rake test:aws'
435
+ sh 'appraisal contrib rake test:elasticsearch'
436
+ sh 'appraisal contrib rake test:grape'
437
+ sh 'appraisal contrib rake test:http'
438
+ sh 'appraisal contrib rake test:mongodb'
439
+ sh 'appraisal contrib rake test:rack'
440
+ sh 'appraisal contrib rake test:resque'
441
+ sh 'appraisal contrib rake test:sucker_punch'
442
+ # Contrib specs
443
+ sh 'appraisal contrib rake spec:active_record'
444
+ sh 'appraisal contrib rake spec:active_support'
445
+ sh 'appraisal contrib rake spec:dalli'
446
+ sh 'appraisal contrib rake spec:faraday'
447
+ sh 'appraisal contrib rake spec:graphql'
448
+ sh 'appraisal contrib rake spec:graphql'
449
+ sh 'appraisal contrib rake spec:racecar'
450
+ sh 'appraisal contrib rake spec:redis'
451
+ # Rails minitests
452
+ sh 'appraisal contrib rake test:sidekiq'
453
+ sh 'rake benchmark'
454
+ end
274
455
  end
275
456
  end
276
457
 
data/ddtrace.gemspec CHANGED
@@ -6,17 +6,17 @@ require 'ddtrace/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'ddtrace'
9
- spec.version = "#{Datadog::VERSION::STRING}#{ENV['VERSION_SUFFIX']}"
9
+ spec.version = Datadog::VERSION::STRING
10
10
  spec.required_ruby_version = '>= 1.9.1'
11
11
  spec.authors = ['Datadog, Inc.']
12
12
  spec.email = ['dev@datadoghq.com']
13
13
 
14
14
  spec.summary = 'Datadog tracing code for your Ruby applications'
15
- spec.description = <<-EOS
16
- ddtrace is Datadog’s tracing client for Ruby. It is used to trace requests
17
- as they flow across web servers, databases and microservices so that developers
18
- have great visiblity into bottlenecks and troublesome requests.
19
- EOS
15
+ spec.description = <<-EOS.gsub(/^[\s]+/, '')
16
+ ddtrace is Datadog’s tracing client for Ruby. It is used to trace requests
17
+ as they flow across web servers, databases and microservices so that developers
18
+ have great visiblity into bottlenecks and troublesome requests.
19
+ EOS
20
20
 
21
21
  spec.homepage = 'https://github.com/DataDog/dd-trace-rb'
22
22
  spec.license = 'BSD-3-Clause'
data/docker-compose.yml CHANGED
@@ -1,52 +1,237 @@
1
- # remember to use this compose file __ONLY__ for development/testing purposes
2
- postgres:
3
- image: postgres:9.6
1
+ version: '3.2'
2
+ services:
3
+ tracer-1.9:
4
+ build:
5
+ context: ./.circleci/images/primary
6
+ dockerfile: Dockerfile-1.9.3
7
+ command: /bin/bash
8
+ depends_on:
9
+ - ddagent
10
+ - elasticsearch
11
+ - memcached
12
+ - mongodb
13
+ - mysql
14
+ - postgres
15
+ - redis
16
+ env_file: ./.env
4
17
  environment:
5
- - POSTGRES_PASSWORD=$TEST_POSTGRES_PASSWORD
6
- - POSTGRES_USER=$TEST_POSTGRES_USER
7
- - POSTGRES_DB=$TEST_POSTGRES_DB
8
- ports:
9
- - "127.0.0.1:${TEST_POSTGRES_PORT}:5432"
10
-
11
- mysql:
12
- image: mysql:5.6
18
+ - TEST_DATADOG_INTEGRATION=1
19
+ - TEST_DDAGENT_HOST=ddagent
20
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
21
+ - TEST_MEMCACHED_HOST=memcached
22
+ - TEST_MONGODB_HOST=mongodb
23
+ - TEST_MYSQL_HOST=mysql
24
+ - TEST_POSTGRES_HOST=postgres
25
+ - TEST_REDIS_HOST=redis
26
+ stdin_open: true
27
+ tty: true
28
+ volumes:
29
+ - .:/app
30
+ - bundle-1.9:/usr/local/bundle
31
+ tracer-2.0:
32
+ build:
33
+ context: ./.circleci/images/primary
34
+ dockerfile: Dockerfile-2.0.0
35
+ command: /bin/bash
36
+ depends_on:
37
+ - ddagent
38
+ - elasticsearch
39
+ - memcached
40
+ - mongodb
41
+ - mysql
42
+ - postgres
43
+ - redis
44
+ env_file: ./.env
45
+ environment:
46
+ - TEST_DATADOG_INTEGRATION=1
47
+ - TEST_DDAGENT_HOST=ddagent
48
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
49
+ - TEST_MEMCACHED_HOST=memcached
50
+ - TEST_MONGODB_HOST=mongodb
51
+ - TEST_MYSQL_HOST=mysql
52
+ - TEST_POSTGRES_HOST=postgres
53
+ - TEST_REDIS_HOST=redis
54
+ stdin_open: true
55
+ tty: true
56
+ volumes:
57
+ - .:/app
58
+ - bundle-2.0:/usr/local/bundle
59
+ tracer-2.1:
60
+ build:
61
+ context: ./.circleci/images/primary
62
+ dockerfile: Dockerfile-2.1.10
63
+ command: /bin/bash
64
+ depends_on:
65
+ - ddagent
66
+ - elasticsearch
67
+ - memcached
68
+ - mongodb
69
+ - mysql
70
+ - postgres
71
+ - redis
72
+ env_file: ./.env
73
+ environment:
74
+ - TEST_DATADOG_INTEGRATION=1
75
+ - TEST_DDAGENT_HOST=ddagent
76
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
77
+ - TEST_MEMCACHED_HOST=memcached
78
+ - TEST_MONGODB_HOST=mongodb
79
+ - TEST_MYSQL_HOST=mysql
80
+ - TEST_POSTGRES_HOST=postgres
81
+ - TEST_REDIS_HOST=redis
82
+ stdin_open: true
83
+ tty: true
84
+ volumes:
85
+ - .:/app
86
+ - bundle-2.1:/usr/local/bundle
87
+ tracer-2.2:
88
+ build:
89
+ context: ./.circleci/images/primary
90
+ dockerfile: Dockerfile-2.2.10
91
+ command: /bin/bash
92
+ depends_on:
93
+ - ddagent
94
+ - elasticsearch
95
+ - memcached
96
+ - mongodb
97
+ - mysql
98
+ - postgres
99
+ - redis
100
+ env_file: ./.env
101
+ environment:
102
+ - TEST_DATADOG_INTEGRATION=1
103
+ - TEST_DDAGENT_HOST=ddagent
104
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
105
+ - TEST_MEMCACHED_HOST=memcached
106
+ - TEST_MONGODB_HOST=mongodb
107
+ - TEST_MYSQL_HOST=mysql
108
+ - TEST_POSTGRES_HOST=postgres
109
+ - TEST_REDIS_HOST=redis
110
+ stdin_open: true
111
+ tty: true
112
+ volumes:
113
+ - .:/app
114
+ - bundle-2.2:/usr/local/bundle
115
+ tracer-2.3:
116
+ build:
117
+ context: ./.circleci/images/primary
118
+ dockerfile: Dockerfile-2.3.7
119
+ command: /bin/bash
120
+ depends_on:
121
+ - ddagent
122
+ - elasticsearch
123
+ - memcached
124
+ - mongodb
125
+ - mysql
126
+ - postgres
127
+ - redis
128
+ env_file: ./.env
129
+ environment:
130
+ - TEST_DATADOG_INTEGRATION=1
131
+ - TEST_DDAGENT_HOST=ddagent
132
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
133
+ - TEST_MEMCACHED_HOST=memcached
134
+ - TEST_MONGODB_HOST=mongodb
135
+ - TEST_MYSQL_HOST=mysql
136
+ - TEST_POSTGRES_HOST=postgres
137
+ - TEST_REDIS_HOST=redis
138
+ stdin_open: true
139
+ tty: true
140
+ volumes:
141
+ - .:/app
142
+ - bundle-2.3:/usr/local/bundle
143
+ tracer-2.4:
144
+ build:
145
+ context: ./.circleci/images/primary
146
+ dockerfile: Dockerfile-2.4.4
147
+ command: /bin/bash
148
+ depends_on:
149
+ - ddagent
150
+ - elasticsearch
151
+ - memcached
152
+ - mongodb
153
+ - mysql
154
+ - postgres
155
+ - redis
156
+ env_file: ./.env
157
+ environment:
158
+ - TEST_DATADOG_INTEGRATION=1
159
+ - TEST_DDAGENT_HOST=ddagent
160
+ - TEST_ELASTICSEARCH_HOST=elasticsearch
161
+ - TEST_MEMCACHED_HOST=memcached
162
+ - TEST_MONGODB_HOST=mongodb
163
+ - TEST_MYSQL_HOST=mysql
164
+ - TEST_POSTGRES_HOST=postgres
165
+ - TEST_REDIS_HOST=redis
166
+ stdin_open: true
167
+ tty: true
168
+ volumes:
169
+ - .:/app
170
+ - bundle-2.4:/usr/local/bundle
171
+ ddagent:
172
+ image: datadog/docker-dd-agent
13
173
  environment:
14
- - MYSQL_ROOT_PASSWORD=$TEST_MYSQL_ROOT_PASSWORD
15
- - MYSQL_PASSWORD=$TEST_MYSQL_PASSWORD
16
- - MYSQL_USER=$TEST_MYSQL_USER
174
+ - DD_APM_ENABLED=true
175
+ - DD_BIND_HOST=0.0.0.0
176
+ - DD_API_KEY=invalid_key_but_this_is_fine
177
+ expose:
178
+ - "8126"
17
179
  ports:
18
- - "127.0.0.1:${TEST_MYSQL_PORT}:3306"
19
-
20
- elasticsearch:
180
+ - "${TEST_DDAGENT_PORT}:8126"
181
+ elasticsearch:
21
182
  # Note: ES 5.0 dies with error:
22
183
  # max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
23
184
  # see https://github.com/docker-library/elasticsearch/issues/98 for details
24
185
  # For now, just rely on a 2.X server.
25
186
  image: elasticsearch:2.4
187
+ expose:
188
+ - "9200"
189
+ - "9300"
26
190
  ports:
27
- - "127.0.0.1:${TEST_ELASTICSEARCH_REST_PORT}:9200"
28
- - "127.0.0.1:${TEST_ELASTICSEARCH_NATIVE_PORT}:9300"
29
-
30
- redis:
31
- image: redis:3.0
191
+ - "${TEST_ELASTICSEARCH_REST_PORT}:9200"
192
+ - "${TEST_ELASTICSEARCH_NATIVE_PORT}:9300"
193
+ memcached:
194
+ image: memcached:1.5-alpine
195
+ expose:
196
+ - "11211"
32
197
  ports:
33
- - "127.0.0.1:${TEST_REDIS_PORT}:6379"
34
-
35
- mongodb:
198
+ - "${TEST_MEMCACHED_PORT}:11211"
199
+ mongodb:
36
200
  image: mongo:3.5
201
+ expose:
202
+ - "27017"
37
203
  ports:
38
- - "127.0.0.1:${TEST_MONGODB_PORT}:27017"
39
-
40
- memcached:
41
- image: memcached:1.5-alpine
204
+ - "${TEST_MONGODB_PORT}:27017"
205
+ mysql:
206
+ image: mysql:5.6
207
+ environment:
208
+ - MYSQL_ROOT_PASSWORD=$TEST_MYSQL_ROOT_PASSWORD
209
+ - MYSQL_PASSWORD=$TEST_MYSQL_PASSWORD
210
+ - MYSQL_USER=$TEST_MYSQL_USER
211
+ expose:
212
+ - "3306"
42
213
  ports:
43
- - "127.0.0.1:${TEST_MEMCACHED_PORT}:11211"
44
-
45
- ddagent:
46
- image: datadog/docker-dd-agent
214
+ - "${TEST_MYSQL_PORT}:3306"
215
+ postgres:
216
+ image: postgres:9.6
47
217
  environment:
48
- - DD_APM_ENABLED=true
49
- - DD_BIND_HOST=0.0.0.0
50
- - DD_API_KEY=invalid_key_but_this_is_fine
218
+ - POSTGRES_PASSWORD=$TEST_POSTGRES_PASSWORD
219
+ - POSTGRES_USER=$TEST_POSTGRES_USER
220
+ - POSTGRES_DB=$TEST_POSTGRES_DB
221
+ expose:
222
+ - "5432"
223
+ ports:
224
+ - "${TEST_POSTGRES_PORT}:5432"
225
+ redis:
226
+ image: redis:3.0
227
+ expose:
228
+ - "6379"
51
229
  ports:
52
- - "127.0.0.1:8126:8126"
230
+ - "${TEST_REDIS_PORT}:6379"
231
+ volumes:
232
+ bundle-1.9:
233
+ bundle-2.0:
234
+ bundle-2.1:
235
+ bundle-2.2:
236
+ bundle-2.3:
237
+ bundle-2.4: