ddtrace 0.47.0 → 0.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +4 -2
  3. data/.circleci/images/primary/Dockerfile-2.0.0 +11 -1
  4. data/.circleci/images/primary/Dockerfile-2.1.10 +11 -1
  5. data/.circleci/images/primary/Dockerfile-2.2.10 +11 -1
  6. data/.circleci/images/primary/Dockerfile-2.3.8 +10 -0
  7. data/.circleci/images/primary/Dockerfile-2.4.6 +10 -0
  8. data/.circleci/images/primary/Dockerfile-2.5.6 +10 -0
  9. data/.circleci/images/primary/Dockerfile-2.6.4 +10 -0
  10. data/.circleci/images/primary/Dockerfile-2.7.0 +10 -0
  11. data/.circleci/images/primary/Dockerfile-jruby-9.2-latest +10 -0
  12. data/.gitlab-ci.yml +18 -18
  13. data/.rubocop.yml +19 -0
  14. data/.rubocop_todo.yml +44 -3
  15. data/Appraisals +55 -1
  16. data/CHANGELOG.md +47 -1
  17. data/Gemfile +10 -0
  18. data/Rakefile +9 -0
  19. data/bin/ddtracerb +15 -0
  20. data/ddtrace.gemspec +4 -2
  21. data/docs/GettingStarted.md +36 -53
  22. data/docs/ProfilingDevelopment.md +88 -0
  23. data/integration/README.md +1 -2
  24. data/integration/apps/rack/Dockerfile +3 -0
  25. data/integration/apps/rack/script/build-images +1 -1
  26. data/integration/apps/rack/script/ci +1 -1
  27. data/integration/apps/rails-five/script/build-images +1 -1
  28. data/integration/apps/rails-five/script/ci +1 -1
  29. data/integration/apps/ruby/script/build-images +1 -1
  30. data/integration/apps/ruby/script/ci +1 -1
  31. data/integration/images/include/http-health-check +1 -1
  32. data/integration/images/wrk/scripts/entrypoint.sh +1 -1
  33. data/integration/script/build-images +1 -1
  34. data/lib/ddtrace.rb +1 -0
  35. data/lib/ddtrace/configuration.rb +39 -13
  36. data/lib/ddtrace/configuration/components.rb +85 -3
  37. data/lib/ddtrace/configuration/settings.rb +31 -0
  38. data/lib/ddtrace/contrib/active_record/configuration/makara_resolver.rb +30 -0
  39. data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +9 -3
  40. data/lib/ddtrace/contrib/resque/configuration/settings.rb +17 -1
  41. data/lib/ddtrace/contrib/resque/patcher.rb +4 -4
  42. data/lib/ddtrace/contrib/resque/resque_job.rb +22 -1
  43. data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +1 -0
  44. data/lib/ddtrace/contrib/shoryuken/tracer.rb +7 -3
  45. data/lib/ddtrace/diagnostics/environment_logger.rb +1 -1
  46. data/lib/ddtrace/error.rb +2 -0
  47. data/lib/ddtrace/ext/profiling.rb +52 -0
  48. data/lib/ddtrace/ext/transport.rb +1 -0
  49. data/lib/ddtrace/metrics.rb +4 -0
  50. data/lib/ddtrace/profiling.rb +54 -0
  51. data/lib/ddtrace/profiling/backtrace_location.rb +32 -0
  52. data/lib/ddtrace/profiling/buffer.rb +41 -0
  53. data/lib/ddtrace/profiling/collectors/stack.rb +253 -0
  54. data/lib/ddtrace/profiling/encoding/profile.rb +31 -0
  55. data/lib/ddtrace/profiling/event.rb +13 -0
  56. data/lib/ddtrace/profiling/events/stack.rb +102 -0
  57. data/lib/ddtrace/profiling/exporter.rb +23 -0
  58. data/lib/ddtrace/profiling/ext/cpu.rb +54 -0
  59. data/lib/ddtrace/profiling/ext/cthread.rb +134 -0
  60. data/lib/ddtrace/profiling/ext/forking.rb +97 -0
  61. data/lib/ddtrace/profiling/flush.rb +41 -0
  62. data/lib/ddtrace/profiling/pprof/builder.rb +121 -0
  63. data/lib/ddtrace/profiling/pprof/converter.rb +85 -0
  64. data/lib/ddtrace/profiling/pprof/message_set.rb +12 -0
  65. data/lib/ddtrace/profiling/pprof/payload.rb +18 -0
  66. data/lib/ddtrace/profiling/pprof/pprof.proto +212 -0
  67. data/lib/ddtrace/profiling/pprof/pprof_pb.rb +81 -0
  68. data/lib/ddtrace/profiling/pprof/stack_sample.rb +90 -0
  69. data/lib/ddtrace/profiling/pprof/string_table.rb +10 -0
  70. data/lib/ddtrace/profiling/pprof/template.rb +114 -0
  71. data/lib/ddtrace/profiling/preload.rb +3 -0
  72. data/lib/ddtrace/profiling/profiler.rb +28 -0
  73. data/lib/ddtrace/profiling/recorder.rb +87 -0
  74. data/lib/ddtrace/profiling/scheduler.rb +84 -0
  75. data/lib/ddtrace/profiling/tasks/setup.rb +77 -0
  76. data/lib/ddtrace/profiling/transport/client.rb +12 -0
  77. data/lib/ddtrace/profiling/transport/http.rb +122 -0
  78. data/lib/ddtrace/profiling/transport/http/api.rb +43 -0
  79. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +90 -0
  80. data/lib/ddtrace/profiling/transport/http/api/instance.rb +36 -0
  81. data/lib/ddtrace/profiling/transport/http/api/spec.rb +40 -0
  82. data/lib/ddtrace/profiling/transport/http/builder.rb +28 -0
  83. data/lib/ddtrace/profiling/transport/http/client.rb +33 -0
  84. data/lib/ddtrace/profiling/transport/http/response.rb +21 -0
  85. data/lib/ddtrace/profiling/transport/io.rb +30 -0
  86. data/lib/ddtrace/profiling/transport/io/client.rb +27 -0
  87. data/lib/ddtrace/profiling/transport/io/response.rb +16 -0
  88. data/lib/ddtrace/profiling/transport/parcel.rb +17 -0
  89. data/lib/ddtrace/profiling/transport/request.rb +15 -0
  90. data/lib/ddtrace/profiling/transport/response.rb +8 -0
  91. data/lib/ddtrace/runtime/container.rb +11 -3
  92. data/lib/ddtrace/sampling/rule_sampler.rb +3 -9
  93. data/lib/ddtrace/tasks/exec.rb +48 -0
  94. data/lib/ddtrace/tasks/help.rb +14 -0
  95. data/lib/ddtrace/tracer.rb +21 -0
  96. data/lib/ddtrace/transport/io/client.rb +15 -8
  97. data/lib/ddtrace/transport/parcel.rb +4 -0
  98. data/lib/ddtrace/version.rb +3 -1
  99. data/lib/ddtrace/workers/runtime_metrics.rb +14 -1
  100. metadata +70 -9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.48.0] - 2021-04-19
