datadog 2.22.0 → 2.23.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 +59 -2
- data/ext/LIBDATADOG_DEVELOPMENT.md +1 -58
- data/ext/datadog_profiling_native_extension/collectors_stack.c +4 -0
- data/ext/datadog_profiling_native_extension/datadog_ruby_common.h +1 -1
- data/ext/datadog_profiling_native_extension/extconf.rb +6 -4
- data/ext/datadog_profiling_native_extension/heap_recorder.c +1 -1
- data/ext/libdatadog_api/datadog_ruby_common.h +1 -1
- data/ext/libdatadog_api/feature_flags.c +554 -0
- data/ext/libdatadog_api/feature_flags.h +5 -0
- data/ext/libdatadog_api/init.c +2 -0
- data/ext/libdatadog_api/library_config.c +12 -11
- data/ext/libdatadog_extconf_helpers.rb +1 -1
- data/lib/datadog/appsec/api_security/route_extractor.rb +23 -6
- data/lib/datadog/appsec/api_security/sampler.rb +7 -4
- data/lib/datadog/appsec/assets/blocked.html +8 -0
- data/lib/datadog/appsec/assets/blocked.json +1 -1
- data/lib/datadog/appsec/assets/blocked.text +3 -1
- data/lib/datadog/appsec/assets.rb +1 -1
- data/lib/datadog/appsec/remote.rb +4 -0
- data/lib/datadog/appsec/response.rb +18 -4
- data/lib/datadog/core/configuration/components.rb +30 -3
- data/lib/datadog/core/configuration/config_helper.rb +1 -1
- data/lib/datadog/core/configuration/settings.rb +14 -0
- data/lib/datadog/core/configuration/supported_configurations.rb +330 -301
- data/lib/datadog/core/ddsketch.rb +0 -2
- data/lib/datadog/core/environment/ext.rb +6 -0
- data/lib/datadog/core/environment/process.rb +79 -0
- data/lib/datadog/core/feature_flags.rb +61 -0
- data/lib/datadog/core/remote/client/capabilities.rb +7 -0
- data/lib/datadog/core/remote/transport/config.rb +2 -10
- data/lib/datadog/core/remote/transport/http/config.rb +9 -9
- data/lib/datadog/core/remote/transport/http/negotiation.rb +17 -8
- data/lib/datadog/core/remote/transport/http.rb +2 -0
- data/lib/datadog/core/remote/transport/negotiation.rb +2 -18
- data/lib/datadog/core/remote/worker.rb +25 -37
- data/lib/datadog/core/tag_builder.rb +0 -4
- data/lib/datadog/core/tag_normalizer.rb +84 -0
- data/lib/datadog/core/telemetry/component.rb +7 -3
- data/lib/datadog/core/telemetry/event/app_started.rb +52 -49
- data/lib/datadog/core/telemetry/event/synth_app_client_configuration_change.rb +1 -1
- data/lib/datadog/core/telemetry/logger.rb +2 -2
- data/lib/datadog/core/telemetry/logging.rb +2 -8
- data/lib/datadog/core/telemetry/transport/http/telemetry.rb +5 -6
- data/lib/datadog/core/telemetry/transport/telemetry.rb +1 -2
- data/lib/datadog/core/transport/http/client.rb +69 -0
- data/lib/datadog/core/utils/array.rb +29 -0
- data/lib/datadog/{appsec/api_security → core/utils}/lru_cache.rb +10 -21
- data/lib/datadog/core/utils/network.rb +3 -1
- data/lib/datadog/core/utils/only_once_successful.rb +6 -2
- data/lib/datadog/core/utils.rb +2 -0
- data/lib/datadog/data_streams/configuration/settings.rb +49 -0
- data/lib/datadog/data_streams/configuration.rb +11 -0
- data/lib/datadog/data_streams/ext.rb +11 -0
- data/lib/datadog/data_streams/extensions.rb +16 -0
- data/lib/datadog/data_streams/pathway_context.rb +169 -0
- data/lib/datadog/data_streams/processor.rb +509 -0
- data/lib/datadog/data_streams/transport/http/api.rb +33 -0
- data/lib/datadog/data_streams/transport/http/client.rb +21 -0
- data/lib/datadog/data_streams/transport/http/stats.rb +87 -0
- data/lib/datadog/data_streams/transport/http.rb +41 -0
- data/lib/datadog/data_streams/transport/stats.rb +60 -0
- data/lib/datadog/data_streams.rb +100 -0
- data/lib/datadog/di/component.rb +0 -16
- data/lib/datadog/di/el/evaluator.rb +1 -1
- data/lib/datadog/di/error.rb +4 -0
- data/lib/datadog/di/instrumenter.rb +76 -30
- data/lib/datadog/di/probe.rb +20 -0
- data/lib/datadog/di/probe_manager.rb +10 -2
- data/lib/datadog/di/probe_notification_builder.rb +62 -23
- data/lib/datadog/di/proc_responder.rb +32 -0
- data/lib/datadog/di/transport/diagnostics.rb +2 -2
- data/lib/datadog/di/transport/http/diagnostics.rb +2 -4
- data/lib/datadog/di/transport/http/input.rb +2 -4
- data/lib/datadog/di/transport/http.rb +6 -2
- data/lib/datadog/di/transport/input.rb +64 -4
- data/lib/datadog/open_feature/component.rb +60 -0
- data/lib/datadog/open_feature/configuration.rb +27 -0
- data/lib/datadog/open_feature/evaluation_engine.rb +69 -0
- data/lib/datadog/open_feature/exposures/batch_builder.rb +32 -0
- data/lib/datadog/open_feature/exposures/buffer.rb +43 -0
- data/lib/datadog/open_feature/exposures/deduplicator.rb +30 -0
- data/lib/datadog/open_feature/exposures/event.rb +60 -0
- data/lib/datadog/open_feature/exposures/reporter.rb +40 -0
- data/lib/datadog/open_feature/exposures/worker.rb +116 -0
- data/lib/datadog/open_feature/ext.rb +14 -0
- data/lib/datadog/open_feature/native_evaluator.rb +38 -0
- data/lib/datadog/open_feature/noop_evaluator.rb +26 -0
- data/lib/datadog/open_feature/provider.rb +141 -0
- data/lib/datadog/open_feature/remote.rb +74 -0
- data/lib/datadog/open_feature/resolution_details.rb +35 -0
- data/lib/datadog/open_feature/transport.rb +72 -0
- data/lib/datadog/open_feature.rb +19 -0
- data/lib/datadog/opentelemetry/configuration/settings.rb +159 -0
- data/lib/datadog/opentelemetry/metrics.rb +110 -0
- data/lib/datadog/opentelemetry/sdk/configurator.rb +25 -1
- data/lib/datadog/opentelemetry/sdk/metrics_exporter.rb +38 -0
- data/lib/datadog/opentelemetry.rb +3 -0
- data/lib/datadog/profiling/collectors/code_provenance.rb +15 -6
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +1 -1
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +1 -1
- data/lib/datadog/profiling/profiler.rb +4 -0
- data/lib/datadog/profiling/tag_builder.rb +36 -3
- data/lib/datadog/profiling.rb +1 -2
- data/lib/datadog/single_step_instrument.rb +1 -1
- data/lib/datadog/tracing/configuration/ext.rb +9 -0
- data/lib/datadog/tracing/configuration/settings.rb +74 -0
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +4 -4
- data/lib/datadog/tracing/contrib/action_pack/utils.rb +1 -2
- data/lib/datadog/tracing/contrib/active_job/log_injection.rb +21 -7
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +5 -1
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +4 -2
- data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +4 -1
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +11 -3
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +11 -7
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +7 -3
- data/lib/datadog/tracing/contrib/graphql/unified_trace.rb +22 -17
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +11 -3
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +11 -3
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +11 -3
- data/lib/datadog/tracing/contrib/kafka/instrumentation/consumer.rb +66 -0
- data/lib/datadog/tracing/contrib/kafka/instrumentation/producer.rb +66 -0
- data/lib/datadog/tracing/contrib/kafka/patcher.rb +14 -0
- data/lib/datadog/tracing/contrib/karafka/framework.rb +30 -0
- data/lib/datadog/tracing/contrib/karafka/monitor.rb +11 -0
- data/lib/datadog/tracing/contrib/karafka/patcher.rb +32 -0
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +59 -27
- data/lib/datadog/tracing/contrib/rack/route_inference.rb +53 -0
- data/lib/datadog/tracing/contrib/rails/middlewares.rb +2 -2
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +4 -1
- data/lib/datadog/tracing/contrib/roda/instrumentation.rb +3 -1
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +3 -1
- data/lib/datadog/tracing/contrib/status_range_matcher.rb +7 -0
- data/lib/datadog/tracing/contrib/waterdrop/configuration/settings.rb +27 -0
- data/lib/datadog/tracing/contrib/waterdrop/distributed/propagation.rb +48 -0
- data/lib/datadog/tracing/contrib/waterdrop/ext.rb +17 -0
- data/lib/datadog/tracing/contrib/waterdrop/integration.rb +43 -0
- data/lib/datadog/tracing/contrib/waterdrop/middleware.rb +46 -0
- data/lib/datadog/tracing/contrib/waterdrop/patcher.rb +46 -0
- data/lib/datadog/tracing/contrib/waterdrop/producer.rb +50 -0
- data/lib/datadog/tracing/contrib/waterdrop.rb +37 -0
- data/lib/datadog/tracing/contrib.rb +1 -0
- data/lib/datadog/tracing/metadata/ext.rb +1 -1
- data/lib/datadog/tracing/transport/http/client.rb +12 -26
- data/lib/datadog/tracing/transport/trace_formatter.rb +11 -0
- data/lib/datadog/tracing/transport/traces.rb +3 -5
- data/lib/datadog/version.rb +2 -2
- data/lib/datadog.rb +2 -0
- metadata +78 -15
- data/lib/datadog/core/remote/transport/http/client.rb +0 -49
- data/lib/datadog/core/telemetry/transport/http/client.rb +0 -49
- data/lib/datadog/di/transport/http/client.rb +0 -47
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a168735b19c403a74cd23f49a301a74006d827ff24f62cc93255a353d0415359
|
|
4
|
+
data.tar.gz: 7f6df03ec7834bf5709b36d8fa9a8213ad5c5f9bf04e299acb7d3c1e781760e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a933fb99fd374b1da93fd0a70b7cb33b2396977e8388ebfd5e12d968da7158ef8fc23a73672c308f8a72e433525c99ac1182285adc2df1eb244082efeef374bb
|
|
7
|
+
data.tar.gz: 224bbcc48cde29a3a85c1eea9d5e1653ed26ad2d195389e599f2e4614158d63284c92fbf155cbd7bf584930195d4b30b7bf5a8a1fd6951ac798c1d3a1b35969b
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.23.0] - 2025-12-11
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Tracing: Add process tags to trace payloads with `DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED` environment variable ([#5033][])
|
|
10
|
+
* Tracing: Integrations: Add Data Streams Monitoring (DSM) instrumentation to Waterdrop producers ([#5031][])
|
|
11
|
+
* Tracing: Open Telemetry: Add OpenTelemetry metrics support with OTLP exporters using `DD_METRICS_OTEL_ENABLED` and standard OpenTelemetry environment variables ([#5021][])
|
|
12
|
+
* Tracing: Add `http.endpoint` tag which contains the route whenever routing info is available, and falls back to route inferred from the request path ([#4995][])
|
|
13
|
+
* Tracing: Add configuration of HTTP client and server error ranges via `DD_TRACE_HTTP_CLIENT_ERROR_STATUSES` and `DD_TRACE_HTTP_SERVER_ERROR_STATUSES` ([#4991][])
|
|
14
|
+
* Tracing: Integrations: Add Data Streams Monitoring for `ruby-kafka` and `karafka` consumers with optional manual instrumentation ([#4901][])
|
|
15
|
+
* Dynamic Instrumentation: Add support for Hash length operations in expression language ([#5019][])
|
|
16
|
+
* AppSec: Add unique security response identifier in the response body for blocked requests ([#5049][])
|
|
17
|
+
* AppSec: Add support for processor overrides and custom data scanners ([#5044][])
|
|
18
|
+
* Feature Flags: Add new component to support Open Feature SDK ([#5054][], [#5024][])
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
* Core: Update minimum `datadog-ruby_core_source` dependency to 3.4.2 ([#5122][])
|
|
23
|
+
* Core: Update `libdatadog` dependency to version 24.0.1 ([#5058][], [#5045][], [#5020][])
|
|
24
|
+
* Tracing: Treat IPs from `100.65.0.0/10` range as private. ([#4975][])
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
* Live Debugger / Dynamic Instrumentation: Fix issues delivering large quantities of snapshots ([#5086][])
|
|
29
|
+
* Tracing: Integrations: Fix `NoMethodError` in GraphQL integration when error has no `locations`. ([#5025][])
|
|
30
|
+
* Tracing: Integrations: Fix `http.route` tag for Rack applications mounted inside Rails. ([#4988][])
|
|
31
|
+
* Profiling: Fix profiler support for Ruby 4.0.0-preview2 ([#5091][])
|
|
32
|
+
* Profiling: Fix profiler sleep and wait states not being categorized in timeline ([#5000][])
|
|
33
|
+
* Profiling: Fix profiler not identifying executables with gems they belong to ([#4999][])
|
|
34
|
+
* Stable Config: Fix potential segfault during configuration file parsing ([#5073][])
|
|
35
|
+
* AppSec: Fix route extraction error for Rails 8.1.1+. ([#5042][])
|
|
36
|
+
|
|
5
37
|
## [2.22.0] - 2025-10-15
|
|
6
38
|
|
|
7
39
|
### Added
|
|
@@ -3360,7 +3392,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
|
3360
3392
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
3361
3393
|
|
|
3362
3394
|
|
|
3363
|
-
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.
|
|
3395
|
+
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.23.0...master
|
|
3396
|
+
[2.23.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.22.0...v2.23.0
|
|
3364
3397
|
[2.22.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.21.0...v2.22.0
|
|
3365
3398
|
[2.21.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.20.0...v2.21.0
|
|
3366
3399
|
[2.20.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.19.0...v2.20.0
|
|
@@ -4967,6 +5000,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
4967
5000
|
[#4893]: https://github.com/DataDog/dd-trace-rb/issues/4893
|
|
4968
5001
|
[#4894]: https://github.com/DataDog/dd-trace-rb/issues/4894
|
|
4969
5002
|
[#4900]: https://github.com/DataDog/dd-trace-rb/issues/4900
|
|
5003
|
+
[#4901]: https://github.com/DataDog/dd-trace-rb/issues/4901
|
|
4970
5004
|
[#4902]: https://github.com/DataDog/dd-trace-rb/issues/4902
|
|
4971
5005
|
[#4906]: https://github.com/DataDog/dd-trace-rb/issues/4906
|
|
4972
5006
|
[#4907]: https://github.com/DataDog/dd-trace-rb/issues/4907
|
|
@@ -4979,6 +5013,29 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
4979
5013
|
[#4957]: https://github.com/DataDog/dd-trace-rb/issues/4957
|
|
4980
5014
|
[#4965]: https://github.com/DataDog/dd-trace-rb/issues/4965
|
|
4981
5015
|
[#4969]: https://github.com/DataDog/dd-trace-rb/issues/4969
|
|
5016
|
+
[#4975]: https://github.com/DataDog/dd-trace-rb/issues/4975
|
|
5017
|
+
[#4988]: https://github.com/DataDog/dd-trace-rb/issues/4988
|
|
5018
|
+
[#4991]: https://github.com/DataDog/dd-trace-rb/issues/4991
|
|
5019
|
+
[#4995]: https://github.com/DataDog/dd-trace-rb/issues/4995
|
|
5020
|
+
[#4999]: https://github.com/DataDog/dd-trace-rb/issues/4999
|
|
5021
|
+
[#5000]: https://github.com/DataDog/dd-trace-rb/issues/5000
|
|
5022
|
+
[#5019]: https://github.com/DataDog/dd-trace-rb/issues/5019
|
|
5023
|
+
[#5020]: https://github.com/DataDog/dd-trace-rb/issues/5020
|
|
5024
|
+
[#5021]: https://github.com/DataDog/dd-trace-rb/issues/5021
|
|
5025
|
+
[#5024]: https://github.com/DataDog/dd-trace-rb/issues/5024
|
|
5026
|
+
[#5025]: https://github.com/DataDog/dd-trace-rb/issues/5025
|
|
5027
|
+
[#5031]: https://github.com/DataDog/dd-trace-rb/issues/5031
|
|
5028
|
+
[#5033]: https://github.com/DataDog/dd-trace-rb/issues/5033
|
|
5029
|
+
[#5042]: https://github.com/DataDog/dd-trace-rb/issues/5042
|
|
5030
|
+
[#5044]: https://github.com/DataDog/dd-trace-rb/issues/5044
|
|
5031
|
+
[#5045]: https://github.com/DataDog/dd-trace-rb/issues/5045
|
|
5032
|
+
[#5049]: https://github.com/DataDog/dd-trace-rb/issues/5049
|
|
5033
|
+
[#5054]: https://github.com/DataDog/dd-trace-rb/issues/5054
|
|
5034
|
+
[#5058]: https://github.com/DataDog/dd-trace-rb/issues/5058
|
|
5035
|
+
[#5073]: https://github.com/DataDog/dd-trace-rb/issues/5073
|
|
5036
|
+
[#5086]: https://github.com/DataDog/dd-trace-rb/issues/5086
|
|
5037
|
+
[#5091]: https://github.com/DataDog/dd-trace-rb/issues/5091
|
|
5038
|
+
[#5122]: https://github.com/DataDog/dd-trace-rb/issues/5122
|
|
4982
5039
|
[@AdrianLC]: https://github.com/AdrianLC
|
|
4983
5040
|
[@Azure7111]: https://github.com/Azure7111
|
|
4984
5041
|
[@BabyGroot]: https://github.com/BabyGroot
|
|
@@ -5133,4 +5190,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5133
5190
|
[@y-yagi]: https://github.com/y-yagi
|
|
5134
5191
|
[@yujideveloper]: https://github.com/yujideveloper
|
|
5135
5192
|
[@yukimurasawa]: https://github.com/yukimurasawa
|
|
5136
|
-
[@zachmccormick]: https://github.com/zachmccormick
|
|
5193
|
+
[@zachmccormick]: https://github.com/zachmccormick
|
|
@@ -1,60 +1,3 @@
|
|
|
1
1
|
# Libdatadog development
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Using libdatadog builds from CI or GitHub
|
|
6
|
-
|
|
7
|
-
If you're developing inside docker/natively on Linux, you can use libdatadog builds from CI and GitHub.
|
|
8
|
-
|
|
9
|
-
Here's what to do:
|
|
10
|
-
|
|
11
|
-
1. Create a folder for extracting libdatadog into based on your ruby platform (for instance inside the dd-trace-rb repo):
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
export DD_RUBY_PLATFORM=`ruby -e 'puts Gem::Platform.local.to_s'`
|
|
15
|
-
echo "Current ruby platform: $DD_RUBY_PLATFORM"
|
|
16
|
-
mkdir -p my-libdatadog-build/$DD_RUBY_PLATFORM
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
2. Find a libdatadog build from CI or [GitHub releases](https://github.com/DataDog/libdatadog/releases). This should match the Ruby platform seen above.
|
|
20
|
-
3. Extract the libdatadog build into the folder:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# In this example the build is in my downloads; notice the use of strip-components to get the correct folder structure
|
|
24
|
-
tar zxvf ~/Downloads/libdatadog-x86_64-unknown-linux-gnu.tar.gz -C my-libdatadog-build/$DD_RUBY_PLATFORM/ --strip-components=1
|
|
25
|
-
# Here's how it should look after
|
|
26
|
-
ls my-libdatadog-build/$DD_RUBY_PLATFORM
|
|
27
|
-
bin cmake include lib LICENSE LICENSE-3rdparty.yml NOTICE
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
6. Tell Ruby where to find libdatadog: ```export LIBDATADOG_VENDOR_OVERRIDE=`pwd`/my-libdatadog-build/``` (Notice no platform + use of pwd for full path here)
|
|
31
|
-
7. From dd-trace-rb, run `bundle exec rake clean compile`
|
|
32
|
-
8. For incremental builds, usually `bundle exec rake compile` is faster and `clean` is not needed
|
|
33
|
-
|
|
34
|
-
If you additionally want to run the profiler test suite, also remember to `export DD_PROFILING_MACOS_TESTING=true` and re-run `rake clean compile`.
|
|
35
|
-
|
|
36
|
-
## Native development on macOS
|
|
37
|
-
|
|
38
|
-
As of this writing (August 2025), the libdatadog builds on rubygems.org only support Linux.
|
|
39
|
-
|
|
40
|
-
We don't officially support using libdatadog for Ruby on other platforms yet, but it is possible to use it for local development on macOS.
|
|
41
|
-
(**Note that you don't need these instructions if you develop inside docker.**)
|
|
42
|
-
|
|
43
|
-
Here's how you can do so:
|
|
44
|
-
|
|
45
|
-
1. [Install rust](https://www.rust-lang.org/tools/install)
|
|
46
|
-
2. Install `cbindgen`: `cargo install cbindgen`
|
|
47
|
-
3. Clone [libdatadog](https://github.com/datadog/libdatadog)
|
|
48
|
-
4. Create a folder for building into based on your ruby platform:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
export DD_RUBY_PLATFORM=`ruby -e 'puts Gem::Platform.local.to_s'`
|
|
52
|
-
mkdir -p my-libdatadog-build/$DD_RUBY_PLATFORM
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
5. From inside of the libdatadog repo, build libdatadog into this folder: `./build-profiling-ffi.sh my-libdatadog-build/$DD_RUBY_PLATFORM`
|
|
56
|
-
6. Tell Ruby where to find libdatadog: `export LIBDATADOG_VENDOR_OVERRIDE=/adjust/this/to/be/the/full/path/to/my-libdatadog-build/` (Notice no platform here)
|
|
57
|
-
7. From dd-trace-rb, run `bundle exec rake clean compile`
|
|
58
|
-
8. For incremental builds, usually `bundle exec rake compile` is faster and `clean` is not needed
|
|
59
|
-
|
|
60
|
-
If you additionally want to run the profiler test suite, also remember to `export DD_PROFILING_MACOS_TESTING=true` and re-run `rake clean compile`.
|
|
3
|
+
Moved to <../docs/LibdatadogDevelopment.md>!
|
|
@@ -354,6 +354,10 @@ void sample_thread(
|
|
|
354
354
|
state_label->str = DDOG_CHARSLICE_C("blocked");
|
|
355
355
|
} else if (CHARSLICE_EQUALS("wait_readable", name_slice)) { // Expected to be IO#wait_readable
|
|
356
356
|
state_label->str = DDOG_CHARSLICE_C("network");
|
|
357
|
+
} else if (CHARSLICE_EQUALS("_native_idle_sampling_loop", name_slice)) { // Expected to be Datadog::Profiler::Collectors::IdleSamplingHelper#_native_idle_sampling_loop
|
|
358
|
+
state_label->str = DDOG_CHARSLICE_C("waiting");
|
|
359
|
+
} else if (CHARSLICE_EQUALS("_native_sampling_loop", name_slice)) { // Expected to be Datadog::Profiler::Collectors::CpuAndWallTimeWorker#_native_sampling_loop
|
|
360
|
+
state_label->str = DDOG_CHARSLICE_C("sleeping");
|
|
357
361
|
}
|
|
358
362
|
#ifdef NO_PRIMITIVE_POP // Ruby < 3.2
|
|
359
363
|
else if (CHARSLICE_EQUALS("pop", name_slice)) { // Expected to be Queue/SizedQueue#pop
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// IMPORTANT: Currently this file is copy-pasted between extensions. Make sure to update all versions when doing any change!
|
|
4
4
|
|
|
5
5
|
#include <ruby.h>
|
|
6
|
-
#include <datadog/
|
|
6
|
+
#include <datadog/common.h>
|
|
7
7
|
|
|
8
8
|
// Used to mark symbols to be exported to the outside of the extension.
|
|
9
9
|
// Consider very carefully before tagging a function with this.
|
|
@@ -138,11 +138,13 @@ if have_header("dlfcn.h")
|
|
|
138
138
|
have_func("dladdr")
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
-
# On Ruby
|
|
142
|
-
$defs << "-DNO_IMEMO_OBJECT_ID" unless RUBY_VERSION < "
|
|
141
|
+
# On Ruby 4, we can't ask the object_id from IMEMOs (https://github.com/ruby/ruby/pull/13347)
|
|
142
|
+
$defs << "-DNO_IMEMO_OBJECT_ID" unless RUBY_VERSION < "4.0"
|
|
143
143
|
|
|
144
|
-
#
|
|
145
|
-
|
|
144
|
+
# This symbol is exclusively visible on certain Ruby versions: 2.6 to 3.2, as well as 3.4 (but not 4.0+)
|
|
145
|
+
# It's only used to get extra information about an object when a failure happens, so it's a "very nice to have" but not
|
|
146
|
+
# actually required for correct behavior of the profiler.
|
|
147
|
+
$defs << "-DNO_RB_OBJ_INFO" if RUBY_VERSION.start_with?("2.5", "3.3", "4.")
|
|
146
148
|
|
|
147
149
|
# On older Rubies, rb_postponed_job_preregister/rb_postponed_job_trigger did not exist
|
|
148
150
|
$defs << "-DNO_POSTPONED_TRIGGER" if RUBY_VERSION < "3.3"
|
|
@@ -305,7 +305,7 @@ void start_heap_allocation_recording(heap_recorder *heap_recorder, VALUE new_obj
|
|
|
305
305
|
|
|
306
306
|
if (++heap_recorder->num_recordings_skipped < heap_recorder->sample_rate ||
|
|
307
307
|
#ifdef NO_IMEMO_OBJECT_ID
|
|
308
|
-
// On Ruby
|
|
308
|
+
// On Ruby 4, we can't ask the object_id from IMEMOs (https://github.com/ruby/ruby/pull/13347)
|
|
309
309
|
RB_BUILTIN_TYPE(new_obj) == RUBY_T_IMEMO
|
|
310
310
|
#else
|
|
311
311
|
false
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// IMPORTANT: Currently this file is copy-pasted between extensions. Make sure to update all versions when doing any change!
|
|
4
4
|
|
|
5
5
|
#include <ruby.h>
|
|
6
|
-
#include <datadog/
|
|
6
|
+
#include <datadog/common.h>
|
|
7
7
|
|
|
8
8
|
// Used to mark symbols to be exported to the outside of the extension.
|
|
9
9
|
// Consider very carefully before tagging a function with this.
|