ddtrace 0.37.0 → 0.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Appraisals +15 -0
  4. data/CHANGELOG.md +33 -1
  5. data/Rakefile +11 -10
  6. data/docker-compose.yml +2 -2
  7. data/docs/GettingStarted.md +55 -0
  8. data/lib/ddtrace.rb +2 -0
  9. data/lib/ddtrace/configuration/settings.rb +18 -0
  10. data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +1 -1
  11. data/lib/ddtrace/contrib/extensions.rb +10 -0
  12. data/lib/ddtrace/contrib/faraday/middleware.rb +5 -3
  13. data/lib/ddtrace/contrib/faraday/patcher.rb +3 -0
  14. data/lib/ddtrace/contrib/grpc/datadog_interceptor/client.rb +1 -3
  15. data/lib/ddtrace/contrib/httprb/configuration/settings.rb +27 -0
  16. data/lib/ddtrace/contrib/httprb/ext.rb +14 -0
  17. data/lib/ddtrace/contrib/httprb/instrumentation.rb +163 -0
  18. data/lib/ddtrace/contrib/httprb/integration.rb +43 -0
  19. data/lib/ddtrace/contrib/httprb/patcher.rb +35 -0
  20. data/lib/ddtrace/contrib/kafka/configuration/settings.rb +25 -0
  21. data/lib/ddtrace/contrib/kafka/consumer_event.rb +14 -0
  22. data/lib/ddtrace/contrib/kafka/consumer_group_event.rb +14 -0
  23. data/lib/ddtrace/contrib/kafka/event.rb +51 -0
  24. data/lib/ddtrace/contrib/kafka/events.rb +44 -0
  25. data/lib/ddtrace/contrib/kafka/events/connection/request.rb +34 -0
  26. data/lib/ddtrace/contrib/kafka/events/consumer/process_batch.rb +41 -0
  27. data/lib/ddtrace/contrib/kafka/events/consumer/process_message.rb +39 -0
  28. data/lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb +39 -0
  29. data/lib/ddtrace/contrib/kafka/events/consumer_group/join_group.rb +29 -0
  30. data/lib/ddtrace/contrib/kafka/events/consumer_group/leave_group.rb +29 -0
  31. data/lib/ddtrace/contrib/kafka/events/consumer_group/sync_group.rb +29 -0
  32. data/lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb +32 -0
  33. data/lib/ddtrace/contrib/kafka/events/producer/deliver_messages.rb +35 -0
  34. data/lib/ddtrace/contrib/kafka/ext.rb +38 -0
  35. data/lib/ddtrace/contrib/kafka/integration.rb +39 -0
  36. data/lib/ddtrace/contrib/kafka/patcher.rb +26 -0
  37. data/lib/ddtrace/contrib/rack/middlewares.rb +15 -12
  38. data/lib/ddtrace/contrib/rest_client/request_patch.rb +2 -2
  39. data/lib/ddtrace/contrib/sidekiq/ext.rb +1 -0
  40. data/lib/ddtrace/contrib/sidekiq/patcher.rb +8 -1
  41. data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +1 -0
  42. data/lib/ddtrace/diagnostics/environment_logger.rb +278 -0
  43. data/lib/ddtrace/environment.rb +5 -1
  44. data/lib/ddtrace/ext/diagnostics.rb +2 -0
  45. data/lib/ddtrace/ext/environment.rb +2 -0
  46. data/lib/ddtrace/pipeline/span_filter.rb +15 -15
  47. data/lib/ddtrace/sampler.rb +2 -0
  48. data/lib/ddtrace/span.rb +10 -0
  49. data/lib/ddtrace/tracer.rb +13 -6
  50. data/lib/ddtrace/transport/http/adapters/net.rb +8 -0
  51. data/lib/ddtrace/transport/http/adapters/test.rb +4 -0
  52. data/lib/ddtrace/transport/http/adapters/unix_socket.rb +4 -0
  53. data/lib/ddtrace/transport/response.rb +11 -0
  54. data/lib/ddtrace/version.rb +1 -1
  55. data/lib/ddtrace/workers/trace_writer.rb +3 -0
  56. data/lib/ddtrace/writer.rb +33 -12
  57. metadata +27 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3253a2d8c0b21e8a1f37a8fdeb871fad442a7972004587ceea5a52fedb335bea
