datadog 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +87 -2
- data/ext/datadog_profiling_loader/datadog_profiling_loader.c +9 -1
- data/ext/datadog_profiling_loader/extconf.rb +14 -26
- 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 +257 -69
- data/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c +53 -28
- 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 +136 -81
- data/ext/datadog_profiling_native_extension/collectors_stack.h +2 -2
- data/ext/datadog_profiling_native_extension/collectors_thread_context.c +661 -48
- data/ext/datadog_profiling_native_extension/collectors_thread_context.h +10 -1
- data/ext/datadog_profiling_native_extension/datadog_ruby_common.c +83 -0
- data/ext/datadog_profiling_native_extension/datadog_ruby_common.h +53 -0
- data/ext/datadog_profiling_native_extension/extconf.rb +91 -69
- data/ext/datadog_profiling_native_extension/gvl_profiling_helper.c +50 -0
- data/ext/datadog_profiling_native_extension/gvl_profiling_helper.h +75 -0
- data/ext/datadog_profiling_native_extension/heap_recorder.c +54 -12
- 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 +41 -9
- 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 -172
- data/ext/datadog_profiling_native_extension/private_vm_api_access.c +116 -139
- data/ext/datadog_profiling_native_extension/private_vm_api_access.h +20 -11
- data/ext/datadog_profiling_native_extension/profiling.c +1 -3
- 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.h +1 -0
- data/ext/datadog_profiling_native_extension/stack_recorder.c +14 -2
- 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 +37 -22
- data/ext/libdatadog_api/datadog_ruby_common.c +83 -0
- data/ext/libdatadog_api/datadog_ruby_common.h +53 -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/assets/waf_rules/recommended.json +2184 -108
- data/lib/datadog/appsec/assets/waf_rules/strict.json +1430 -2
- data/lib/datadog/appsec/component.rb +29 -8
- data/lib/datadog/appsec/configuration/settings.rb +2 -2
- data/lib/datadog/appsec/contrib/devise/patcher/authenticatable_patch.rb +1 -0
- data/lib/datadog/appsec/contrib/devise/patcher/rememberable_patch.rb +21 -0
- data/lib/datadog/appsec/contrib/devise/patcher.rb +12 -2
- data/lib/datadog/appsec/contrib/graphql/appsec_trace.rb +35 -0
- data/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb +109 -0
- data/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb +71 -0
- data/lib/datadog/appsec/contrib/graphql/integration.rb +54 -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 +3 -6
- data/lib/datadog/appsec/event.rb +1 -1
- data/lib/datadog/appsec/processor/actions.rb +1 -1
- data/lib/datadog/appsec/processor/rule_loader.rb +3 -1
- data/lib/datadog/appsec/processor/rule_merger.rb +33 -15
- data/lib/datadog/appsec/processor.rb +36 -37
- data/lib/datadog/appsec/rate_limiter.rb +25 -40
- data/lib/datadog/appsec/remote.rb +7 -3
- data/lib/datadog/appsec/response.rb +15 -1
- data/lib/datadog/appsec.rb +3 -2
- data/lib/datadog/core/configuration/components.rb +18 -15
- data/lib/datadog/core/configuration/settings.rb +135 -9
- 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/diagnostics/environment_logger.rb +8 -11
- data/lib/datadog/core/environment/execution.rb +5 -5
- data/lib/datadog/core/metrics/client.rb +7 -0
- data/lib/datadog/core/rate_limiter.rb +183 -0
- data/lib/datadog/core/remote/client/capabilities.rb +4 -3
- data/lib/datadog/core/remote/component.rb +4 -2
- data/lib/datadog/core/remote/negotiation.rb +4 -4
- data/lib/datadog/core/remote/tie.rb +2 -0
- data/lib/datadog/core/runtime/metrics.rb +1 -1
- data/lib/datadog/core/telemetry/component.rb +51 -2
- data/lib/datadog/core/telemetry/emitter.rb +9 -11
- data/lib/datadog/core/telemetry/event.rb +37 -1
- data/lib/datadog/core/telemetry/ext.rb +1 -0
- data/lib/datadog/core/telemetry/http/adapters/net.rb +10 -12
- 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/logger.rb +51 -0
- data/lib/datadog/core/telemetry/logging.rb +71 -0
- data/lib/datadog/core/telemetry/request.rb +13 -1
- data/lib/datadog/core/utils/at_fork_monkey_patch.rb +102 -0
- data/lib/datadog/core/utils/time.rb +12 -0
- data/lib/datadog/di/code_tracker.rb +168 -0
- data/lib/datadog/di/configuration/settings.rb +163 -0
- data/lib/datadog/di/configuration.rb +11 -0
- data/lib/datadog/di/error.rb +31 -0
- data/lib/datadog/di/extensions.rb +16 -0
- data/lib/datadog/di/probe.rb +133 -0
- data/lib/datadog/di/probe_builder.rb +41 -0
- data/lib/datadog/di/redactor.rb +188 -0
- data/lib/datadog/di/serializer.rb +193 -0
- data/lib/datadog/di.rb +14 -0
- data/lib/datadog/kit/appsec/events.rb +2 -4
- data/lib/datadog/opentelemetry/sdk/propagator.rb +2 -0
- data/lib/datadog/opentelemetry/sdk/span_processor.rb +10 -0
- data/lib/datadog/opentelemetry/sdk/trace/span.rb +23 -0
- data/lib/datadog/profiling/collectors/code_provenance.rb +7 -7
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +28 -26
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +11 -13
- data/lib/datadog/profiling/collectors/info.rb +15 -6
- data/lib/datadog/profiling/collectors/thread_context.rb +30 -2
- data/lib/datadog/profiling/component.rb +89 -95
- data/lib/datadog/profiling/exporter.rb +3 -3
- data/lib/datadog/profiling/ext/dir_monkey_patches.rb +3 -3
- data/lib/datadog/profiling/ext.rb +21 -21
- data/lib/datadog/profiling/flush.rb +1 -1
- data/lib/datadog/profiling/http_transport.rb +14 -7
- 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 +33 -25
- data/lib/datadog/profiling/stack_recorder.rb +3 -0
- 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 +4 -5
- data/lib/datadog/single_step_instrument.rb +12 -0
- data/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +8 -12
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +5 -0
- data/lib/datadog/tracing/contrib/action_pack/action_dispatch/instrumentation.rb +78 -0
- data/lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb +33 -0
- data/lib/datadog/tracing/contrib/action_pack/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +4 -0
- data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +3 -1
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +4 -1
- data/lib/datadog/tracing/contrib/active_support/cache/events/cache.rb +5 -1
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +5 -0
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +6 -1
- data/lib/datadog/tracing/contrib/ext.rb +14 -0
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +9 -0
- data/lib/datadog/tracing/contrib/grape/endpoint.rb +19 -0
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +9 -12
- data/lib/datadog/tracing/contrib/graphql/trace_patcher.rb +3 -3
- data/lib/datadog/tracing/contrib/graphql/tracing_patcher.rb +3 -3
- data/lib/datadog/tracing/contrib/graphql/unified_trace.rb +14 -10
- data/lib/datadog/tracing/contrib/graphql/unified_trace_patcher.rb +10 -4
- data/lib/datadog/tracing/contrib/http/instrumentation.rb +18 -15
- data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +6 -5
- data/lib/datadog/tracing/contrib/httpclient/patcher.rb +1 -14
- data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +5 -0
- data/lib/datadog/tracing/contrib/httprb/patcher.rb +1 -14
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +15 -0
- data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +2 -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/opensearch/patcher.rb +13 -6
- data/lib/datadog/tracing/contrib/patcher.rb +2 -1
- 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/presto/patcher.rb +1 -13
- 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/rack/middlewares.rb +27 -0
- data/lib/datadog/tracing/contrib/redis/tags.rb +4 -0
- data/lib/datadog/tracing/contrib/sinatra/tracer.rb +4 -0
- data/lib/datadog/tracing/contrib/stripe/request.rb +3 -2
- 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/propagation.rb +7 -0
- data/lib/datadog/tracing/metadata/errors.rb +9 -1
- data/lib/datadog/tracing/metadata/ext.rb +6 -0
- data/lib/datadog/tracing/pipeline/span_filter.rb +2 -2
- data/lib/datadog/tracing/remote.rb +5 -2
- data/lib/datadog/tracing/sampling/matcher.rb +6 -1
- data/lib/datadog/tracing/sampling/rate_sampler.rb +1 -1
- data/lib/datadog/tracing/sampling/rule.rb +2 -0
- data/lib/datadog/tracing/sampling/rule_sampler.rb +9 -5
- data/lib/datadog/tracing/sampling/span/ext.rb +1 -1
- data/lib/datadog/tracing/sampling/span/rule.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 +6 -2
- data/lib/datadog/tracing/trace_operation.rb +26 -2
- data/lib/datadog/tracing/tracer.rb +14 -12
- data/lib/datadog/tracing/transport/http/client.rb +1 -0
- data/lib/datadog/tracing/transport/io/client.rb +1 -0
- data/lib/datadog/tracing/transport/serializable_trace.rb +3 -0
- data/lib/datadog/tracing/workers/trace_writer.rb +1 -1
- data/lib/datadog/tracing/workers.rb +1 -1
- data/lib/datadog/version.rb +1 -1
- metadata +46 -11
- data/lib/datadog/profiling/crashtracker.rb +0 -91
- data/lib/datadog/profiling/ext/forking.rb +0 -98
- data/lib/datadog/tracing/sampling/rate_limiter.rb +0 -185
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba1dc00d9afe70c54ea0918673e832793bb7c7a629618dc3d36e066fd121ea56
|
4
|
+
data.tar.gz: 9818bf0ba8dbd989451b7b0492efe848a9cdf97239acac3637aaa9d17937b541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 419ac80497f45159d199d2b9d3b16c70c46903d65d828c6e5ab52029758c9b38e11b243e112d52e3e9d45f05d5e1acf814bcb3f7582496f1e5be120c13f0f685
|
7
|
+
data.tar.gz: ce8f36e974b194fbdedd40fdf634e49115c0bd6befb350092dfc4cb94185a173a7d3325b6adc9cf50e060b05a4968ca7858a52082748a4979090a7eb32aa96ba
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,57 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [2.4.0] - 2024-10-11
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
* Core: Allow changing sampling rate for customer defined tags and resources ([#3956][])
|
10
|
+
* Profiling: Add GVL profiling for Ruby 3.2+ as a preview feature ([#3929][])
|
11
|
+
* Profiling: Otel: Add preview support for correlating profiling with otel ruby gem ([#3984][])
|
12
|
+
* Tracing: AppSec: Add http.route tag to Rails, Grape, and Sinatra integrations ([#3849][])
|
13
|
+
* Tracing: Add capabilities to remote config: tracing sample rate, tracing logs injection, tracing http header tags ([#3888][])
|
14
|
+
* AppSec: Add a force disable of AppSec feature when using Ruby >= 3.3 with old FFI gem version ([#3969][])
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
* AppSec: Improve PII compliance ([#3857][])
|
19
|
+
* AppSec: Integrations: Improve accuracy of login tracking for Devise ([#3867][])
|
20
|
+
* Crashtracking feature is now disabled by default ([#3970][])
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
|
24
|
+
* AppSec: Integrations: Fix GraphQL instrumentation for query fragments ([#3887][])
|
25
|
+
* Bug: Profiling: Fix (small) memory leak in profiler when forking ([#3852][])
|
26
|
+
* Tracing: Integrations: Fix GraphQL integration reconfiguration ([#3859][])
|
27
|
+
|
28
|
+
## [2.3.0] - 2024-08-22
|
29
|
+
|
30
|
+
### Added
|
31
|
+
|
32
|
+
* Core: Support agentless telemetry ([#3779][])
|
33
|
+
* Tracing: Add support for span events ([#3776][])
|
34
|
+
* Tracing: Add tags to enable inferred service dependencies for databases ([#3789][])
|
35
|
+
* Tracing: Emit log message and instructions for incompatible Lograge setup ([#3812][], [#3839][])
|
36
|
+
* Tracing: Add `append_comment` option to append SQL comment propagation for `mysql`, `pg` and `trilogy` ([#3809][])
|
37
|
+
* AppSec: Add threat detection and protection for `graphql` ([#3769][], [#3814][])
|
38
|
+
|
39
|
+
### Changed
|
40
|
+
|
41
|
+
* Core: Enable crashtracking by default ([#3826][])
|
42
|
+
* Profiling: Reduce allocation overhead ([#3805][], [#3797][])
|
43
|
+
* Profiling: Speed up stack sampling ([#3837][])
|
44
|
+
* Profiling: Upgrade to libdatadog 11 ([#3799][])
|
45
|
+
* Profiling: Disable allocation counting feature by default ([#3798][])
|
46
|
+
* Profiling: Reduce the maximum biased result for allocation samples ([#3793][])
|
47
|
+
* Tracing: Reduce noisy integration logs ([#3785][])
|
48
|
+
|
49
|
+
### Fixed
|
50
|
+
|
51
|
+
* Tracing: Fix `require` issue for `graphql` ([#3813][])
|
52
|
+
* AppSec: Fix an error when parsing http headers with integer value ([#3790][])
|
53
|
+
* AppSec: Fix an error when tracking login failure without `user_id` ([#3841][])
|
54
|
+
* Fix a syntax error for Ruby < 2.4 during single step instrumentation ([#3795][])
|
55
|
+
|
5
56
|
## [2.2.0] - 2024-07-11
|
6
57
|
|
7
58
|
### Added
|
@@ -2934,7 +2985,9 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
2934
2985
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
2935
2986
|
|
2936
2987
|
|
2937
|
-
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.
|
2988
|
+
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.4.0...master
|
2989
|
+
[2.4.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.3.0...v2.4.0
|
2990
|
+
[2.3.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.2.0...v2.3.0
|
2938
2991
|
[2.2.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.1.0...v2.2.0
|
2939
2992
|
[2.1.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.0.0...v2.1.0
|
2940
2993
|
[2.0.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.0.0.rc1...v2.0.0
|
@@ -4331,9 +4384,41 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
4331
4384
|
[#3753]: https://github.com/DataDog/dd-trace-rb/issues/3753
|
4332
4385
|
[#3757]: https://github.com/DataDog/dd-trace-rb/issues/3757
|
4333
4386
|
[#3759]: https://github.com/DataDog/dd-trace-rb/issues/3759
|
4387
|
+
[#3769]: https://github.com/DataDog/dd-trace-rb/issues/3769
|
4334
4388
|
[#3770]: https://github.com/DataDog/dd-trace-rb/issues/3770
|
4335
4389
|
[#3772]: https://github.com/DataDog/dd-trace-rb/issues/3772
|
4336
4390
|
[#3774]: https://github.com/DataDog/dd-trace-rb/issues/3774
|
4391
|
+
[#3776]: https://github.com/DataDog/dd-trace-rb/issues/3776
|
4392
|
+
[#3779]: https://github.com/DataDog/dd-trace-rb/issues/3779
|
4393
|
+
[#3785]: https://github.com/DataDog/dd-trace-rb/issues/3785
|
4394
|
+
[#3789]: https://github.com/DataDog/dd-trace-rb/issues/3789
|
4395
|
+
[#3790]: https://github.com/DataDog/dd-trace-rb/issues/3790
|
4396
|
+
[#3793]: https://github.com/DataDog/dd-trace-rb/issues/3793
|
4397
|
+
[#3795]: https://github.com/DataDog/dd-trace-rb/issues/3795
|
4398
|
+
[#3797]: https://github.com/DataDog/dd-trace-rb/issues/3797
|
4399
|
+
[#3798]: https://github.com/DataDog/dd-trace-rb/issues/3798
|
4400
|
+
[#3799]: https://github.com/DataDog/dd-trace-rb/issues/3799
|
4401
|
+
[#3805]: https://github.com/DataDog/dd-trace-rb/issues/3805
|
4402
|
+
[#3809]: https://github.com/DataDog/dd-trace-rb/issues/3809
|
4403
|
+
[#3812]: https://github.com/DataDog/dd-trace-rb/issues/3812
|
4404
|
+
[#3813]: https://github.com/DataDog/dd-trace-rb/issues/3813
|
4405
|
+
[#3814]: https://github.com/DataDog/dd-trace-rb/issues/3814
|
4406
|
+
[#3826]: https://github.com/DataDog/dd-trace-rb/issues/3826
|
4407
|
+
[#3837]: https://github.com/DataDog/dd-trace-rb/issues/3837
|
4408
|
+
[#3839]: https://github.com/DataDog/dd-trace-rb/issues/3839
|
4409
|
+
[#3841]: https://github.com/DataDog/dd-trace-rb/issues/3841
|
4410
|
+
[#3849]: https://github.com/DataDog/dd-trace-rb/issues/3849
|
4411
|
+
[#3852]: https://github.com/DataDog/dd-trace-rb/issues/3852
|
4412
|
+
[#3857]: https://github.com/DataDog/dd-trace-rb/issues/3857
|
4413
|
+
[#3859]: https://github.com/DataDog/dd-trace-rb/issues/3859
|
4414
|
+
[#3867]: https://github.com/DataDog/dd-trace-rb/issues/3867
|
4415
|
+
[#3887]: https://github.com/DataDog/dd-trace-rb/issues/3887
|
4416
|
+
[#3888]: https://github.com/DataDog/dd-trace-rb/issues/3888
|
4417
|
+
[#3929]: https://github.com/DataDog/dd-trace-rb/issues/3929
|
4418
|
+
[#3956]: https://github.com/DataDog/dd-trace-rb/issues/3956
|
4419
|
+
[#3969]: https://github.com/DataDog/dd-trace-rb/issues/3969
|
4420
|
+
[#3970]: https://github.com/DataDog/dd-trace-rb/issues/3970
|
4421
|
+
[#3984]: https://github.com/DataDog/dd-trace-rb/issues/3984
|
4337
4422
|
[@AdrianLC]: https://github.com/AdrianLC
|
4338
4423
|
[@Azure7111]: https://github.com/Azure7111
|
4339
4424
|
[@BabyGroot]: https://github.com/BabyGroot
|
@@ -4485,4 +4570,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
4485
4570
|
[@y-yagi]: https://github.com/y-yagi
|
4486
4571
|
[@yujideveloper]: https://github.com/yujideveloper
|
4487
4572
|
[@yukimurasawa]: https://github.com/yukimurasawa
|
4488
|
-
[@zachmccormick]: https://github.com/zachmccormick
|
4573
|
+
[@zachmccormick]: https://github.com/zachmccormick
|
@@ -65,7 +65,15 @@ static VALUE _native_load(DDTRACE_UNUSED VALUE self, VALUE ruby_path, VALUE ruby
|
|
65
65
|
char *path = StringValueCStr(ruby_path);
|
66
66
|
char *init_name = StringValueCStr(ruby_init_name);
|
67
67
|
|
68
|
-
|
68
|
+
int dlopen_flags = RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND;
|
69
|
+
|
70
|
+
#if defined(__has_feature)
|
71
|
+
#if __has_feature(address_sanitizer)
|
72
|
+
dlopen_flags &= ~RTLD_DEEPBIND; // Not supported by ASAN
|
73
|
+
#endif
|
74
|
+
#endif
|
75
|
+
|
76
|
+
void *handle = dlopen(path, dlopen_flags);
|
69
77
|
|
70
78
|
VALUE failure_details = Qnil;
|
71
79
|
|
@@ -1,49 +1,38 @@
|
|
1
1
|
# rubocop:disable Style/StderrPuts
|
2
|
-
# rubocop:disable Style/GlobalVars
|
3
2
|
|
4
|
-
if RUBY_ENGINE !=
|
3
|
+
if RUBY_ENGINE != "ruby" || Gem.win_platform?
|
5
4
|
$stderr.puts(
|
6
|
-
|
5
|
+
"WARN: Skipping build of Datadog profiling loader. See Datadog profiling native extension note for details."
|
7
6
|
)
|
8
7
|
|
9
|
-
File.write(
|
8
|
+
File.write("Makefile", "all install clean: # dummy makefile that does nothing")
|
10
9
|
exit
|
11
10
|
end
|
12
11
|
|
13
|
-
require
|
14
|
-
|
15
|
-
# mkmf on modern Rubies actually has an append_cflags that does something similar
|
16
|
-
# (see https://github.com/ruby/ruby/pull/5760), but as usual we need a bit more boilerplate to deal with legacy Rubies
|
17
|
-
def add_compiler_flag(flag)
|
18
|
-
if try_cflags(flag)
|
19
|
-
$CFLAGS << ' ' << flag
|
20
|
-
else
|
21
|
-
$stderr.puts("WARNING: '#{flag}' not accepted by compiler, skipping it")
|
22
|
-
end
|
23
|
-
end
|
12
|
+
require "mkmf"
|
24
13
|
|
25
14
|
# Because we can't control what compiler versions our customers use, shipping with -Werror by default is a no-go.
|
26
15
|
# But we can enable it in CI, so that we quickly spot any new warnings that just got introduced.
|
27
|
-
|
16
|
+
append_cflags "-Werror" if ENV["DATADOG_GEM_CI"] == "true"
|
28
17
|
|
29
18
|
# Older gcc releases may not default to C99 and we need to ask for this. This is also used:
|
30
19
|
# * by upstream Ruby -- search for gnu99 in the codebase
|
31
20
|
# * by msgpack, another datadog gem dependency
|
32
21
|
# (https://github.com/msgpack/msgpack-ruby/blob/18ce08f6d612fe973843c366ac9a0b74c4e50599/ext/msgpack/extconf.rb#L8)
|
33
|
-
|
22
|
+
append_cflags "-std=gnu99"
|
34
23
|
|
35
24
|
# Gets really noisy when we include the MJIT header, let's omit it (TODO: Use #pragma GCC diagnostic instead?)
|
36
|
-
|
25
|
+
append_cflags "-Wno-unused-function"
|
37
26
|
|
38
27
|
# Allow defining variables at any point in a function
|
39
|
-
|
28
|
+
append_cflags "-Wno-declaration-after-statement"
|
40
29
|
|
41
30
|
# If we forget to include a Ruby header, the function call may still appear to work, but then
|
42
31
|
# cause a segfault later. Let's ensure that never happens.
|
43
|
-
|
32
|
+
append_cflags "-Werror-implicit-function-declaration"
|
44
33
|
|
45
34
|
# Warn on unused parameters to functions. Use `DDTRACE_UNUSED` to mark things as known-to-not-be-used.
|
46
|
-
|
35
|
+
append_cflags "-Wunused-parameter"
|
47
36
|
|
48
37
|
# The native extension is not intended to expose any symbols/functions for other native libraries to use;
|
49
38
|
# the sole exception being `Init_datadog_profiling_loader` which needs to be visible for Ruby to call it when
|
@@ -51,14 +40,14 @@ add_compiler_flag '-Wunused-parameter'
|
|
51
40
|
#
|
52
41
|
# By setting this compiler flag, we tell it to assume that everything is private unless explicitly stated.
|
53
42
|
# For more details see https://gcc.gnu.org/wiki/Visibility
|
54
|
-
|
43
|
+
append_cflags "-fvisibility=hidden"
|
55
44
|
|
56
45
|
# Avoid legacy C definitions
|
57
|
-
|
46
|
+
append_cflags "-Wold-style-definition"
|
58
47
|
|
59
48
|
# Enable all other compiler warnings
|
60
|
-
|
61
|
-
|
49
|
+
append_cflags "-Wall"
|
50
|
+
append_cflags "-Wextra"
|
62
51
|
|
63
52
|
# Tag the native extension library with the Ruby version and Ruby platform.
|
64
53
|
# This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that
|
@@ -68,5 +57,4 @@ EXTENSION_NAME = "datadog_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}".fre
|
|
68
57
|
|
69
58
|
create_makefile(EXTENSION_NAME)
|
70
59
|
|
71
|
-
# rubocop:enable Style/GlobalVars
|
72
60
|
# rubocop:enable Style/StderrPuts
|
@@ -7,11 +7,10 @@
|
|
7
7
|
#include <pthread.h>
|
8
8
|
#include <time.h>
|
9
9
|
#include <errno.h>
|
10
|
-
#include <ruby.h>
|
11
10
|
|
11
|
+
#include "clock_id.h"
|
12
12
|
#include "helpers.h"
|
13
13
|
#include "private_vm_api_access.h"
|
14
|
-
#include "clock_id.h"
|
15
14
|
#include "time_helpers.h"
|
16
15
|
|
17
16
|
// Validate that our home-cooked pthread_id_for() matches pthread_self() for the current thread
|