6
+
7
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.48.0
8
+
9
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.47.0...v0.48.0
10
+
11
+ ### Added
12
+
13
+ - Makara support with ActiveRecord ([#1447][])
14
+ - `tag_body` configuration for Shoryuken ([#1449][]) ([@gkampjes][])
15
+
16
+ ### Changed
17
+
18
+ - Add deprecation warning for Ruby 2.0 support ([#1441][])
19
+
20
+ Support for Ruby 2.0 will be available up to release `0.49.x`, and dropped from release `0.50.0` and greater.
21
+ Users are welcome to continue using version `< 0.50.0` for their Ruby 2.0 deployments going forward.
22
+
23
+ - Auto instrument Resque workers by default ([#1400][])
24
+
25
+ ### Fixed
26
+
27
+ - Ensure DD_TRACE_SAMPLE_RATE enables full RuleSampler ([#1416][])
28
+ - Fix Fargate 1.4 container ID not being read ([#1457][])
29
+ - Correctly close all StatsD clients ([#1429][])
30
+
31
+ ### Refactored
32
+ - Improvements to test suite & CI ([#1421][], [#1435][], [#1445][], [#1453][], [#1456][], [#1461][])
33
+ - Improvements to documentation ([#1455][])
34
+
5
35
  ## [0.47.0] - 2021-03-29
6
36
 
7
37
  Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.47.0
@@ -1632,7 +1662,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
1632
1662
 
1633
1663
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
1634
1664
 
1635
- [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.47.0...master
1665
+ [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.48.0...master
1666
+ [0.48.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.47.0...v0.48.0
1636
1667
  [0.47.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.46.0...v0.47.0
1637
1668
  [0.46.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.45.0...v0.46.0
1638
1669
  [0.45.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.44.0...v0.45.0
@@ -2280,6 +2311,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2280
2311
  [#1396]: https://github.com/DataDog/dd-trace-rb/issues/1396
2281
2312
  [#1398]: https://github.com/DataDog/dd-trace-rb/issues/1398
2282
2313
  [#1399]: https://github.com/DataDog/dd-trace-rb/issues/1399
2314
+ [#1400]: https://github.com/DataDog/dd-trace-rb/issues/1400
2283
2315
  [#1403]: https://github.com/DataDog/dd-trace-rb/issues/1403
2284
2316
  [#1406]: https://github.com/DataDog/dd-trace-rb/issues/1406
2285
2317
  [#1408]: https://github.com/DataDog/dd-trace-rb/issues/1408
@@ -2287,17 +2319,30 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2287
2319
  [#1412]: https://github.com/DataDog/dd-trace-rb/issues/1412
2288
2320
  [#1414]: https://github.com/DataDog/dd-trace-rb/issues/1414
2289
2321
  [#1415]: https://github.com/DataDog/dd-trace-rb/issues/1415
2322
+ [#1416]: https://github.com/DataDog/dd-trace-rb/issues/1416
2290
2323
  [#1417]: https://github.com/DataDog/dd-trace-rb/issues/1417
2291
2324
  [#1418]: https://github.com/DataDog/dd-trace-rb/issues/1418
2292
2325
  [#1419]: https://github.com/DataDog/dd-trace-rb/issues/1419
2293
2326
  [#1420]: https://github.com/DataDog/dd-trace-rb/issues/1420
2327
+ [#1421]: https://github.com/DataDog/dd-trace-rb/issues/1421
2294
2328
  [#1422]: https://github.com/DataDog/dd-trace-rb/issues/1422
2295
2329
  [#1426]: https://github.com/DataDog/dd-trace-rb/issues/1426
2296
2330
  [#1427]: https://github.com/DataDog/dd-trace-rb/issues/1427
2297
2331
  [#1428]: https://github.com/DataDog/dd-trace-rb/issues/1428
2332
+ [#1429]: https://github.com/DataDog/dd-trace-rb/issues/1429
2298
2333
  [#1430]: https://github.com/DataDog/dd-trace-rb/issues/1430
2299
2334
  [#1431]: https://github.com/DataDog/dd-trace-rb/issues/1431
2300
2335
  [#1432]: https://github.com/DataDog/dd-trace-rb/issues/1432
2336
+ [#1435]: https://github.com/DataDog/dd-trace-rb/issues/1435
2337
+ [#1441]: https://github.com/DataDog/dd-trace-rb/issues/1441
2338
+ [#1445]: https://github.com/DataDog/dd-trace-rb/issues/1445
2339
+ [#1447]: https://github.com/DataDog/dd-trace-rb/issues/1447
2340
+ [#1449]: https://github.com/DataDog/dd-trace-rb/issues/1449
2341
+ [#1453]: https://github.com/DataDog/dd-trace-rb/issues/1453
2342
+ [#1455]: https://github.com/DataDog/dd-trace-rb/issues/1455
2343
+ [#1456]: https://github.com/DataDog/dd-trace-rb/issues/1456
2344
+ [#1457]: https://github.com/DataDog/dd-trace-rb/issues/1457
2345
+ [#1461]: https://github.com/DataDog/dd-trace-rb/issues/1461
2301
2346
  [@AdrianLC]: https://github.com/AdrianLC
2302
2347
  [@Azure7111]: https://github.com/Azure7111
2303
2348
  [@BabyGroot]: https://github.com/BabyGroot
@@ -2352,6 +2397,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2352
2397
  [@gaborszakacs]: https://github.com/gaborszakacs
2353
2398
  [@giancarlocosta]: https://github.com/giancarlocosta
2354
2399
  [@gingerlime]: https://github.com/gingerlime
2400
+ [@gkampjes]: https://github.com/gkampjes
2355
2401
  [@gottfrois]: https://github.com/gottfrois
2356
2402
  [@guizmaii]: https://github.com/guizmaii
2357
2403
  [@hawknewton]: https://github.com/hawknewton
data/Gemfile CHANGED
@@ -44,6 +44,9 @@ else
44
44
  end
45
45
  gem 'warning', '~> 1' if RUBY_VERSION >= '2.5.0'
46
46
  gem 'webmock', '>= 3.10.0'
47
+ if RUBY_VERSION < '2.3.0'
48
+ gem 'rexml', '< 3.2.5' # Pinned due to https://github.com/ruby/rexml/issues/69
49
+ end
47
50
  gem 'webrick', '>= 1.7.0' if RUBY_VERSION >= '3.0.0' # No longer bundled by default since Ruby 3.0
48
51
  gem 'yard', '~> 0.9'
49
52
 
@@ -57,3 +60,10 @@ end
57
60
  # TODO: Move this to Appraisals?
58
61
  gem 'dogstatsd-ruby', '>= 3.3.0'
59
62
  gem 'opentracing', '>= 0.4.1'
63
+
64
+ # Profiler optional dependencies
65
+ # NOTE: We're excluding versions 3.7.0 and 3.7.1 for the reasons documented in #1424 and the big comment in
66
+ # lib/ddtrace/profiling.rb: it breaks for some older rubies in CI without BUNDLE_FORCE_RUBY_PLATFORM=true.
67
+ # Since most of our customers won't have BUNDLE_FORCE_RUBY_PLATFORM=true, it's not something we want to add
68
+ # to our CI, so we just shortcut and exclude specific versions that were affecting our CI.
69
+ gem 'google-protobuf', ['~> 3.0', '!= 3.7.0', '!= 3.7.1'] if RUBY_PLATFORM != 'java'
data/Rakefile CHANGED
@@ -209,6 +209,7 @@ task :ci do
209
209
  # Main library
210
210
  declare 'bundle exec rake test:main'
211
211
  declare 'bundle exec rake spec:main'
212
+ declare 'bundle exec appraisal core-old rake spec:main'
212
213
  declare 'bundle exec rake spec:contrib'
213
214
 
214
215
  if RUBY_PLATFORM != 'java'
@@ -265,6 +266,7 @@ task :ci do
265
266
  # Main library
266
267
  declare 'bundle exec rake test:main'
267
268
  declare 'bundle exec rake spec:main'
269
+ declare 'bundle exec appraisal core-old rake spec:main'
268
270
  declare 'bundle exec rake spec:contrib'
269
271
  declare 'bundle exec rake spec:opentracer'
270
272
 
@@ -331,6 +333,7 @@ task :ci do
331
333
  # Main library
332
334
  declare 'bundle exec rake test:main'
333
335
  declare 'bundle exec rake spec:main'
336
+ declare 'bundle exec appraisal core-old rake spec:main'
334
337
  declare 'bundle exec rake spec:contrib'
335
338
  declare 'bundle exec rake spec:opentracer'
336
339
 
@@ -413,6 +416,7 @@ task :ci do
413
416
  # Main library
414
417
  declare 'bundle exec rake test:main'
415
418
  declare 'bundle exec rake spec:main'
419
+ declare 'bundle exec appraisal core-old rake spec:main'
416
420
  declare 'bundle exec rake spec:contrib'
417
421
  declare 'bundle exec rake spec:opentracer'
418
422
 
@@ -500,6 +504,7 @@ task :ci do
500
504
  # Main library
501
505
  declare 'bundle exec rake test:main'
502
506
  declare 'bundle exec rake spec:main'
507
+ declare 'bundle exec appraisal core-old rake spec:main'
503
508
  declare 'bundle exec rake spec:contrib'
504
509
  declare 'bundle exec rake spec:opentracer'
505
510
  declare 'bundle exec rake spec:opentelemetry'
@@ -574,6 +579,7 @@ task :ci do
574
579
  # Main library
575
580
  declare 'bundle exec rake test:main'
576
581
  declare 'bundle exec rake spec:main'
582
+ declare 'bundle exec appraisal core-old rake spec:main'
577
583
  declare 'bundle exec rake spec:contrib'
578
584
  declare 'bundle exec rake spec:opentracer'
579
585
  declare 'bundle exec rake spec:opentelemetry'
@@ -667,6 +673,7 @@ task :ci do
667
673
  # Main library
668
674
  declare 'bundle exec rake test:main'
669
675
  declare 'bundle exec rake spec:main'
676
+ declare 'bundle exec appraisal core-old rake spec:main'
670
677
  declare 'bundle exec rake spec:contrib'
671
678
  declare 'bundle exec rake spec:opentracer'
672
679
  declare 'bundle exec rake spec:opentelemetry'
@@ -764,6 +771,7 @@ task :ci do
764
771
  # Main library
765
772
  declare 'bundle exec rake test:main'
766
773
  declare 'bundle exec rake spec:main'
774
+ declare 'bundle exec appraisal core-old rake spec:main'
767
775
  declare 'bundle exec rake spec:contrib'
768
776
  declare 'bundle exec rake spec:opentracer'
769
777
  declare 'bundle exec rake spec:opentelemetry'
@@ -859,6 +867,7 @@ task :ci do
859
867
  # Main library
860
868
  declare 'bundle exec rake test:main'
861
869
  declare 'bundle exec rake spec:main'
870
+ declare 'bundle exec appraisal core-old rake spec:main'
862
871
  declare 'bundle exec rake spec:contrib'
863
872
  declare 'bundle exec rake spec:opentracer'
864
873
  declare 'bundle exec rake spec:opentelemetry'
data/bin/ddtracerb ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ require 'ddtrace/tasks/exec'
3
+ require 'ddtrace/tasks/help'
4
+
5
+ command = ARGV.shift
6
+
7
+ case command
8
+ when 'exec'
9
+ Datadog::Tasks::Exec.new(ARGV).run
10
+ when 'help', '--help'
11
+ Datadog::Tasks::Help.new.run
12
+ else
13
+ puts "Command '#{command}' is not valid for ddtrace."
14
+ Datadog::Tasks::Help.new.run
15
+ end
data/ddtrace.gemspec CHANGED
@@ -29,8 +29,7 @@ Gem::Specification.new do |spec|
29
29
  end
30
30
 
31
31
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
- spec.bindir = 'exe'
33
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.executables = ['ddtracerb']
34
33
  spec.require_paths = ['lib']
35
34
 
36
35
  if RUBY_VERSION >= '2.2.0'
@@ -39,4 +38,7 @@ Gem::Specification.new do |spec|
39
38
  # msgpack 1.4 fails for Ruby 2.0 and 2.1: https://github.com/msgpack/msgpack-ruby/issues/205
40
39
  spec.add_dependency 'msgpack', '< 1.4'
41
40
  end
41
+
42
+ # Used by the profiler
43
+ spec.add_dependency 'ffi', '~> 1.0'
42
44
  end
@@ -71,7 +71,9 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
71
71
  - [Tracer settings](#tracer-settings)
72
72
  - [Custom logging](#custom-logging)
73
73
  - [Environment and tags](#environment-and-tags)
74
+ - [Environment variables](#environment-variables)
74
75
  - [Sampling](#sampling)
76
+ - [Application-side sampling](#application-side-sampling)
75
77
  - [Priority sampling](#priority-sampling)
76
78
  - [Distributed tracing](#distributed-tracing)
77
79
  - [HTTP request queuing](#http-request-queuing)
@@ -98,7 +100,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
98
100
  | | | 2.3 | Full | Latest |
99
101
  | | | 2.2 | Full | Latest |
100
102
  | | | 2.1 | Full | Latest |
101
- | | | 2.0 | Full | Latest |
103
+ | | | 2.0 | Deprecated | < 0.50.0 |
102
104
  | | | 1.9.3 | EOL since August 6th, 2020 | < 0.27.0 |
103
105
  | | | 1.9.1 | EOL since August 6th, 2020 | < 0.27.0 |
104
106
  | JRuby | https://www.jruby.org | 9.2 | Full | Latest |
@@ -401,6 +403,7 @@ For a list of available integrations, and their configuration options, please re
401
403
  | httpclient | `httpclient` | `>= 2.2` | `>= 2.2` | *[Link](#httpclient)* | *[Link](https://github.com/nahi/httpclient)* |
402
404
  | httpx | `httpx` | `>= 0.11` | `>= 0.11` | *[Link](#httpx)* | *[Link](https://gitlab.com/honeyryderchuck/httpx)* |
403
405
  | Kafka | `ruby-kafka` | `>= 0.7.10` | `>= 0.7.10` | *[Link](#kafka)* | *[Link](https://github.com/zendesk/ruby-kafka)* |
406
+ | Makara (through Active Record) | `makara` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#active-record)* | *[Link](https://github.com/instacart/makara)* |
404
407
  | MongoDB | `mongo` | `>= 2.1` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
405
408
  | MySQL2 | `mysql2` | `>= 0.3.21` | *gem not available* | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
406
409
  | Net/HTTP | `http` | *(Any supported Ruby)* | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
@@ -440,7 +443,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
440
443
 
441
444
  | Key | Description | Default |
442
445
  | --- | ----------- | ------- |
443
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
444
446
  | `service_name` | Service name used for `action_cable` instrumentation | `'action_cable'` |
445
447
 
446
448
  ### Action View
@@ -460,7 +462,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
460
462
 
461
463
  | Key | Description | Default |
462
464
  | ---| --- | --- |
463
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
464
465
  | `service_name` | Service name used for rendering instrumentation. | `action_view` |
465
466
  | `template_base_path` | Used when the template name is parsed. If you don't store your templates in the `views/` folder, you may need to change this value | `'views/'` |
466
467
 
@@ -482,7 +483,6 @@ ActiveModelSerializers::SerializableResource.new(test_obj).serializable_hash
482
483
 
483
484
  | Key | Description | Default |
484
485
  | --- | ----------- | ------- |
485
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
486
486
  | `service_name` | Service name used for `active_model_serializers` instrumentation. | `'active_model_serializers'` |
487
487
 
488
488
  ### Action Pack
@@ -502,7 +502,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
502
502
 
503
503
  | Key | Description | Default |
504
504
  | ---| --- | --- |
505
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
506
505
  | `service_name` | Service name used for rendering instrumentation. | `action_pack` |
507
506
 
508
507
  ### Active Record
@@ -530,7 +529,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
530
529
 
531
530
  | Key | Description | Default |
532
531
  | ---| --- | --- |
533
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
534
532
  | `orm_service_name` | Service name used for the mapping portion of query results to ActiveRecord objects. Inherits service name from parent by default. | _parent.service_name_ (e.g. `'mysql2'`) |
535
533
  | `service_name` | Service name used for database portion of `active_record` instrumentation. | Name of database adapter (e.g. `'mysql2'`) |
536
534
 
@@ -570,6 +568,10 @@ Datadog.configure do |c|
570
568
  username: 'root'
571
569
  },
572
570
  service_name: 'secondary-db'
571
+
572
+ # If using the `makara` gem, it's possible to match on connection `role`:
573
+ c.use :active_record, describes: { makara_role: 'primary' }, service_name: 'primary-db'
574
+ c.use :active_record, describes: { makara_role: 'replica' }, service_name: 'secondary-db'
573
575
  end
574
576
  ```
575
577
 
@@ -616,7 +618,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
616
618
 
617
619
  | Key | Description | Default |
618
620
  | ---| --- | --- |
619
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
620
621
  | `cache_service` | Service name used for caching with `active_support` instrumentation. | `active_support-cache` |
621
622
 
622
623
  ### AWS
@@ -639,7 +640,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
639
640
 
640
641
  | Key | Description | Default |
641
642
  | --- | ----------- | ------- |
642
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
643
643
  | `service_name` | Service name used for `aws` instrumentation | `'aws'` |
644
644
 
645
645
  ### Concurrent Ruby
@@ -725,7 +725,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
725
725
 
726
726
  | Key | Description | Default |
727
727
  | --- | ----------- | ------- |
728
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
729
728
  | `service_name` | Service name used for `dalli` instrumentation | `'memcached'` |
730
729
 
731
730
  ### DelayedJob
@@ -746,7 +745,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
746
745
 
747
746
  | Key | Description | Default |
748
747
  | --- | ----------- | ------- |
749
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
750
748
  | `service_name` | Service name used for `DelayedJob` instrumentation | `'delayed_job'` |
751
749
  | `client_service_name` | Service name used for client-side `DelayedJob` instrumentation | `'delayed_job-client'` |
752
750
  | `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? }` |
@@ -772,7 +770,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
772
770
 
773
771
  | Key | Description | Default |
774
772
  | --- | ----------- | ------- |
775
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
776
773
  | `quantize` | Hash containing options for quantization. May include `:show` with an Array of keys to not quantize (or `:all` to skip quantization), or `:exclude` with Array of keys to exclude entirely. | `{}` |
777
774
  | `service_name` | Service name used for `elasticsearch` instrumentation | `'elasticsearch'` |
778
775
 
@@ -798,7 +795,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
798
795
 
799
796
  | Key | Description | Default |
800
797
  | --- | ----------- | ------- |
801
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
802
798
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
803
799
  | `service_name` | Service name for `ethon` instrumentation. | `'ethon'` |
804
800
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -830,7 +826,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
830
826
 
831
827
  | Key | Description | Default |
832
828
  | --- | ----------- | ------- |
833
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
834
829
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
835
830
  | `error_handler` | A `Proc` that accepts a `response` parameter. If it evaluates to a *truthy* value, the trace span is marked as an error. By default only sets 5XX responses as errors. | `nil` |
836
831
  | `service_name` | Service name for Excon instrumentation. When provided to middleware for a specific connection, it applies only to that connection object. | `'excon'` |
@@ -893,7 +888,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
893
888
 
894
889
  | Key | Description | Default |
895
890
  | --- | ----------- | ------- |
896
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
897
891
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
898
892
  | `error_handler` | A `Proc` that accepts a `response` parameter. If it evaluates to a *truthy* value, the trace span is marked as an error. By default only sets 5XX responses as errors. | `nil` |
899
893
  | `service_name` | Service name for Faraday instrumentation. When provided to middleware for a specific connection, it applies only to that connection object. | `'faraday'` |
@@ -927,7 +921,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
927
921
 
928
922
  | Key | Description | Default |
929
923
  | --- | ----------- | ------- |
930
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
931
924
  | `enabled` | Defines whether Grape should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
932
925
  | `service_name` | Service name used for `grape` instrumentation | `'grape'` |
933
926
  | `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` |
@@ -952,7 +945,6 @@ The `use :graphql` method accepts the following parameters. Additional options c
952
945
 
953
946
  | Key | Description | Default |
954
947
  | --- | ----------- | ------- |
955
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
956
948
  | `service_name` | Service name used for `graphql` instrumentation | `'ruby-graphql'` |
957
949
  | `schemas` | Required. Array of `GraphQL::Schema` objects which to trace. Tracing will be added to all the schemas listed, using the options provided to this configuration. If you do not provide any, then tracing will not be activated. | `[]` |
958
950
 
@@ -1031,7 +1023,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1031
1023
 
1032
1024
  | Key | Description | Default |
1033
1025
  | --- | ----------- | ------- |
1034
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1035
1026
  | `service_name` | Service name used for `grpc` instrumentation | `'grpc'` |
1036
1027
 
1037
1028
  **Configuring clients to use different settings**
@@ -1073,7 +1064,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1073
1064
 
1074
1065
  | Key | Description | Default |
1075
1066
  | --- | ----------- | ------- |
1076
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1077
1067
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1078
1068
  | `service_name` | Service name for `httprb` instrumentation. | `'httprb'` |
1079
1069
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -1099,7 +1089,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1099
1089
 
1100
1090
  | Key | Description | Default |
1101
1091
  | --- | ----------- | ------- |
1102
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1103
1092
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1104
1093
  | `service_name` | Service name for `httpclient` instrumentation. | `'httpclient'` |
1105
1094
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -1143,7 +1132,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1143
1132
 
1144
1133
  | Key | Description | Default |
1145
1134
  | --- | ----------- | ------- |
1146
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1147
1135
  | `service_name` | Service name used for `kafka` instrumentation | `'kafka'` |
1148
1136
  | `tracer` | `Datadog::Tracer` used to perform instrumentation. Usually you don't need to set this. | `Datadog.tracer` |
1149
1137
 
@@ -1172,7 +1160,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1172
1160
 
1173
1161
  | Key | Description | Default |
1174
1162
  | --- | ----------- | ------- |
1175
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1176
1163
  | `quantize` | Hash containing options for quantization. May include `:show` with an Array of keys to not quantize (or `:all` to skip quantization), or `:exclude` with Array of keys to exclude entirely. | `{ show: [:collection, :database, :operation] }` |
1177
1164
  | `service_name` | Service name used for `mongo` instrumentation | `'mongodb'` |
1178
1165
 
@@ -1196,7 +1183,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1196
1183
 
1197
1184
  | Key | Description | Default |
1198
1185
  | --- | ----------- | ------- |
1199
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1200
1186
  | `service_name` | Service name used for `mysql2` instrumentation | `'mysql2'` |
1201
1187
 
1202
1188
  ### Net/HTTP
@@ -1229,7 +1215,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1229
1215
 
1230
1216
  | Key | Description | Default |
1231
1217
  | --- | ----------- | ------- |
1232
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1233
1218
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1234
1219
  | `service_name` | Service name used for `http` instrumentation | `'net/http'` |
1235
1220
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -1270,7 +1255,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1270
1255
 
1271
1256
  | Key | Description | Default |
1272
1257
  | --- | ----------- | ------- |
1273
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1274
1258
  | `service_name` | Service name used for `presto` instrumentation | `'presto'` |
1275
1259
 
1276
1260
  ### Qless
@@ -1291,7 +1275,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1291
1275
 
1292
1276
  | Key | Description | Default |
1293
1277
  | --- | ----------- | ------- |
1294
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
1295
1278
  | `service_name` | Service name used for `qless` instrumentation | `'qless'` |
1296
1279
  | `tag_job_data` | Enable tagging with job arguments. true for on, false for off. | `false` |
1297
1280
  | `tag_job_tags` | Enable tagging with job tags. true for on, false for off. | `false` |
@@ -1314,7 +1297,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1314
1297
 
1315
1298
  | Key | Description | Default |
1316
1299
  | --- | ----------- | ------- |
1317
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1318
1300
  | `enabled` | Defines whether Que should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1319
1301
  | `service_name` | Service name used for `que` instrumentation | `'que'` |
1320
1302
  | `tag_args` | Enable tagging of a job's args field. `true` for on, `false` for off. | `false` |
@@ -1339,7 +1321,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1339
1321
 
1340
1322
  | Key | Description | Default |
1341
1323
  | --- | ----------- | ------- |
1342
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1343
1324
  | `service_name` | Service name used for `racecar` instrumentation | `'racecar'` |
1344
1325
 
1345
1326
  ### Rack
@@ -1369,7 +1350,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1369
1350
 
1370
1351
  | Key | Description | Default |
1371
1352
  | --- | ----------- | ------- |
1372
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
1373
1353
  | `application` | Your Rack application. Required for `middleware_names`. | `nil` |
1374
1354
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` |
1375
1355
  | `headers` | Hash of HTTP request or response headers to add as tags to the `rack.request`. Accepts `request` and `response` keys with Array values e.g. `['Last-Modified']`. Adds `http.request.headers.*` and `http.response.headers.*` tags respectively. | `{ response: ['Content-Type', 'X-Request-ID'] }` |
@@ -1432,7 +1412,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1432
1412
 
1433
1413
  | Key | Description | Default |
1434
1414
  | --- | ----------- | ------- |
1435
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `nil` |
1436
1415
  | `cache_service` | Cache service name used when tracing cache activity | `'<app_name>-cache'` |
1437
1416
  | `controller_service` | Service name used when tracing a Rails action controller | `'<app_name>'` |
1438
1417
  | `database_service` | Database service name used when tracing database activity | `'<app_name>-<adapter_name>'` |
@@ -1482,7 +1461,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1482
1461
 
1483
1462
  | Key | Description | Default |
1484
1463
  | --- | ----------- | ------- |
1485
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
1486
1464
  | `enabled` | Defines whether Rake tasks should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1487
1465
  | `quantize` | Hash containing options for quantization of task arguments. See below for more details and examples. | `{}` |
1488
1466
  | `service_name` | Service name used for `rake` instrumentation | `'rake'` |
@@ -1542,7 +1520,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1542
1520
 
1543
1521
  | Key | Description | Default |
1544
1522
  | --- | ----------- | ------- |
1545
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1546
1523
  | `service_name` | Service name used for `redis` instrumentation | `'redis'` |
1547
1524
  | `command_args` | Show the command arguments (e.g. `key` in `GET key`) as resource name and tag | true |
1548
1525
 
@@ -1609,16 +1586,11 @@ The Resque integration uses Resque hooks that wraps the `perform` method.
1609
1586
  To add tracing to a Resque job:
1610
1587
 
1611
1588
  ```ruby
1589
+ require 'resque'
1612
1590
  require 'ddtrace'
1613
1591
 
1614
- class MyJob
1615
- def self.perform(*args)
1616
- # do_something
1617
- end
1618
- end
1619
-
1620
1592
  Datadog.configure do |c|
1621
- c.use :resque, options
1593
+ c.use :resque, **options
1622
1594
  end
1623
1595
  ```
1624
1596
 
@@ -1626,10 +1598,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1626
1598
 
1627
1599
  | Key | Description | Default |
1628
1600
  | --- | ----------- | ------- |
1629
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
1630
1601
  | `service_name` | Service name used for `resque` instrumentation | `'resque'` |
1631
- | `workers` | An array including all worker classes you want to trace (e.g. `[MyJob]`) | `[]` |
1632
1602
  | `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? }` |
1603
+ | `workers` | **[DEPRECATED]** Limits instrumented worker classes to only the ones specified in an array (e.g. `[MyJob]`). If not provided, instruments all workers. | `nil` |
1633
1604
 
1634
1605
  ### Rest Client
1635
1606
 
@@ -1648,7 +1619,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1648
1619
 
1649
1620
  | Key | Description | Default |
1650
1621
  | --- | ----------- | ------- |
1651
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1652
1622
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1653
1623
  | `service_name` | Service name for `rest_client` instrumentation. | `'rest_client'` |
1654
1624
 
@@ -1706,7 +1676,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1706
1676
 
1707
1677
  | Key | Description | Default |
1708
1678
  | --- | ----------- | ------- |
1709
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1710
1679
  | `service_name` | Service name for `sequel` instrumentation | Name of database adapter (e.g. `'mysql2'`) |
1711
1680
 
1712
1681
  Only Ruby 2.0+ is supported.
@@ -1742,8 +1711,8 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1742
1711
 
1743
1712
  | Key | Description | Default |
1744
1713
  | --- | ----------- | ------- |
1745
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1746
1714
  | `service_name` | Service name used for `shoryuken` instrumentation | `'shoryuken'` |
1715
+ | `tag_body` | Tag spans with the SQS message body `true` or `false` | `false` |
1747
1716
  | `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? }` |
1748
1717
 
1749
1718
  ### Sidekiq
@@ -1764,7 +1733,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1764
1733
 
1765
1734
  | Key | Description | Default |
1766
1735
  | --- | ----------- | ------- |
1767
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1768
1736
  | `client_service_name` | Service name used for client-side `sidekiq` instrumentation | `'sidekiq-client'` |
1769
1737
  | `service_name` | Service name used for server-side `sidekiq` instrumentation | `'sidekiq'` |
1770
1738
  | `tag_args` | Enable tagging of job arguments. `true` for on, `false` for off. | `false` |
@@ -1828,7 +1796,6 @@ Ensure you register `Datadog::Contrib::Sinatra::Tracer` as a middleware before y
1828
1796
 
1829
1797
  | Key | Description | Default |
1830
1798
  | --- | ----------- | ------- |
1831
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
1832
1799
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` |
1833
1800
  | `headers` | Hash of HTTP request or response headers to add as tags to the `sinatra.request`. Accepts `request` and `response` keys with Array values e.g. `['Last-Modified']`. Adds `http.request.headers.*` and `http.response.headers.*` tags respectively. | `{ response: ['Content-Type', 'X-Request-ID'] }` |
1834
1801
  | `resource_script_names` | Prepend resource names with script name | `false` |
@@ -1852,7 +1819,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1852
1819
 
1853
1820
  | Key | Description | Default |
1854
1821
  | --- | ----------- | ------- |
1855
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1856
1822
  | `enabled` | Defines whether Sneakers should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1857
1823
  | `service_name` | Service name used for `sneakers` instrumentation | `'sneakers'` |
1858
1824
  | `tag_body` | Enable tagging of job message. `true` for on, `false` for off. | `false` |
@@ -1877,7 +1843,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1877
1843
 
1878
1844
  | Key | Description | Default |
1879
1845
  | --- | ----------- | ------- |
1880
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1881
1846
  | `service_name` | Service name used for `sucker_punch` instrumentation | `'sucker_punch'` |
1882
1847
 
1883
1848
  ## Advanced configuration
@@ -1893,13 +1858,20 @@ Datadog.configure do |c|
1893
1858
  c.tracer.enabled = true
1894
1859
  c.tracer.hostname = 'my-agent'
1895
1860
  c.tracer.port = 8126
1896
- c.tracer.partial_flush.enabled = false
1861
+
1862
+ # Ensure all traces are ingested by Datadog
1863
+ c.sampling.default_rate = 1.0 # Recommended
1864
+ c.sampling.rate_limit = 200
1865
+ # or provide a custom implementation (overrides c.sampling settings)
1897
1866
  c.tracer.sampler = Datadog::AllSampler.new
1898
1867
 
1899
- # OR for advanced use cases, you can specify your own tracer:
1868
+ # Breaks down very large traces into smaller batches
1869
+ c.tracer.partial_flush.enabled = false
1870
+
1871
+ # You can specify your own tracer
1900
1872
  c.tracer.instance = Datadog::Tracer.new
1901
1873
 
1902
- # To enable debug mode:
1874
+ # To enable debug mode
1903
1875
  c.diagnostics.debug = true
1904
1876
  end
1905
1877
  ```
@@ -1911,6 +1883,8 @@ Available options are:
1911
1883
  - `instance`: set to a custom `Datadog::Tracer` instance. If provided, other trace settings are ignored (you must configure it manually.)
1912
1884
  - `partial_flush.enabled`: set to `true` to enable partial trace flushing (for long running traces.) Disabled by default. *Experimental.*
1913
1885
  - `port`: set the port the trace agent is listening on.
1886
+ - `sampling.default_rate`: default tracer sampling rate, between `0.0` (0%) and `1.0` (100%, recommended). `1.0` or Tracing without Limits™, allows you to send all of your traffic and retention can be [configured within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/). When this configuration is not set, the Datadog agent will keep an intelligent assortment of diverse traces.
1887
+ - `sampling.rate_limit`: maximum number of traces per second to sample. Defaults to 100 per second.
1914
1888
  - `sampler`: set to a custom `Datadog::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior.
1915
1889
  - `diagnostics.startup_logs.enabled`: Startup configuration and diagnostic log. Defaults to `true`. Can be configured through the `DD_TRACE_STARTUP_LOGS` environment variable.
1916
1890
  - `diagnostics.debug`: set to true to enable debug logging. Can be configured through the `DD_TRACE_DEBUG` environment variable. Defaults to `false`.
@@ -1968,13 +1942,22 @@ Other Environment Variables:
1968
1942
 
1969
1943
  - `DD_TRACE_AGENT_URL`: Sets the URL endpoint where traces are sent. Has priority over `DD_AGENT_HOST` and `DD_TRACE_AGENT_PORT` if set. e.g. `DD_TRACE_AGENT_URL=http://localhost:8126`.
1970
1944
  - `DD_TRACE_<INTEGRATION>_ENABLED`: Enables or disables an **activated** integration. Defaults to `true`.. e.g. `DD_TRACE_RAILS_ENABLED=false`. This option has no effects on integrations that have not been explicitly activated (e.g. `Datadog.configure{ |c| c.use :integration }`).on code. This environment variable can only be used to disable an integration.
1971
- - `DD_TRACE_<INTEGRATION>_ANALYTICS_ENABLED`: Enables or disable App Analytics for a specific integration. Valid values are: true or false (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_ENABLED=true`.
1972
- - `DD_TRACE_<INTEGRATION>_ANALYTICS_SAMPLE_RATE`: Sets the App Analytics sampling rate for a specific integration. A floating number between 0.0 and 1.0 (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_SAMPLE_RATE=0.5`.
1945
+ - `DD_TRACE_SAMPLE_RATE`: Sets the trace sampling rate between `0.0` (0%) and `1.0` (100%, recommended). `1.0` or Tracing without Limits™, allows you to send all of your traffic and retention can be [configured within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/). When this configuration is not set, the Datadog agent will keep an intelligent assortment of diverse traces.
1973
1946
  - `DD_LOGS_INJECTION`: Automatically enables injection [Trace Correlation](#trace-correlation) information, such as `dd.trace_id`, into Rails logs. Supports the default logger (`ActiveSupport::TaggedLogging`) and `Lograge`. Details on the format of Trace Correlation information can be found in the [Trace Correlation](#trace-correlation) section. Valid values are: `true` or `false`(default). e.g. `DD_LOGS_INJECTION=true`.
1974
1947
 
1975
1948
  ### Sampling
1976
1949
 
1977
- `ddtrace` can perform trace sampling. While the trace agent already samples traces to reduce bandwidth usage, client sampling reduces the performance overhead.
1950
+ Datadog's Tracing without Limits™ allows you to send all of your traffic and [configure retention within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/).
1951
+
1952
+ We recommend setting the environment variable `DD_TRACE_SAMPLE_RATE=1.0` in all new applications using `ddtrace`.
1953
+
1954
+ App Analytics, previously configured with the `analytics_enabled` setting, is deprecated in favor of Tracing without Limits™. Documentation for this [deprecated configuration is still available](https://docs.datadoghq.com/tracing/legacy_app_analytics/).
1955
+
1956
+ #### Application-side sampling
1957
+
1958
+ While the trace agent can sample traces to reduce bandwidth usage, application-side sampling reduces the performance overhead.
1959
+
1960
+ This will **reduce visibility and is not recommended**. See [DD_TRACE_SAMPLE_RATE](#environment-variables) for the recommended sampling approach.
1978
1961
 
1979
1962
  `Datadog::RateSampler` samples a ratio of the traces. For example:
1980
1963