ddtrace 1.18.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -1
  3. data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +67 -52
  4. data/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c +22 -14
  5. data/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h +4 -0
  6. data/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c +156 -0
  7. data/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h +5 -0
  8. data/ext/ddtrace_profiling_native_extension/collectors_stack.c +43 -102
  9. data/ext/ddtrace_profiling_native_extension/collectors_stack.h +10 -3
  10. data/ext/ddtrace_profiling_native_extension/collectors_thread_context.c +159 -124
  11. data/ext/ddtrace_profiling_native_extension/collectors_thread_context.h +2 -1
  12. data/ext/ddtrace_profiling_native_extension/extconf.rb +16 -0
  13. data/ext/ddtrace_profiling_native_extension/heap_recorder.c +970 -0
  14. data/ext/ddtrace_profiling_native_extension/heap_recorder.h +155 -0
  15. data/ext/ddtrace_profiling_native_extension/helpers.h +2 -0
  16. data/ext/ddtrace_profiling_native_extension/libdatadog_helpers.c +20 -0
  17. data/ext/ddtrace_profiling_native_extension/libdatadog_helpers.h +11 -0
  18. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +5 -0
  19. data/ext/ddtrace_profiling_native_extension/profiling.c +1 -0
  20. data/ext/ddtrace_profiling_native_extension/ruby_helpers.c +147 -0
  21. data/ext/ddtrace_profiling_native_extension/ruby_helpers.h +28 -0
  22. data/ext/ddtrace_profiling_native_extension/stack_recorder.c +329 -10
  23. data/ext/ddtrace_profiling_native_extension/stack_recorder.h +3 -0
  24. data/lib/datadog/core/configuration/settings.rb +139 -22
  25. data/lib/datadog/core/telemetry/collector.rb +10 -0
  26. data/lib/datadog/core/telemetry/event.rb +2 -1
  27. data/lib/datadog/core/telemetry/ext.rb +3 -0
  28. data/lib/datadog/core/telemetry/v1/app_event.rb +8 -1
  29. data/lib/datadog/core/telemetry/v1/install_signature.rb +38 -0
  30. data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +6 -11
  31. data/lib/datadog/profiling/component.rb +197 -13
  32. data/lib/datadog/profiling/scheduler.rb +4 -6
  33. data/lib/datadog/profiling/stack_recorder.rb +13 -2
  34. data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +4 -0
  35. data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +2 -1
  36. data/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +0 -2
  37. data/lib/ddtrace/version.rb +1 -1
  38. metadata +12 -7
@@ -4,7 +4,10 @@ module Datadog
4
4
  # Note that `record_sample` is only accessible from native code.
5
5
  # Methods prefixed with _native_ are implemented in `stack_recorder.c`
6
6
  class StackRecorder
7
- def initialize(cpu_time_enabled:, alloc_samples_enabled:)
7
+ def initialize(
8
+ cpu_time_enabled:, alloc_samples_enabled:, heap_samples_enabled:, heap_size_enabled:,
9
+ heap_sample_every:, timeline_enabled:
10
+ )
8
11
  # This mutex works in addition to the fancy C-level mutexes we have in the native side (see the docs there).
9
12
  # It prevents multiple Ruby threads calling serialize at the same time -- something like
10
13
  # `10.times { Thread.new { stack_recorder.serialize } }`.
@@ -13,7 +16,15 @@ module Datadog
13
16
  # accidentally happening.
14
17
  @no_concurrent_synchronize_mutex = Mutex.new
15
18
 
16
- self.class._native_initialize(self, cpu_time_enabled, alloc_samples_enabled)
19
+ self.class._native_initialize(
20
+ self,
21
+ cpu_time_enabled,
22
+ alloc_samples_enabled,
23
+ heap_samples_enabled,
24
+ heap_size_enabled,
25
+ heap_sample_every,
26
+ timeline_enabled,
27
+ )
17
28
  end
