ddtrace 0.15.0.beta1 → 0.15.0.internaltracinfeature1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 152355917a6f63e309d2fa3c2493df04f689bae2
4
- data.tar.gz: ffbb1cd4275783dce93875758383ac0df983ac72
2
+ SHA256:
3
+ metadata.gz: e6700cc19b4e8774fd5704faae484af128420ad0dbea55eea1834a066bb4b00a
4
+ data.tar.gz: 167719d0a22192b44c94f11ef6a0f16f42de17b8c15afe6490e0e133858e0048
5
5
  SHA512:
6
- metadata.gz: 7143e0ffc5d84ca3f8305840f299cd021281cc45df6cad2c78460d431f835a2483af3f4cc9b9a0c75557c837fc997e3151a4d5e4cb0f19c776bd1960509652bf
7
- data.tar.gz: 4918277463d66e58a51314d268305a1529564966cdb645bd31b6e9770644ee3e0bb455cbaf05de493e9cdefacc523444ccd4680dce41994b2d59ca8fa5e2239c
6
+ metadata.gz: 1d82cd8c84a8f4df0b50d0d4d6d6e5a90b7d4c6638694f1fafd11e7fdcbcdfbf4ef3aab200cf56aa8a04d218fb06f985f14b618c9ad2e6be5cf3c89a28fb86db
7
+ data.tar.gz: a34c49958997bc2fdc0b50f09718f3675e11d4d91268bc8b0bed4ca40f3b7096ed56cbee1818e3b65af28a52d9f2435fbcb75f974e240e121829be29b62ac23a
data/Appraisals CHANGED
@@ -67,6 +67,7 @@ elsif Gem::Version.new('1.9.3') <= Gem::Version.new(RUBY_VERSION) \
67
67
  gem 'activerecord', '3.2.22.5'
68
68
  gem 'activerecord-mysql-adapter', platform: :ruby
69
69
  gem 'aws-sdk', '~> 2.0'
70
+ gem 'concurrent-ruby'
70
71
  gem 'dalli'
71
72
  gem 'delayed_job'
72
73
  gem 'delayed_job_active_record'
@@ -150,6 +151,7 @@ elsif Gem::Version.new('2.0.0') <= Gem::Version.new(RUBY_VERSION) \
150
151
  gem 'activerecord', '3.2.22.5'
151
152
  gem 'activerecord-mysql-adapter', platform: :ruby
152
153
  gem 'aws-sdk', '~> 2.0'
154
+ gem 'concurrent-ruby'
153
155
  gem 'dalli'
154
156
  gem 'delayed_job'
155
157
  gem 'delayed_job_active_record'
@@ -253,6 +255,7 @@ elsif Gem::Version.new('2.1.0') <= Gem::Version.new(RUBY_VERSION) \
253
255
  gem 'activerecord', '3.2.22.5'
254
256
  gem 'activerecord-mysql-adapter', platform: :ruby
255
257
  gem 'aws-sdk', '~> 2.0'
258
+ gem 'concurrent-ruby'
256
259
  gem 'dalli'
257
260
  gem 'delayed_job'
258
261
  gem 'delayed_job_active_record'
@@ -360,24 +363,24 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \
360
363
  end
361
364
 
362
365
  appraise 'rails5-mysql2' do
363
- gem 'rails', '~> 5.1.6'
366
+ gem 'rails', '~> 5.2.1'
364
367
  gem 'mysql2', '< 0.5', platform: :ruby
365
368
  end
366
369
 
367
370
  appraise 'rails5-postgres' do
368
- gem 'rails', '~> 5.1.6'
371
+ gem 'rails', '~> 5.2.1'
369
372
  gem 'pg', '< 1.0', platform: :ruby
370
373
  end
371
374
 
372
375
  appraise 'rails5-postgres-redis' do
373
- gem 'rails', '~> 5.1.6'
376
+ gem 'rails', '~> 5.2.1'
374
377
  gem 'pg', '< 1.0', platform: :ruby
375
378
  gem 'redis-rails'
376
379
  gem 'redis'
377
380
  end
378
381
 
379
382
  appraise 'rails5-postgres-sidekiq' do
380
- gem 'rails', '~> 5.1.6'
383
+ gem 'rails', '~> 5.2.1'
381
384
  gem 'pg', '< 1.0', platform: :ruby