4
- data.tar.gz: e1702aa824d9dfe47cded67df133f8bc819303260fe2254c90fa47c9ec97744a
3
+ metadata.gz: 88a2890ed343b6cfef9752a3bbeb34c4a670a86755c66f99d625fe10f9172f5f
4
+ data.tar.gz: e77520aa45dad85b0a8198233dd7e1bc485db11e8d478eb606401aaa9e17f2f9
5
5
  SHA512:
6
- metadata.gz: 0053d18a6ba7c003ab30d9c70fee26a300fdce9a5c996c26f1a3104b765f54877f5133e295137fb55e87681e0c10eec3c8c9b6f9bb28ea3be0d98cfc956b0dfe
7
- data.tar.gz: 46331851889d62b9814c51ce987fcd3632a85e6ffb2f72dc69cc7e410e795a89ebb84ff3822c8e41e9a2fb07721998b30eea5249c5b72dcd6a1c237483189309
6
+ metadata.gz: af5e2a13d1960b68d4b4d9c39661052898ce7636eef5866447ee67cb23d2f9e4a4d98aed3be403780a5d31c7c7a588cc7821dcf8b161679e211a6d315932f1bf
7
+ data.tar.gz: f0dc91d291576bec7a7b5ed7e494a09d2a976acfe7aa38999d2c8be893117757925253192f83f70317a8f60eee3d7fcc122aa8c33867409db5ade6b94f9148f4
data/.gitignore CHANGED
@@ -50,6 +50,8 @@ build-iPhoneSimulator/
50
50
 
51
51
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
52
52
  .rvmrc
53
+ # Ignore local variables
54
+ .envrc
53
55
 
54
56
  # lock files
55
57
  Gemfile.lock
data/Appraisals CHANGED
@@ -73,6 +73,7 @@ elsif Gem::Version.new('2.0.0') <= Gem::Version.new(RUBY_VERSION) \
73
73
  gem 'ethon'
74
74
  gem 'excon'
75
75
  gem 'hiredis'
76
+ gem 'http'
76
77
  gem 'mongo', '< 2.5'
77
78
  gem 'mysql2', '0.3.21', platform: :ruby
78
79
  gem 'rack', '1.4.7'
@@ -184,6 +185,7 @@ elsif Gem::Version.new('2.1.0') <= Gem::Version.new(RUBY_VERSION) \
184
185
  gem 'ethon'
185
186
  gem 'excon'
186
187
  gem 'hiredis'
188
+ gem 'http'
187
189
  gem 'mongo', '< 2.5'
188
190
  gem 'mysql2', '0.3.21', platform: :ruby
189
191
  gem 'rack', '1.4.7'
@@ -193,6 +195,7 @@ elsif Gem::Version.new('2.1.0') <= Gem::Version.new(RUBY_VERSION) \
193
195
  gem 'redis', '< 4.0'
194
196
  gem 'rest-client'
195
197
  gem 'resque', '< 2.0'
198
+ gem 'ruby-kafka', '>= 0.7.10'
196
199
  gem 'sequel', '~> 4.0', '< 4.37'
197
200
  gem 'shoryuken'
198
201
  gem 'sidekiq', '~> 3.5.4'
@@ -344,6 +347,7 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \
344
347
  gem 'graphql', '< 1.9.4'
345
348
  gem 'grpc', '~> 1.21.0' # Last version to support Ruby < 2.3
346
349
  gem 'hiredis'
350
+ gem 'http'
347
351
  gem 'mongo', '>= 2.8.0'
348
352
  gem 'mysql2', '< 0.5', platform: :ruby
349
353
  gem 'racecar', '>= 0.3.5'
@@ -353,6 +357,7 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \
353
357
  gem 'redis', '< 4.0'
354
358
  gem 'rest-client'
355
359
  gem 'resque', '< 2.0'
360
+ gem 'ruby-kafka', '>= 0.7.10'
356
361
  gem 'sequel'
357
362
  gem 'shoryuken'
358
363
  gem 'sidekiq'
@@ -503,6 +508,7 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \
503
508
  gem 'grpc'
504
509
  gem 'google-protobuf', '~> 3.11.0' # Last version to support Ruby < 2.5
505
510
  gem 'hiredis'
