datadog 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +101 -1
- data/ext/datadog_profiling_loader/extconf.rb +15 -15
- data/ext/datadog_profiling_native_extension/clock_id.h +1 -0
- data/ext/datadog_profiling_native_extension/clock_id_from_pthread.c +1 -2
- data/ext/datadog_profiling_native_extension/clock_id_noop.c +1 -2
- data/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +132 -44
- data/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c +49 -26
- data/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.h +34 -4
- data/ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.c +4 -0
- data/ext/datadog_profiling_native_extension/collectors_stack.c +90 -37
- data/ext/datadog_profiling_native_extension/collectors_stack.h +2 -2
- data/ext/datadog_profiling_native_extension/collectors_thread_context.c +81 -19
- data/ext/datadog_profiling_native_extension/collectors_thread_context.h +1 -0
- data/ext/datadog_profiling_native_extension/datadog_ruby_common.c +110 -0
- data/ext/datadog_profiling_native_extension/datadog_ruby_common.h +57 -0
- data/ext/datadog_profiling_native_extension/extconf.rb +69 -62
- data/ext/datadog_profiling_native_extension/heap_recorder.c +34 -6
- data/ext/datadog_profiling_native_extension/heap_recorder.h +3 -1
- data/ext/datadog_profiling_native_extension/helpers.h +6 -17
- data/ext/datadog_profiling_native_extension/http_transport.c +3 -3
- data/ext/datadog_profiling_native_extension/libdatadog_helpers.c +0 -86
- data/ext/datadog_profiling_native_extension/libdatadog_helpers.h +2 -23
- data/ext/datadog_profiling_native_extension/native_extension_helpers.rb +61 -126
- data/ext/datadog_profiling_native_extension/private_vm_api_access.c +64 -138
- data/ext/datadog_profiling_native_extension/private_vm_api_access.h +17 -11
- data/ext/datadog_profiling_native_extension/profiling.c +0 -2
- data/ext/datadog_profiling_native_extension/ruby_helpers.c +0 -33
- data/ext/datadog_profiling_native_extension/ruby_helpers.h +1 -26
- data/ext/datadog_profiling_native_extension/setup_signal_handler.c +1 -1
- data/ext/datadog_profiling_native_extension/setup_signal_handler.h +1 -0
- data/ext/datadog_profiling_native_extension/stack_recorder.c +27 -8
- data/ext/datadog_profiling_native_extension/stack_recorder.h +2 -0
- data/ext/datadog_profiling_native_extension/time_helpers.c +0 -15
- data/ext/datadog_profiling_native_extension/time_helpers.h +36 -6
- data/ext/{datadog_profiling_native_extension → libdatadog_api}/crashtracker.c +20 -7
- data/ext/libdatadog_api/datadog_ruby_common.c +110 -0
- data/ext/libdatadog_api/datadog_ruby_common.h +57 -0
- data/ext/libdatadog_api/extconf.rb +108 -0
- data/ext/libdatadog_api/macos_development.md +26 -0
- data/ext/libdatadog_extconf_helpers.rb +130 -0
- data/lib/datadog/appsec/contrib/graphql/appsec_trace.rb +49 -0
- data/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb +73 -0
- data/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb +68 -0
- data/lib/datadog/appsec/contrib/graphql/integration.rb +41 -0
- data/lib/datadog/appsec/contrib/graphql/patcher.rb +37 -0
- data/lib/datadog/appsec/contrib/graphql/reactive/multiplex.rb +59 -0
- data/lib/datadog/appsec/contrib/rack/gateway/request.rb +1 -1
- data/lib/datadog/appsec/contrib/sinatra/patcher.rb +1 -1
- data/lib/datadog/appsec/extensions.rb +1 -0
- data/lib/datadog/appsec/processor/actions.rb +1 -1
- data/lib/datadog/appsec/response.rb +15 -1
- data/lib/datadog/appsec.rb +1 -0
- data/lib/datadog/core/configuration/components.rb +17 -12
- data/lib/datadog/core/configuration/settings.rb +93 -7
- data/lib/datadog/core/configuration.rb +3 -17
- data/lib/datadog/core/crashtracking/agent_base_url.rb +21 -0
- data/lib/datadog/core/crashtracking/component.rb +111 -0
- data/lib/datadog/core/crashtracking/tag_builder.rb +39 -0
- data/lib/datadog/core/deprecations.rb +58 -0
- data/lib/datadog/core/diagnostics/environment_logger.rb +8 -11
- data/lib/datadog/core/environment/yjit.rb +5 -0
- data/lib/datadog/core/runtime/ext.rb +1 -0
- data/lib/datadog/core/runtime/metrics.rb +6 -0
- data/lib/datadog/core/telemetry/component.rb +154 -0
- data/lib/datadog/core/telemetry/emitter.rb +9 -11
- data/lib/datadog/core/telemetry/event.rb +132 -26
- data/lib/datadog/core/telemetry/ext.rb +3 -0
- data/lib/datadog/core/telemetry/http/adapters/net.rb +11 -13
- data/lib/datadog/core/telemetry/http/ext.rb +3 -0
- data/lib/datadog/core/telemetry/http/transport.rb +38 -9
- data/lib/datadog/core/telemetry/logging.rb +35 -0
- data/lib/datadog/core/telemetry/metric.rb +167 -0
- data/lib/datadog/core/telemetry/metrics_collection.rb +81 -0
- data/lib/datadog/core/telemetry/metrics_manager.rb +81 -0
- data/lib/datadog/core/telemetry/request.rb +1 -1
- data/lib/datadog/core/telemetry/worker.rb +173 -0
- data/lib/datadog/core/utils/at_fork_monkey_patch.rb +102 -0
- data/lib/datadog/core/utils/only_once_successful.rb +76 -0
- data/lib/datadog/core.rb +2 -19
- data/lib/datadog/kit/appsec/events.rb +2 -4
- data/lib/datadog/opentelemetry/sdk/propagator.rb +5 -10
- data/lib/datadog/opentelemetry/sdk/span_processor.rb +15 -2
- data/lib/datadog/opentelemetry/sdk/trace/span.rb +23 -0
- data/lib/datadog/profiling/collectors/code_provenance.rb +24 -11
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +17 -17
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +11 -13
- data/lib/datadog/profiling/collectors/info.rb +3 -3
- data/lib/datadog/profiling/collectors/thread_context.rb +4 -2
- data/lib/datadog/profiling/component.rb +85 -90
- data/lib/datadog/profiling/exporter.rb +3 -3
- data/lib/datadog/profiling/ext/dir_monkey_patches.rb +410 -0
- data/lib/datadog/profiling/ext.rb +21 -21
- data/lib/datadog/profiling/flush.rb +1 -1
- data/lib/datadog/profiling/http_transport.rb +8 -6
- data/lib/datadog/profiling/load_native_extension.rb +5 -5
- data/lib/datadog/profiling/preload.rb +1 -1
- data/lib/datadog/profiling/profiler.rb +5 -8
- data/lib/datadog/profiling/scheduler.rb +31 -25
- data/lib/datadog/profiling/tag_builder.rb +2 -2
- data/lib/datadog/profiling/tasks/exec.rb +5 -5
- data/lib/datadog/profiling/tasks/setup.rb +16 -35
- data/lib/datadog/profiling.rb +5 -5
- data/lib/datadog/tracing/contrib/action_cable/event.rb +1 -1
- data/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +1 -1
- data/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +1 -1
- data/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +1 -1
- data/lib/datadog/tracing/contrib/action_mailer/event.rb +4 -6
- data/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +9 -4
- data/lib/datadog/tracing/contrib/action_mailer/events/process.rb +3 -2
- data/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +1 -5
- data/lib/datadog/tracing/contrib/action_view/events/render_template.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/discard.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/perform.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +1 -1
- data/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +1 -1
- data/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +1 -1
- data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +1 -1
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +2 -1
- data/lib/datadog/tracing/contrib/active_support/cache/event.rb +32 -0
- data/lib/datadog/tracing/contrib/active_support/cache/events/cache.rb +156 -0
- data/lib/datadog/tracing/contrib/active_support/cache/events.rb +34 -0
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +45 -41
- data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +17 -40
- data/lib/datadog/tracing/contrib/active_support/cache/redis.rb +4 -1
- data/lib/datadog/tracing/contrib/active_support/notifications/event.rb +29 -6
- data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +16 -4
- data/lib/datadog/tracing/contrib/active_support/notifications/subscription.rb +33 -29
- data/lib/datadog/tracing/contrib/analytics.rb +5 -0
- data/lib/datadog/tracing/contrib/ext.rb +14 -0
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +5 -0
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +8 -2
- data/lib/datadog/tracing/contrib/graphql/unified_trace.rb +166 -0
- data/lib/datadog/tracing/contrib/graphql/unified_trace_patcher.rb +28 -0
- data/lib/datadog/tracing/contrib/kafka/consumer_event.rb +1 -1
- data/lib/datadog/tracing/contrib/kafka/consumer_group_event.rb +1 -1
- data/lib/datadog/tracing/contrib/kafka/event.rb +1 -1
- data/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +3 -3
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +3 -3
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +3 -3
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +3 -3
- data/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +3 -3
- data/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +3 -3
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +16 -0
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +5 -0
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +17 -13
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +5 -0
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +4 -1
- data/lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb +28 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment/mode.rb +5 -1
- data/lib/datadog/tracing/contrib/propagation/sql_comment.rb +22 -10
- data/lib/datadog/tracing/contrib/racecar/event.rb +2 -2
- data/lib/datadog/tracing/contrib/rails/ext.rb +9 -0
- data/lib/datadog/tracing/contrib/rails/patcher.rb +7 -0
- data/lib/datadog/tracing/contrib/rails/runner.rb +95 -0
- data/lib/datadog/tracing/contrib/trilogy/configuration/settings.rb +5 -0
- data/lib/datadog/tracing/contrib/trilogy/instrumentation.rb +4 -1
- data/lib/datadog/tracing/diagnostics/environment_logger.rb +14 -16
- data/lib/datadog/tracing/distributed/b3_multi.rb +1 -1
- data/lib/datadog/tracing/distributed/b3_single.rb +3 -1
- data/lib/datadog/tracing/distributed/datadog.rb +2 -2
- data/lib/datadog/tracing/distributed/propagation.rb +9 -2
- data/lib/datadog/tracing/distributed/trace_context.rb +3 -2
- data/lib/datadog/tracing/metadata/errors.rb +9 -1
- data/lib/datadog/tracing/metadata/ext.rb +4 -0
- data/lib/datadog/tracing/pipeline/span_filter.rb +2 -2
- data/lib/datadog/tracing/span.rb +9 -2
- data/lib/datadog/tracing/span_event.rb +41 -0
- data/lib/datadog/tracing/span_operation.rb +9 -4
- data/lib/datadog/tracing/trace_operation.rb +7 -3
- data/lib/datadog/tracing/trace_segment.rb +4 -1
- data/lib/datadog/tracing/tracer.rb +9 -2
- data/lib/datadog/tracing/transport/serializable_trace.rb +3 -0
- data/lib/datadog/tracing.rb +5 -1
- data/lib/datadog/version.rb +2 -2
- metadata +43 -12
- data/lib/datadog/core/telemetry/client.rb +0 -95
- data/lib/datadog/core/telemetry/heartbeat.rb +0 -33
- data/lib/datadog/profiling/crashtracker.rb +0 -91
- data/lib/datadog/profiling/ext/forking.rb +0 -98
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datadog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.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: 2024-
|
11
|
+
date: 2024-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 11.0.0.1.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 11.0.0.1.0
|
69
69
|
description: |
|
70
70
|
datadog is Datadog's client library for Ruby. It includes a suite of tools
|
71
71
|
which provide visibility into the performance and security of Ruby applications,
|
@@ -77,6 +77,7 @@ executables:
|
|
77
77
|
extensions:
|
78
78
|
- ext/datadog_profiling_native_extension/extconf.rb
|
79
79
|
- ext/datadog_profiling_loader/extconf.rb
|
80
|
+
- ext/libdatadog_api/extconf.rb
|
80
81
|
extra_rdoc_files: []
|
81
82
|
files:
|
82
83
|
- CHANGELOG.md
|
@@ -106,7 +107,8 @@ files:
|
|
106
107
|
- ext/datadog_profiling_native_extension/collectors_stack.h
|
107
108
|
- ext/datadog_profiling_native_extension/collectors_thread_context.c
|
108
109
|
- ext/datadog_profiling_native_extension/collectors_thread_context.h
|
109
|
-
- ext/datadog_profiling_native_extension/
|
110
|
+
- ext/datadog_profiling_native_extension/datadog_ruby_common.c
|
111
|
+
- ext/datadog_profiling_native_extension/datadog_ruby_common.h
|
110
112
|
- ext/datadog_profiling_native_extension/extconf.rb
|
111
113
|
- ext/datadog_profiling_native_extension/heap_recorder.c
|
112
114
|
- ext/datadog_profiling_native_extension/heap_recorder.h
|
@@ -126,6 +128,12 @@ files:
|
|
126
128
|
- ext/datadog_profiling_native_extension/stack_recorder.h
|
127
129
|
- ext/datadog_profiling_native_extension/time_helpers.c
|
128
130
|
- ext/datadog_profiling_native_extension/time_helpers.h
|
131
|
+
- ext/libdatadog_api/crashtracker.c
|
132
|
+
- ext/libdatadog_api/datadog_ruby_common.c
|
133
|
+
- ext/libdatadog_api/datadog_ruby_common.h
|
134
|
+
- ext/libdatadog_api/extconf.rb
|
135
|
+
- ext/libdatadog_api/macos_development.md
|
136
|
+
- ext/libdatadog_extconf_helpers.rb
|
129
137
|
- lib/datadog.rb
|
130
138
|
- lib/datadog/appsec.rb
|
131
139
|
- lib/datadog/appsec/assets.rb
|
@@ -150,6 +158,12 @@ files:
|
|
150
158
|
- lib/datadog/appsec/contrib/devise/patcher/registration_controller_patch.rb
|
151
159
|
- lib/datadog/appsec/contrib/devise/resource.rb
|
152
160
|
- lib/datadog/appsec/contrib/devise/tracking.rb
|
161
|
+
- lib/datadog/appsec/contrib/graphql/appsec_trace.rb
|
162
|
+
- lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb
|
163
|
+
- lib/datadog/appsec/contrib/graphql/gateway/watcher.rb
|
164
|
+
- lib/datadog/appsec/contrib/graphql/integration.rb
|
165
|
+
- lib/datadog/appsec/contrib/graphql/patcher.rb
|
166
|
+
- lib/datadog/appsec/contrib/graphql/reactive/multiplex.rb
|
153
167
|
- lib/datadog/appsec/contrib/integration.rb
|
154
168
|
- lib/datadog/appsec/contrib/patcher.rb
|
155
169
|
- lib/datadog/appsec/contrib/rack/ext.rb
|
@@ -223,6 +237,10 @@ files:
|
|
223
237
|
- lib/datadog/core/configuration/option_definition.rb
|
224
238
|
- lib/datadog/core/configuration/options.rb
|
225
239
|
- lib/datadog/core/configuration/settings.rb
|
240
|
+
- lib/datadog/core/crashtracking/agent_base_url.rb
|
241
|
+
- lib/datadog/core/crashtracking/component.rb
|
242
|
+
- lib/datadog/core/crashtracking/tag_builder.rb
|
243
|
+
- lib/datadog/core/deprecations.rb
|
226
244
|
- lib/datadog/core/diagnostics/environment_logger.rb
|
227
245
|
- lib/datadog/core/diagnostics/health.rb
|
228
246
|
- lib/datadog/core/encoding.rb
|
@@ -281,17 +299,21 @@ files:
|
|
281
299
|
- lib/datadog/core/remote/worker.rb
|
282
300
|
- lib/datadog/core/runtime/ext.rb
|
283
301
|
- lib/datadog/core/runtime/metrics.rb
|
284
|
-
- lib/datadog/core/telemetry/
|
302
|
+
- lib/datadog/core/telemetry/component.rb
|
285
303
|
- lib/datadog/core/telemetry/emitter.rb
|
286
304
|
- lib/datadog/core/telemetry/event.rb
|
287
305
|
- lib/datadog/core/telemetry/ext.rb
|
288
|
-
- lib/datadog/core/telemetry/heartbeat.rb
|
289
306
|
- lib/datadog/core/telemetry/http/adapters/net.rb
|
290
307
|
- lib/datadog/core/telemetry/http/env.rb
|
291
308
|
- lib/datadog/core/telemetry/http/ext.rb
|
292
309
|
- lib/datadog/core/telemetry/http/response.rb
|
293
310
|
- lib/datadog/core/telemetry/http/transport.rb
|
311
|
+
- lib/datadog/core/telemetry/logging.rb
|
312
|
+
- lib/datadog/core/telemetry/metric.rb
|
313
|
+
- lib/datadog/core/telemetry/metrics_collection.rb
|
314
|
+
- lib/datadog/core/telemetry/metrics_manager.rb
|
294
315
|
- lib/datadog/core/telemetry/request.rb
|
316
|
+
- lib/datadog/core/telemetry/worker.rb
|
295
317
|
- lib/datadog/core/transport/ext.rb
|
296
318
|
- lib/datadog/core/transport/http/adapters/net.rb
|
297
319
|
- lib/datadog/core/transport/http/adapters/registry.rb
|
@@ -306,12 +328,14 @@ files:
|
|
306
328
|
- lib/datadog/core/transport/request.rb
|
307
329
|
- lib/datadog/core/transport/response.rb
|
308
330
|
- lib/datadog/core/utils.rb
|
331
|
+
- lib/datadog/core/utils/at_fork_monkey_patch.rb
|
309
332
|
- lib/datadog/core/utils/base64.rb
|
310
333
|
- lib/datadog/core/utils/duration.rb
|
311
334
|
- lib/datadog/core/utils/forking.rb
|
312
335
|
- lib/datadog/core/utils/hash.rb
|
313
336
|
- lib/datadog/core/utils/network.rb
|
314
337
|
- lib/datadog/core/utils/only_once.rb
|
338
|
+
- lib/datadog/core/utils/only_once_successful.rb
|
315
339
|
- lib/datadog/core/utils/safe_dup.rb
|
316
340
|
- lib/datadog/core/utils/sequence.rb
|
317
341
|
- lib/datadog/core/utils/time.rb
|
@@ -352,10 +376,9 @@ files:
|
|
352
376
|
- lib/datadog/profiling/collectors/stack.rb
|
353
377
|
- lib/datadog/profiling/collectors/thread_context.rb
|
354
378
|
- lib/datadog/profiling/component.rb
|
355
|
-
- lib/datadog/profiling/crashtracker.rb
|
356
379
|
- lib/datadog/profiling/exporter.rb
|
357
380
|
- lib/datadog/profiling/ext.rb
|
358
|
-
- lib/datadog/profiling/ext/
|
381
|
+
- lib/datadog/profiling/ext/dir_monkey_patches.rb
|
359
382
|
- lib/datadog/profiling/flush.rb
|
360
383
|
- lib/datadog/profiling/http_transport.rb
|
361
384
|
- lib/datadog/profiling/load_native_extension.rb
|
@@ -447,6 +470,9 @@ files:
|
|
447
470
|
- lib/datadog/tracing/contrib/active_record/integration.rb
|
448
471
|
- lib/datadog/tracing/contrib/active_record/patcher.rb
|
449
472
|
- lib/datadog/tracing/contrib/active_record/utils.rb
|
473
|
+
- lib/datadog/tracing/contrib/active_support/cache/event.rb
|
474
|
+
- lib/datadog/tracing/contrib/active_support/cache/events.rb
|
475
|
+
- lib/datadog/tracing/contrib/active_support/cache/events/cache.rb
|
450
476
|
- lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb
|
451
477
|
- lib/datadog/tracing/contrib/active_support/cache/patcher.rb
|
452
478
|
- lib/datadog/tracing/contrib/active_support/cache/redis.rb
|
@@ -536,6 +562,8 @@ files:
|
|
536
562
|
- lib/datadog/tracing/contrib/graphql/patcher.rb
|
537
563
|
- lib/datadog/tracing/contrib/graphql/trace_patcher.rb
|
538
564
|
- lib/datadog/tracing/contrib/graphql/tracing_patcher.rb
|
565
|
+
- lib/datadog/tracing/contrib/graphql/unified_trace.rb
|
566
|
+
- lib/datadog/tracing/contrib/graphql/unified_trace_patcher.rb
|
539
567
|
- lib/datadog/tracing/contrib/grpc.rb
|
540
568
|
- lib/datadog/tracing/contrib/grpc/configuration/settings.rb
|
541
569
|
- lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb
|
@@ -664,6 +692,7 @@ files:
|
|
664
692
|
- lib/datadog/tracing/contrib/rails/middlewares.rb
|
665
693
|
- lib/datadog/tracing/contrib/rails/patcher.rb
|
666
694
|
- lib/datadog/tracing/contrib/rails/railtie.rb
|
695
|
+
- lib/datadog/tracing/contrib/rails/runner.rb
|
667
696
|
- lib/datadog/tracing/contrib/rails/utils.rb
|
668
697
|
- lib/datadog/tracing/contrib/rake/configuration/settings.rb
|
669
698
|
- lib/datadog/tracing/contrib/rake/ext.rb
|
@@ -806,6 +835,7 @@ files:
|
|
806
835
|
- lib/datadog/tracing/sampling/span/rule_parser.rb
|
807
836
|
- lib/datadog/tracing/sampling/span/sampler.rb
|
808
837
|
- lib/datadog/tracing/span.rb
|
838
|
+
- lib/datadog/tracing/span_event.rb
|
809
839
|
- lib/datadog/tracing/span_link.rb
|
810
840
|
- lib/datadog/tracing/span_operation.rb
|
811
841
|
- lib/datadog/tracing/sync_writer.rb
|
@@ -840,7 +870,8 @@ licenses:
|
|
840
870
|
- Apache-2.0
|
841
871
|
metadata:
|
842
872
|
allowed_push_host: https://rubygems.org
|
843
|
-
changelog_uri: https://github.com/DataDog/dd-trace-rb/blob/
|
873
|
+
changelog_uri: https://github.com/DataDog/dd-trace-rb/blob/v2.3.0/CHANGELOG.md
|
874
|
+
source_code_uri: https://github.com/DataDog/dd-trace-rb/tree/v2.3.0
|
844
875
|
post_install_message:
|
845
876
|
rdoc_options: []
|
846
877
|
require_paths:
|
@@ -852,14 +883,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
852
883
|
version: 2.5.0
|
853
884
|
- - "<"
|
854
885
|
- !ruby/object:Gem::Version
|
855
|
-
version: '3.
|
886
|
+
version: '3.5'
|
856
887
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
857
888
|
requirements:
|
858
889
|
- - ">="
|
859
890
|
- !ruby/object:Gem::Version
|
860
891
|
version: 2.0.0
|
861
892
|
requirements: []
|
862
|
-
rubygems_version: 3.
|
893
|
+
rubygems_version: 3.5.16
|
863
894
|
signing_key:
|
864
895
|
specification_version: 4
|
865
896
|
summary: Datadog tracing code for your Ruby applications
|
@@ -1,95 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'emitter'
|
4
|
-
require_relative 'event'
|
5
|
-
require_relative 'heartbeat'
|
6
|
-
require_relative '../utils/forking'
|
7
|
-
|
8
|
-
module Datadog
|
9
|
-
module Core
|
10
|
-
module Telemetry
|
11
|
-
# Telemetry entrypoint, coordinates sending telemetry events at various points in app lifecycle.
|
12
|
-
class Client
|
13
|
-
attr_reader \
|
14
|
-
:enabled,
|
15
|
-
:unsupported
|
16
|
-
|
17
|
-
include Core::Utils::Forking
|
18
|
-
|
19
|
-
# @param enabled [Boolean] Determines whether telemetry events should be sent to the API
|
20
|
-
# @param heartbeat_interval_seconds [Float] How frequently heartbeats will be reported, in seconds.
|
21
|
-
# @param [Boolean] dependency_collection Whether to send the `app-dependencies-loaded` event
|
22
|
-
def initialize(heartbeat_interval_seconds:, dependency_collection:, enabled: true)
|
23
|
-
@enabled = enabled
|
24
|
-
@emitter = Emitter.new
|
25
|
-
@stopped = false
|
26
|
-
@unsupported = false
|
27
|
-
@started = false
|
28
|
-
@dependency_collection = dependency_collection
|
29
|
-
|
30
|
-
@worker = Telemetry::Heartbeat.new(enabled: @enabled, heartbeat_interval_seconds: heartbeat_interval_seconds) do
|
31
|
-
next unless @started # `started!` should be the first event, thus ensure that `heartbeat!` is not sent first.
|
32
|
-
|
33
|
-
heartbeat!
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def disable!
|
38
|
-
@enabled = false
|
39
|
-
@worker.enabled = false
|
40
|
-
end
|
41
|
-
|
42
|
-
def started!
|
43
|
-
return if !@enabled || forked?
|
44
|
-
|
45
|
-
res = @emitter.request(Event::AppStarted.new)
|
46
|
-
|
47
|
-
if res.not_found? # Telemetry is only supported by agent versions 7.34 and up
|
48
|
-
Datadog.logger.debug('Agent does not support telemetry; disabling future telemetry events.')
|
49
|
-
disable!
|
50
|
-
@unsupported = true # Prevent telemetry from getting re-enabled
|
51
|
-
return res
|
52
|
-
end
|
53
|
-
|
54
|
-
@emitter.request(Event::AppDependenciesLoaded.new) if @dependency_collection
|
55
|
-
|
56
|
-
@started = true
|
57
|
-
end
|
58
|
-
|
59
|
-
def emit_closing!
|
60
|
-
return if !@enabled || forked?
|
61
|
-
|
62
|
-
@emitter.request(Event::AppClosing.new)
|
63
|
-
end
|
64
|
-
|
65
|
-
def stop!
|
66
|
-
return if @stopped
|
67
|
-
|
68
|
-
@worker.stop(true, 0)
|
69
|
-
@stopped = true
|
70
|
-
end
|
71
|
-
|
72
|
-
def integrations_change!
|
73
|
-
return if !@enabled || forked?
|
74
|
-
|
75
|
-
@emitter.request(Event::AppIntegrationsChange.new)
|
76
|
-
end
|
77
|
-
|
78
|
-
# Report configuration changes caused by Remote Configuration.
|
79
|
-
def client_configuration_change!(changes)
|
80
|
-
return if !@enabled || forked?
|
81
|
-
|
82
|
-
@emitter.request(Event::AppClientConfigurationChange.new(changes, 'remote_config'))
|
83
|
-
end
|
84
|
-
|
85
|
-
private
|
86
|
-
|
87
|
-
def heartbeat!
|
88
|
-
return if !@enabled || forked?
|
89
|
-
|
90
|
-
@emitter.request(Event::AppHeartbeat.new)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../worker'
|
4
|
-
require_relative '../workers/polling'
|
5
|
-
|
6
|
-
module Datadog
|
7
|
-
module Core
|
8
|
-
module Telemetry
|
9
|
-
# Periodically (every DEFAULT_INTERVAL_SECONDS) sends a heartbeat event to the telemetry API.
|
10
|
-
class Heartbeat < Core::Worker
|
11
|
-
include Core::Workers::Polling
|
12
|
-
|
13
|
-
def initialize(heartbeat_interval_seconds:, enabled: true, &block)
|
14
|
-
# Workers::Polling settings
|
15
|
-
self.enabled = enabled
|
16
|
-
# Workers::IntervalLoop settings
|
17
|
-
self.loop_base_interval = heartbeat_interval_seconds
|
18
|
-
self.fork_policy = Core::Workers::Async::Thread::FORK_POLICY_STOP
|
19
|
-
super(&block)
|
20
|
-
start
|
21
|
-
end
|
22
|
-
|
23
|
-
def loop_wait_before_first_iteration?; end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def start
|
28
|
-
perform
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'libdatadog'
|
4
|
-
|
5
|
-
module Datadog
|
6
|
-
module Profiling
|
7
|
-
# Used to report Ruby VM crashes.
|
8
|
-
# The interesting bits are implemented as native code and using libdatadog.
|
9
|
-
#
|
10
|
-
# NOTE: The crashtracker native state is a singleton; so even if you create multiple instances of `Crashtracker`
|
11
|
-
# and start them, it only works as "last writer wins". Same for stop -- there's only one state, so calling stop
|
12
|
-
# on it will stop the crash tracker, regardless of which instance started it.
|
13
|
-
#
|
14
|
-
# Methods prefixed with _native_ are implemented in `crashtracker.c`
|
15
|
-
class Crashtracker
|
16
|
-
private
|
17
|
-
|
18
|
-
attr_reader \
|
19
|
-
:exporter_configuration,
|
20
|
-
:tags_as_array,
|
21
|
-
:path_to_crashtracking_receiver_binary,
|
22
|
-
:ld_library_path,
|
23
|
-
:upload_timeout_seconds
|
24
|
-
|
25
|
-
public
|
26
|
-
|
27
|
-
def initialize(
|
28
|
-
exporter_configuration:,
|
29
|
-
tags:,
|
30
|
-
upload_timeout_seconds:,
|
31
|
-
path_to_crashtracking_receiver_binary: Libdatadog.path_to_crashtracking_receiver_binary,
|
32
|
-
ld_library_path: Libdatadog.ld_library_path
|
33
|
-
)
|
34
|
-
@exporter_configuration = exporter_configuration
|
35
|
-
@tags_as_array = tags.to_a
|
36
|
-
@upload_timeout_seconds = upload_timeout_seconds
|
37
|
-
@path_to_crashtracking_receiver_binary = path_to_crashtracking_receiver_binary
|
38
|
-
@ld_library_path = ld_library_path
|
39
|
-
end
|
40
|
-
|
41
|
-
def start
|
42
|
-
start_or_update_on_fork(action: :start)
|
43
|
-
end
|
44
|
-
|
45
|
-
def reset_after_fork
|
46
|
-
start_or_update_on_fork(action: :update_on_fork)
|
47
|
-
end
|
48
|
-
|
49
|
-
def stop
|
50
|
-
begin
|
51
|
-
self.class._native_stop
|
52
|
-
Datadog.logger.debug('Crash tracking stopped successfully')
|
53
|
-
rescue => e
|
54
|
-
Datadog.logger.error("Failed to stop crash tracking: #{e.message}")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
private
|
59
|
-
|
60
|
-
def start_or_update_on_fork(action:)
|
61
|
-
unless path_to_crashtracking_receiver_binary
|
62
|
-
Datadog.logger.warn(
|
63
|
-
"Cannot #{action} profiling crash tracking as no path_to_crashtracking_receiver_binary was found"
|
64
|
-
)
|
65
|
-
return
|
66
|
-
end
|
67
|
-
|
68
|
-
unless ld_library_path
|
69
|
-
Datadog.logger.warn(
|
70
|
-
"Cannot #{action} profiling crash tracking as no ld_library_path was found"
|
71
|
-
)
|
72
|
-
return
|
73
|
-
end
|
74
|
-
|
75
|
-
begin
|
76
|
-
self.class._native_start_or_update_on_fork(
|
77
|
-
action: action,
|
78
|
-
exporter_configuration: exporter_configuration,
|
79
|
-
path_to_crashtracking_receiver_binary: path_to_crashtracking_receiver_binary,
|
80
|
-
ld_library_path: ld_library_path,
|
81
|
-
tags_as_array: tags_as_array,
|
82
|
-
upload_timeout_seconds: Integer(upload_timeout_seconds),
|
83
|
-
)
|
84
|
-
Datadog.logger.debug("Crash tracking #{action} successful")
|
85
|
-
rescue => e
|
86
|
-
Datadog.logger.error("Failed to #{action} crash tracking: #{e.message}")
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Datadog
|
4
|
-
module Profiling
|
5
|
-
module Ext
|
6
|
-
# Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore
|
7
|
-
# profiling abilities after the VM forks.
|
8
|
-
#
|
9
|
-
# Known limitations: Does not handle `BasicObject`s that include `Kernel` directly; e.g.
|
10
|
-
# `Class.new(BasicObject) { include(::Kernel); def call; fork { }; end }.new.call`.
|
11
|
-
#
|
12
|
-
# This will be fixed once we moved to hooking into `Process._fork`
|
13
|
-
module Forking
|
14
|
-
def self.supported?
|
15
|
-
Process.respond_to?(:fork)
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.apply!
|
19
|
-
return false unless supported?
|
20
|
-
|
21
|
-
[
|
22
|
-
::Process.singleton_class, # Process.fork
|
23
|
-
::Kernel.singleton_class, # Kernel.fork
|
24
|
-
::Object, # fork without explicit receiver (it's defined as a method in ::Kernel)
|
25
|
-
# Note: Modifying Object as we do here is irreversible. During tests, this
|
26
|
-
# change will stick around even if we otherwise stub `Process` and `Kernel`
|
27
|
-
].each { |target| target.prepend(Kernel) }
|
28
|
-
|
29
|
-
::Process.singleton_class.prepend(ProcessDaemonPatch)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Extensions for kernel
|
33
|
-
#
|
34
|
-
# TODO: Consider hooking into `Process._fork` on Ruby 3.1+ instead, see
|
35
|
-
# https://github.com/ruby/ruby/pull/5017 and https://bugs.ruby-lang.org/issues/17795
|
36
|
-
module Kernel
|
37
|
-
def fork
|
38
|
-
# If a block is provided, it must be wrapped to trigger callbacks.
|
39
|
-
child_block = if block_given?
|
40
|
-
proc do
|
41
|
-
# Trigger :child callback
|
42
|
-
datadog_at_fork_blocks[:child].each(&:call) if datadog_at_fork_blocks.key?(:child)
|
43
|
-
|
44
|
-
# Invoke original block
|
45
|
-
yield
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Start fork
|
50
|
-
# If a block is provided, use the wrapped version.
|
51
|
-
result = child_block.nil? ? super : super(&child_block)
|
52
|
-
|
53
|
-
# Trigger correct callbacks depending on whether we're in the parent or child.
|
54
|
-
# If we're in the fork, result = nil: trigger child callbacks.
|
55
|
-
# If we're in the parent, result = fork PID: trigger parent callbacks.
|
56
|
-
datadog_at_fork_blocks[:child].each(&:call) if result.nil? && datadog_at_fork_blocks.key?(:child)
|
57
|
-
|
58
|
-
# Return PID from #fork
|
59
|
-
result
|
60
|
-
end
|
61
|
-
|
62
|
-
def at_fork(stage, &block)
|
63
|
-
raise ArgumentError, 'Bad \'stage\' for ::at_fork' unless stage == :child
|
64
|
-
|
65
|
-
datadog_at_fork_blocks[stage] = [] unless datadog_at_fork_blocks.key?(stage)
|
66
|
-
datadog_at_fork_blocks[stage] << block
|
67
|
-
end
|
68
|
-
|
69
|
-
module_function
|
70
|
-
|
71
|
-
def datadog_at_fork_blocks
|
72
|
-
# Blocks should be shared across all users of this module,
|
73
|
-
# e.g. Process#fork, Kernel#fork, etc. should all invoke the same callbacks.
|
74
|
-
# rubocop:disable Style/ClassVars
|
75
|
-
@@datadog_at_fork_blocks ||= {}
|
76
|
-
# rubocop:enable Style/ClassVars
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# A call to Process.daemon ( https://rubyapi.org/3.1/o/process#method-c-daemon ) forks the current process and
|
81
|
-
# keeps executing code in the child process, killing off the parent, thus effectively replacing it.
|
82
|
-
#
|
83
|
-
# This monkey patch makes the `Kernel#at_fork` mechanism defined above also work in this situation.
|
84
|
-
module ProcessDaemonPatch
|
85
|
-
def daemon(*args)
|
86
|
-
datadog_at_fork_blocks = Datadog::Profiling::Ext::Forking::Kernel.datadog_at_fork_blocks
|
87
|
-
|
88
|
-
result = super
|
89
|
-
|
90
|
-
datadog_at_fork_blocks[:child].each(&:call) if datadog_at_fork_blocks.key?(:child)
|
91
|
-
|
92
|
-
result
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|