382
385
  gem 'sidekiq'
383
386
  gem 'activejob'
@@ -387,6 +390,7 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \
387
390
  gem 'active_model_serializers', '>= 0.10.0'
388
391
  gem 'activerecord', '< 5.1.5'
389
392
  gem 'aws-sdk'
393
+ gem 'concurrent-ruby'
390
394
  gem 'dalli'
391
395
  gem 'delayed_job'
392
396
  gem 'delayed_job_active_record'
@@ -497,24 +501,24 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \
497
501
  end
498
502
 
499
503
  appraise 'rails5-mysql2' do
500
- gem 'rails', '~> 5.1.6'
504
+ gem 'rails', '~> 5.2.1'
501
505
  gem 'mysql2', '< 0.5', platform: :ruby
502
506
  end
503
507
 
504
508
  appraise 'rails5-postgres' do
505
- gem 'rails', '~> 5.1.6'
509
+ gem 'rails', '~> 5.2.1'
506
510
  gem 'pg', '< 1.0', platform: :ruby
507
511
  end
508
512
 
509
513
  appraise 'rails5-postgres-redis' do
510
- gem 'rails', '~> 5.1.6'
514
+ gem 'rails', '~> 5.2.1'
511
515
  gem 'pg', '< 1.0', platform: :ruby
512
516
  gem 'redis-rails'
513
517
  gem 'redis'
514
518
  end
515
519
 
516
520
  appraise 'rails5-postgres-sidekiq' do
517
- gem 'rails', '~> 5.1.6'
521
+ gem 'rails', '~> 5.2.1'
518
522
  gem 'pg', '< 1.0', platform: :ruby
519
523
  gem 'sidekiq'
520
524
  gem 'activejob'
@@ -524,6 +528,7 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \
524
528
  gem 'active_model_serializers', '>= 0.10.0'
525
529
  gem 'activerecord', '< 5.1.5'
526
530
  gem 'aws-sdk'
531
+ gem 'concurrent-ruby'
527
532
  gem 'dalli'
528
533
  gem 'delayed_job'
529
534
  gem 'delayed_job_active_record'
@@ -555,6 +560,7 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION)
555
560
  gem 'active_model_serializers', '>= 0.10.0'
556
561
  gem 'activerecord', '< 5.1.5'
557
562
  gem 'aws-sdk'
563
+ gem 'concurrent-ruby'
558
564
  gem 'dalli'
559
565
  gem 'delayed_job'
560
566
  gem 'delayed_job_active_record'
data/CHANGELOG.md CHANGED
@@ -4,15 +4,45 @@
4
4
 
5
5
  ## [Unreleased (beta)]
6
6
 
7
- ## [0.15.0.beta1] - 2018-08-15
7
+ ## [0.15.0] - 2018-09-12
8
8
 
9
- Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.15.0.beta1
9
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.15.0
10
10
 