511
+ gem 'http'
506
512
  gem 'mongo', '>= 2.8.0'
507
513
  gem 'mysql2', '< 0.5', platform: :ruby
508
514
  gem 'presto-client', '>= 0.5.14'
@@ -513,6 +519,7 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \
513
519
  gem 'redis', '< 4.0'
514
520
  gem 'rest-client'
515
521
  gem 'resque', '< 2.0'
522
+ gem 'ruby-kafka', '>= 0.7.10'
516
523
  gem 'sequel'
517
524
  gem 'shoryuken'
518
525
  gem 'sidekiq'
@@ -582,6 +589,7 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) \
582
589
  gem 'grpc'
583
590
  gem 'google-protobuf', '~> 3.11.0' # Last version to support Ruby < 2.5
584
591
  gem 'hiredis'
592
+ gem 'http'
585
593
  gem 'mongo', '>= 2.8.0'
586
594
  gem 'mysql2', '< 0.5', platform: :ruby
587
595
  gem 'presto-client', '>= 0.5.14'
@@ -592,6 +600,7 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) \
592
600
  gem 'redis', '< 4.0'
593
601
  gem 'rest-client'
594
602
  gem 'resque', '< 2.0'
603
+ gem 'ruby-kafka', '>= 0.7.10'
595
604
  gem 'sequel'
596
605
  gem 'shoryuken'
597
606
  gem 'sidekiq'
@@ -694,6 +703,7 @@ elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
694
703
  gem 'graphql'
695
704
  gem 'grpc'
696
705
  gem 'hiredis'
706
+ gem 'http'
697
707
  gem 'mongo', '>= 2.8.0'
698
708
  gem 'mysql2', '< 0.5', platform: :ruby
699
709
  gem 'presto-client', '>= 0.5.14'
@@ -704,6 +714,7 @@ elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
704
714
  gem 'redis', '< 4.0'
705
715
  gem 'rest-client'
706
716
  gem 'resque', '< 2.0'
717
+ gem 'ruby-kafka', '>= 0.7.10'
707
718
  gem 'sequel'
708
719
  gem 'shoryuken'
709
720
  gem 'sidekiq'
@@ -806,6 +817,7 @@ elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) \
806
817
  gem 'graphql'
807
818
  gem 'grpc'
808
819
  gem 'hiredis'
820
+ gem 'http'
809
821
  gem 'mongo', '>= 2.8.0'
810
822
  gem 'mysql2', '< 0.5', platform: :ruby
811
823
  gem 'presto-client', '>= 0.5.14'
@@ -816,6 +828,7 @@ elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) \
816
828
  gem 'redis', '< 4.0'
817
829
  gem 'rest-client'
818
830
  gem 'resque', '< 2.0'
831
+ gem 'ruby-kafka', '>= 0.7.10'
819
832
  gem 'sequel'
820
833
  gem 'shoryuken'
821
834
  gem 'sidekiq'
@@ -920,6 +933,7 @@ elsif Gem::Version.new('2.7.0') <= Gem::Version.new(RUBY_VERSION)
920
933
  gem 'graphql'
921
934
  gem 'grpc'
922
935
  gem 'hiredis'
936
+ gem 'http'
923
937
  gem 'mongo', '>= 2.8.0'
924
938
  gem 'mysql2', '< 0.5', platform: :ruby
925
939
  gem 'presto-client', '>= 0.5.14'
@@ -930,6 +944,7 @@ elsif Gem::Version.new('2.7.0') <= Gem::Version.new(RUBY_VERSION)
930
944
  gem 'redis', '< 4.0'
931
945
  gem 'rest-client'
932
946
  gem 'resque', '< 2.0'
947
+ gem 'ruby-kafka', '>= 0.7.10'
933
948
  gem 'sequel'
934
949
  gem 'shoryuken'
935
950
  gem 'sidekiq'
