ddtrace 0.42.0 → 0.43.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/add-milestone-to-pull-requests.yml +42 -0
- data/.github/workflows/create-next-milestone.yml +20 -0
- data/.simplecov +1 -1
- data/Appraisals +160 -132
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +1 -1
- data/Rakefile +39 -0
- data/docs/DevelopmentGuide.md +2 -2
- data/docs/GettingStarted.md +71 -1
- data/lib/ddtrace.rb +2 -0
- data/lib/ddtrace/configuration.rb +20 -4
- data/lib/ddtrace/configuration/settings.rb +4 -2
- data/lib/ddtrace/context.rb +18 -0
- data/lib/ddtrace/context_provider.rb +12 -1
- data/lib/ddtrace/contrib/active_support/cache/instrumentation.rb +104 -3
- data/lib/ddtrace/contrib/active_support/cache/patcher.rb +21 -0
- data/lib/ddtrace/contrib/active_support/ext.rb +3 -0
- data/lib/ddtrace/contrib/active_support/notifications/event.rb +10 -0
- data/lib/ddtrace/contrib/aws/instrumentation.rb +2 -1
- data/lib/ddtrace/contrib/aws/patcher.rb +0 -1
- data/lib/ddtrace/contrib/configurable.rb +2 -0
- data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +4 -5
- data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +38 -0
- data/lib/ddtrace/contrib/cucumber/ext.rb +19 -0
- data/lib/ddtrace/contrib/cucumber/formatter.rb +104 -0
- data/lib/ddtrace/contrib/cucumber/instrumentation.rb +24 -0
- data/lib/ddtrace/contrib/cucumber/integration.rb +40 -0
- data/lib/ddtrace/contrib/cucumber/patcher.rb +23 -0
- data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/delayed_job/plugin.rb +3 -1
- data/lib/ddtrace/contrib/excon/middleware.rb +7 -1
- data/lib/ddtrace/contrib/faraday/patcher.rb +1 -1
- data/lib/ddtrace/contrib/grape/configuration/settings.rb +7 -0
- data/lib/ddtrace/contrib/grape/endpoint.rb +19 -4
- data/lib/ddtrace/contrib/http/instrumentation.rb +2 -2
- data/lib/ddtrace/contrib/httprb/instrumentation.rb +2 -2
- data/lib/ddtrace/contrib/kafka/event.rb +1 -1
- data/lib/ddtrace/contrib/que/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/que/tracer.rb +2 -1
- data/lib/ddtrace/contrib/rails/patcher.rb +5 -2
- data/lib/ddtrace/contrib/resque/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/resque/resque_job.rb +1 -1
- data/lib/ddtrace/contrib/rspec/configuration/settings.rb +38 -0
- data/lib/ddtrace/contrib/rspec/example.rb +61 -0
- data/lib/ddtrace/contrib/rspec/example_group.rb +61 -0
- data/lib/ddtrace/contrib/rspec/ext.rb +19 -0
- data/lib/ddtrace/contrib/rspec/integration.rb +41 -0
- data/lib/ddtrace/contrib/rspec/patcher.rb +25 -0
- data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/shoryuken/tracer.rb +4 -1
- data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +4 -1
- data/lib/ddtrace/contrib/sneakers/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/sneakers/tracer.rb +17 -20
- data/lib/ddtrace/contrib/status_code_matcher.rb +67 -0
- data/lib/ddtrace/ext/app_types.rb +1 -0
- data/lib/ddtrace/ext/ci.rb +265 -0
- data/lib/ddtrace/ext/distributed.rb +8 -2
- data/lib/ddtrace/ext/git.rb +12 -0
- data/lib/ddtrace/ext/runtime.rb +1 -0
- data/lib/ddtrace/ext/test.rb +24 -0
- data/lib/ddtrace/runtime/identity.rb +4 -5
- data/lib/ddtrace/sampling/rate_limiter.rb +65 -16
- data/lib/ddtrace/tracer.rb +14 -1
- data/lib/ddtrace/utils.rb +10 -11
- data/lib/ddtrace/utils/forking.rb +52 -0
- data/lib/ddtrace/version.rb +1 -1
- data/lib/ddtrace/writer.rb +19 -1
- metadata +23 -31
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,41 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [0.43.0] - 2020-11-18
|
6
|
+
|
7
|
+
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.43.0
|
8
|
+
|
9
|
+
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.42.0...v0.43.0
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Background job custom error handlers (#1212) (@norbertnytko)
|
14
|
+
- Add "multi" methods instrumentation for Rails cache (#1217) (@michaelkl)
|
15
|
+
- Support custom error status codes for Grape (#1238)
|
16
|
+
- Cucumber integration (#1216)
|
17
|
+
- RSpec integration (#1234)
|
18
|
+
- Validation to `:on_error` argument on `Datadog::Tracer#trace` (#1220)
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Update `TokenBucket#effective_rate` calculation (#1236)
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
|
26
|
+
- Avoid writer reinitialization during shutdown (#1235, #1248)
|
27
|
+
- Fix configuration multiplexing (#1204, #1227)
|
28
|
+
- Fix misnamed B3 distributed headers (#1226, #1229)
|
29
|
+
- Correct span type for AWS SDK (#1233)
|
30
|
+
- Correct span type for internal Pin on HTTP clients (#1239)
|
31
|
+
- Reset trace context after fork (#1225)
|
32
|
+
|
33
|
+
### Refactored
|
34
|
+
|
35
|
+
- Improvements to test suite (#1232, #1244)
|
36
|
+
- Improvements to documentation (#1243, #1218) (@cjford)
|
37
|
+
|
38
|
+
### Removed
|
39
|
+
|
5
40
|
## [0.42.0] - 2020-10-21
|
6
41
|
|
7
42
|
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.42.0
|
@@ -1458,6 +1493,7 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
1458
1493
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
1459
1494
|
|
1460
1495
|
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.41.0...master
|
1496
|
+
[0.43.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.42.0...v0.43.0
|
1461
1497
|
[0.41.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.40.0...v0.41.0
|
1462
1498
|
[0.40.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.39.0...v0.40.0
|
1463
1499
|
[0.39.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.38.0...v0.39.0
|
data/CONTRIBUTING.md
CHANGED
@@ -76,7 +76,7 @@ We also recommend that you share in your description:
|
|
76
76
|
|
77
77
|
Pull requests will be reviewed and added to [our Community project](https://github.com/DataDog/dd-trace-rb/projects/2).
|
78
78
|
|
79
|
-
For more information on common topics such as debugging locally, or how to write new integrations, check out [our development guide](https://github.com/DataDog/dd-trace-rb/docs/DevelopmentGuide.md). If at any point you have a question or need assistance with your pull request, feel free to mention a project member! We're always happy to help contributors with their pull requests.
|
79
|
+
For more information on common topics such as debugging locally, or how to write new integrations, check out [our development guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md). If at any point you have a question or need assistance with your pull request, feel free to mention a project member! We're always happy to help contributors with their pull requests.
|
80
80
|
|
81
81
|
## Final word
|
82
82
|
|
data/Rakefile
CHANGED
@@ -85,6 +85,7 @@ namespace :spec do
|
|
85
85
|
:active_support,
|
86
86
|
:aws,
|
87
87
|
:concurrent_ruby,
|
88
|
+
:cucumber,
|
88
89
|
:dalli,
|
89
90
|
:delayed_job,
|
90
91
|
:elasticsearch,
|
@@ -107,6 +108,7 @@ namespace :spec do
|
|
107
108
|
:redis,
|
108
109
|
:resque,
|
109
110
|
:rest_client,
|
111
|
+
:rspec,
|
110
112
|
:sequel,
|
111
113
|
:shoryuken,
|
112
114
|
:sidekiq,
|
@@ -234,6 +236,7 @@ task :ci do
|
|
234
236
|
declare 'bundle exec appraisal contrib-old rake spec:redis'
|
235
237
|
declare 'bundle exec appraisal contrib-old rake spec:resque'
|
236
238
|
declare 'bundle exec appraisal contrib-old rake spec:rest_client'
|
239
|
+
declare 'bundle exec appraisal contrib-old rake spec:rspec'
|
237
240
|
declare 'bundle exec appraisal contrib-old rake spec:sequel'
|
238
241
|
declare 'bundle exec appraisal contrib-old rake spec:sidekiq'
|
239
242
|
declare 'bundle exec appraisal contrib-old rake spec:sinatra'
|
@@ -281,6 +284,7 @@ task :ci do
|
|
281
284
|
declare 'bundle exec appraisal contrib-old rake spec:faraday'
|
282
285
|
declare 'bundle exec appraisal contrib-old rake spec:http'
|
283
286
|
declare 'bundle exec appraisal contrib-old rake spec:httprb'
|
287
|
+
declare 'bundle exec appraisal contrib-old rake spec:kafka'
|
284
288
|
declare 'bundle exec appraisal contrib-old rake spec:mongodb'
|
285
289
|
declare 'bundle exec appraisal contrib-old rake spec:mysql2'
|
286
290
|
declare 'bundle exec appraisal contrib-old rake spec:presto'
|
@@ -289,6 +293,7 @@ task :ci do
|
|
289
293
|
declare 'bundle exec appraisal contrib-old rake spec:redis'
|
290
294
|
declare 'bundle exec appraisal contrib-old rake spec:resque'
|
291
295
|
declare 'bundle exec appraisal contrib-old rake spec:rest_client'
|
296
|
+
declare 'bundle exec appraisal contrib-old rake spec:rspec'
|
292
297
|
declare 'bundle exec appraisal contrib-old rake spec:sequel'
|
293
298
|
declare 'bundle exec appraisal contrib-old rake spec:sidekiq'
|
294
299
|
declare 'bundle exec appraisal contrib-old rake spec:sinatra'
|
@@ -346,6 +351,7 @@ task :ci do
|
|
346
351
|
declare 'bundle exec appraisal contrib rake spec:grpc'
|
347
352
|
declare 'bundle exec appraisal contrib rake spec:http'
|
348
353
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
354
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
349
355
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
350
356
|
declare 'bundle exec appraisal contrib rake spec:mysql2'
|
351
357
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -356,6 +362,7 @@ task :ci do
|
|
356
362
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
357
363
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
358
364
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
365
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
359
366
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
360
367
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
361
368
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -419,6 +426,7 @@ task :ci do
|
|
419
426
|
declare 'bundle exec appraisal contrib rake spec:grpc'
|
420
427
|
declare 'bundle exec appraisal contrib rake spec:http'
|
421
428
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
429
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
422
430
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
423
431
|
declare 'bundle exec appraisal contrib rake spec:mysql2'
|
424
432
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -429,6 +437,7 @@ task :ci do
|
|
429
437
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
430
438
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
431
439
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
440
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
432
441
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
433
442
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
434
443
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -499,6 +508,7 @@ task :ci do
|
|
499
508
|
declare 'bundle exec appraisal contrib rake spec:grpc'
|
500
509
|
declare 'bundle exec appraisal contrib rake spec:http'
|
501
510
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
511
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
502
512
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
503
513
|
declare 'bundle exec appraisal contrib rake spec:mysql2'
|
504
514
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -509,6 +519,7 @@ task :ci do
|
|
509
519
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
510
520
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
511
521
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
522
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
512
523
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
513
524
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
514
525
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -533,6 +544,10 @@ task :ci do
|
|
533
544
|
# explicitly test resque-2x compatability
|
534
545
|
declare 'bundle exec appraisal resque2-redis3 rake spec:resque'
|
535
546
|
declare 'bundle exec appraisal resque2-redis4 rake spec:resque'
|
547
|
+
|
548
|
+
# explicitly test cucumber compatibility
|
549
|
+
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
|
550
|
+
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
|
536
551
|
end
|
537
552
|
elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
|
538
553
|
&& Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0')
|
@@ -551,6 +566,7 @@ task :ci do
|
|
551
566
|
declare 'bundle exec appraisal contrib rake spec:active_support'
|
552
567
|
declare 'bundle exec appraisal contrib rake spec:aws'
|
553
568
|
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
|
569
|
+
declare 'bundle exec appraisal contrib rake spec:cucumber'
|
554
570
|
declare 'bundle exec appraisal contrib rake spec:dalli'
|
555
571
|
declare 'bundle exec appraisal contrib rake spec:delayed_job'
|
556
572
|
declare 'bundle exec appraisal contrib rake spec:elasticsearch'
|
@@ -562,6 +578,7 @@ task :ci do
|
|
562
578
|
declare 'bundle exec appraisal contrib rake spec:grpc' if RUBY_PLATFORM != 'java' # protobuf not supported
|
563
579
|
declare 'bundle exec appraisal contrib rake spec:http'
|
564
580
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
581
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
565
582
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
566
583
|
declare 'bundle exec appraisal contrib rake spec:mysql2' if RUBY_PLATFORM != 'java' # built-in jdbc is used instead
|
567
584
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -572,6 +589,7 @@ task :ci do
|
|
572
589
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
573
590
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
574
591
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
592
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
575
593
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
576
594
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
577
595
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -606,6 +624,11 @@ task :ci do
|
|
606
624
|
# explicitly test resque-2x compatability
|
607
625
|
declare 'bundle exec appraisal resque2-redis3 rake spec:resque'
|
608
626
|
declare 'bundle exec appraisal resque2-redis4 rake spec:resque'
|
627
|
+
|
628
|
+
# explicitly test cucumber compatibility
|
629
|
+
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
|
630
|
+
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
|
631
|
+
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'
|
609
632
|
elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) \
|
610
633
|
&& Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0')
|
611
634
|
# Main library
|
@@ -625,6 +648,7 @@ task :ci do
|
|
625
648
|
declare 'bundle exec appraisal contrib rake spec:active_support'
|
626
649
|
declare 'bundle exec appraisal contrib rake spec:aws'
|
627
650
|
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
|
651
|
+
declare 'bundle exec appraisal contrib rake spec:cucumber'
|
628
652
|
declare 'bundle exec appraisal contrib rake spec:dalli'
|
629
653
|
declare 'bundle exec appraisal contrib rake spec:delayed_job'
|
630
654
|
declare 'bundle exec appraisal contrib rake spec:elasticsearch'
|
@@ -636,6 +660,7 @@ task :ci do
|
|
636
660
|
declare 'bundle exec appraisal contrib rake spec:grpc'
|
637
661
|
declare 'bundle exec appraisal contrib rake spec:http'
|
638
662
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
663
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
639
664
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
640
665
|
declare 'bundle exec appraisal contrib rake spec:mysql2'
|
641
666
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -646,6 +671,7 @@ task :ci do
|
|
646
671
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
647
672
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
648
673
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
674
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
649
675
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
650
676
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
651
677
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -680,6 +706,11 @@ task :ci do
|
|
680
706
|
# explicitly test resque-2x compatability
|
681
707
|
declare 'bundle exec appraisal resque2-redis3 rake spec:resque'
|
682
708
|
declare 'bundle exec appraisal resque2-redis4 rake spec:resque'
|
709
|
+
|
710
|
+
# explicitly test cucumber compatibility
|
711
|
+
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
|
712
|
+
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
|
713
|
+
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'
|
683
714
|
end
|
684
715
|
elsif Gem::Version.new('2.7.0') <= Gem::Version.new(RUBY_VERSION)
|
685
716
|
# Main library
|
@@ -699,6 +730,7 @@ task :ci do
|
|
699
730
|
declare 'bundle exec appraisal contrib rake spec:active_support'
|
700
731
|
declare 'bundle exec appraisal contrib rake spec:aws'
|
701
732
|
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
|
733
|
+
declare 'bundle exec appraisal contrib rake spec:cucumber'
|
702
734
|
declare 'bundle exec appraisal contrib rake spec:dalli'
|
703
735
|
declare 'bundle exec appraisal contrib rake spec:delayed_job'
|
704
736
|
declare 'bundle exec appraisal contrib rake spec:elasticsearch'
|
@@ -710,6 +742,7 @@ task :ci do
|
|
710
742
|
declare 'bundle exec appraisal contrib rake spec:grpc'
|
711
743
|
declare 'bundle exec appraisal contrib rake spec:http'
|
712
744
|
declare 'bundle exec appraisal contrib rake spec:httprb'
|
745
|
+
declare 'bundle exec appraisal contrib rake spec:kafka'
|
713
746
|
declare 'bundle exec appraisal contrib rake spec:mongodb'
|
714
747
|
declare 'bundle exec appraisal contrib rake spec:mysql2'
|
715
748
|
declare 'bundle exec appraisal contrib rake spec:presto'
|
@@ -720,6 +753,7 @@ task :ci do
|
|
720
753
|
declare 'bundle exec appraisal contrib rake spec:redis'
|
721
754
|
declare 'bundle exec appraisal contrib rake spec:resque'
|
722
755
|
declare 'bundle exec appraisal contrib rake spec:rest_client'
|
756
|
+
declare 'bundle exec appraisal contrib rake spec:rspec'
|
723
757
|
declare 'bundle exec appraisal contrib rake spec:sequel'
|
724
758
|
declare 'bundle exec appraisal contrib rake spec:shoryuken'
|
725
759
|
declare 'bundle exec appraisal contrib rake spec:sidekiq'
|
@@ -752,6 +786,11 @@ task :ci do
|
|
752
786
|
# explicitly test resque-2x compatability
|
753
787
|
declare 'bundle exec appraisal resque2-redis3 rake spec:resque'
|
754
788
|
declare 'bundle exec appraisal resque2-redis4 rake spec:resque'
|
789
|
+
|
790
|
+
# explicitly test cucumber compatibility
|
791
|
+
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
|
792
|
+
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
|
793
|
+
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'
|
755
794
|
end
|
756
795
|
end
|
757
796
|
end
|
data/docs/DevelopmentGuide.md
CHANGED
@@ -151,9 +151,9 @@ To get started quickly, it's perfectly fine to copy-paste an existing integratio
|
|
151
151
|
|
152
152
|
Once you have it working in your application, you can [add unit tests](#writing-tests), [run them locally](#running-tests), and [check for code quality](#checking-code-quality) using Docker Compose.
|
153
153
|
|
154
|
-
Then [open a pull request](
|
154
|
+
Then [open a pull request](../CONTRIBUTING.md#have-a-patch) and be sure to add the following to the description:
|
155
155
|
|
156
|
-
- [Documentation](
|
156
|
+
- [Documentation](./GettingStarted.md) for the integration, including versions supported.
|
157
157
|
- Links to the repository/website of the library being integrated
|
158
158
|
- Screenshots showing a sample trace
|
159
159
|
- Any additional code snippets, sample apps, benchmarks, or other resources that demonstrate its implementation are a huge plus!
|
data/docs/GettingStarted.md
CHANGED
@@ -34,6 +34,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
|
|
34
34
|
- [Active Support](#active-support)
|
35
35
|
- [AWS](#aws)
|
36
36
|
- [Concurrent Ruby](#concurrent-ruby)
|
37
|
+
- [Cucumber](#cucumber)
|
37
38
|
- [Dalli](#dalli)
|
38
39
|
- [DelayedJob](#delayedjob)
|
39
40
|
- [Elasticsearch](#elasticsearch)
|
@@ -338,6 +339,7 @@ For a list of available integrations, and their configuration options, please re
|
|
338
339
|
| Active Support | `active_support` | `>= 3.0` | `>= 3.0` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
|
339
340
|
| AWS | `aws` | `>= 2.0` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
|
340
341
|
| Concurrent Ruby | `concurrent_ruby` | `>= 0.9` | `>= 0.9` | *[Link](#concurrent-ruby)* | *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
|
342
|
+
| Cucumber | `cucumber` | `>= 3.0` | `>= 1.7.16` | *[Link](#cucumber)* | *[Link](https://github.com/cucumber/cucumber-ruby)* |
|
341
343
|
| Dalli | `dalli` | `>= 2.0` | `>= 2.0` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
|
342
344
|
| DelayedJob | `delayed_job` | `>= 4.1` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
|
343
345
|
| Elasticsearch | `elasticsearch` | `>= 1.0` | `>= 1.0` | *[Link](#elasticsearch)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
|
@@ -590,6 +592,42 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
590
592
|
| --- | ----------- | ------- |
|
591
593
|
| `service_name` | Service name used for `concurrent-ruby` instrumentation | `'concurrent-ruby'` |
|
592
594
|
|
595
|
+
### Cucumber
|
596
|
+
|
597
|
+
Cucumber integration will trace all executions of scenarios and steps when using `cucumber` framework.
|
598
|
+
|
599
|
+
To activate your integration, use the `Datadog.configure` method:
|
600
|
+
|
601
|
+
```ruby
|
602
|
+
require 'cucumber'
|
603
|
+
require 'ddtrace'
|
604
|
+
|
605
|
+
# Configure default Cucumber integration
|
606
|
+
Datadog.configure do |c|
|
607
|
+
c.use :cucumber, options
|
608
|
+
end
|
609
|
+
|
610
|
+
# Example of how to attach tags from scenario to active span
|
611
|
+
Around do |scenario, block|
|
612
|
+
active_span = Datadog.configuration[:cucumber][:tracer].active_span
|
613
|
+
unless active_span.nil?
|
614
|
+
scenario.tags.filter { |tag| tag.include? ':' }.each do |tag|
|
615
|
+
active_span.set_tag(*tag.name.split(':', 2))
|
616
|
+
end
|
617
|
+
end
|
618
|
+
block.call
|
619
|
+
end
|
620
|
+
```
|
621
|
+
|
622
|
+
Where `options` is an optional `Hash` that accepts the following parameters:
|
623
|
+
|
624
|
+
| Key | Description | Default |
|
625
|
+
| --- | ----------- | ------- |
|
626
|
+
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `true` |
|
627
|
+
| `enabled` | Defines whether Cucumber tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
|
628
|
+
| `service_name` | Service name used for `cucumber` instrumentation. | `'cucumber'` |
|
629
|
+
| `operation_name` | Operation name used for `cucumber` instrumentation. Useful if you want rename automatic trace metrics e.g. `trace.#{operation_name}.errors`. | `'cucumber.test'` |
|
630
|
+
|
593
631
|
### Dalli
|
594
632
|
|
595
633
|
Dalli integration will trace all calls to your `memcached` server:
|
@@ -636,6 +674,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
636
674
|
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
|
637
675
|
| `service_name` | Service name used for `DelayedJob` instrumentation | `'delayed_job'` |
|
638
676
|
| `client_service_name` | Service name used for client-side `DelayedJob` instrumentation | `'delayed_job-client'` |
|
677
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
639
678
|
|
640
679
|
### Elasticsearch
|
641
680
|
|
@@ -816,6 +855,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
816
855
|
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
|
817
856
|
| `enabled` | Defines whether Grape should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
|
818
857
|
| `service_name` | Service name used for `grape` instrumentation | `'grape'` |
|
858
|
+
| `error_statuses`| Defines a status code or range of status codes which should be marked as errors. `'404,405,500-599'` or `[404,405,'500-599']` | `nil` |
|
819
859
|
|
820
860
|
### GraphQL
|
821
861
|
|
@@ -1136,6 +1176,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1136
1176
|
| `service_name` | Service name used for `que` instrumentation | `'que'` |
|
1137
1177
|
| `tag_args` | Enable tagging of a job's args field. `true` for on, `false` for off. | `false` |
|
1138
1178
|
| `tag_data` | Enable tagging of a job's data field. `true` for on, `false` for off. | `false` |
|
1179
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
1139
1180
|
|
1140
1181
|
### Racecar
|
1141
1182
|
|
@@ -1436,6 +1477,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1436
1477
|
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
|
1437
1478
|
| `service_name` | Service name used for `resque` instrumentation | `'resque'` |
|
1438
1479
|
| `workers` | An array including all worker classes you want to trace (e.g. `[MyJob]`) | `[]` |
|
1480
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
1439
1481
|
|
1440
1482
|
### Rest Client
|
1441
1483
|
|
@@ -1458,6 +1500,31 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1458
1500
|
| `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
|
1459
1501
|
| `service_name` | Service name for `rest_client` instrumentation. | `'rest_client'` |
|
1460
1502
|
|
1503
|
+
## RSpec
|
1504
|
+
|
1505
|
+
RSpec integration will trace all executions of example groups and examples when using `rspec` test framework.
|
1506
|
+
|
1507
|
+
To activate your integration, use the `Datadog.configure` method:
|
1508
|
+
|
1509
|
+
```ruby
|
1510
|
+
require 'rspec'
|
1511
|
+
require 'ddtrace'
|
1512
|
+
|
1513
|
+
# Configure default RSpec integration
|
1514
|
+
Datadog.configure do |c|
|
1515
|
+
c.use :rspec, options
|
1516
|
+
end
|
1517
|
+
```
|
1518
|
+
|
1519
|
+
Where `options` is an optional `Hash` that accepts the following parameters:
|
1520
|
+
|
1521
|
+
| Key | Description | Default |
|
1522
|
+
| --- | ----------- | ------- |
|
1523
|
+
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `true` |
|
1524
|
+
| `enabled` | Defines whether RSpec tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
|
1525
|
+
| `service_name` | Service name used for `rspec` instrumentation. | `'rspec'` |
|
1526
|
+
| `operation_name` | Operation name used for `rspec` instrumentation. Useful if you want rename automatic trace metrics e.g. `trace.#{operation_name}.errors`. | `'rspec.example'` |
|
1527
|
+
|
1461
1528
|
### Sequel
|
1462
1529
|
|
1463
1530
|
The Sequel integration traces queries made to your database.
|
@@ -1526,6 +1593,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1526
1593
|
| --- | ----------- | ------- |
|
1527
1594
|
| `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
|
1528
1595
|
| `service_name` | Service name used for `shoryuken` instrumentation | `'shoryuken'` |
|
1596
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
1529
1597
|
|
1530
1598
|
### Sidekiq
|
1531
1599
|
|
@@ -1549,6 +1617,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1549
1617
|
| `client_service_name` | Service name used for client-side `sidekiq` instrumentation | `'sidekiq-client'` |
|
1550
1618
|
| `service_name` | Service name used for server-side `sidekiq` instrumentation | `'sidekiq'` |
|
1551
1619
|
| `tag_args` | Enable tagging of job arguments. `true` for on, `false` for off. | `false` |
|
1620
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
1552
1621
|
|
1553
1622
|
### Sinatra
|
1554
1623
|
|
@@ -1636,6 +1705,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
|
|
1636
1705
|
| `enabled` | Defines whether Sneakers should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
|
1637
1706
|
| `service_name` | Service name used for `sneakers` instrumentation | `'sneakers'` |
|
1638
1707
|
| `tag_body` | Enable tagging of job message. `true` for on, `false` for off. | `false` |
|
1708
|
+
| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
|
1639
1709
|
|
1640
1710
|
### Sucker Punch
|
1641
1711
|
|
@@ -2050,7 +2120,7 @@ _Note:_ For `lograge` users who have also defined `lograge.custom_options` in an
|
|
2050
2120
|
|
2051
2121
|
##### Manual (Lograge)
|
2052
2122
|
|
2053
|
-
After [setting up Lograge in a Rails application](https://docs.datadoghq.com/logs/log_collection/ruby/), manually modify the `custom_options` block in your environment configuration file (e.g. `config/environments/production.rb`) to add the trace IDs.
|
2123
|
+
After [setting up Lograge in a Rails application](https://docs.datadoghq.com/logs/log_collection/ruby/), manually modify the `custom_options` block in your environment configuration file (e.g. `config/environments/production.rb`) to add the trace IDs.
|
2054
2124
|
|
2055
2125
|
```ruby
|
2056
2126
|
config.lograge.custom_options = lambda do |event|
|
data/lib/ddtrace.rb
CHANGED
@@ -45,6 +45,7 @@ require 'ddtrace/contrib/active_record/integration'
|
|
45
45
|
require 'ddtrace/contrib/active_support/integration'
|
46
46
|
require 'ddtrace/contrib/aws/integration'
|
47
47
|
require 'ddtrace/contrib/concurrent_ruby/integration'
|
48
|
+
require 'ddtrace/contrib/cucumber/integration'
|
48
49
|
require 'ddtrace/contrib/dalli/integration'
|
49
50
|
require 'ddtrace/contrib/delayed_job/integration'
|
50
51
|
require 'ddtrace/contrib/elasticsearch/integration'
|
@@ -69,6 +70,7 @@ require 'ddtrace/contrib/rake/integration'
|
|
69
70
|
require 'ddtrace/contrib/redis/integration'
|
70
71
|
require 'ddtrace/contrib/resque/integration'
|
71
72
|
require 'ddtrace/contrib/rest_client/integration'
|
73
|
+
require 'ddtrace/contrib/rspec/integration'
|
72
74
|
require 'ddtrace/contrib/sequel/integration'
|
73
75
|
require 'ddtrace/contrib/shoryuken/integration'
|
74
76
|
require 'ddtrace/contrib/sidekiq/integration'
|
@@ -55,11 +55,27 @@ module Datadog
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
# Gracefully shuts down all components.
|
59
|
+
#
|
60
|
+
# Components will still respond to method calls as usual,
|
61
|
+
# but might not internally perform their work after shutdown.
|
62
|
+
#
|
63
|
+
# This avoids errors being raised across the host application
|
64
|
+
# during shutdown, while allowing for graceful decommission of resources.
|
65
|
+
#
|
66
|
+
# Components won't be automatically reinitialized after a shutdown.
|
58
67
|
def shutdown!
|
59
|
-
if instance_variable_defined?(:@components) && @components
|
60
|
-
|
61
|
-
|
62
|
-
|
68
|
+
components.shutdown! if instance_variable_defined?(:@components) && @components
|
69
|
+
end
|
70
|
+
|
71
|
+
# Gracefully shuts down the tracer and disposes of component references,
|
72
|
+
# allowing execution to start anew.
|
73
|
+
#
|
74
|
+
# In contrast with +#shutdown!+, components will be automatically
|
75
|
+
# reinitialized after a reset.
|
76
|
+
def reset!
|
77
|
+
shutdown!
|
78
|
+
@components = nil
|
63
79
|
end
|
64
80
|
|
65
81
|
protected
|