11
- Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0...v0.15.0.beta1
11
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.14.2...v0.15.0
12
+
13
+ ### Added
14
+
15
+ - Rails 5.2 support (#535)
16
+ - Context propagation support for `Concurrent::Future` (#415, #496)
17
+
18
+ ### Fixed
19
+
20
+ - Grape uninitialized constant TraceMiddleware (#525, #533) (@dim)
21
+ - Signed integer trace and span IDs being discarded in distributed traces (#530) (@alloy)
22
+
23
+ ## [0.14.2] - 2018-08-23
24
+
25
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.14.2
26
+
27
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.14.1...v0.14.2
28
+
29
+ ### Fixed
30
+
31
+ - Sampling priority from request headers not being used (#521)
32
+
33
+ ## [0.14.1] - 2018-08-21
34
+
35
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.14.1
36
+
37
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0...v0.14.1
12
38
 
13
39
  ### Changed
14
40
 
15
- - Reduced locking to improve multithreaded performance (#506)
41
+ - Reduce verbosity of connection errors in log (#515)
42
+
43
+ ### Fixed
44
+
45
+ - Sequel 'not a valid integration' error (#514, #516) (@steveh)
16
46
 
17
47
  ## [0.14.0] - 2018-08-14
18
48
 
@@ -470,8 +500,11 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
470
500
 
471
501
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
472
502
 
473
- [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0...master
474
- [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0...0.15-dev
503
+ [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.15.0...master
504
+ [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.15.0...0.16-dev
505
+ [0.15.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.2...v0.15.0
506
+ [0.14.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.1...v0.14.2
507
+ [0.14.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0...v0.14.1
475
508
  [0.14.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.13.2...v0.14.0
476
509
  [0.14.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0.beta2...v0.14.0.rc1
477
510
  [0.14.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.14.0.beta1...v0.14.0.beta2
data/Rakefile CHANGED
@@ -49,6 +49,7 @@ namespace :spec do
49
49
  :delayed_job,
50
50
  :active_support,
51
51
  :aws,
52
+ :concurrent_ruby,
52
53
  :dalli,
53
54
  :elasticsearch,
54
55
  :excon,
@@ -230,6 +231,7 @@ task :ci do
230
231
  sh 'bundle exec appraisal contrib-old rake spec:active_record'
231
232
  sh 'bundle exec appraisal contrib-old rake spec:delayed_job'
232
233
  sh 'bundle exec appraisal contrib-old rake spec:active_support'
234
+ sh 'bundle exec appraisal contrib-old rake spec:concurrent_ruby'
233
235
  sh 'bundle exec appraisal contrib-old rake spec:dalli'
234
236
  sh 'bundle exec appraisal contrib-old rake spec:elasticsearch'
235
237
  sh 'bundle exec appraisal contrib-old rake spec:excon'
@@ -275,6 +277,7 @@ task :ci do
275
277
  sh 'bundle exec appraisal contrib-old rake spec:active_record'
276
278
  sh 'bundle exec appraisal contrib-old rake spec:delayed_job'
277
279
  sh 'bundle exec appraisal contrib-old rake spec:active_support'
280
+ sh 'bundle exec appraisal contrib-old rake spec:concurrent_ruby'
278
281
  sh 'bundle exec appraisal contrib-old rake spec:dalli'
279
282
  sh 'bundle exec appraisal contrib-old rake spec:elasticsearch'
280
283
  sh 'bundle exec appraisal contrib-old rake spec:excon'
@@ -323,6 +326,7 @@ task :ci do
323
326
  sh 'bundle exec appraisal contrib-old rake spec:active_record'
324
327
  sh 'bundle exec appraisal contrib-old rake spec:delayed_job'
325
328
  sh 'bundle exec appraisal contrib-old rake spec:active_support'
329
+ sh 'bundle exec appraisal contrib-old rake spec:concurrent_ruby'
326
330
  sh 'bundle exec appraisal contrib-old rake spec:dalli'
327
331
  sh 'bundle exec appraisal contrib-old rake spec:elasticsearch'
328
332
  sh 'bundle exec appraisal contrib-old rake spec:excon'
@@ -377,6 +381,7 @@ task :ci do
377
381
  sh 'bundle exec appraisal contrib rake spec:active_record'
378
382
  sh 'bundle exec appraisal contrib rake spec:delayed_job'
379
383
  sh 'bundle exec appraisal contrib rake spec:active_support'
384
+ sh 'bundle exec appraisal contrib rake spec:concurrent_ruby'
380
385
  sh 'bundle exec appraisal contrib rake spec:dalli'
381
386
  sh 'bundle exec appraisal contrib rake spec:elasticsearch'
382
387
  sh 'bundle exec appraisal contrib rake spec:excon'
@@ -442,6 +447,7 @@ task :ci do
442
447
  sh 'bundle exec appraisal contrib rake spec:active_record'
443
448
  sh 'bundle exec appraisal contrib rake spec:delayed_job'
444
449
  sh 'bundle exec appraisal contrib rake spec:active_support'
450
+ sh 'bundle exec appraisal contrib rake spec:concurrent_ruby'
445
451
  sh 'bundle exec appraisal contrib rake spec:dalli'
446
452
  sh 'bundle exec appraisal contrib rake spec:excon'
447
453
  sh 'bundle exec appraisal contrib rake spec:elasticsearch'
@@ -506,6 +512,7 @@ task :ci do
506
512
  sh 'bundle exec appraisal contrib rake spec:active_record'
507
513
  sh 'bundle exec appraisal contrib rake spec:delayed_job'
508
514
  sh 'bundle exec appraisal contrib rake spec:active_support'
515
+ sh 'bundle exec appraisal contrib rake spec:concurrent_ruby'
509
516
  sh 'bundle exec appraisal contrib rake spec:dalli'
510
517
  sh 'bundle exec appraisal contrib rake spec:elasticsearch'
511
518
  sh 'bundle exec appraisal contrib rake spec:excon'
@@ -25,6 +25,7 @@ For descriptions of terminology used in APM, take a look at the [official docume
25
25
  - [Integration instrumentation](#integration-instrumentation)
26
26
  - [Active Record](#active-record)
27
27
  - [AWS](#aws)
28
+ - [Concurrent Ruby](#concurrent-ruby)
28
29
  - [Dalli](#dalli)
29
30
  - [DelayedJob](#delayedjob)
30
31
  - [Elastic Search](#elastic-search)
@@ -265,32 +266,33 @@ end
265
266
 
266
267
  For a list of available integrations, and their configuration options, please refer to the following:
267
268
 
268
- | Name | Key | Versions Supported | How to configure | Gem source |
269
- | -------------- | --------------- | ---------------------- | ------------------------- | ------------------------------------------------------------------------------ |
270
- | Active Record | `active_record` | `>= 3.2, < 5.2` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
271
- | AWS | `aws` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
272
- | Dalli | `dalli` | `>= 2.7` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
273
- | DelayedJob | `delayed_job` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
274
- | Elastic Search | `elasticsearch` | `>= 6.0` | *[Link](#elastic-search)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
275
- | Excon | `excon` | `>= 0.62` | *[Link](#excon)* | *[Link](https://github.com/excon/excon)* |
276
- | Faraday | `faraday` | `>= 0.14` | *[Link](#faraday)* | *[Link](https://github.com/lostisland/faraday)* |
277
- | gRPC | `grpc` | `>= 1.10` | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
278
- | Grape | `grape` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
279
- | GraphQL | `graphql` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
280
- | MongoDB | `mongo` | `>= 2.0, < 2.5` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
281
- | MySQL2 | `mysql2` | `>= 0.5` | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
282
- | Net/HTTP | `http` | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
283
- | Racecar | `racecar` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
284
- | Rack | `rack` | `>= 1.4.7` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
285
- | Rails | `rails` | `>= 3.2, < 5.2` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
286
- | Rake | `rake` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
287
- | Redis | `redis` | `>= 3.2, < 4.0` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
288
- | Rest Client | `rest-client` | `>= 1.8` | *[Link](#restclient)* | *[Link](https://github.com/rest-client/rest-client)* |
289
- | Resque | `resque` | `>= 1.0, < 2.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
290
- | Sequel | `sequel` | `>= 3.41` | *[Link](#sequel)* | *[Link](https://github.com/jeremyevans/sequel)* |
291
- | Sidekiq | `sidekiq` | `>= 4.0` | *[Link](#sidekiq)* | *[Link](https://github.com/mperham/sidekiq)* |
292
- | Sinatra | `sinatra` | `>= 1.4.5` | *[Link](#sinatra)* | *[Link](https://github.com/sinatra/sinatra)* |
293
- | Sucker Punch | `sucker_punch` | `>= 2.0` | *[Link](#sucker-punch)* | *[Link](https://github.com/brandonhilkert/sucker_punch)* |
269
+ | Name | Key | Versions Supported | How to configure | Gem source |
270
+ | -------------- | ----------------- | ------------------------ | ------------------------- | ------------------------------------------------------------------------------ |
271
+ | Active Record | `active_record` | `>= 3.2, < 6.0` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
272
+ | AWS | `aws` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
273
+ | Concurrent Ruby| `concurrent_ruby` | `>= 0.9` | *[Link](#concurrent-ruby)*| *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
274
+ | Dalli | `dalli` | `>= 2.7` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
275
+ | DelayedJob | `delayed_job` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
276
+ | Elastic Search | `elasticsearch` | `>= 6.0` | *[Link](#elastic-search)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
277
+ | Excon | `excon` | `>= 0.62` | *[Link](#excon)* | *[Link](https://github.com/excon/excon)* |
278
+ | Faraday | `faraday` | `>= 0.14` | *[Link](#faraday)* | *[Link](https://github.com/lostisland/faraday)* |
279
+ | gRPC | `grpc` | `>= 1.10` | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
280
+ | Grape | `grape` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
281
+ | GraphQL | `graphql` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
282
+ | MongoDB | `mongo` | `>= 2.0, < 2.5` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
283
+ | MySQL2 | `mysql2` | `>= 0.5` | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
284
+ | Net/HTTP | `http` | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
285
+ | Racecar | `racecar` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
286
+ | Rack | `rack` | `>= 1.4.7` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
287
+ | Rails | `rails` | `>= 3.2, <= 6.0` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
288
+ | Rake | `rake` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
289
+ | Redis | `redis` | `>= 3.2, < 4.0` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
290
+ | Rest Client | `rest-client` | `>= 1.8` | *[Link](#restclient)* | *[Link](https://github.com/rest-client/rest-client)* |
291
+ | Resque | `resque` | `>= 1.0, < 2.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
292
+ | Sequel | `sequel` | `>= 3.41` | *[Link](#sequel)* | *[Link](https://github.com/jeremyevans/sequel)* |
293
+ | Sidekiq | `sidekiq` | `>= 4.0` | *[Link](#sidekiq)* | *[Link](https://github.com/mperham/sidekiq)* |
294
+ | Sinatra | `sinatra` | `>= 1.4.5` | *[Link](#sinatra)* | *[Link](https://github.com/sinatra/sinatra)* |
295
+ | Sucker Punch | `sucker_punch` | `>= 2.0` | *[Link](#sucker-punch)* | *[Link](https://github.com/brandonhilkert/sucker_punch)* |
294
296
 
295
297
  ### Active Record
296
298
 
@@ -379,6 +381,32 @@ Where `options` is an optional `Hash` that accepts the following parameters:
379
381
  | --- | --- | --- |
380
382
  | ``service_name`` | Service name used for `aws` instrumentation | aws |
381
383
 
384
+ ### Concurrent Ruby
385
+
386
+ The Concurrent Ruby integration adds support for context propagation when using `::Concurrent::Future`.
387
+ Making sure that code traced within the `Future#execute` will have correct parent set.
388
+
389
+ To activate your integration, use the ``Datadog.configure`` method:
390
+
391
+ ```ruby
392
+ # Inside Rails initializer or equivalent
393
+ Datadog.configure do |c|
394
+ c.use :concurrent_ruby # patches ::Concurrent::Future to use ExecutorService that propagates context
395
+ end
396
+
397
+ # Pass context into code executed within Concurrent::Future
398
+ Datadog.tracer.trace('outer') do
399
+ Concurrent::Future.execute { Datadog.tracer.trace('inner') { } }.wait
400
+ end
401
+ ```
402
+
403
+ The `use :concurrent_ruby` method accepts the following parameters:
404
+
405
+ | Key | Description | Default |
406
+ | --- | --- | --- |
407
+ | ``tracer`` | A ``Datadog::Tracer`` instance used to instrument the application. Usually you don't need to set that. | ``Datadog.tracer`` |
408
+
409
+
382
410
  ### Dalli
383
411
 
384
412
  Dalli integration will trace all calls to your ``memcached`` server:
@@ -846,6 +874,15 @@ Where `options` is an optional `Hash` that accepts the following parameters:
846
874
  | ``tracer`` | A ``Datadog::Tracer`` instance used to instrument the application. Usually you don't need to set that. | ``Datadog.tracer`` |
847
875
  | ``databases`` | Hash of tracer settings to use for each database connection. See [ActiveRecord](#activerecord) for more details. | ``{}`` |
848
876
 
877
+ **Supported versions**
878
+
879
+ | Ruby Versions | Supported Rails Versions |
880
+ | ------------- | ------------------------ |
881
+ | 1.9.3 - 2.0 | 3.0 - 3.2 |
882
+ | 2.1 | 3.0 - 4.2 |
883
+ | 2.2 - 2.3 | 3.0 - 5.2 |
884
+ | 2.4 - 2.5 | 4.2.8 - 5.2 |
885
+
849
886
  ### Rake
850
887
 
851
888
  You can add instrumentation around your Rake tasks by activating the `rake` integration. Each task and its subsequent subtasks will be traced.
data/lib/ddtrace.rb CHANGED
@@ -44,29 +44,30 @@ module Datadog
44
44
  end
45
45
 
46
46
  require 'ddtrace/contrib/base'
47
- require 'ddtrace/contrib/integration'
48
- require 'ddtrace/contrib/rack/patcher'
49
- require 'ddtrace/contrib/rails/patcher'
50
47
  require 'ddtrace/contrib/active_model_serializers/patcher'
51
48
  require 'ddtrace/contrib/active_record/integration'
52
- require 'ddtrace/contrib/sequel/patcher'
49
+ require 'ddtrace/contrib/aws/patcher'
50
+ require 'ddtrace/contrib/concurrent_ruby/integration'
51
+ require 'ddtrace/contrib/dalli/patcher'
52
+ require 'ddtrace/contrib/delayed_job/patcher'
53
53
  require 'ddtrace/contrib/elasticsearch/patcher'
54
+ require 'ddtrace/contrib/excon/patcher'
54
55
  require 'ddtrace/contrib/faraday/patcher'
55
56
  require 'ddtrace/contrib/grape/patcher'
56
57
  require 'ddtrace/contrib/graphql/patcher'
57
58
  require 'ddtrace/contrib/grpc/patcher'
58
- require 'ddtrace/contrib/redis/patcher'
59
59
  require 'ddtrace/contrib/http/patcher'
60
- require 'ddtrace/contrib/aws/patcher'
61
- require 'ddtrace/contrib/sucker_punch/patcher'
62
- require 'ddtrace/contrib/rest_client/integration'
60
+ require 'ddtrace/contrib/integration'
63
61
  require 'ddtrace/contrib/mongodb/patcher'
64
- require 'ddtrace/contrib/dalli/patcher'
62
+ require 'ddtrace/contrib/mysql2/patcher'
63
+ require 'ddtrace/contrib/racecar/patcher'
64
+ require 'ddtrace/contrib/rack/patcher'
65
+ require 'ddtrace/contrib/rails/patcher'
65
66
  require 'ddtrace/contrib/rake/patcher'
67
+ require 'ddtrace/contrib/redis/patcher'
66
68
  require 'ddtrace/contrib/resque/patcher'
67
- require 'ddtrace/contrib/delayed_job/patcher'
68
- require 'ddtrace/contrib/racecar/patcher'
69
+ require 'ddtrace/contrib/rest_client/integration'
70
+ require 'ddtrace/contrib/sequel/integration'
69
71
  require 'ddtrace/contrib/sidekiq/patcher'
70
- require 'ddtrace/contrib/excon/patcher'
71
- require 'ddtrace/contrib/mysql2/patcher'
72
+ require 'ddtrace/contrib/sucker_punch/patcher'
72
73
  require 'ddtrace/monkey'
@@ -8,7 +8,7 @@ module Datadog
8
8
  def initialize(max_size)
9
9
  @max_size = max_size
10
10
 
11
- @mutex = Mutex.new
11
+ @mutex = Mutex.new()
12
12
  @traces = []
13
13
  @closed = false
14
14
  end
@@ -16,20 +16,30 @@ module Datadog
16
16
  # Add a new ``trace`` in the local queue. This method doesn't block the execution
17
17
  # even if the buffer is full. In that case, a random trace is discarded.
18
18
  def push(trace)
19
- return if @closed
20
- len = @traces.length
21
- @traces.delete_at(rand(len)) if len >= @max_size && @max_size > 0
22
- @traces << trace
19
+ @mutex.synchronize do
20
+ return if @closed
21
+ len = @traces.length
22
+ if len < @max_size || @max_size <= 0
23
+ @traces << trace
24
+ else
25
+ # we should replace a random trace with the new one
26
+ @traces[rand(len)] = trace
27
+ end
28
+ end
23
29
  end
24
30
 
25
31
  # Return the current number of stored traces.
26
32
  def length
27
- @traces.length
33
+ @mutex.synchronize do
34
+ return @traces.length
35
+ end
28
36
  end
29
37
 
30
38
  # Return if the buffer is empty.
31
39
  def empty?
32
- @traces.empty?
40
+ @mutex.synchronize do
41
+ return @traces.empty?
42
+ end
33
43
  end
34
44
 
35
45
  # Stored traces are returned and the local buffer is reset.
@@ -42,7 +52,9 @@ module Datadog
42
52
  end
43
53
 
44
54
  def close
45
- @closed = true
55
+ @mutex.synchronize do
56
+ @closed = true
57
+ end
46
58
  end
47
59
  end
48
60
  end