@@ -2,6 +2,37 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.38.0] - 2020-07-13
6
+
7
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.38.0
8
+
9
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.37.0...v0.38.0
10
+
11
+ ### Added
12
+
13
+ - http.rb integration (#529, #853)
14
+ - Kafka integration (#1070) (@tjwp)
15
+ - Span#set_tags (#1081) (@DocX)
16
+ - retry_count tag for Sidekiq jobs (#1089) (@elyalvarado)
17
+ - Startup environment log (#1104, #1109)
18
+ - DD_SITE and DD_API_KEY configuration (#1107)
19
+
20
+ ### Changed
21
+
22
+ - Auto instrument Faraday default connection (#1057)
23
+ - Sidekiq client middleware is now the same for client and server (#1099) (@drcapulet)
24
+ - Single pass SpanFilter (#1071) (@tjwp)
25
+
26
+ ### Fixed
27
+
28
+ - Ensure fatal exceptions are propagated (#1100)
29
+ - Respect child_of: option in Tracer#trace (#1082) (@DocX)
30
+ - Improve Writer thread safety (#1091) (@fledman)
31
+
32
+ ### Refactored
33
+
34
+ - Improvements to test suite (#1092, #1103)
35
+
5
36
  ## [0.37.0] - 2020-06-24
6
37
 
7
38
  Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.37.0
@@ -1274,7 +1305,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
1274
1305
 
1275
1306
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
1276
1307
 
1277
- [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.37.0...master
1308
+ [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.38.0...master
1309
+ [0.38.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.37.0...v0.38.0
1278
1310
  [0.37.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.36.0...v0.37.0
1279
1311
  [0.36.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.35.2...v0.36.0
1280
1312
  [0.35.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.35.1...v0.35.2
data/Rakefile CHANGED
@@ -95,6 +95,8 @@ namespace :spec do
95
95
  :graphql,
96
96
  :grpc,
97
97
  :http,
98
+ :httprb,
99
+ :kafka,
98
100
  :mongodb,
99
101
  :mysql2,
100
102
  :presto,
@@ -121,7 +123,7 @@ end
121
123
  namespace :test do
122
124
  task all: [:main,
123
125
  :rails,
124
- :sidekiq, :monkey]
126
+ :monkey]
125
127
 
126
128
  Rake::TestTask.new(:main) do |t|
127
129
  t.libs << %w[test lib]
@@ -140,7 +142,6 @@ namespace :test do
140
142
 
141
143
  [
142
144
  :grape,
143
- :sidekiq,
144
145
  :sucker_punch
145
146
  ].each do |contrib|
146
147
  Rake::TestTask.new(contrib) do |t|
@@ -199,7 +200,6 @@ task :ci do
199
200
  if RUBY_PLATFORM != 'java'
200
201
  # Contrib minitests
201
202
  sh 'bundle exec appraisal contrib-old rake test:monkey'
202
- sh 'bundle exec appraisal contrib-old rake test:sidekiq'
203
203
  sh 'bundle exec appraisal contrib-old rake test:sucker_punch'
204
204
  # Contrib specs
205
205
  sh 'bundle exec appraisal contrib-old rake spec:active_model_serializers'
@@ -214,6 +214,7 @@ task :ci do
214
214
  sh 'bundle exec appraisal contrib-old rake spec:excon'
215
215
  sh 'bundle exec appraisal contrib-old rake spec:faraday'
216
216
  sh 'bundle exec appraisal contrib-old rake spec:http'
217
+ sh 'bundle exec appraisal contrib-old rake spec:httprb'
217
218
  sh 'bundle exec appraisal contrib-old rake spec:mongodb'
218
219
  sh 'bundle exec appraisal contrib-old rake spec:mysql2'
219
220
  sh 'bundle exec appraisal contrib-old rake spec:rack'
@@ -256,7 +257,6 @@ task :ci do
256
257
  if RUBY_PLATFORM != 'java'
257
258
  # Contrib minitests
258
259
  sh 'bundle exec appraisal contrib-old rake test:monkey'
259
- sh 'bundle exec appraisal contrib-old rake test:sidekiq'
260
260
  sh 'bundle exec appraisal contrib-old rake test:sucker_punch'
261
261
  # Contrib specs
262
262
  sh 'bundle exec appraisal contrib-old rake spec:active_model_serializers'
@@ -271,6 +271,7 @@ task :ci do
271
271
  sh 'bundle exec appraisal contrib-old rake spec:excon'
272
272
  sh 'bundle exec appraisal contrib-old rake spec:faraday'
273
273
  sh 'bundle exec appraisal contrib-old rake spec:http'
274
+ sh 'bundle exec appraisal contrib-old rake spec:httprb'
274
275
  sh 'bundle exec appraisal contrib-old rake spec:mongodb'
275
276
  sh 'bundle exec appraisal contrib-old rake spec:mysql2'
276
277
  sh 'bundle exec appraisal contrib-old rake spec:presto'
@@ -320,7 +321,6 @@ task :ci do
320
321
  if RUBY_PLATFORM != 'java'
321
322
  # Contrib minitests
322
323
  sh 'bundle exec appraisal contrib rake test:grape'
323
- sh 'bundle exec appraisal contrib rake test:sidekiq'
324
324
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
325
325
  # Contrib specs
326
326
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -340,6 +340,7 @@ task :ci do
340
340
  sh 'bundle exec appraisal contrib rake spec:graphql'
341
341
  sh 'bundle exec appraisal contrib rake spec:grpc'
342
342
  sh 'bundle exec appraisal contrib rake spec:http'
343
+ sh 'bundle exec appraisal contrib rake spec:httprb'
343
344
  sh 'bundle exec appraisal contrib rake spec:mongodb'
344
345
  sh 'bundle exec appraisal contrib rake spec:mysql2'
345
346
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -395,7 +396,6 @@ task :ci do
395
396
  if RUBY_PLATFORM != 'java'
396
397
  # Contrib minitests
397
398
  sh 'bundle exec appraisal contrib rake test:grape'
398
- sh 'bundle exec appraisal contrib rake test:sidekiq'
399
399
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
400
400
  # Contrib specs
401
401
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -415,6 +415,7 @@ task :ci do
415
415
  sh 'bundle exec appraisal contrib rake spec:graphql'
416
416
  sh 'bundle exec appraisal contrib rake spec:grpc'
417
417
  sh 'bundle exec appraisal contrib rake spec:http'
418
+ sh 'bundle exec appraisal contrib rake spec:httprb'
418
419
  sh 'bundle exec appraisal contrib rake spec:mongodb'
419
420
  sh 'bundle exec appraisal contrib rake spec:mysql2'
420
421
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -475,7 +476,6 @@ task :ci do
475
476
  sh 'bundle exec rake benchmark'
476
477
  # Contrib minitests
477
478
  sh 'bundle exec appraisal contrib rake test:grape'
478
- sh 'bundle exec appraisal contrib rake test:sidekiq'
479
479
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
480
480
  # Contrib specs
481
481
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -495,6 +495,7 @@ task :ci do
495
495
  sh 'bundle exec appraisal contrib rake spec:graphql'
496
496
  sh 'bundle exec appraisal contrib rake spec:grpc'
497
497
  sh 'bundle exec appraisal contrib rake spec:http'
498
+ sh 'bundle exec appraisal contrib rake spec:httprb'
498
499
  sh 'bundle exec appraisal contrib rake spec:mongodb'
499
500
  sh 'bundle exec appraisal contrib rake spec:mysql2'
500
501
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -540,7 +541,6 @@ task :ci do
540
541
  sh 'bundle exec rake benchmark'
541
542
  # Contrib minitests
542
543
  sh 'bundle exec appraisal contrib rake test:grape'
543
- sh 'bundle exec appraisal contrib rake test:sidekiq'
544
544
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
545
545
  # Contrib specs
546
546
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -560,6 +560,7 @@ task :ci do
560
560
  sh 'bundle exec appraisal contrib rake spec:graphql'
561
561
  sh 'bundle exec appraisal contrib rake spec:grpc'
562
562
  sh 'bundle exec appraisal contrib rake spec:http'
563
+ sh 'bundle exec appraisal contrib rake spec:httprb'
563
564
  sh 'bundle exec appraisal contrib rake spec:mongodb'
564
565
  sh 'bundle exec appraisal contrib rake spec:mysql2'
565
566
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -615,7 +616,6 @@ task :ci do
615
616
  sh 'bundle exec rake benchmark'
616
617
  # Contrib minitests
617
618
  sh 'bundle exec appraisal contrib rake test:grape'
618
- sh 'bundle exec appraisal contrib rake test:sidekiq'
619
619
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
620
620
  # Contrib specs
621
621
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -635,6 +635,7 @@ task :ci do
635
635
  sh 'bundle exec appraisal contrib rake spec:graphql'
636
636
  sh 'bundle exec appraisal contrib rake spec:grpc'
637
637
  sh 'bundle exec appraisal contrib rake spec:http'
638
+ sh 'bundle exec appraisal contrib rake spec:httprb'
638
639
  sh 'bundle exec appraisal contrib rake spec:mongodb'
639
640
  sh 'bundle exec appraisal contrib rake spec:mysql2'
640
641
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -689,7 +690,6 @@ task :ci do
689
690
  sh 'bundle exec rake benchmark'
690
691
  # Contrib minitests
691
692
  sh 'bundle exec appraisal contrib rake test:grape'
692
- sh 'bundle exec appraisal contrib rake test:sidekiq'
693
693
  sh 'bundle exec appraisal contrib rake test:sucker_punch'
694
694
  # Contrib specs
695
695
  sh 'bundle exec appraisal contrib rake spec:action_pack'
@@ -709,6 +709,7 @@ task :ci do
709
709
  sh 'bundle exec appraisal contrib rake spec:graphql'
710
710
  sh 'bundle exec appraisal contrib rake spec:grpc'
711
711
  sh 'bundle exec appraisal contrib rake spec:http'
712
+ sh 'bundle exec appraisal contrib rake spec:httprb'
712
713
  sh 'bundle exec appraisal contrib rake spec:mongodb'
713
714
  sh 'bundle exec appraisal contrib rake spec:mysql2'
714
715
  sh 'bundle exec appraisal contrib rake spec:presto'
@@ -281,11 +281,11 @@ services:
281
281
  - bundle-jruby-9.2:/usr/local/bundle
282
282
  - gemfiles-jruby-9.2:/app/gemfiles
283
283
  ddagent:
284
- image: datadog/docker-dd-agent
284
+ image: datadog/agent
285
285
  environment:
286
286
  - DD_APM_ENABLED=true
287
287
  - DD_BIND_HOST=0.0.0.0
288
- - DD_API_KEY=invalid_key_but_this_is_fine
288
+ - DD_API_KEY=00000000000000000000000000000000
289
289
  expose:
290
290
  - "8125/udp"
291
291
  - "8126"
@@ -43,6 +43,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
43
43
  - [Grape](#grape)
44
44
  - [GraphQL](#graphql)
45
45
  - [gRPC](#grpc)
46
+ - [http.rb](#http.rb)
46
47
  - [MongoDB](#mongodb)
47
48
  - [MySQL2](#mysql2)
48
49
  - [Net/HTTP](#net-http)
@@ -344,6 +345,8 @@ For a list of available integrations, and their configuration options, please re
344
345
  | Grape | `grape` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
345
346
  | GraphQL | `graphql` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
346
347
  | gRPC | `grpc` | `>= 1.7` | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
348
+ | http.rb | `httprb` | `>= 2.0` | *[Link](#http.rb)* | *[Link](https://github.com/httprb/http)* |
349
+ | Kafka | `ruby-kafka` | `>= 0.7.10` | *[Link](#kafka)* | |
347
350
  | MongoDB | `mongo` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
348
351
  | MySQL2 | `mysql2` | `>= 0.3.21` | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
349
352
  | Net/HTTP | `http` | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
@@ -929,6 +932,56 @@ alternate_client = Demo::Echo::Service.rpc_stub_class.new(
929
932
 
930
933
  The integration will ensure that the `configured_interceptor` establishes a unique tracing setup for that client instance.
931
934
 
935
+ ### http.rb
936
+
937
+ The http.rb integration will trace any HTTP call using the Http.rb gem.
938
+
939
+ ```ruby
940
+ require 'http'
941
+ require 'ddtrace'
942
+ Datadog.configure do |c|
943
+ c.use :httprb, options
944
+ # optionally, specify a different service name for hostnames matching a regex
945
+ c.use :httprb, describes: /user-[^.]+\.example\.com/ do |httprb|
946
+ httprb.service_name = 'user.example.com'
947
+ httprb.split_by_domain = false # Only necessary if split_by_domain is true by default
948
+ end
949
+ end
950
+ ```
951
+
952
+ Where `options` is an optional `Hash` that accepts the following parameters:
953
+
954
+ | Key | Description | Default |
955
+ | --- | ----------- | ------- |
956
+ | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
957
+ | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
958
+ | `service_name` | Service name for `httprb` instrumentation. | `'httprb'` |
959
+ | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
960
+
961
+ ### Kafka
962
+
963
+ The Kafka integration provides tracing of the `ruby-kafka` gem:
964
+
965
+ You can enable it through `Datadog.configure`:
966
+
967
+ ```ruby
968
+ require 'active_support/notifications' # required to enable 'ruby-kafka' instrumentation
969
+ require 'kafka'
970
+ require 'ddtrace'
971
+
972
+ Datadog.configure do |c|
973
+ c.use :kafka, options
974
+ end
975
+ ```
976
+
977
+ Where `options` is an optional `Hash` that accepts the following parameters:
978
+
979
+ | Key | Description | Default |
980
+ | --- | ----------- | ------- |
981
+ | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
982
+ | `service_name` | Service name used for `kafka` instrumentation | `'kafka'` |
983
+ | `tracer` | `Datadog::Tracer` used to perform instrumentation. Usually you don't need to set this. | `Datadog.tracer` |
984
+
932
985
  ### MongoDB
933
986
 
934
987
  The integration traces any `Command` that is sent from the [MongoDB Ruby Driver](https://github.com/mongodb/mongo-ruby-driver) to a MongoDB cluster. By extension, Object Document Mappers (ODM) such as Mongoid are automatically instrumented if they use the official Ruby driver. To activate the integration, simply:
@@ -1586,6 +1639,7 @@ Available options are:
1586
1639
  - `partial_flush.enabled`: set to `true` to enable partial trace flushing (for long running traces.) Disabled by default. *Experimental.*
1587
1640
  - `port`: set the port the trace agent is listening on.
1588
1641
  - `sampler`: set to a custom `Datadog::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior.
1642
+ - `diagnostics.startup_logs.enabled`: Startup configuration and diagnostic log. Defaults to `true`. Can be configured through the `DD_TRACE_STARTUP_LOGS` environment variable.
1589
1643
 
1590
1644
  #### Custom logging
1591
1645
 
@@ -1798,6 +1852,7 @@ For more details on how to activate distributed tracing for integrations, see th
1798
1852
  - [Rack](#rack)
1799
1853
  - [Rails](#rails)
1800
1854
  - [Sinatra](#sinatra)
1855
+ - [http.rb](#http.rb)
1801
1856
 
1802
1857
  **Using the HTTP propagator**
1803
1858
 
@@ -55,7 +55,9 @@ require 'ddtrace/contrib/grape/integration'
55
55
  require 'ddtrace/contrib/graphql/integration'
56
56
  require 'ddtrace/contrib/grpc/integration'
57
57
  require 'ddtrace/contrib/http/integration'
58
+ require 'ddtrace/contrib/httprb/integration'
58
59
  require 'ddtrace/contrib/integration'
60
+ require 'ddtrace/contrib/kafka/integration'
59
61
  require 'ddtrace/contrib/presto/integration'
60
62
  require 'ddtrace/contrib/mysql2/integration'
61
63
  require 'ddtrace/contrib/mongodb/integration'
@@ -31,6 +31,11 @@ module Datadog
31
31
  end
32
32
  end
33
33
 
34
+ option :api_key do |o|
35
+ o.default { ENV.fetch(Ext::Environment::ENV_API_KEY, nil) }
36
+ o.lazy
37
+ end
38
+
34
39
  settings :diagnostics do
35
40
  option :debug, default: false
36
41
 
@@ -42,6 +47,14 @@ module Datadog
42
47
 
43
48
  option :statsd
44
49
  end
50
+
51
+ settings :startup_logs do
52
+ option :enabled do |o|
53
+ # Defaults to nil as we want to know when the default value is being used
54
+ o.default { env_to_bool(Datadog::Ext::Diagnostics::DD_TRACE_STARTUP_LOGS, nil) }
55
+ o.lazy
56
+ end
57
+ end
45
58
  end
46
59
 
47
60
  settings :distributed_tracing do
@@ -138,6 +151,11 @@ module Datadog
138
151
  o.lazy
139
152
  end
140
153
 
154
+ option :site do |o|
155
+ o.default { ENV.fetch(Ext::Environment::ENV_SITE, nil) }
156
+ o.lazy
157
+ end
158
+
141
159
  option :tags do |o|
142
160
  o.default do
143
161
  tags = {}