ddtrace 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -2
  3. data/LICENSE-3rdparty.csv +1 -1
  4. data/bin/ddprofrb +15 -0
  5. data/bin/ddtracerb +3 -1
  6. data/ext/{ddtrace_profiling_loader/ddtrace_profiling_loader.c → datadog_profiling_loader/datadog_profiling_loader.c} +2 -2
  7. data/ext/{ddtrace_profiling_loader → datadog_profiling_loader}/extconf.rb +3 -3
  8. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_cpu_and_wall_time_worker.c +206 -49
  9. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_discrete_dynamic_sampler.c +145 -72
  10. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_discrete_dynamic_sampler.h +17 -5
  11. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_thread_context.c +92 -2
  12. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/extconf.rb +2 -2
  13. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/http_transport.c +10 -14
  14. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/native_extension_helpers.rb +4 -4
  15. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/private_vm_api_access.c +14 -0
  16. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/private_vm_api_access.h +4 -0
  17. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/profiling.c +1 -1
  18. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/ruby_helpers.c +10 -0
  19. data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/ruby_helpers.h +2 -0
  20. data/lib/datadog/core/configuration/components.rb +5 -5
  21. data/lib/datadog/core/configuration/option.rb +1 -1
  22. data/lib/datadog/core/configuration/settings.rb +92 -46
  23. data/lib/datadog/core/diagnostics/environment_logger.rb +4 -3
  24. data/lib/datadog/core/environment/git.rb +25 -0
  25. data/lib/datadog/core/environment/identity.rb +18 -48
  26. data/lib/datadog/core/git/ext.rb +2 -23
  27. data/lib/datadog/core/remote/negotiation.rb +2 -2
  28. data/lib/datadog/core/remote/worker.rb +7 -4
  29. data/lib/datadog/core/transport/ext.rb +2 -0
  30. data/lib/datadog/core/utils/url.rb +25 -0
  31. data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +6 -0
  32. data/lib/datadog/profiling/collectors/info.rb +101 -0
  33. data/lib/datadog/profiling/component.rb +12 -14
  34. data/lib/datadog/profiling/exporter.rb +19 -5
  35. data/lib/datadog/profiling/ext.rb +2 -0
  36. data/lib/datadog/profiling/flush.rb +6 -3
  37. data/lib/datadog/profiling/http_transport.rb +5 -1
  38. data/lib/datadog/profiling/load_native_extension.rb +5 -5
  39. data/lib/datadog/profiling/native_extension.rb +1 -1
  40. data/lib/datadog/profiling/tag_builder.rb +5 -0
  41. data/lib/datadog/profiling/tasks/exec.rb +3 -3
  42. data/lib/datadog/profiling/tasks/help.rb +3 -3
  43. data/lib/datadog/profiling.rb +2 -2
  44. data/lib/datadog/tracing/contrib/concurrent_ruby/async_patch.rb +20 -0
  45. data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +11 -1
  46. data/lib/datadog/tracing/contrib/extensions.rb +6 -2
  47. data/lib/datadog/tracing/contrib/grape/endpoint.rb +5 -0
  48. data/lib/datadog/tracing/contrib/pg/instrumentation.rb +11 -4
  49. data/lib/datadog/tracing/contrib/rack/middlewares.rb +28 -4
  50. data/lib/datadog/tracing/contrib/rails/patcher.rb +16 -0
  51. data/lib/datadog/tracing/contrib/sinatra/tracer.rb +6 -3
  52. data/lib/datadog/tracing/metadata/ext.rb +2 -0
  53. data/lib/datadog/tracing/trace_operation.rb +1 -2
  54. data/lib/datadog/tracing/transport/http.rb +1 -0
  55. data/lib/datadog/tracing/transport/trace_formatter.rb +31 -0
  56. data/lib/ddtrace/version.rb +1 -1
  57. metadata +56 -53
  58. data/ext/ddtrace_profiling_native_extension/pid_controller.c +0 -57
  59. data/ext/ddtrace_profiling_native_extension/pid_controller.h +0 -45
  60. data/lib/datadog/profiling/diagnostics/environment_logger.rb +0 -39
  61. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/NativeExtensionDesign.md +0 -0
  62. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/clock_id.h +0 -0
  63. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/clock_id_from_pthread.c +0 -0
  64. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/clock_id_noop.c +0 -0
  65. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_dynamic_sampling_rate.c +0 -0
  66. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_dynamic_sampling_rate.h +0 -0
  67. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_gc_profiling_helper.c +0 -0
  68. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_gc_profiling_helper.h +0 -0
  69. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_idle_sampling_helper.c +0 -0
  70. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_idle_sampling_helper.h +0 -0
  71. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_stack.c +0 -0
  72. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_stack.h +0 -0
  73. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/collectors_thread_context.h +0 -0
  74. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/heap_recorder.c +0 -0
  75. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/heap_recorder.h +0 -0
  76. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/helpers.h +0 -0
  77. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/libdatadog_helpers.c +0 -0
  78. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/libdatadog_helpers.h +0 -0
  79. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/setup_signal_handler.c +0 -0
  80. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/setup_signal_handler.h +0 -0
  81. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/stack_recorder.c +0 -0
  82. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/stack_recorder.h +0 -0
  83. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/time_helpers.c +0 -0
  84. /data/ext/{ddtrace_profiling_native_extension → datadog_profiling_native_extension}/time_helpers.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1baa733b2ad3335ab214de620e849f1eab598effb15d24f336aa20147e6e34be