18
29
 
19
30
  def serialize
@@ -50,6 +50,10 @@ module Datadog
50
50
  o.type :string, nilable: true
51
51
  o.env Ext::ENV_PEER_SERVICE
52
52
  end
53
+
54
+ option :on_error do |o|
55
+ o.type :proc, nilable: true
56
+ end
53
57
  end
54
58
  end
55
59
  end
@@ -21,8 +21,9 @@ module Datadog
21
21
  module InstanceMethods
22
22
  def query(sql, options = {})
23
23
  service = Datadog.configuration_for(self, :service_name) || datadog_configuration[:service_name]
24
+ on_error = Datadog.configuration_for(self, :on_error) || datadog_configuration[:on_error]
24
25
 
25
- Tracing.trace(Ext::SPAN_QUERY, service: service) do |span, trace_op|
26
+ Tracing.trace(Ext::SPAN_QUERY, service: service, on_error: on_error) do |span, trace_op|
26
27
  span.resource = sql
27
28
  span.span_type = Tracing::Metadata::Ext::SQL::TYPE
28
29
 
@@ -1,5 +1,3 @@
1
- require_relative '../auto_instrument'
2
-
3
1
  # Railtie to include AutoInstrumentation in rails loading
4
2
  class DatadogAutoInstrumentRailtie < Rails::Railtie
5
3
  # we want to load before config initializers so that any user supplied config
@@ -3,7 +3,7 @@
3
3
  module DDTrace
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 18
6
+ MINOR = 19
7
7
  PATCH = 0
8
8
  PRE = nil
9
9
  BUILD = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-07 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.3
33
+ version: 3.3.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.3
40
+ version: 3.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: libddwaf
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.5.0
75
+ version: 0.6.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.5.0
82
+ version: 0.6.0
83
83
  description: |
84
84
  ddtrace is Datadog's tracing client for Ruby. It is used to trace requests
85
85
  as they flow across web servers, databases and microservices so that developers
@@ -110,6 +110,8 @@ files:
110
110
  - ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c
111
111
  - ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c
112
112
  - ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
113
+ - ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c
114
+ - ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h
113
115
  - ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.c
114
116
  - ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.h
115
117
  - ext/ddtrace_profiling_native_extension/collectors_stack.c
@@ -117,6 +119,8 @@ files:
117
119
  - ext/ddtrace_profiling_native_extension/collectors_thread_context.c
118
120
  - ext/ddtrace_profiling_native_extension/collectors_thread_context.h
119
121
  - ext/ddtrace_profiling_native_extension/extconf.rb
122
+ - ext/ddtrace_profiling_native_extension/heap_recorder.c
123
+ - ext/ddtrace_profiling_native_extension/heap_recorder.h
120
124
  - ext/ddtrace_profiling_native_extension/helpers.h
121
125
  - ext/ddtrace_profiling_native_extension/http_transport.c
122
126
  - ext/ddtrace_profiling_native_extension/libdatadog_helpers.c
@@ -301,6 +305,7 @@ files:
301
305
  - lib/datadog/core/telemetry/v1/configuration.rb
302
306
  - lib/datadog/core/telemetry/v1/dependency.rb
303
307
  - lib/datadog/core/telemetry/v1/host.rb
308
+ - lib/datadog/core/telemetry/v1/install_signature.rb
304
309
  - lib/datadog/core/telemetry/v1/integration.rb
305
310
  - lib/datadog/core/telemetry/v1/product.rb
306
311
  - lib/datadog/core/telemetry/v1/telemetry_request.rb
@@ -890,7 +895,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
890
895
  - !ruby/object:Gem::Version
891
896
  version: 2.0.0
892
897
  requirements: []
893
- rubygems_version: 3.4.21
898
+ rubygems_version: 3.4.10
894
899
  signing_key:
895
900
  specification_version: 4
896
901
  summary: Datadog tracing code for your Ruby applications