ddtrace 0.52.0 → 0.54.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +174 -11
  3. data/ddtrace.gemspec +6 -3
  4. data/docs/DevelopmentGuide.md +1 -6
  5. data/docs/GettingStarted.md +109 -18
  6. data/docs/ProfilingDevelopment.md +2 -2
  7. data/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +86 -0
  8. data/ext/ddtrace_profiling_native_extension/clock_id.h +4 -0
  9. data/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +52 -0
  10. data/ext/ddtrace_profiling_native_extension/clock_id_noop.c +14 -0
  11. data/ext/ddtrace_profiling_native_extension/extconf.rb +177 -8
  12. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +35 -0
  13. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +3 -0
  14. data/ext/ddtrace_profiling_native_extension/profiling.c +6 -1
  15. data/lib/datadog/ci/contrib/cucumber/formatter.rb +1 -0
  16. data/lib/datadog/ci/contrib/rspec/example.rb +1 -0
  17. data/lib/datadog/ci/contrib/rspec/integration.rb +2 -2
  18. data/lib/datadog/ci/ext/environment.rb +64 -22
  19. data/lib/datadog/ci/ext/test.rb +1 -0
  20. data/lib/datadog/ci/test.rb +5 -1
  21. data/lib/datadog/contrib.rb +2 -0
  22. data/lib/datadog/core/environment/vm_cache.rb +46 -0
  23. data/lib/ddtrace/buffer.rb +28 -16
  24. data/lib/ddtrace/configuration/agent_settings_resolver.rb +131 -53
  25. data/lib/ddtrace/configuration/components.rb +1 -1
  26. data/lib/ddtrace/configuration/settings.rb +13 -3
  27. data/lib/ddtrace/context.rb +10 -2
  28. data/lib/ddtrace/contrib/action_cable/instrumentation.rb +46 -0
  29. data/lib/ddtrace/contrib/action_cable/patcher.rb +1 -0
  30. data/lib/ddtrace/contrib/action_mailer/configuration/settings.rb +32 -0
  31. data/lib/ddtrace/contrib/action_mailer/event.rb +50 -0
  32. data/lib/ddtrace/contrib/action_mailer/events/deliver.rb +54 -0
  33. data/lib/ddtrace/contrib/action_mailer/events/process.rb +41 -0
  34. data/lib/ddtrace/contrib/action_mailer/events.rb +31 -0
  35. data/lib/ddtrace/contrib/action_mailer/ext.rb +32 -0
  36. data/lib/ddtrace/contrib/action_mailer/integration.rb +45 -0
  37. data/lib/ddtrace/contrib/action_mailer/patcher.rb +27 -0
  38. data/lib/ddtrace/contrib/active_job/configuration/settings.rb +33 -0
  39. data/lib/ddtrace/contrib/active_job/event.rb +54 -0
  40. data/lib/ddtrace/contrib/active_job/events/discard.rb +46 -0
  41. data/lib/ddtrace/contrib/active_job/events/enqueue.rb +45 -0
  42. data/lib/ddtrace/contrib/active_job/events/enqueue_at.rb +45 -0
  43. data/lib/ddtrace/contrib/active_job/events/enqueue_retry.rb +47 -0
  44. data/lib/ddtrace/contrib/active_job/events/perform.rb +45 -0
  45. data/lib/ddtrace/contrib/active_job/events/retry_stopped.rb +46 -0
  46. data/lib/ddtrace/contrib/active_job/events.rb +39 -0
  47. data/lib/ddtrace/contrib/active_job/ext.rb +32 -0
  48. data/lib/ddtrace/contrib/active_job/integration.rb +46 -0
  49. data/lib/ddtrace/contrib/active_job/log_injection.rb +21 -0
  50. data/lib/ddtrace/contrib/active_job/patcher.rb +33 -0
  51. data/lib/ddtrace/contrib/auto_instrument.rb +0 -1
  52. data/lib/ddtrace/contrib/delayed_job/plugin.rb +2 -2
  53. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +1 -1
  54. data/lib/ddtrace/contrib/mongodb/integration.rb +5 -0
  55. data/lib/ddtrace/contrib/rails/auto_instrument_railtie.rb +0 -1
  56. data/lib/ddtrace/contrib/rails/configuration/settings.rb +7 -0
  57. data/lib/ddtrace/contrib/rails/framework.rb +24 -1
  58. data/lib/ddtrace/contrib/rails/patcher.rb +19 -10
  59. data/lib/ddtrace/contrib/redis/instrumentation.rb +90 -0
  60. data/lib/ddtrace/contrib/redis/patcher.rb +2 -84
  61. data/lib/ddtrace/contrib/registerable.rb +0 -1
  62. data/lib/ddtrace/contrib/resque/integration.rb +1 -5
  63. data/lib/ddtrace/contrib/sidekiq/ext.rb +3 -0
  64. data/lib/ddtrace/contrib/sidekiq/integration.rb +10 -0
  65. data/lib/ddtrace/contrib/sidekiq/patcher.rb +26 -0
  66. data/lib/ddtrace/contrib/sidekiq/server_internal_tracer/heartbeat.rb +30 -0
  67. data/lib/ddtrace/contrib/sidekiq/server_internal_tracer/job_fetch.rb +30 -0
  68. data/lib/ddtrace/contrib/sidekiq/server_internal_tracer/scheduled_push.rb +29 -0
  69. data/lib/ddtrace/contrib/sinatra/env.rb +2 -1
  70. data/lib/ddtrace/contrib/sinatra/tracer.rb +15 -2
  71. data/lib/ddtrace/ext/git.rb +12 -0
  72. data/lib/ddtrace/ext/priority.rb +6 -4
  73. data/lib/ddtrace/ext/profiling.rb +8 -11
  74. data/lib/ddtrace/ext/runtime.rb +3 -0
  75. data/lib/ddtrace/ext/transport.rb +11 -0
  76. data/lib/ddtrace/metrics.rb +2 -2
  77. data/lib/ddtrace/profiling/collectors/stack.rb +112 -72
  78. data/lib/ddtrace/profiling/encoding/profile.rb +10 -2
  79. data/lib/ddtrace/profiling/events/stack.rb +13 -13
  80. data/lib/ddtrace/profiling/native_extension.rb +23 -1
  81. data/lib/ddtrace/profiling/pprof/builder.rb +8 -2
  82. data/lib/ddtrace/profiling/pprof/converter.rb +22 -9
  83. data/lib/ddtrace/profiling/pprof/stack_sample.rb +32 -9
  84. data/lib/ddtrace/profiling/pprof/template.rb +2 -2
  85. data/lib/ddtrace/profiling/scheduler.rb +20 -4
  86. data/lib/ddtrace/profiling/tasks/setup.rb +21 -13
  87. data/lib/ddtrace/profiling/trace_identifiers/ddtrace.rb +10 -9
  88. data/lib/ddtrace/profiling/trace_identifiers/helper.rb +5 -5
  89. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +8 -15
  90. data/lib/ddtrace/profiling/transport/http.rb +8 -17
  91. data/lib/ddtrace/profiling.rb +0 -2
  92. data/lib/ddtrace/runtime/metrics.rb +14 -0
  93. data/lib/ddtrace/sampler.rb +18 -8
  94. data/lib/ddtrace/sampling/rule_sampler.rb +13 -1
  95. data/lib/ddtrace/span.rb +7 -19
  96. data/lib/ddtrace/tracer.rb +1 -1
  97. data/lib/ddtrace/transport/http/adapters/net.rb +13 -3
  98. data/lib/ddtrace/transport/http/adapters/test.rb +4 -2
  99. data/lib/ddtrace/transport/http/adapters/unix_socket.rb +23 -12
  100. data/lib/ddtrace/transport/http/builder.rb +13 -6
  101. data/lib/ddtrace/transport/http.rb +5 -11
  102. data/lib/ddtrace/utils/time.rb +11 -6
  103. data/lib/ddtrace/version.rb +2 -2
  104. data/lib/ddtrace/workers/{loop.rb → interval_loop.rb} +0 -16
  105. data/lib/ddtrace/workers/polling.rb +1 -1
  106. metadata +40 -10
  107. data/lib/ddtrace/profiling/ext/cpu.rb +0 -67
  108. data/lib/ddtrace/profiling/ext/cthread.rb +0 -156
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f5ee0735d05ecdadc38bbc0978a2087141d136f31b1848845518d2086f877d2
4
- data.tar.gz: dd677af05b413d5593440aedca7b36dc9aba0c9ba08e9213eb8eb9c5443cb2d9
3
+ metadata.gz: 000f0860f13e54bd5d4e0e2d0c4803eb8c568e808379f6ad58b9c9132c03562e
4
+ data.tar.gz: 26433871947470f4ba39de8b0790385a7dd3e7d8ff6e04aa28aff717ec81a490
5
5
  SHA512:
6
- metadata.gz: 9f964c58615348135d915933cea46dac145c1266fa7d573fd8609c7eaf13be8667a8917af8ad5d93340935c00d2dc4bcd89adc7e14db7667eadf005448594f91
7
- data.tar.gz: 23ee7b6812d641a0f6bdc65e43baac6f7f17cc68ca2c07a42e87158400a9b97944aa0f6416c2002fdbbfd0e00f92b1e0a6907de7ee3df39e0840f408a6ec1aec
6
+ metadata.gz: 4f2282c9f65efc83c4b815f64f51cb352adb443ca059b6fbeed921a8db83bd0f076060b190ff2a41e024a77599e80b7e2fdbc0a53c0f701a799f0541a53a64cc
7
+ data.tar.gz: aa4c8ef2ab73071bd1e58c367d300799483aac3c79e1fee3483bc917316da1cd49fae8a999f4a2c0dfc4a7b081478bd872ca2b6fbfe812f07f6bfa7329de304b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,107 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.54.2] - 2022-01-18
6
+
7
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.54.2
8
+
9
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.54.1...v0.54.2
10
+
11
+ ### Changed
12
+
13
+ - Bump `debase-ruby_core_source` dependency version; also allow older versions to be used ([#1798][], [#1829][])
14
+ - Profiler: Reduce impact of reporting data in multi-process applications ([#1807][])
15
+ - Profiler: Update API used to report data to backend ([#1820][])
16
+
17
+ ### Fixed
18
+
19
+ - Gracefully handle installation on environments where Ruby JIT seems to be available but is actually broken ([#1801][])
20
+
21
+ ## [0.54.1] - 2021-11-30
22
+
23
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.54.1
24
+
25
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.54.0...v0.54.1
26
+
27
+ ### Fixed
28
+
29
+ - Skip building profiling native extension when Ruby has been compiled without JIT ([#1774][], [#1776][])
30
+
31
+ ## [0.54.0] - 2021-11-17
32
+
33
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.54.0
34
+
35
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.53.0...v0.54.0
36
+
37
+ ### Added
38
+
39
+ - MongoDB service name resolver when using multi cluster ([#1423][]) ([@skcc321][])
40
+ - Service name override for ActiveJob in Rails configuration ([#1703][], [#1770][]) ([@hatstand][])
41
+ - Profiler: Expose profile duration and start to the UI ([#1709][])
42
+ - Profiler: Gather CPU time without monkey patching Thread ([#1735][], [#1740][])
43
+ - Profiler: Link profiler samples to individual web requests ([#1688][])
44
+ - Profiler: Capture threads with empty backtrace ([#1719][])
45
+ - CI-App: Memoize environment tags to improve performance ([#1762][])
46
+ - CI-App: `test.framework_version` tag for rspec and cucumber ([#1713][])
47
+
48
+ ### Changed
49
+
50
+ - Set minimum version of dogstatsd-ruby 5 series to 5.3 ([#1717][])
51
+ - Use USER_KEEP/USER_REJECT for RuleSampler decisions ([#1769][])
52
+
53
+ ### Fixed
54
+
55
+ - "private method `ruby2_keywords' called" errors ([#1712][], [#1714][])
56
+ - Configuration warning when Agent port is a String ([#1720][])
57
+ - Ensure internal trace buffer respects its maximum size ([#1715][])
58
+ - Remove erroneous maximum resque version support ([#1761][])
59
+ - CI-App: Environment variables parsing precedence ([#1745][], [#1763][])
60
+ - CI-App: GitHub Metadata Extraction ([#1771][])
61
+ - Profiler: Missing thread id for natively created threads ([#1718][])
62
+ - Docs: Active Job integration example code ([#1721][]) ([@y-yagi][])
63
+
64
+ ### Refactored
65
+
66
+ - Redis client patch to use prepend ([#1743][]) ([@justinhoward][])
67
+
68
+ ## [0.53.0] - 2021-10-06
69
+
70
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.53.0
71
+
72
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.52.0...v0.53.0
73
+
74
+ ### Added
75
+
76
+ - ActiveJob integration ([#1639][]) ([@bensheldon][])
77
+ - Instrument Action Cable subscribe/unsubscribe hooks ([#1674][]) ([@agrobbin][])
78
+ - Instrument Sidekiq server internal events (heartbeat, job fetch, and scheduled push) ([#1685][]) ([@agrobbin][])
79
+ - Correlate Active Job logs to the active DataDog trace ([#1694][]) ([@agrobbin][])
80
+ - Runtime Metrics: Global VM cache statistics ([#1680][])
81
+ - Automatically send traces to agent Unix socket if present ([#1700][])
82
+ - CI-App: User Provided Git Metadata ([#1662][])
83
+ - ActionMailer integration ([#1280][])
84
+
85
+ ### Changed
86
+
87
+ - Profiler: Set Sinatra resource setting at beginning of request and delay setting fallback resource ([#1628][])
88
+ - Profiler: Use most recent event for trace resource name ([#1695][])
89
+ - Profiler: Limit number of threads per sample ([#1699][])
90
+ - Profiler: Rename `extract_trace_resource` to `endpoint.collection.enabled` ([#1702][])
91
+
92
+ ### Fixed
93
+
94
+ - Capture Rails exception before default error page is rendered ([#1684][])
95
+ - `NoMethodError` in sinatra integration when Tracer middleware is missing ([#1643][], [#1644][]) ([@mscrivo][])
96
+ - CI-App: Require `rspec-core` for RSpec integration ([#1654][]) ([@elliterate][])
97
+ - CI-App: Use the merge request branch on merge requests ([#1687][]) ([@carlallen][])
98
+ - Remove circular dependencies. ([#1668][]) ([@saturnflyer][])
99
+ - Links in the Table of Contents ([#1661][]) ([@chychkan][])
100
+ - CI-App: Fix CI Visibility Spec Tests ([#1706][])
101
+
102
+ ### Refactored
103
+
104
+ - Profiler: pprof encoding benchmark and improvements ([#1511][])
105
+
5
106
  ## [0.52.0] - 2021-08-09
6
107
 
7
108
  Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.52.0
@@ -438,26 +539,26 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.39.0...v0.40.0
438
539
  ### Fixed
439
540
 
440
541
  - Sinatra nested modular applications possibly leaking spans ([#1035][], [#1145][])
441
-
542
+
442
543
  * **BREAKING** for nested modular Sinatra applications only:
443
544
  ```ruby
444
545
  class Nested < Sinatra::Base
445
546
  end
446
-
547
+
447
548
  class TopLevel < Sinatra::Base
448
549
  use Nested # Nesting happens here
449
550
  end
450
551
  ```
451
552
  * Non-breaking for classic applications nor modular non-nested applications.
452
-
553
+
453
554
  Fixes issues introduced by [#1015][] (in 0.35.0), when we first introduced Sinatra support for modular applications.
454
-
555
+
455
556
  The main issue we had to solve for modular support is how to handle nested applications, as only one application is actually responsible for handling the route. A naive implementation would cause the creation of nested `sinatra.request` spans, even for applications that did not handle the request. This is technically correct, as Sinatra is traversing that middleware, accruing overhead, but that does not aligned with our existing behavior of having a single `sinatra.request` span.
456
-
557
+
457
558
  While trying to achieve backwards-compatibility, we had to resort to a solution that turned out brittle: `sinatra.request` spans had to start in one middleware level and finished it in another. This allowed us to only capture the `sinatra.request` for the matching route, and skip the non-matching one. This caused unexpected issues on some user setups, specially around Sinatra middleware that created spans in between the initialization and closure of `sinatra.request` spans.
458
-
559
+
459
560
  This change now address these implementation issues by creating multiple `sinatra.request`, one for each traversed Sinatra application, even non-matching ones. This instrumentation is more correct, but at the cost of being a breaking change for nested modular applications.
460
-
561
+
461
562
  Please see [#1145][] for more information, and example screenshots on how traces for affected applications will look like.
462
563
 
463
564
  - Rack/Rails span error propagation with `rescue_from` ([#1155][], [#1162][])
@@ -1313,7 +1414,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.14.1...v0.14.2
1313
1414
 
1314
1415
  ### Fixed
1315
1416
 
1316
- - Sampling priority from request headers not being used ([#521][])
1417
+ - Sampling priority from request headers not being used ([#521][])
1317
1418
 
1318
1419
  ## [0.14.1] - 2018-08-21
1319
1420
 
@@ -1459,9 +1560,9 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.12.1...v0.13.0
1459
1560
  - Hash quantization into core library ([#410][])
1460
1561
  - MongoDB integration to use Hash quantization library ([#463][])
1461
1562
 
1462
- ### Changed
1563
+ ### Changed
1463
1564
 
1464
- - Hash quantization truncates arrays with nested objects ([#463][])
1565
+ - Hash quantization truncates arrays with nested objects ([#463][])
1465
1566
 
1466
1567
  ## [0.13.0.beta1] - 2018-05-09
1467
1568
 
@@ -1810,7 +1911,10 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
1810
1911
 
1811
1912
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
1812
1913
 
1813
- [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.48.0...master
1914
+ [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.54.0...master
1915
+ [0.54.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.53.0...v0.54.0
1916
+ [0.53.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.52.0...v0.53.0
1917
+ [0.52.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.51.1...v0.52.0
1814
1918
  [0.51.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.51.0...v0.51.1
1815
1919
  [0.51.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.50.0...v0.51.0
1816
1920
  [0.48.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.47.0...v0.48.0
@@ -2400,6 +2504,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2400
2504
  [#1277]: https://github.com/DataDog/dd-trace-rb/issues/1277
2401
2505
  [#1278]: https://github.com/DataDog/dd-trace-rb/issues/1278
2402
2506
  [#1279]: https://github.com/DataDog/dd-trace-rb/issues/1279
2507
+ [#1280]: https://github.com/DataDog/dd-trace-rb/issues/1280
2403
2508
  [#1281]: https://github.com/DataDog/dd-trace-rb/issues/1281
2404
2509
  [#1283]: https://github.com/DataDog/dd-trace-rb/issues/1283
2405
2510
  [#1284]: https://github.com/DataDog/dd-trace-rb/issues/1284
@@ -2477,6 +2582,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2477
2582
  [#1420]: https://github.com/DataDog/dd-trace-rb/issues/1420
2478
2583
  [#1421]: https://github.com/DataDog/dd-trace-rb/issues/1421
2479
2584
  [#1422]: https://github.com/DataDog/dd-trace-rb/issues/1422
2585
+ [#1423]: https://github.com/DataDog/dd-trace-rb/issues/1423
2480
2586
  [#1426]: https://github.com/DataDog/dd-trace-rb/issues/1426
2481
2587
  [#1427]: https://github.com/DataDog/dd-trace-rb/issues/1427
2482
2588
  [#1428]: https://github.com/DataDog/dd-trace-rb/issues/1428
@@ -2511,6 +2617,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2511
2617
  [#1507]: https://github.com/DataDog/dd-trace-rb/issues/1507
2512
2618
  [#1509]: https://github.com/DataDog/dd-trace-rb/issues/1509
2513
2619
  [#1510]: https://github.com/DataDog/dd-trace-rb/issues/1510
2620
+ [#1511]: https://github.com/DataDog/dd-trace-rb/issues/1511
2514
2621
  [#1523]: https://github.com/DataDog/dd-trace-rb/issues/1523
2515
2622
  [#1524]: https://github.com/DataDog/dd-trace-rb/issues/1524
2516
2623
  [#1529]: https://github.com/DataDog/dd-trace-rb/issues/1529
@@ -2549,6 +2656,53 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2549
2656
  [#1630]: https://github.com/DataDog/dd-trace-rb/issues/1630
2550
2657
  [#1632]: https://github.com/DataDog/dd-trace-rb/issues/1632
2551
2658
  [#1636]: https://github.com/DataDog/dd-trace-rb/issues/1636
2659
+ [#1639]: https://github.com/DataDog/dd-trace-rb/issues/1639
2660
+ [#1643]: https://github.com/DataDog/dd-trace-rb/issues/1643
2661
+ [#1644]: https://github.com/DataDog/dd-trace-rb/issues/1644
2662
+ [#1654]: https://github.com/DataDog/dd-trace-rb/issues/1654
2663
+ [#1661]: https://github.com/DataDog/dd-trace-rb/issues/1661
2664
+ [#1662]: https://github.com/DataDog/dd-trace-rb/issues/1662
2665
+ [#1668]: https://github.com/DataDog/dd-trace-rb/issues/1668
2666
+ [#1674]: https://github.com/DataDog/dd-trace-rb/issues/1674
2667
+ [#1680]: https://github.com/DataDog/dd-trace-rb/issues/1680
2668
+ [#1684]: https://github.com/DataDog/dd-trace-rb/issues/1684
2669
+ [#1685]: https://github.com/DataDog/dd-trace-rb/issues/1685
2670
+ [#1687]: https://github.com/DataDog/dd-trace-rb/issues/1687
2671
+ [#1688]: https://github.com/DataDog/dd-trace-rb/issues/1688
2672
+ [#1694]: https://github.com/DataDog/dd-trace-rb/issues/1694
2673
+ [#1695]: https://github.com/DataDog/dd-trace-rb/issues/1695
2674
+ [#1699]: https://github.com/DataDog/dd-trace-rb/issues/1699
2675
+ [#1700]: https://github.com/DataDog/dd-trace-rb/issues/1700
2676
+ [#1702]: https://github.com/DataDog/dd-trace-rb/issues/1702
2677
+ [#1703]: https://github.com/DataDog/dd-trace-rb/issues/1703
2678
+ [#1706]: https://github.com/DataDog/dd-trace-rb/issues/1706
2679
+ [#1709]: https://github.com/DataDog/dd-trace-rb/issues/1709
2680
+ [#1712]: https://github.com/DataDog/dd-trace-rb/issues/1712
2681
+ [#1713]: https://github.com/DataDog/dd-trace-rb/issues/1713
2682
+ [#1714]: https://github.com/DataDog/dd-trace-rb/issues/1714
2683
+ [#1715]: https://github.com/DataDog/dd-trace-rb/issues/1715
2684
+ [#1717]: https://github.com/DataDog/dd-trace-rb/issues/1717
2685
+ [#1718]: https://github.com/DataDog/dd-trace-rb/issues/1718
2686
+ [#1719]: https://github.com/DataDog/dd-trace-rb/issues/1719
2687
+ [#1720]: https://github.com/DataDog/dd-trace-rb/issues/1720
2688
+ [#1721]: https://github.com/DataDog/dd-trace-rb/issues/1721
2689
+ [#1735]: https://github.com/DataDog/dd-trace-rb/issues/1735
2690
+ [#1740]: https://github.com/DataDog/dd-trace-rb/issues/1740
2691
+ [#1743]: https://github.com/DataDog/dd-trace-rb/issues/1743
2692
+ [#1745]: https://github.com/DataDog/dd-trace-rb/issues/1745
2693
+ [#1761]: https://github.com/DataDog/dd-trace-rb/issues/1761
2694
+ [#1762]: https://github.com/DataDog/dd-trace-rb/issues/1762
2695
+ [#1763]: https://github.com/DataDog/dd-trace-rb/issues/1763
2696
+ [#1769]: https://github.com/DataDog/dd-trace-rb/issues/1769
2697
+ [#1770]: https://github.com/DataDog/dd-trace-rb/issues/1770
2698
+ [#1771]: https://github.com/DataDog/dd-trace-rb/issues/1771
2699
+ [#1774]: https://github.com/DataDog/dd-trace-rb/issues/1774
2700
+ [#1776]: https://github.com/DataDog/dd-trace-rb/issues/1776
2701
+ [#1798]: https://github.com/DataDog/dd-trace-rb/issues/1798
2702
+ [#1801]: https://github.com/DataDog/dd-trace-rb/issues/1801
2703
+ [#1807]: https://github.com/DataDog/dd-trace-rb/issues/1807
2704
+ [#1820]: https://github.com/DataDog/dd-trace-rb/issues/1820
2705
+ [#1829]: https://github.com/DataDog/dd-trace-rb/issues/1829
2552
2706
  [@AdrianLC]: https://github.com/AdrianLC
2553
2707
  [@Azure7111]: https://github.com/Azure7111
2554
2708
  [@BabyGroot]: https://github.com/BabyGroot
@@ -2577,11 +2731,14 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2577
2731
  [@awendt]: https://github.com/awendt
2578
2732
  [@bartekbsh]: https://github.com/bartekbsh
2579
2733
  [@benhutton]: https://github.com/benhutton
2734
+ [@bensheldon]: https://github.com/bensheldon
2580
2735
  [@bheemreddy181]: https://github.com/bheemreddy181
2581
2736
  [@blaines]: https://github.com/blaines
2582
2737
  [@brafales]: https://github.com/brafales
2583
2738
  [@bzf]: https://github.com/bzf
2584
2739
  [@callumj]: https://github.com/callumj
2740
+ [@carlallen]: https://github.com/carlallen
2741
+ [@chychkan]: https://github.com/chychkan
2585
2742
  [@cjford]: https://github.com/cjford
2586
2743
  [@ck3g]: https://github.com/ck3g
2587
2744
  [@components]: https://github.com/components
@@ -2593,6 +2750,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2593
2750
  [@dorner]: https://github.com/dorner
2594
2751
  [@drcapulet]: https://github.com/drcapulet
2595
2752
  [@e1senh0rn]: https://github.com/e1senh0rn
2753
+ [@elliterate]: https://github.com/elliterate
2596
2754
  [@elyalvarado]: https://github.com/elyalvarado
2597
2755
  [@ericmustin]: https://github.com/ericmustin
2598
2756
  [@erict-square]: https://github.com/erict-square
@@ -2607,6 +2765,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2607
2765
  [@gkampjes]: https://github.com/gkampjes
2608
2766
  [@gottfrois]: https://github.com/gottfrois
2609
2767
  [@guizmaii]: https://github.com/guizmaii
2768
+ [@hatstand]: https://github.com/hatstand
2610
2769
  [@hawknewton]: https://github.com/hawknewton
2611
2770
  [@hs-bguven]: https://github.com/hs-bguven
2612
2771
  [@illdelph]: https://github.com/illdelph
@@ -2616,6 +2775,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2616
2775
  [@jfrancoist]: https://github.com/jfrancoist
2617
2776
  [@joeyAghion]: https://github.com/joeyAghion
2618
2777
  [@jpaulgs]: https://github.com/jpaulgs
2778
+ [@justinhoward]: https://github.com/justinhoward
2619
2779
  [@jvalanen]: https://github.com/jvalanen
2620
2780
  [@kelvin-acosta]: https://github.com/kelvin-acosta
2621
2781
  [@kexoth]: https://github.com/kexoth
@@ -2632,6 +2792,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2632
2792
  [@mdross95]: https://github.com/mdross95
2633
2793
  [@michaelkl]: https://github.com/michaelkl
2634
2794
  [@mriddle]: https://github.com/mriddle
2795
+ [@mscrivo]: https://github.com/mscrivo
2635
2796
  [@mstruve]: https://github.com/mstruve
2636
2797
  [@mustela]: https://github.com/mustela
2637
2798
  [@nic-lan]: https://github.com/nic-lan
@@ -2647,10 +2808,12 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2647
2808
  [@renchap]: https://github.com/renchap
2648
2809
  [@ricbartm]: https://github.com/ricbartm
2649
2810
  [@roccoblues]: https://github.com/roccoblues
2811
+ [@saturnflyer]: https://github.com/saturnflyer
2650
2812
  [@sco11morgan]: https://github.com/sco11morgan
2651
2813
  [@senny]: https://github.com/senny
2652
2814
  [@shayonj]: https://github.com/shayonj
2653
2815
  [@sinsoku]: https://github.com/sinsoku
2816
+ [@skcc321]: https://github.com/skcc321
2654
2817
  [@soulcutter]: https://github.com/soulcutter
2655
2818
  [@stefanahman]: https://github.com/stefanahman
2656
2819
  [@steveh]: https://github.com/steveh
data/ddtrace.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  .reject { |f| f.match(%r{^(test|spec|features|[.]circleci|[.]github|[.]dd-ci|benchmarks|gemfiles|integration|tasks|sorbet)/}) }
35
35
  .reject do |f|
36
36
  ['.dockerignore', '.env', '.gitattributes', '.gitlab-ci.yml', '.rspec', '.rubocop.yml',
37
- '.rubocop_todo.yml', '.simplecov', 'Appraisals', 'Gemfile', 'Rakefile', 'docker-compose.yml'].include?(f)
37
+ '.rubocop_todo.yml', '.simplecov', 'Appraisals', 'Gemfile', 'Rakefile', 'docker-compose.yml', '.pryrc'].include?(f)
38
38
  end
39
39
  spec.executables = ['ddtracerb']
40
40
  spec.require_paths = ['lib']
@@ -46,8 +46,11 @@ Gem::Specification.new do |spec|
46
46
  spec.add_dependency 'msgpack', '< 1.4'
47
47
  end
48
48
 
49
- # Used by the profiler
50
- spec.add_dependency 'ffi', '~> 1.0'
49
+ # Used by the profiler native extension to support older Rubies (see NativeExtensionDesign.md for notes)
50
+ #
51
+ # Because we only use this for older Rubies, and we consider it "feature-complete" for those older Rubies,
52
+ # we're pinning it at the latest available version and will manually bump the dependency as needed.
53
+ spec.add_dependency 'debase-ruby_core_source', '<= 0.10.14'
51
54
 
52
55
  spec.extensions = ['ext/ddtrace_profiling_native_extension/extconf.rb']
53
56
  end
@@ -42,9 +42,7 @@ Then within this container you can [run tests](#running-tests), or [run code qua
42
42
 
43
43
  ## Testing
44
44
 
45
- The test suite uses both [Minitest](https://github.com/seattlerb/minitest) and [RSpec](https://rspec.info/) tests to verify the correctness of both the core trace library and its integrations.
46
-
47
- Minitest is deprecated in favor of RSpec; all new tests should be written in RSpec, and only existing minitests should be updated.
45
+ The test suite uses [RSpec](https://rspec.info/) tests to verify the correctness of both the core trace library and its integrations.
48
46
 
49
47
  ### Writing tests
50
48
 
@@ -68,9 +66,6 @@ Simplest way to run tests is to run `bundle exec rake ci`, which will run the en
68
66
  Run the tests for the core library with:
69
67
 
70
68
  ```
71
- # Run Minitest
72
- $ bundle exec rake test:main
73
- # Run RSpec
74
69
  $ bundle exec rake spec:main
75
70
  ```
76
71
 
@@ -28,8 +28,10 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
28
28
  - [Integration instrumentation](#integration-instrumentation)
29
29
  - [Action Cable](#action-cable)
30
30
  - [Action View](#action-view)
31
+ - [Action Mailer](#action-mailer)
31
32
  - [Active Model Serializers](#active-model-serializers)
32
33
  - [Action Pack](#action-pack)
34
+ - [Active Job](#active-job)
33
35
  - [Active Record](#active-record)
34
36
  - [Active Support](#active-support)
35
37
  - [AWS](#aws)
@@ -44,12 +46,12 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
44
46
  - [Grape](#grape)
45
47
  - [GraphQL](#graphql)
46
48
  - [gRPC](#grpc)
47
- - [http.rb](#http-rb)
49
+ - [http.rb](#httprb)
48
50
  - [httpclient](#httpclient)
49
51
  - [httpx](#httpx)
50
52
  - [MongoDB](#mongodb)
51
53
  - [MySQL2](#mysql2)
52
- - [Net/HTTP](#net-http)
54
+ - [Net/HTTP](#nethttp)
53
55
  - [Presto](#presto)
54
56
  - [Qless](#qless)
55
57
  - [Que](#que)
@@ -133,13 +135,22 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
133
135
 
134
136
  *EOL* indicates support is no longer provided.
135
137
 
138
+ ### Apple macOS support
139
+
140
+ Use of `ddtrace` on macOS is supported for development, but not for production deployments.
141
+
142
+ ### Microsoft Windows support
143
+
144
+ Using `ddtrace` on Microsoft Windows is currently unsupported. We'll still accept community contributions and issues,
145
+ but will consider them as having low priority.
146
+
136
147
  ## Installation
137
148
 
138
149
  The following steps will help you quickly start tracing your Ruby application.
139
150
 
140
151
  ### Configure the Datadog Agent for APM
141
152
 
142
- Before downloading tracing on your application, install the Datadog Agent. The Ruby APM tracer sends trace data through the Datadog Agent.
153
+ Before downloading tracing on your application, [install the Datadog Agent on the host](https://docs.datadoghq.com/agent/). The Ruby APM tracer sends trace data through the Datadog Agent.
143
154
 
144
155
  Install and configure the Datadog Agent to receive traces from your now instrumented application. By default the Datadog Agent is enabled in your `datadog.yaml` file under `apm_enabled: true` and listens for trace traffic at `localhost:8126`. For containerized environments, follow the steps below to enable trace collection within the Datadog Agent.
145
156
 
@@ -165,7 +176,7 @@ Install and configure the Datadog Agent to receive traces from your now instrume
165
176
 
166
177
  2. Install the gem with `bundle install`
167
178
 
168
- 3. You can configure, override, or disable any specific integration settings by also adding a [Rails Manual Configuration](#rails-manual-configuration) file.
179
+ 3. You can configure, override, or disable any specific integration settings by also adding a Rails manual instrumentation configuration file (next).
169
180
 
170
181
  #### Manual instrumentation
171
182
 
@@ -205,7 +216,7 @@ Install and configure the Datadog Agent to receive traces from your now instrume
205
216
  require 'ddtrace/auto_instrument'
206
217
  ```
207
218
 
208
- You can configure, override, or disable any specific integration settings by also adding a [Ruby Manual Configuration Block](#ruby-manual-configuration).
219
+ You can configure, override, or disable any specific integration settings by also adding a Ruby manual configuration block (next).
209
220
 
210
221
  #### Manual instrumentation
211
222
 
@@ -388,14 +399,16 @@ For a list of available integrations, and their configuration options, please re
388
399
  | Name | Key | Versions Supported: MRI | Versions Supported: JRuby | How to configure | Gem source |
389
400
  | ------------------------ | -------------------------- | ------------------------ | --------------------------| ----------------------------------- | ------------------------------------------------------------------------------ |
390
401
  | Action Cable | `action_cable` | `>= 5.0` | `>= 5.0` | *[Link](#action-cable)* | *[Link](https://github.com/rails/rails/tree/master/actioncable)* |
402
+ | Action Mailer | `action_mailer` | `>= 5.0` | `>= 5.0` | *[Link](#action-mailer)* | *[Link](https://github.com/rails/rails/tree/master/actionmailer)* |
391
403
  | Action View | `action_view` | `>= 3.0` | `>= 3.0` | *[Link](#action-view)* | *[Link](https://github.com/rails/rails/tree/master/actionview)* |
392
404
  | Active Model Serializers | `active_model_serializers` | `>= 0.9` | `>= 0.9` | *[Link](#active-model-serializers)* | *[Link](https://github.com/rails-api/active_model_serializers)* |
393
405
  | Action Pack | `action_pack` | `>= 3.0` | `>= 3.0` | *[Link](#action-pack)* | *[Link](https://github.com/rails/rails/tree/master/actionpack)* |
406
+ | Active Job | `active_job` | `>= 4.2` | `>= 4.2` | *[Link](#active-job)* | *[Link](https://github.com/rails/rails/tree/master/activejob)* |
394
407
  | Active Record | `active_record` | `>= 3.0` | `>= 3.0` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
395
408
  | Active Support | `active_support` | `>= 3.0` | `>= 3.0` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
396
409
  | AWS | `aws` | `>= 2.0` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
397
410
  | Concurrent Ruby | `concurrent_ruby` | `>= 0.9` | `>= 0.9` | *[Link](#concurrent-ruby)* | *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
398
- | Cucumber | `cucumber` | `>= 3.0` | `>= 1.7.16` | *[Link](#cucumber)* | *[Link](https://github.com/cucumber/cucumber-ruby)* |
411
+ | Cucumber | `cucumber` | `>= 3.0` | `>= 1.7.16` | *[Link](#cucumber)* | *[Link](https://github.com/cucumber/cucumber-ruby)* |
399
412
  | Dalli | `dalli` | `>= 2.0` | `>= 2.0` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
400
413
  | DelayedJob | `delayed_job` | `>= 4.1` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
401
414
  | Elasticsearch | `elasticsearch` | `>= 1.0` | `>= 1.0` | *[Link](#elasticsearch)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
@@ -405,7 +418,7 @@ For a list of available integrations, and their configuration options, please re
405
418
  | Grape | `grape` | `>= 1.0` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
406
419
  | GraphQL | `graphql` | `>= 1.7.9` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
407
420
  | gRPC | `grpc` | `>= 1.7` | *gem not available* | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
408
- | http.rb | `httprb` | `>= 2.0` | `>= 2.0` | *[Link](#http-rb)* | *[Link](https://github.com/httprb/http)* |
421
+ | http.rb | `httprb` | `>= 2.0` | `>= 2.0` | *[Link](#httprb)* | *[Link](https://github.com/httprb/http)* |
409
422
  | httpclient | `httpclient` | `>= 2.2` | `>= 2.2` | *[Link](#httpclient)* | *[Link](https://github.com/nahi/httpclient)* |
410
423
  | httpx | `httpx` | `>= 0.11` | `>= 0.11` | *[Link](#httpx)* | *[Link](https://gitlab.com/honeyryderchuck/httpx)* |
411
424
  | Kafka | `ruby-kafka` | `>= 0.7.10` | `>= 0.7.10` | *[Link](#kafka)* | *[Link](https://github.com/zendesk/ruby-kafka)* |
@@ -471,6 +484,27 @@ Where `options` is an optional `Hash` that accepts the following parameters:
471
484
  | `service_name` | Service name used for rendering instrumentation. | `action_view` |
472
485
  | `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/'` |
473
486
 
487
+ ### Action Mailer
488
+
489
+ The Action Mailer integration provides tracing for Rails 5 ActionMailer actions.
490
+
491
+ You can enable it through `Datadog.configure`:
492
+
493
+ ```ruby
494
+ require 'ddtrace'
495
+ Datadog.configure do |c|
496
+ c.use :action_mailer, options
497
+ end
498
+ ```
499
+
500
+ Where `options` is an optional `Hash` that accepts the following parameters:
501
+
502
+ | Key | Description | Default |
503
+ | --- | ----------- | ------- |
504
+ | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
505
+ | `service_name` | Service name used for `action_mailer` instrumentation | `'action_mailer'` |
506
+ | `email_data` | Whether or not to append additional email payload metadata to `action_mailer.deliver` spans. Fields include `['subject', 'to', 'from', 'bcc', 'cc', 'date', 'perform_deliveries']`. | `false` |
507
+
474
508
  ### Active Model Serializers
475
509
 
476
510
  The Active Model Serializers integration traces the `serialize` event for version 0.9+ and the `render` event for version 0.10+.
@@ -510,6 +544,28 @@ Where `options` is an optional `Hash` that accepts the following parameters:
510
544
  | ---| --- | --- |
511
545
  | `service_name` | Service name used for rendering instrumentation. | `action_pack` |
512
546
 
547
+ ### Active Job
548
+
549
+ Most of the time, Active Job is set up as part of Rails, but it can be activated separately:
550
+
551
+ ```ruby
552
+ require 'active_job'
553
+ require 'ddtrace'
554
+
555
+ Datadog.configure do |c|
556
+ c.use :active_job, options
557
+ end
558
+
559
+ ExampleJob.perform_later
560
+ ```
561
+
562
+ Where `options` is an optional `Hash` that accepts the following parameters:
563
+
564
+ | Key | Description | Default |
565
+ | --- | ----------- | ------- |
566
+ | `service_name` | Service name used for `active_job` instrumentation | `'active_job'` |
567
+ | `log_injection` | Automatically enables injection [Trace Correlation](#trace-correlation) information, such as `dd.trace_id`, into Active Job 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. | `false` |
568
+
513
569
  ### Active Record
514
570
 
515
571
  Most of the time, Active Record is set up as part of a web framework (Rails, Sinatra...) however, it can be set up alone:
@@ -1170,6 +1226,37 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1170
1226
  | `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] }` |
1171
1227
  | `service_name` | Service name used for `mongo` instrumentation | `'mongodb'` |
1172
1228
 
1229
+ **Configuring trace settings per connection**
1230
+
1231
+ You can configure trace settings per connection by using the `describes` option:
1232
+
1233
+ ```ruby
1234
+ # Provide a `:describes` option with a connection key.
1235
+ # Any of the following keys are acceptable and equivalent to one another.
1236
+ # If a block is provided, it yields a Settings object that
1237
+ # accepts any of the configuration options listed above.
1238
+
1239
+ Datadog.configure do |c|
1240
+ # Network connection string
1241
+ c.use :mongo, describes: '127.0.0.1:27017', service_name: 'mongo-primary'
1242
+
1243
+ # Network connection regular expression
1244
+ c.use :mongo, describes: /localhost.*/, service_name: 'mongo-secondary'
1245
+ end
1246
+
1247
+ client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'artists')
1248
+ collection = client[:people]
1249
+ collection.insert_one({ name: 'Steve' })
1250
+ # Traced call will belong to `mongo-primary` service
1251
+
1252
+ client = Mongo::Client.new([ 'localhost:27017' ], :database => 'artists')
1253
+ collection = client[:people]
1254
+ collection.insert_one({ name: 'Steve' })
1255
+ # Traced call will belong to `mongo-secondary` service
1256
+ ```
1257
+
1258
+ When multiple `describes` configurations match a connection, the latest configured rule that matches will be applied.
1259
+
1173
1260
  ### MySQL2
1174
1261
 
1175
1262
  The MySQL2 integration traces any SQL command sent through `mysql2` gem.
@@ -1424,6 +1511,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1424
1511
  | `database_service` | Database service name used when tracing database activity | `'<app_name>-<adapter_name>'` |
1425
1512
  | `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` |
1426
1513
  | `exception_controller` | Class or Module which identifies a custom exception controller class. Tracer provides improved error behavior when it can identify custom exception controllers. By default, without this option, it 'guesses' what a custom exception controller looks like. Providing this option aids this identification. | `nil` |
1514
+ | `job_service` | Service name used when tracing ActiveJob activity. | `<app_name>-active_job` |
1427
1515
  | `middleware` | Add the trace middleware to the Rails application. Set to `false` if you don't want the middleware to load. | `true` |
1428
1516
  | `middleware_names` | Enables any short-circuited middleware requests to display the middleware name as a resource for the trace. | `false` |
1429
1517
  | `service_name` | Service name used when tracing application requests (on the `rack` level) | `'<app_name>'` (inferred from your Rails application namespace) |
@@ -1434,7 +1522,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1434
1522
 
1435
1523
  | MRI Versions | JRuby Versions | Rails Versions |
1436
1524
  | ------------- | -------------- | -------------- |
1437
- | 2.0 | | 3.0 - 3.2 |
1438
1525
  | 2.1 | | 3.0 - 4.2 |
1439
1526
  | 2.2 - 2.3 | | 3.0 - 5.2 |
1440
1527
  | 2.4 | | 4.2.8 - 5.2 |
@@ -2125,7 +2212,7 @@ For more details on how to activate distributed tracing for integrations, see th
2125
2212
  - [Rack](#rack)
2126
2213
  - [Rails](#rails)
2127
2214
  - [Sinatra](#sinatra)
2128
- - [http.rb](#http-rb)
2215
+ - [http.rb](#httprb)
2129
2216
  - [httpclient](#httpclient)
2130
2217
  - [httpx](#httpx)
2131
2218
 
@@ -2343,7 +2430,9 @@ Datadog.tracer.trace('my.operation') { logger.warn('This is a traced operation.'
2343
2430
 
2344
2431
  ### Configuring the transport layer
2345
2432
 
2346
- By default, the tracer submits trace data using `Net::HTTP` to `127.0.0.1:8126`, the default location for the Datadog trace agent process. However, the tracer can be configured to send its trace data to alternative destinations, or by alternative protocols.
2433
+ By default, the tracer submits trace data using the Unix socket `/var/run/datadog/apm.socket`, if one is created by the Agent. Otherwise, it connects via HTTP to `127.0.0.1:8126`, the default TCP location the Agent listens on.
2434
+
2435
+ However, the tracer can be configured to send its trace data to alternative destinations, or by alternative protocols.
2347
2436
 
2348
2437
  Some basic settings, such as hostname and port, can be configured using [tracer settings](#tracer-settings).
2349
2438
 
@@ -2369,7 +2458,7 @@ To use, first configure your trace agent to listen by Unix socket, then configur
2369
2458
  ```ruby
2370
2459
  Datadog.configure do |c|
2371
2460
  c.tracer.transport_options = proc { |t|
2372
- # Provide filepath to trace agent Unix socket
2461
+ # Provide local path to trace agent Unix socket
2373
2462
  t.adapter :unix, '/tmp/ddagent/trace.sock'
2374
2463
  }
2375
2464
  end
@@ -2413,7 +2502,7 @@ The tracer and its integrations can produce some additional metrics that can pro
2413
2502
  To configure your application for metrics collection:
2414
2503
 
2415
2504
  1. [Configure your Datadog agent for StatsD](https://docs.datadoghq.com/developers/dogstatsd/#setup)
2416
- 2. Add `gem 'dogstatsd-ruby', '~> 5.2'` to your Gemfile
2505
+ 2. Add `gem 'dogstatsd-ruby', '~> 5.3'` to your Gemfile
2417
2506
 
2418
2507
  #### For application runtime
2419
2508
 
@@ -2442,11 +2531,13 @@ See the [Dogstatsd documentation](https://www.rubydoc.info/github/DataDog/dogsta
2442
2531
 
2443
2532
  The stats are VM specific and will include:
2444
2533
 
2445
- | Name | Type | Description |
2446
- | -------------------------- | ------- | -------------------------------------------------------- |
2447
- | `runtime.ruby.class_count` | `gauge` | Number of classes in memory space. |
2448
- | `runtime.ruby.thread_count` | `gauge` | Number of threads. |
2449
- | `runtime.ruby.gc.*`. | `gauge` | Garbage collection statistics: collected from `GC.stat`. |
2534
+ | Name | Type | Description | Available on |
2535
+ | -------------------------- | ------- | -------------------------------------------------------- | ------------ |
2536
+ | `runtime.ruby.class_count` | `gauge` | Number of classes in memory space. | CRuby |
2537
+ | `runtime.ruby.gc.*` | `gauge` | Garbage collection statistics: collected from `GC.stat`. | All runtimes |
2538
+ | `runtime.ruby.thread_count` | `gauge` | Number of threads. | All runtimes |
2539
+ | `runtime.ruby.global_constant_state` | `gauge` | Global constant cache generation. | CRuby |
2540
+ | `runtime.ruby.global_method_state` | `gauge` | [Global method cache generation.](https://tenderlovemaking.com/2015/12/23/inline-caching-in-mri.html) | [CRuby < 3.0.0](https://docs.ruby-lang.org/en/3.0.0/NEWS_md.html#label-Implementation+improvements) |
2450
2541
 
2451
2542
  In addition, all metrics include the following tags:
2452
2543
 
@@ -2492,7 +2583,7 @@ However, additional instrumentation provided by Datadog can be activated alongsi
2492
2583
 
2493
2584
  **Setup**
2494
2585
 
2495
- To get started with profiling, follow the [Profiler Getting Started Guide](https://docs.datadoghq.com/tracing/profiler/getting_started/?code-lang=ruby).
2586
+ To get started with profiling, follow the [Enabling the Ruby Profiler](https://docs.datadoghq.com/tracing/profiler/enabling/ruby/) guide.
2496
2587
 
2497
2588
  #### Troubleshooting
2498
2589