ddtrace 0.15.0.beta1 → 0.15.0.internaltracinfeature1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Appraisals +14 -8
- data/CHANGELOG.md +39 -6
- data/Rakefile +7 -0
- data/docs/GettingStarted.md +63 -26
- data/lib/ddtrace.rb +14 -13
- data/lib/ddtrace/buffer.rb +20 -8
- data/lib/ddtrace/context.rb +104 -60
- data/lib/ddtrace/contrib/concurrent_ruby/configuration/settings.rb +13 -0
- data/lib/ddtrace/contrib/concurrent_ruby/context_composite_executor_service.rb +35 -0
- data/lib/ddtrace/contrib/concurrent_ruby/future_patch.rb +23 -0
- data/lib/ddtrace/contrib/concurrent_ruby/integration.rb +28 -0
- data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +34 -0
- data/lib/ddtrace/contrib/grape/endpoint.rb +1 -0
- data/lib/ddtrace/contrib/graphql/patcher.rb +10 -2
- data/lib/ddtrace/contrib/http/patcher.rb +20 -7
- data/lib/ddtrace/propagation/distributed_headers.rb +8 -6
- data/lib/ddtrace/registry.rb +4 -2
- data/lib/ddtrace/sampler.rb +24 -6
- data/lib/ddtrace/tracer.rb +4 -1
- data/lib/ddtrace/transport.rb +105 -33
- data/lib/ddtrace/utils.rb +1 -0
- data/lib/ddtrace/utils/internal_traces.rb +53 -0
- data/lib/ddtrace/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e6700cc19b4e8774fd5704faae484af128420ad0dbea55eea1834a066bb4b00a
|
4
|
+
data.tar.gz: 167719d0a22192b44c94f11ef6a0f16f42de17b8c15afe6490e0e133858e0048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
7
|
+
## [0.15.0] - 2018-09-12
|
8
8
|
|
9
|
-
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.15.0
|
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.
|
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
|
-
-
|
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.
|
474
|
-
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.
|
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'
|
data/docs/GettingStarted.md
CHANGED
@@ -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
|
269
|
-
| -------------- |
|
270
|
-
| Active Record | `active_record`
|
271
|
-
| AWS | `aws`
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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/
|
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/
|
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/
|
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/
|
68
|
-
require 'ddtrace/contrib/
|
69
|
+
require 'ddtrace/contrib/rest_client/integration'
|
70
|
+
require 'ddtrace/contrib/sequel/integration'
|
69
71
|
require 'ddtrace/contrib/sidekiq/patcher'
|
70
|
-
require 'ddtrace/contrib/
|
71
|
-
require 'ddtrace/contrib/mysql2/patcher'
|
72
|
+
require 'ddtrace/contrib/sucker_punch/patcher'
|
72
73
|
require 'ddtrace/monkey'
|
data/lib/ddtrace/buffer.rb
CHANGED
@@ -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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
55
|
+
@mutex.synchronize do
|
56
|
+
@closed = true
|
57
|
+
end
|
46
58
|
end
|
47
59
|
end
|
48
60
|
end
|