4
- data.tar.gz: 684bbf501475346f6e2a32b5a9284d59e193344e23d63b912624de77ac8bbbad
3
+ metadata.gz: 223ae0480854efa00a669acefedd34748a08bec69b0a10fdfa3d49112d30ea13
4
+ data.tar.gz: e6013cf6647797fbefd898c11760a13140fd1427ec069ce3a797f3367ebc8f4b
5
5
  SHA512:
6
- metadata.gz: a10dcafb4ff9e9655e06e149ae83a872a0b614f44d69db15ed120f6aa6990f858bb94897d7b8fe30c1b41fe74dc71f054bdf7f0387ded0c0b66058d0d9a15492
7
- data.tar.gz: 87be0dc85c2fc044a0f95096d147dbc79dda101babad85bfdfd29a37c42cd9cb70180fdedae00ff95321fe6eec0e4d61a6aaab852c9c6d3f10fc39ff7f06d87c
6
+ metadata.gz: f868c1ce84455bd994da7b662ce29686238a40d2a31c5828fe21ba33bae4d9756b7e54e2e4a69028f299ad7c2cdd3f49485d690135c9213db83a94d0d044fae1
7
+ data.tar.gz: 8cee7869c4f9fe4bb5c07a000d11741199e65b02a8c31bbbe9e1d7f94cb5e46d68adfd43449ebe3645f0ff127094620234eafd1cb84d2bdbfb1534738faaf6aa
data/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.21.0] - 2024-03-14
6
+
7
+ ### Highlights
8
+ Allocation profiling is now in beta, and timeline profiling is enabled by default.
9
+ For more details, check the [release notes](https://github.com/DataDog/dd-trace-rb/releases/tag/v1.21.0)
10
+
11
+ ### Added
12
+
13
+ * APM source code integration ([#3463][])
14
+ * Core: Reduce startup logs verbosity ([#3468][])
15
+ * Tracing: Add Concurrent::Async instrumentation ([#3427][])
16
+ * Profiling: System info support ([#3357][])
17
+ * Profiling: Add bin/ddprofrb ([#3501][])
18
+
19
+ ### Changed
20
+
21
+ * Bump datadog-ci dependency to 0.8.1 ([#3518][])
22
+ * Upgrade to libdatadog 6 ([#3455][])
23
+ * Core: Allow suppressing error logs for Core::Remote::Negotiation ([#3495][])
24
+ * Tracing: Add `http.route` tag to rack ([#3345][])
25
+ * Tracing: Logs deprecation warning for `use` removal ([#3438][])
26
+ * Profiling: Allocation sampling overhead improvements ([#3434][], [#3440][])
27
+ * Profiling: Enable timeline by default ([#3428][])
28
+ * Profiling: Rename Profiling files to reflect "datadog" instead of "ddtrace" ([#3502][])
29
+ * Profiling: Replace `profiling.advanced.experimental_allocation_enabled` with `profiling.allocation_enabled` and remove experimental warning ([#3520][])
30
+
31
+ ### Fixed
32
+
33
+ * Core: Fix rare remote configuration worker thread leak ([#3519][])
34
+ * Tracing: Fix `Datadog::Tracing.reject!` with correct metrics ([#3491][])
35
+ * Tracing: Guard PG result with `nil` check ([#3511][])
36
+ * Profiling: Add workaround for Ruby VM bug causing crash in gc_finalize_deferred ([#3473][])
37
+ * Profiling: Fix missing profiling code hotspots when using ddtrace+otel ([#3466][])
38
+ * Profiling: Stop worker on clock failure ([#3439][])
39
+ * Profiling: Upgrade libdatadog to fix incorrect platform detection for x86_64-linux-gnu/aarch64-linux-gnu ([#3503][])
40
+
5
41
  ## [1.20.0] - 2024-02-05
6
42
 
7
43
  ### Added
@@ -2728,7 +2764,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
2728
2764
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
2729
2765
 
2730
2766
 
2731
- [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.20.0...master
2767
+ [Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.0...master
2768
+ [1.21.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.20.0...v1.21.0
2732
2769
  [1.20.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.19.0...v1.20.0
2733
2770
  [1.19.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.18.0...v1.19.0
2734
2771
  [1.18.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.17.0...v1.18.0
@@ -3979,10 +4016,12 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
3979
4016
  [#3328]: https://github.com/DataDog/dd-trace-rb/issues/3328
3980
4017
  [#3329]: https://github.com/DataDog/dd-trace-rb/issues/3329
3981
4018
  [#3333]: https://github.com/DataDog/dd-trace-rb/issues/3333
4019
+ [#3345]: https://github.com/DataDog/dd-trace-rb/issues/3345
3982
4020
  [#3349]: https://github.com/DataDog/dd-trace-rb/issues/3349
3983
4021
  [#3352]: https://github.com/DataDog/dd-trace-rb/issues/3352
3984
4022
  [#3354]: https://github.com/DataDog/dd-trace-rb/issues/3354
3985
4023
  [#3356]: https://github.com/DataDog/dd-trace-rb/issues/3356
4024
+ [#3357]: https://github.com/DataDog/dd-trace-rb/issues/3357
3986
4025
  [#3360]: https://github.com/DataDog/dd-trace-rb/issues/3360
3987
4026
  [#3361]: https://github.com/DataDog/dd-trace-rb/issues/3361
3988
4027
  [#3362]: https://github.com/DataDog/dd-trace-rb/issues/3362
@@ -3996,7 +4035,27 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
3996
4035
  [#3408]: https://github.com/DataDog/dd-trace-rb/issues/3408
3997
4036
  [#3420]: https://github.com/DataDog/dd-trace-rb/issues/3420
3998
4037
  [#3426]: https://github.com/DataDog/dd-trace-rb/issues/3426
4038
+ [#3427]: https://github.com/DataDog/dd-trace-rb/issues/3427
4039
+ [#3428]: https://github.com/DataDog/dd-trace-rb/issues/3428
3999
4040
  [#3431]: https://github.com/DataDog/dd-trace-rb/issues/3431
4041
+ [#3434]: https://github.com/DataDog/dd-trace-rb/issues/3434
4042
+ [#3438]: https://github.com/DataDog/dd-trace-rb/issues/3438
4043
+ [#3439]: https://github.com/DataDog/dd-trace-rb/issues/3439
4044
+ [#3440]: https://github.com/DataDog/dd-trace-rb/issues/3440
4045
+ [#3455]: https://github.com/DataDog/dd-trace-rb/issues/3455
4046
+ [#3463]: https://github.com/DataDog/dd-trace-rb/issues/3463
4047
+ [#3466]: https://github.com/DataDog/dd-trace-rb/issues/3466
4048
+ [#3468]: https://github.com/DataDog/dd-trace-rb/issues/3468
4049
+ [#3473]: https://github.com/DataDog/dd-trace-rb/issues/3473
4050
+ [#3491]: https://github.com/DataDog/dd-trace-rb/issues/3491
4051
+ [#3495]: https://github.com/DataDog/dd-trace-rb/issues/3495
4052
+ [#3501]: https://github.com/DataDog/dd-trace-rb/issues/3501
4053
+ [#3502]: https://github.com/DataDog/dd-trace-rb/issues/3502
4054
+ [#3503]: https://github.com/DataDog/dd-trace-rb/issues/3503
4055
+ [#3511]: https://github.com/DataDog/dd-trace-rb/issues/3511
4056
+ [#3518]: https://github.com/DataDog/dd-trace-rb/issues/3518
4057
+ [#3519]: https://github.com/DataDog/dd-trace-rb/issues/3519
4058
+ [#3520]: https://github.com/DataDog/dd-trace-rb/issues/3520
4000
4059
  [@AdrianLC]: https://github.com/AdrianLC
4001
4060
  [@Azure7111]: https://github.com/Azure7111
4002
4061
  [@BabyGroot]: https://github.com/BabyGroot
@@ -4148,4 +4207,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
4148
4207
  [@y-yagi]: https://github.com/y-yagi
4149
4208
  [@yujideveloper]: https://github.com/yujideveloper
4150
4209
  [@yukimurasawa]: https://github.com/yukimurasawa
4151
- [@zachmccormick]: https://github.com/zachmccormick
4210
+ [@zachmccormick]: https://github.com/zachmccormick
data/LICENSE-3rdparty.csv CHANGED
@@ -2,7 +2,7 @@ Component,Origin,License,Copyright
2
2
  lib/datadog/core/vendor/multipart-post,https://github.com/socketry/multipart-post,MIT,"Copyright (c) 2007-2013 Nick Sieger."
3
3
  lib/datadog/tracing/contrib/active_record/vendor,https://github.com/rails/rails/,MIT,"Copyright (c) 2005-2018 David Heinemeier Hansson"
4
4
  lib/datadog/tracing/contrib/utils/quantization/http.rb,https://github.com/ruby/uri,BSD-2-Clause,"Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
5
- ext/ddtrace_profiling_native_extension/private_vm_api_access,https://github.com/ruby/ruby,BSD-2-Clause,"Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
5
+ ext/datadog_profiling_native_extension/private_vm_api_access,https://github.com/ruby/ruby,BSD-2-Clause,"Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
6
6
  msgpack,https://rubygems.org/gems/msgpack,Apache-2.0,"Copyright (c) 2008-2015 Sadayuki Furuhashi"
7
7
  debase-ruby_core_source,https://rubygems.org/gems/debase-ruby_core_source,MIT for gem and BSD-2-Clause for Ruby sources,"Copyright (c) 2012 Gabriel Horner. Files from Ruby sources are Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
8
8
  lib/datadog/core/vendor/ipaddr,https://github.com/ruby/ipaddr/blob/master/lib/ipaddr.rb,BSD 2-Clause "Simplified" License,"Copyright (c) 2002 Hajimu UMEMOTO <ume@mahoroba.org> Copyright (c) 2007-2017 Akinori MUSHA <knu@iDaemons.org>"
data/bin/ddprofrb ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ require 'datadog/profiling/tasks/exec'
3
+ require 'datadog/profiling/tasks/help'
4
+
5
+ command = ARGV.shift
6
+
7
+ case command
8
+ when 'exec'
9
+ Datadog::Profiling::Tasks::Exec.new(ARGV).run
10
+ when 'help', '--help'
11
+ Datadog::Profiling::Tasks::Help.new.run
12
+ else
13
+ puts "Command '#{command}' is not valid for ddprofrb."
14
+ Datadog::Profiling::Tasks::Help.new.run
15
+ end
data/bin/ddtracerb CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ Kernel.warn 'WARNING: Use of `ddtracerb` is deprecated, and will be removed in 2.0. Use `ddprofrb` instead.'
3
+
2
4
  require 'datadog/profiling/tasks/exec'
3
5
  require 'datadog/profiling/tasks/help'
4
6
 
@@ -10,6 +12,6 @@ when 'exec'
10
12
  when 'help', '--help'
11
13
  Datadog::Profiling::Tasks::Help.new.run
12
14
  else
13
- puts "Command '#{command}' is not valid for ddtrace."
15
+ puts "Command '#{command}' is not valid for ddtracerb."
14
16
  Datadog::Profiling::Tasks::Help.new.run
15
17
  end
@@ -14,7 +14,7 @@
14
14
  // up other's symbols (`RTLD_DEEPBIND`).
15
15
  //
16
16
  // But Ruby's extension loading mechanism is not configurable -- there's no way to tell it to use different flags when
17
- // calling `dlopen`. To get around this, this file (ddtrace_profiling_loader.c) introduces another extension
17
+ // calling `dlopen`. To get around this, this file (datadog_profiling_loader.c) introduces another extension
18
18
  // (profiling loader) which has only a single responsibility: mimic Ruby's extension loading mechanism, but when calling
19
19
  // `dlopen` use a different set of flags.
20
20
  // This idea was shamelessly stolen from @lloeki's work in https://github.com/rubyjs/mini_racer/pull/179, big thanks!
@@ -48,7 +48,7 @@ static void unload_failed_library(void *handle);
48
48
 
49
49
  #define DDTRACE_EXPORT __attribute__ ((visibility ("default")))
50
50
 
51
- void DDTRACE_EXPORT Init_ddtrace_profiling_loader(void) {
51
+ void DDTRACE_EXPORT Init_datadog_profiling_loader(void) {
52
52
  VALUE datadog_module = rb_define_module("Datadog");
53
53
  VALUE profiling_module = rb_define_module_under(datadog_module, "Profiling");
54
54
  VALUE loader_module = rb_define_module_under(profiling_module, "Loader");
@@ -3,7 +3,7 @@
3
3
 
4
4
  if RUBY_ENGINE != 'ruby' || Gem.win_platform?
5
5
  $stderr.puts(
6
- 'WARN: Skipping build of ddtrace profiling loader. See ddtrace profiling native extension note for details.'
6
+ 'WARN: Skipping build of Datadog profiling loader. See Datadog profiling native extension note for details.'
7
7
  )
8
8
 
9
9
  File.write('Makefile', 'all install clean: # dummy makefile that does nothing')
@@ -46,7 +46,7 @@ add_compiler_flag '-Werror-implicit-function-declaration'
46
46
  add_compiler_flag '-Wunused-parameter'
47
47
 
48
48
  # The native extension is not intended to expose any symbols/functions for other native libraries to use;
49
- # the sole exception being `Init_ddtrace_profiling_loader` which needs to be visible for Ruby to call it when
49
+ # the sole exception being `Init_datadog_profiling_loader` which needs to be visible for Ruby to call it when
50
50
  # it `dlopen`s the library.
51
51
  #
52
52
  # By setting this compiler flag, we tell it to assume that everything is private unless explicitly stated.
@@ -64,7 +64,7 @@ add_compiler_flag '-Wextra'
64
64
  # This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that
65
65
  # the wrong library is never loaded.
66
66
  # When requiring, we need to use the exact same string, including the version and the platform.
67
- EXTENSION_NAME = "ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze
67
+ EXTENSION_NAME = "datadog_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze
68
68
 
69
69
  create_makefile(EXTENSION_NAME)
70
70