datadog 2.48.0 → 2.49.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 +47 -1
- data/ext/datadog_profiling_native_extension/collectors_stack.c +1 -1
- data/ext/datadog_profiling_native_extension/collectors_stack.h +4 -2
- data/ext/datadog_profiling_native_extension/extconf.rb +3 -0
- data/ext/datadog_profiling_native_extension/private_vm_api_access.c +13 -21
- data/ext/libdatadog_api/extconf.rb +2 -0
- data/ext/libdatadog_api/feature_flags.c +137 -0
- data/ext/libdatadog_api/process_discovery.c +3 -3
- data/ext/libdatadog_extconf_helpers.rb +1 -1
- data/lib/datadog/ai_guard/contrib/rack/patcher.rb +3 -5
- data/lib/datadog/ai_guard/contrib/rails/patcher.rb +7 -9
- data/lib/datadog/ai_guard/contrib/ruby_llm/patcher.rb +3 -5
- data/lib/datadog/ai_guard/metrics/telemetry.rb +2 -4
- data/lib/datadog/appsec/actions_handler.rb +5 -7
- data/lib/datadog/appsec/api_security/endpoint_collection/grape_route_serializer.rb +1 -3
- data/lib/datadog/appsec/api_security/endpoint_collection/rails_route_serializer.rb +1 -3
- data/lib/datadog/appsec/api_security/endpoint_collection/sinatra_route_serializer.rb +1 -3
- data/lib/datadog/appsec/assets.rb +8 -10
- data/lib/datadog/appsec/configuration.rb +1 -1
- data/lib/datadog/appsec/context.rb +63 -6
- data/lib/datadog/appsec/contrib/active_record/instrumentation.rb +1 -3
- data/lib/datadog/appsec/contrib/active_record/patcher.rb +21 -24
- data/lib/datadog/appsec/contrib/aws_lambda/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/aws_lambda/waf_addresses.rb +9 -11
- data/lib/datadog/appsec/contrib/devise/configuration.rb +2 -4
- data/lib/datadog/appsec/contrib/devise/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/excon/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/faraday/patcher.rb +4 -6
- data/lib/datadog/appsec/contrib/graphql/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/rack/input_peeker.rb +3 -5
- data/lib/datadog/appsec/contrib/rack/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/rack/request_body_middleware.rb +5 -4
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +6 -7
- data/lib/datadog/appsec/contrib/rails/patcher.rb +19 -16
- data/lib/datadog/appsec/contrib/rails/patches/live_thread_patch.rb +33 -0
- data/lib/datadog/appsec/contrib/rest_client/patcher.rb +3 -5
- data/lib/datadog/appsec/contrib/sinatra/patcher.rb +4 -6
- data/lib/datadog/appsec/default_header_tags.rb +2 -4
- data/lib/datadog/appsec/metrics/exporter.rb +4 -6
- data/lib/datadog/appsec/metrics/telemetry.rb +1 -3
- data/lib/datadog/appsec/metrics/telemetry_exporter.rb +2 -4
- data/lib/datadog/appsec/route_normalizer/route_text.rb +1 -3
- data/lib/datadog/appsec/route_normalizer.rb +4 -6
- data/lib/datadog/appsec/utils/http/body_reader.rb +3 -5
- data/lib/datadog/appsec/utils/http/url_encoded.rb +2 -4
- data/lib/datadog/core/borrowing_token_bucket.rb +60 -0
- data/lib/datadog/core/chunker.rb +1 -3
- data/lib/datadog/core/configuration/components.rb +48 -17
- data/lib/datadog/core/configuration/settings.rb +2 -1
- data/lib/datadog/core/configuration/supported_configurations.rb +2 -0
- data/lib/datadog/core/diagnostics/environment_logger.rb +1 -6
- data/lib/datadog/core/encoding.rb +8 -12
- data/lib/datadog/core/environment/cgroup.rb +3 -5
- data/lib/datadog/core/environment/container.rb +9 -11
- data/lib/datadog/core/environment/ext.rb +1 -6
- data/lib/datadog/core/environment/gc.rb +2 -4
- data/lib/datadog/core/environment/identity.rb +13 -15
- data/lib/datadog/core/environment/platform.rb +10 -12
- data/lib/datadog/core/environment/socket.rb +3 -5
- data/lib/datadog/core/environment/thread_count.rb +2 -4
- data/lib/datadog/core/environment/variable_helpers.rb +2 -6
- data/lib/datadog/core/environment/vm_cache.rb +5 -7
- data/lib/datadog/core/environment/yjit.rb +25 -24
- data/lib/datadog/core/logger.rb +5 -2
- data/lib/datadog/core/metrics/client.rb +8 -16
- data/lib/datadog/core/metrics/helpers.rb +3 -0
- data/lib/datadog/core/metrics/metric.rb +3 -1
- data/lib/datadog/core/rate_limiter.rb +9 -31
- data/lib/datadog/core/refillable_bucket.rb +72 -0
- data/lib/datadog/core/remote/client/capabilities.rb +4 -0
- data/lib/datadog/core/remote/client.rb +1 -5
- data/lib/datadog/core/remote/transport/http.rb +2 -4
- data/lib/datadog/core/tag_normalizer.rb +0 -2
- data/lib/datadog/core/telemetry/configuration_value.rb +1 -3
- data/lib/datadog/core/telemetry/transport/http.rb +2 -4
- data/lib/datadog/core/telemetry/worker.rb +30 -24
- data/lib/datadog/core/transport/http.rb +2 -4
- data/lib/datadog/core/utils/at_fork_monkey_patch.rb +2 -2
- data/lib/datadog/core/utils/forking.rb +1 -1
- data/lib/datadog/core/utils/lru_cache.rb +2 -2
- data/lib/datadog/core/utils/network.rb +1 -1
- data/lib/datadog/core/utils/time.rb +2 -2
- data/lib/datadog/core/utils/truncation.rb +1 -3
- data/lib/datadog/core/workers/async.rb +16 -14
- data/lib/datadog/core/workers/runtime_metrics.rb +1 -1
- data/lib/datadog/data_streams/transport/http.rb +1 -3
- data/lib/datadog/di/component.rb +14 -2
- data/lib/datadog/di/context.rb +50 -0
- data/lib/datadog/di/contrib.rb +2 -2
- data/lib/datadog/di/correlation_sampler/trace_budget.rb +75 -0
- data/lib/datadog/di/correlation_sampler/trace_budget_ledger/entry.rb +34 -0
- data/lib/datadog/di/correlation_sampler/trace_budget_ledger.rb +104 -0
- data/lib/datadog/di/correlation_sampler.rb +224 -0
- data/lib/datadog/di/guardrails_telemetry/reason.rb +8 -3
- data/lib/datadog/di/instrumenter.rb +294 -109
- data/lib/datadog/di/probe.rb +13 -2
- data/lib/datadog/di/probe_builder.rb +6 -8
- data/lib/datadog/di/probe_file_loader.rb +2 -2
- data/lib/datadog/di/probe_manager.rb +7 -30
- data/lib/datadog/di/probe_notification_builder.rb +42 -11
- data/lib/datadog/di/probe_notifier_worker.rb +11 -0
- data/lib/datadog/di/snapshot_pruner/node.rb +190 -0
- data/lib/datadog/di/snapshot_pruner/node_queue.rb +104 -0
- data/lib/datadog/di/snapshot_pruner/parser.rb +102 -0
- data/lib/datadog/di/snapshot_pruner.rb +128 -0
- data/lib/datadog/di/transport/input.rb +75 -15
- data/lib/datadog/di/utils.rb +3 -3
- data/lib/datadog/di.rb +29 -0
- data/lib/datadog/error_tracking/filters.rb +6 -8
- data/lib/datadog/open_feature/agentless/parser.rb +2 -4
- data/lib/datadog/open_feature/component.rb +24 -2
- data/lib/datadog/open_feature/configuration.rb +13 -0
- data/lib/datadog/open_feature/evaluation_engine.rb +5 -5
- data/lib/datadog/open_feature/exposure_hook.rb +146 -0
- data/lib/datadog/open_feature/exposures/event.rb +10 -8
- data/lib/datadog/open_feature/exposures/reporter.rb +34 -25
- data/lib/datadog/open_feature/ext.rb +12 -0
- data/lib/datadog/open_feature/flag_evaluation/aggregator.rb +10 -8
- data/lib/datadog/open_feature/flag_evaluation/writer.rb +9 -6
- data/lib/datadog/open_feature/hooks/exposure_logging_hook.rb +58 -0
- data/lib/datadog/open_feature/hooks/flag_eval_evp_hook.rb +4 -2
- data/lib/datadog/open_feature/hooks/flag_eval_metrics_hook.rb +3 -5
- data/lib/datadog/open_feature/hooks/span_enrichment_hook/codec.rb +3 -5
- data/lib/datadog/open_feature/native_evaluator.rb +30 -2
- data/lib/datadog/open_feature/noop_evaluator.rb +3 -1
- data/lib/datadog/open_feature/provider.rb +54 -4
- data/lib/datadog/open_feature/resolution_details.rb +1 -0
- data/lib/datadog/open_feature/split_features.rb +76 -0
- data/lib/datadog/opentelemetry/sdk/propagator.rb +5 -2
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +28 -31
- data/lib/datadog/profiling/component.rb +31 -9
- data/lib/datadog/profiling/profiler.rb +6 -0
- data/lib/datadog/profiling/remote.rb +381 -0
- data/lib/datadog/profiling/worker_state.rb +65 -0
- data/lib/datadog/profiling.rb +1 -0
- data/lib/datadog/symbol_database/file_hash.rb +1 -3
- data/lib/datadog/tracing/component.rb +14 -16
- data/lib/datadog/tracing/configuration/settings.rb +2 -2
- data/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +4 -6
- data/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +4 -6
- data/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +4 -6
- data/lib/datadog/tracing/contrib/action_cable/events.rb +3 -5
- data/lib/datadog/tracing/contrib/action_cable/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +5 -7
- data/lib/datadog/tracing/contrib/action_mailer/events/process.rb +4 -6
- data/lib/datadog/tracing/contrib/action_mailer/events.rb +3 -5
- data/lib/datadog/tracing/contrib/action_mailer/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +2 -4
- data/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/action_pack/action_dispatch/instrumentation.rb +2 -4
- data/lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/action_pack/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +3 -5
- data/lib/datadog/tracing/contrib/action_view/events/render_template.rb +3 -5
- data/lib/datadog/tracing/contrib/action_view/events.rb +3 -5
- data/lib/datadog/tracing/contrib/action_view/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/action_view/utils.rb +1 -3
- data/lib/datadog/tracing/contrib/active_job/events/discard.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events/perform.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/events.rb +3 -5
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +4 -6
- data/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +4 -6
- data/lib/datadog/tracing/contrib/active_model_serializers/events.rb +3 -5
- data/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +4 -6
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +3 -5
- data/lib/datadog/tracing/contrib/active_record/events.rb +3 -5
- data/lib/datadog/tracing/contrib/active_record/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/active_support/cache/events/cache.rb +8 -10
- data/lib/datadog/tracing/contrib/active_support/cache/events.rb +3 -5
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +5 -7
- data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/active_support/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/analytics.rb +4 -6
- data/lib/datadog/tracing/contrib/aws/patcher.rb +5 -7
- data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +5 -7
- data/lib/datadog/tracing/contrib/configuration/settings.rb +17 -0
- data/lib/datadog/tracing/contrib/dalli/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/dalli/quantize.rb +1 -3
- data/lib/datadog/tracing/contrib/delayed_job/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/elasticsearch/quantize.rb +6 -8
- data/lib/datadog/tracing/contrib/ethon/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/excon/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/faraday/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/grape/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/graphql/trace_patcher.rb +1 -3
- data/lib/datadog/tracing/contrib/graphql/tracing_patcher.rb +1 -3
- data/lib/datadog/tracing/contrib/graphql/unified_trace_patcher.rb +1 -3
- data/lib/datadog/tracing/contrib/grpc/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/hanami/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/http/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/httpclient/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/httprb/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +4 -6
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +3 -5
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +3 -5
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +3 -5
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb +2 -4
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb +2 -4
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb +2 -4
- data/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +4 -6
- data/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +4 -6
- data/lib/datadog/tracing/contrib/kafka/events.rb +3 -5
- data/lib/datadog/tracing/contrib/kafka/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/karafka/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/mongodb/parsers.rb +5 -7
- data/lib/datadog/tracing/contrib/mongodb/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/mysql2/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/opensearch/patcher.rb +1 -3
- data/lib/datadog/tracing/contrib/opensearch/quantize.rb +5 -7
- data/lib/datadog/tracing/contrib/pg/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/presto/patcher.rb +1 -3
- data/lib/datadog/tracing/contrib/que/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/racecar/events/batch.rb +3 -5
- data/lib/datadog/tracing/contrib/racecar/events/consume.rb +3 -5
- data/lib/datadog/tracing/contrib/racecar/events/message.rb +3 -5
- data/lib/datadog/tracing/contrib/racecar/events.rb +3 -5
- data/lib/datadog/tracing/contrib/racecar/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/rack/patcher.rb +13 -19
- data/lib/datadog/tracing/contrib/rack/request_queue.rb +1 -3
- data/lib/datadog/tracing/contrib/rack/route_inference.rb +4 -6
- data/lib/datadog/tracing/contrib/rack/trace_proxy_middleware.rb +4 -6
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +4 -0
- data/lib/datadog/tracing/contrib/rails/ext.rb +2 -0
- data/lib/datadog/tracing/contrib/rails/framework.rb +6 -8
- data/lib/datadog/tracing/contrib/rails/log_injection.rb +1 -3
- data/lib/datadog/tracing/contrib/rails/patcher.rb +9 -11
- data/lib/datadog/tracing/contrib/rake/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/redis/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/redis/quantize.rb +7 -9
- data/lib/datadog/tracing/contrib/resque/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/rest_client/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/roda/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/sequel/patcher.rb +4 -6
- data/lib/datadog/tracing/contrib/shoryuken/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/sidekiq/patcher.rb +7 -9
- data/lib/datadog/tracing/contrib/sinatra/env.rb +3 -5
- data/lib/datadog/tracing/contrib/sinatra/patcher.rb +5 -7
- data/lib/datadog/tracing/contrib/sneakers/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/stripe/patcher.rb +2 -4
- data/lib/datadog/tracing/contrib/stripe/request.rb +4 -6
- data/lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb +1 -3
- data/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +1 -3
- data/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/support.rb +1 -3
- data/lib/datadog/tracing/contrib/trilogy/configuration/settings.rb +4 -0
- data/lib/datadog/tracing/contrib/trilogy/instrumentation.rb +2 -1
- data/lib/datadog/tracing/contrib/trilogy/patcher.rb +3 -5
- data/lib/datadog/tracing/contrib/utils/database.rb +1 -3
- data/lib/datadog/tracing/contrib/utils/quantization/hash_formatter.rb +8 -10
- data/lib/datadog/tracing/contrib/utils/quantization/http.rb +11 -13
- data/lib/datadog/tracing/contrib/waterdrop/patcher.rb +3 -5
- data/lib/datadog/tracing/correlation.rb +3 -5
- data/lib/datadog/tracing/distributed/propagation.rb +2 -2
- data/lib/datadog/tracing/distributed/propagation_policy.rb +1 -3
- data/lib/datadog/tracing/distributed/trace_state/datadog.rb +5 -5
- data/lib/datadog/tracing/distributed/trace_state/open_telemetry.rb +2 -2
- data/lib/datadog/tracing/metadata/ext.rb +3 -9
- data/lib/datadog/tracing/remote.rb +1 -1
- data/lib/datadog/tracing/trace_operation.rb +11 -3
- data/lib/datadog/tracing/tracer.rb +9 -1
- data/lib/datadog/tracing/transport/http.rb +1 -3
- data/lib/datadog/tracing/transport/io.rb +2 -4
- data/lib/datadog/tracing/transport/traces.rb +1 -3
- data/lib/datadog/tracing/utils.rb +4 -6
- data/lib/datadog/version.rb +1 -1
- metadata +22 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a901b66bcf64aa759f7df6617c88b234196dc71cf4384959e79e445e59c9800
|
|
4
|
+
data.tar.gz: 2f573988580ef84254b3198793e8d1a02db030e348ee8264554b5179dfd49843
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40db4058f8dac5d1b275baff8a4769c41d68f5e0ee08424e9bd5ecb4c322cc22b0c173238dc531ade8a039bfdf71c035c141cfd3cd84c31c3b9be1a788bb1473
|
|
7
|
+
data.tar.gz: 43e660bd9b0b239cd6a131c79d391a6c56fa315ae5b66fb4bef3e1f647e9898c17af678fb3955cbd3e80ac70f07773701d90eae755bbe347843cdfe5855f8433
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.49.0] - 2026-11-13
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Tracing: Add a `web_service_name` option to the Rails integration, customizing the service name of frontend server request queuing spans; it defaults to `'web-server'`. ([#2716][]) ([@Surgo][])
|
|
10
|
+
* Open Feature: Add per-subject experimentation opt-out with `DD_FEATURE_FLAGS_EXPERIMENTATION_OPT_OUT_MODE=immediate|future_experiments_only` and the `dd_experimentation_opt_out_at` evaluation context attribute. ([#6521][])
|
|
11
|
+
* Open Feature: Add `Datadog::OpenFeature::ExposureHook`, which passes each flag evaluation with its exposure decision and the selected split's features to application code; register it with `config.hooks << hook` in `OpenFeature::SDK.configure`. ([#6610][])
|
|
12
|
+
* Open Feature: Add `DD_FEATURE_FLAGS_EXPOSURES_DATADOG_LOGGING_ENABLED` (default `true`); set it to `false` to stop sending exposures to Datadog while `Datadog::OpenFeature::ExposureHook` keeps receiving them. ([#6610][])
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
* Core: Shorten the path in debug and error log lines from the default logger. ([#6650][])
|
|
17
|
+
* Tracing: Enable partial flushing by default so unfinished traces flush completed spans at the 500-span threshold. Restore complete-trace flushing with `c.tracing.partial_flush.enabled = false` in `Datadog.configure`. ([#6572][])
|
|
18
|
+
* Dynamic Instrumentation: Live Debugger snapshots now capture all or no probes within one APM trace. ([#6118][])
|
|
19
|
+
* Dynamic Instrumentation: Send the probed method name of snapshots as `logger.method_name` instead of `logger.method`, so the Logger Method facet in Log Management shows it; update queries, monitors, and dashboards that filter to use `[@logger][].method_name`. ([#6539][])
|
|
20
|
+
* Dynamic Instrumentation: Send snapshots larger than 1 MB with their largest, most deeply nested captured values marked as pruned; snapshots that still exceed 1 MB after pruning are dropped. ([#6655][])
|
|
21
|
+
* Open Feature: Send an exposure only after a flag evaluation succeeds, so a result rejected by an `after` hook is not reported; exposures now require `openfeature-sdk` 0.5.1 or later and the Datadog provider registered directly. ([#6610][])
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
* Tracing: Fix a thread stuck at 100% CPU when `Rack::Timeout` or another non-`StandardError` exception interrupts a starting span. ([#6607][])
|
|
26
|
+
* Tracing: Fix the Rails integration replacing `service_name`, `middleware_names`, `distributed_tracing` and `request_queuing` set on the Rack integration when they are not set on the Rails integration. ([#6644][])
|
|
27
|
+
* Tracing: Add support for the `on_error` option to the `trilogy` integration. ([#6424][]) ([@ctotheameron][])
|
|
28
|
+
* Profiling: Fix a rare crash when a profiled method is refined. ([#6680][])
|
|
29
|
+
* AppSec: Fix missing RASP SQL injection checks for `mysql2` adapter on `ActiveRecord` before 7.1 and `postgresql` adapter before 7.0. ([#6630][])
|
|
30
|
+
* AppSec: Fix `WAF::InstanceFinalizedError` from `ActiveRecord` queries that run in `ActionController::Live` threads with RASP enabled. ([#6648][])
|
|
31
|
+
* Open Feature: Prevent evaluation context keys containing NUL from matching ordinary feature flag targeting attributes, including when experimentation opt-out is disabled. ([#6521][])
|
|
32
|
+
|
|
5
33
|
## [2.48.0] - 2026-11-03
|
|
6
34
|
|
|
7
35
|
### Added
|
|
@@ -3890,7 +3918,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
|
3890
3918
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
3891
3919
|
|
|
3892
3920
|
|
|
3893
|
-
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.
|
|
3921
|
+
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v2.49.0...master
|
|
3922
|
+
[2.49.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.48.0...v2.49.0
|
|
3894
3923
|
[2.48.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.47.0...v2.48.0
|
|
3895
3924
|
[2.47.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.46.0...v2.47.0
|
|
3896
3925
|
[2.46.0]: https://github.com/DataDog/dd-trace-rb/compare/v2.45.0...v2.46.0
|
|
@@ -4999,6 +5028,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
4999
5028
|
[#2705]: https://github.com/DataDog/dd-trace-rb/issues/2705
|
|
5000
5029
|
[#2710]: https://github.com/DataDog/dd-trace-rb/issues/2710
|
|
5001
5030
|
[#2711]: https://github.com/DataDog/dd-trace-rb/issues/2711
|
|
5031
|
+
[#2716]: https://github.com/DataDog/dd-trace-rb/issues/2716
|
|
5002
5032
|
[#2720]: https://github.com/DataDog/dd-trace-rb/issues/2720
|
|
5003
5033
|
[#2726]: https://github.com/DataDog/dd-trace-rb/issues/2726
|
|
5004
5034
|
[#2727]: https://github.com/DataDog/dd-trace-rb/issues/2727
|
|
@@ -5715,6 +5745,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5715
5745
|
[#6104]: https://github.com/DataDog/dd-trace-rb/issues/6104
|
|
5716
5746
|
[#6111]: https://github.com/DataDog/dd-trace-rb/issues/6111
|
|
5717
5747
|
[#6116]: https://github.com/DataDog/dd-trace-rb/issues/6116
|
|
5748
|
+
[#6118]: https://github.com/DataDog/dd-trace-rb/issues/6118
|
|
5718
5749
|
[#6126]: https://github.com/DataDog/dd-trace-rb/issues/6126
|
|
5719
5750
|
[#6130]: https://github.com/DataDog/dd-trace-rb/issues/6130
|
|
5720
5751
|
[#6132]: https://github.com/DataDog/dd-trace-rb/issues/6132
|
|
@@ -5755,6 +5786,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5755
5786
|
[#6412]: https://github.com/DataDog/dd-trace-rb/issues/6412
|
|
5756
5787
|
[#6418]: https://github.com/DataDog/dd-trace-rb/issues/6418
|
|
5757
5788
|
[#6419]: https://github.com/DataDog/dd-trace-rb/issues/6419
|
|
5789
|
+
[#6424]: https://github.com/DataDog/dd-trace-rb/issues/6424
|
|
5758
5790
|
[#6427]: https://github.com/DataDog/dd-trace-rb/issues/6427
|
|
5759
5791
|
[#6433]: https://github.com/DataDog/dd-trace-rb/issues/6433
|
|
5760
5792
|
[#6441]: https://github.com/DataDog/dd-trace-rb/issues/6441
|
|
@@ -5768,14 +5800,25 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5768
5800
|
[#6488]: https://github.com/DataDog/dd-trace-rb/issues/6488
|
|
5769
5801
|
[#6500]: https://github.com/DataDog/dd-trace-rb/issues/6500
|
|
5770
5802
|
[#6519]: https://github.com/DataDog/dd-trace-rb/issues/6519
|
|
5803
|
+
[#6521]: https://github.com/DataDog/dd-trace-rb/issues/6521
|
|
5771
5804
|
[#6532]: https://github.com/DataDog/dd-trace-rb/issues/6532
|
|
5772
5805
|
[#6537]: https://github.com/DataDog/dd-trace-rb/issues/6537
|
|
5806
|
+
[#6539]: https://github.com/DataDog/dd-trace-rb/issues/6539
|
|
5773
5807
|
[#6543]: https://github.com/DataDog/dd-trace-rb/issues/6543
|
|
5774
5808
|
[#6547]: https://github.com/DataDog/dd-trace-rb/issues/6547
|
|
5775
5809
|
[#6548]: https://github.com/DataDog/dd-trace-rb/issues/6548
|
|
5810
|
+
[#6572]: https://github.com/DataDog/dd-trace-rb/issues/6572
|
|
5776
5811
|
[#6581]: https://github.com/DataDog/dd-trace-rb/issues/6581
|
|
5777
5812
|
[#6596]: https://github.com/DataDog/dd-trace-rb/issues/6596
|
|
5778
5813
|
[#6601]: https://github.com/DataDog/dd-trace-rb/issues/6601
|
|
5814
|
+
[#6607]: https://github.com/DataDog/dd-trace-rb/issues/6607
|
|
5815
|
+
[#6610]: https://github.com/DataDog/dd-trace-rb/issues/6610
|
|
5816
|
+
[#6630]: https://github.com/DataDog/dd-trace-rb/issues/6630
|
|
5817
|
+
[#6644]: https://github.com/DataDog/dd-trace-rb/issues/6644
|
|
5818
|
+
[#6648]: https://github.com/DataDog/dd-trace-rb/issues/6648
|
|
5819
|
+
[#6650]: https://github.com/DataDog/dd-trace-rb/issues/6650
|
|
5820
|
+
[#6655]: https://github.com/DataDog/dd-trace-rb/issues/6655
|
|
5821
|
+
[#6680]: https://github.com/DataDog/dd-trace-rb/issues/6680
|
|
5779
5822
|
[@AdrianLC]: https://github.com/AdrianLC
|
|
5780
5823
|
[@Azure7111]: https://github.com/Azure7111
|
|
5781
5824
|
[@BabyGroot]: https://github.com/BabyGroot
|
|
@@ -5796,6 +5839,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5796
5839
|
[@Redapted]: https://github.com/Redapted
|
|
5797
5840
|
[@Sticksword]: https://github.com/Sticksword
|
|
5798
5841
|
[@Supy]: https://github.com/Supy
|
|
5842
|
+
[@Surgo]: https://github.com/Surgo
|
|
5799
5843
|
[@Yurokle]: https://github.com/Yurokle
|
|
5800
5844
|
[@ZimbiX]: https://github.com/ZimbiX
|
|
5801
5845
|
[@agirlnamedsophia]: https://github.com/agirlnamedsophia
|
|
@@ -5825,6 +5869,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5825
5869
|
[@components]: https://github.com/components
|
|
5826
5870
|
[@coneill-enhance]: https://github.com/coneill-enhance
|
|
5827
5871
|
[@cswatt]: https://github.com/cswatt
|
|
5872
|
+
[@ctotheameron]: https://github.com/ctotheameron
|
|
5828
5873
|
[@cwoodcox]: https://github.com/cwoodcox
|
|
5829
5874
|
[@danhodge]: https://github.com/danhodge
|
|
5830
5875
|
[@dasch]: https://github.com/dasch
|
|
@@ -5877,6 +5922,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
|
5877
5922
|
[@letiesperon]: https://github.com/letiesperon
|
|
5878
5923
|
[@link04]: https://github.com/link04
|
|
5879
5924
|
[@lloeki]: https://github.com/lloeki
|
|
5925
|
+
[@logger]: https://github.com/logger
|
|
5880
5926
|
[@mantrala]: https://github.com/mantrala
|
|
5881
5927
|
[@marcotc]: https://github.com/marcotc
|
|
5882
5928
|
[@marocchino]: https://github.com/marocchino
|
|
@@ -729,7 +729,7 @@ void sample_locations_free(sample_locations *locations) {
|
|
|
729
729
|
}
|
|
730
730
|
|
|
731
731
|
uint16_t sampling_buffer_check_max_frames(int max_frames) {
|
|
732
|
-
if (max_frames <
|
|
732
|
+
if (max_frames < MIN_FRAMES_LIMIT) raise_error(rb_eArgError, "Invalid max_frames: value must be >= " MIN_FRAMES_LIMIT_AS_STRING);
|
|
733
733
|
if (max_frames > MAX_FRAMES_LIMIT) raise_error(rb_eArgError, "Invalid max_frames: value must be <= " MAX_FRAMES_LIMIT_AS_STRING);
|
|
734
734
|
return max_frames;
|
|
735
735
|
}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
#include "private_vm_api_access.h"
|
|
6
6
|
#include "stack_recorder.h"
|
|
7
7
|
|
|
8
|
-
#define
|
|
9
|
-
#define
|
|
8
|
+
#define MIN_FRAMES_LIMIT 400
|
|
9
|
+
#define MIN_FRAMES_LIMIT_AS_STRING "400"
|
|
10
|
+
#define MAX_FRAMES_LIMIT 600
|
|
11
|
+
#define MAX_FRAMES_LIMIT_AS_STRING "600"
|
|
10
12
|
|
|
11
13
|
// Longest qualified frame name we keep per frame in `sampling_buffer`. Longer names are still reported, they just get
|
|
12
14
|
// composed again on every sample; this bounds the per-thread memory the cache costs (max_frames * this).
|
|
@@ -214,6 +214,9 @@ $defs << "-DNO_GVL_OWNER" if RUBY_VERSION < "2.6"
|
|
|
214
214
|
# On older Rubies, there was no thread->invoke_arg
|
|
215
215
|
$defs << "-DNO_THREAD_INVOKE_ARG" if RUBY_VERSION < "2.6"
|
|
216
216
|
|
|
217
|
+
# On older Rubies, there was no ISEQ_TYPE_PLAIN iseq type
|
|
218
|
+
$defs << "-DNO_ISEQ_TYPE_PLAIN" if RUBY_VERSION < "2.6"
|
|
219
|
+
|
|
217
220
|
# If we got here, libdatadog is available and loaded
|
|
218
221
|
$stderr.puts("Using libdatadog #{Libdatadog::VERSION} from #{Libdatadog.pkgconfig_folder}")
|
|
219
222
|
|
|
@@ -1040,23 +1040,6 @@ void self_test_current_fiber_for(void) { } // Nothing to do
|
|
|
1040
1040
|
// Also, those functions are static functions in vm_backtrace.c so not reusable.
|
|
1041
1041
|
// There is also AFAIK no reasonable way to create a rb_backtrace_location_t from outside that file.
|
|
1042
1042
|
|
|
1043
|
-
// Return true if a given location is a C method or supposed to behave like one.
|
|
1044
|
-
static bool location_cfunc_p(const rb_callable_method_entry_t *cme) {
|
|
1045
|
-
if (!cme) {
|
|
1046
|
-
return false;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
switch (cme->def->type) {
|
|
1050
|
-
case VM_METHOD_TYPE_CFUNC:
|
|
1051
|
-
return true;
|
|
1052
|
-
// Upstream, but we don't want that behavior:
|
|
1053
|
-
// case VM_METHOD_TYPE_ISEQ:
|
|
1054
|
-
// return is_internal_location(loc->cme->def->body.iseq.iseqptr);
|
|
1055
|
-
default:
|
|
1056
|
-
return false;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
1043
|
// RCLASS_SINGLETON_P() is only defined on Ruby 3.4+, so we have a copy for older versions
|
|
1061
1044
|
static bool ddtrace_RCLASS_SINGLETON_P(VALUE klass) {
|
|
1062
1045
|
return RB_TYPE_P(klass, T_CLASS) && FL_TEST_RAW(klass, FL_SINGLETON);
|
|
@@ -1181,7 +1164,7 @@ static ssize_t calculate_iseq_label(VALUE owner, const rb_iseq_t *iseq, char *bu
|
|
|
1181
1164
|
case ISEQ_TYPE_METHOD:
|
|
1182
1165
|
return rb_gen_method_name(owner, ISEQ_BODY(iseq)->location.label, buf, buf_size);
|
|
1183
1166
|
|
|
1184
|
-
#
|
|
1167
|
+
#ifndef NO_ISEQ_TYPE_PLAIN
|
|
1185
1168
|
case ISEQ_TYPE_PLAIN:
|
|
1186
1169
|
#endif
|
|
1187
1170
|
case ISEQ_TYPE_BLOCK: {
|
|
@@ -1223,9 +1206,17 @@ static ssize_t calculate_iseq_label(VALUE owner, const rb_iseq_t *iseq, char *bu
|
|
|
1223
1206
|
}
|
|
1224
1207
|
|
|
1225
1208
|
// MRI: location_label()
|
|
1226
|
-
// C methods don't have an iseq, only Ruby methods have
|
|
1227
1209
|
ssize_t ddtrace_location_label(const rb_callable_method_entry_t *cme, const rb_iseq_t *iseq, char *buf, size_t buf_size) {
|
|
1228
|
-
|
|
1210
|
+
// The upstream `location_label` uses `location_cfunc_p` instead of testing `iseq == NULL`, which checks cme->def->type.
|
|
1211
|
+
// Between capturing the stack and naming its frames, a refinement can replace cme->def
|
|
1212
|
+
// with a VM_METHOD_TYPE_REFINED definition. The captured frame is still a C frame with
|
|
1213
|
+
// no ISEQ, so we use its captured frame kind rather than the method entry's current type.
|
|
1214
|
+
//
|
|
1215
|
+
// Upstream also names internal Ruby methods like C ones:
|
|
1216
|
+
// case VM_METHOD_TYPE_ISEQ:
|
|
1217
|
+
// return is_internal_location(loc->cme->def->body.iseq.iseqptr);
|
|
1218
|
+
// but we don't want that behavior.
|
|
1219
|
+
if (iseq == NULL) {
|
|
1229
1220
|
VALUE method_name = rb_id2str(cme->def->original_id);
|
|
1230
1221
|
if (method_name == Qfalse) {
|
|
1231
1222
|
return NO_METHOD_NAME;
|
|
@@ -1239,7 +1230,8 @@ ssize_t ddtrace_location_label(const rb_callable_method_entry_t *cme, const rb_i
|
|
|
1239
1230
|
|
|
1240
1231
|
// Returns a String or Qfalse (like rb_id2str())
|
|
1241
1232
|
VALUE ddtrace_location_base_label(const rb_callable_method_entry_t *cme, const rb_iseq_t *iseq) {
|
|
1242
|
-
|
|
1233
|
+
// We test `iseq == NULL` and not `location_cfunc_p` for the same reason as `ddtrace_location_label` above
|
|
1234
|
+
if (iseq == NULL) {
|
|
1243
1235
|
return rb_id2str(cme->def->original_id);
|
|
1244
1236
|
} else {
|
|
1245
1237
|
return rb_iseq_base_label(iseq);
|
|
@@ -99,6 +99,8 @@ Datadog::LibdatadogExtconfHelpers.add_libdatadog_version_define
|
|
|
99
99
|
EXTENSION_NAME = "libdatadog_api.#{RUBY_VERSION[/\d+.\d+/]}_#{RUBY_PLATFORM}".freeze
|
|
100
100
|
|
|
101
101
|
have_func("rb_iseq_type")
|
|
102
|
+
have_func("ddog_ffe_get_assignment_with_options", ["datadog/common.h", "datadog/ffe.h"])
|
|
103
|
+
have_func("ddog_ffe_get_assignment_with_opt_out_mode", ["datadog/common.h", "datadog/ffe.h"])
|
|
102
104
|
|
|
103
105
|
$defs << "-DHAVE_RB_IMEMO_NAME" if RUBY_VERSION >= "3.0"
|
|
104
106
|
$defs << "-DHAVE_SHIFTED_IMEMO_MASK" if RUBY_VERSION >= "4.1"
|
|
@@ -16,6 +16,14 @@ static void configuration_free(void *ptr);
|
|
|
16
16
|
static VALUE configuration_get_observe_full_evaluation_data(VALUE self);
|
|
17
17
|
static VALUE configuration_get_assignment(
|
|
18
18
|
VALUE self, VALUE flag_key, VALUE expected_type, VALUE context);
|
|
19
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPTIONS
|
|
20
|
+
static VALUE configuration_get_assignment_with_options(
|
|
21
|
+
VALUE self, VALUE flag_key, VALUE expected_type, VALUE context, VALUE experimentation_opt_out_immediate);
|
|
22
|
+
#endif
|
|
23
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPT_OUT_MODE
|
|
24
|
+
static VALUE configuration_get_assignment_with_opt_out_mode(
|
|
25
|
+
VALUE self, VALUE flag_key, VALUE expected_type, VALUE context, VALUE experimentation_opt_out_mode);
|
|
26
|
+
#endif
|
|
19
27
|
|
|
20
28
|
static void resolution_details_free(void *ptr);
|
|
21
29
|
static VALUE resolution_details_get_raw_value(VALUE self);
|
|
@@ -28,6 +36,7 @@ static VALUE resolution_details_get_error_code(VALUE self);
|
|
|
28
36
|
static VALUE resolution_details_get_error_message(VALUE self);
|
|
29
37
|
static VALUE resolution_details_get_do_log(VALUE self);
|
|
30
38
|
static VALUE resolution_details_get_flag_metadata(VALUE self);
|
|
39
|
+
static VALUE resolution_details_get_features(VALUE self);
|
|
31
40
|
|
|
32
41
|
static const rb_data_type_t configuration_data_type = {
|
|
33
42
|
.wrap_struct_name = "Datadog::Core::FeatureFlags::Configuration",
|
|
@@ -52,6 +61,7 @@ static const rb_data_type_t resolution_details_typed_data = {
|
|
|
52
61
|
// Cached values to use in function later in the code.
|
|
53
62
|
static VALUE feature_flags_error_class = Qnil;
|
|
54
63
|
static VALUE resolution_details_class = Qnil;
|
|
64
|
+
static VALUE empty_features = Qnil;
|
|
55
65
|
static ID id_boolean;
|
|
56
66
|
static ID id_string;
|
|
57
67
|
static ID id_number;
|
|
@@ -95,6 +105,12 @@ void feature_flags_init(VALUE core_module) {
|
|
|
95
105
|
rb_undef_alloc_func(configuration_class);
|
|
96
106
|
rb_define_singleton_method(configuration_class, "new", configuration_new, 1);
|
|
97
107
|
rb_define_method(configuration_class, "get_assignment", configuration_get_assignment, 3);
|
|
108
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPTIONS
|
|
109
|
+
rb_define_method(configuration_class, "get_assignment_with_options", configuration_get_assignment_with_options, 4);
|
|
110
|
+
#endif
|
|
111
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPT_OUT_MODE
|
|
112
|
+
rb_define_method(configuration_class, "get_assignment_with_opt_out_mode", configuration_get_assignment_with_opt_out_mode, 4);
|
|
113
|
+
#endif
|
|
98
114
|
rb_define_method(configuration_class, "observe_full_evaluation_data", configuration_get_observe_full_evaluation_data, 0);
|
|
99
115
|
|
|
100
116
|
rb_gc_register_address(&resolution_details_class);
|
|
@@ -110,6 +126,10 @@ void feature_flags_init(VALUE core_module) {
|
|
|
110
126
|
rb_define_method(resolution_details_class, "error_message", resolution_details_get_error_message, 0);
|
|
111
127
|
rb_define_method(resolution_details_class, "log?", resolution_details_get_do_log, 0);
|
|
112
128
|
rb_define_method(resolution_details_class, "flag_metadata", resolution_details_get_flag_metadata, 0);
|
|
129
|
+
rb_define_method(resolution_details_class, "features", resolution_details_get_features, 0);
|
|
130
|
+
|
|
131
|
+
rb_gc_register_address(&empty_features);
|
|
132
|
+
empty_features = rb_obj_freeze(rb_ary_new());
|
|
113
133
|
|
|
114
134
|
// Cache symbol IDs for expected types
|
|
115
135
|
id_boolean = rb_intern_const("boolean");
|
|
@@ -188,6 +208,10 @@ static int evaluation_context_foreach_callback(VALUE key, VALUE value, VALUE arg
|
|
|
188
208
|
|
|
189
209
|
ENFORCE_TYPE(key, T_STRING);
|
|
190
210
|
const char *name = RSTRING_PTR(key);
|
|
211
|
+
// C strings must not turn a different attribute into a reserved key.
|
|
212
|
+
if (memchr(name, '\0', RSTRING_LEN(key)) != NULL) {
|
|
213
|
+
return ST_CONTINUE;
|
|
214
|
+
}
|
|
191
215
|
|
|
192
216
|
// Extract targeting_key separately if present.
|
|
193
217
|
//
|
|
@@ -329,6 +353,69 @@ static VALUE configuration_get_assignment(VALUE self, VALUE flag_key, VALUE expe
|
|
|
329
353
|
return TypedData_Wrap_Struct(resolution_details_class, &resolution_details_typed_data, resolution_details);
|
|
330
354
|
}
|
|
331
355
|
|
|
356
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPTIONS
|
|
357
|
+
static VALUE configuration_get_assignment_with_options(
|
|
358
|
+
VALUE self, VALUE flag_key, VALUE expected_type, VALUE context_hash, VALUE experimentation_opt_out_immediate
|
|
359
|
+
) {
|
|
360
|
+
ENFORCE_TYPED_DATA(self, &configuration_data_type);
|
|
361
|
+
ENFORCE_TYPE(flag_key, T_STRING);
|
|
362
|
+
ENFORCE_TYPE(expected_type, T_SYMBOL);
|
|
363
|
+
ENFORCE_TYPE(context_hash, T_HASH);
|
|
364
|
+
if (experimentation_opt_out_immediate != Qtrue && experimentation_opt_out_immediate != Qfalse) {
|
|
365
|
+
rb_raise(rb_eTypeError, "experimentation_opt_out_immediate must be a boolean");
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const ddog_ffe_Handle_Configuration config =
|
|
369
|
+
(ddog_ffe_Handle_Configuration)rb_check_typeddata(self, &configuration_data_type);
|
|
370
|
+
const ddog_ffe_ExpectedFlagType expected_ty = expected_type_from_value(expected_type);
|
|
371
|
+
ddog_ffe_Handle_EvaluationContext context = evaluation_context_from_hash(context_hash);
|
|
372
|
+
const struct ddog_ffe_EvaluationOptions options = {
|
|
373
|
+
.experimentation_opt_out_immediate = experimentation_opt_out_immediate == Qtrue
|
|
374
|
+
};
|
|
375
|
+
ddog_ffe_Handle_ResolutionDetails resolution_details = ddog_ffe_get_assignment_with_options(
|
|
376
|
+
config, RSTRING_PTR(flag_key), expected_ty, context, options
|
|
377
|
+
);
|
|
378
|
+
ddog_ffe_evaluation_context_drop(&context);
|
|
379
|
+
|
|
380
|
+
return TypedData_Wrap_Struct(resolution_details_class, &resolution_details_typed_data, resolution_details);
|
|
381
|
+
}
|
|
382
|
+
#endif
|
|
383
|
+
|
|
384
|
+
#ifdef HAVE_DDOG_FFE_GET_ASSIGNMENT_WITH_OPT_OUT_MODE
|
|
385
|
+
static VALUE configuration_get_assignment_with_opt_out_mode(
|
|
386
|
+
VALUE self, VALUE flag_key, VALUE expected_type, VALUE context_hash, VALUE experimentation_opt_out_mode
|
|
387
|
+
) {
|
|
388
|
+
ENFORCE_TYPED_DATA(self, &configuration_data_type);
|
|
389
|
+
ENFORCE_TYPE(flag_key, T_STRING);
|
|
390
|
+
ENFORCE_TYPE(expected_type, T_SYMBOL);
|
|
391
|
+
ENFORCE_TYPE(context_hash, T_HASH);
|
|
392
|
+
ENFORCE_TYPE(experimentation_opt_out_mode, T_SYMBOL);
|
|
393
|
+
|
|
394
|
+
const ID mode_id = SYM2ID(experimentation_opt_out_mode);
|
|
395
|
+
enum ddog_ffe_ExperimentationOptOutMode mode;
|
|
396
|
+
if (mode_id == rb_intern("disabled")) {
|
|
397
|
+
mode = DDOG_FFE_EXPERIMENTATION_OPT_OUT_MODE_DISABLED;
|
|
398
|
+
} else if (mode_id == rb_intern("immediate")) {
|
|
399
|
+
mode = DDOG_FFE_EXPERIMENTATION_OPT_OUT_MODE_IMMEDIATE;
|
|
400
|
+
} else if (mode_id == rb_intern("future_experiments_only")) {
|
|
401
|
+
mode = DDOG_FFE_EXPERIMENTATION_OPT_OUT_MODE_FUTURE_EXPERIMENTS_ONLY;
|
|
402
|
+
} else {
|
|
403
|
+
rb_raise(rb_eArgError, "Unsupported experimentation opt-out mode");
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const ddog_ffe_Handle_Configuration config =
|
|
407
|
+
(ddog_ffe_Handle_Configuration)rb_check_typeddata(self, &configuration_data_type);
|
|
408
|
+
const ddog_ffe_ExpectedFlagType expected_ty = expected_type_from_value(expected_type);
|
|
409
|
+
ddog_ffe_Handle_EvaluationContext context = evaluation_context_from_hash(context_hash);
|
|
410
|
+
ddog_ffe_Handle_ResolutionDetails resolution_details = ddog_ffe_get_assignment_with_opt_out_mode(
|
|
411
|
+
config, RSTRING_PTR(flag_key), expected_ty, context, mode
|
|
412
|
+
);
|
|
413
|
+
ddog_ffe_evaluation_context_drop(&context);
|
|
414
|
+
|
|
415
|
+
return TypedData_Wrap_Struct(resolution_details_class, &resolution_details_typed_data, resolution_details);
|
|
416
|
+
}
|
|
417
|
+
#endif
|
|
418
|
+
|
|
332
419
|
static void resolution_details_free(void *ptr) {
|
|
333
420
|
ddog_ffe_Handle_ResolutionDetails resolution_details = (ddog_ffe_Handle_ResolutionDetails)ptr;
|
|
334
421
|
ddog_ffe_assignment_drop(&resolution_details);
|
|
@@ -586,3 +673,53 @@ static VALUE resolution_details_get_flag_metadata(VALUE self) {
|
|
|
586
673
|
|
|
587
674
|
return hash;
|
|
588
675
|
}
|
|
676
|
+
|
|
677
|
+
static VALUE feature_value_to_ruby(const struct ddog_ffe_FeatureValue *value) {
|
|
678
|
+
switch (value->tag) {
|
|
679
|
+
case DDOG_FFE_FEATURE_VALUE_STRING:
|
|
680
|
+
// Frozen because flag metadata reaches customer code while queued telemetry still holds the value.
|
|
681
|
+
return rb_obj_freeze(rb_utf8_str_new((const char *)value->string.ptr, value->string.len));
|
|
682
|
+
case DDOG_FFE_FEATURE_VALUE_FLOAT:
|
|
683
|
+
return rb_float_new(value->float_);
|
|
684
|
+
case DDOG_FFE_FEATURE_VALUE_BOOLEAN:
|
|
685
|
+
return value->boolean ? Qtrue : Qfalse;
|
|
686
|
+
default:
|
|
687
|
+
// This should never happen as we checked for all possible tag values.
|
|
688
|
+
raise_error(feature_flags_error_class, "Internal: Unexpected feature value tag");
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/*
|
|
693
|
+
* call-seq:
|
|
694
|
+
* resolution_details.features() -> Array
|
|
695
|
+
*
|
|
696
|
+
* Get the features of the selected split, in configuration order.
|
|
697
|
+
*
|
|
698
|
+
* @return [Array<Array(String, String | Float | Boolean, Array<String>)>]
|
|
699
|
+
* `[key, value, destinations]` triples; a shared frozen empty array when the split has none
|
|
700
|
+
*/
|
|
701
|
+
static VALUE resolution_details_get_features(VALUE self) {
|
|
702
|
+
ddog_ffe_Handle_ResolutionDetails resolution_details =
|
|
703
|
+
(ddog_ffe_Handle_ResolutionDetails)rb_check_typeddata(self, &resolution_details_typed_data);
|
|
704
|
+
// Borrowed from the handle, which `self` keeps alive while Ruby allocates below.
|
|
705
|
+
struct ddog_ffe_FeatureArray features = ddog_ffe_assignment_get_features(resolution_details);
|
|
706
|
+
if (features.count == 0) {
|
|
707
|
+
return empty_features;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
VALUE result = rb_ary_new_capa((long)features.count);
|
|
711
|
+
for (size_t i = 0; i < features.count; i++) {
|
|
712
|
+
const struct ddog_ffe_Feature *feature = &features.elements[i];
|
|
713
|
+
|
|
714
|
+
VALUE destinations = rb_ary_new_capa((long)feature->destinations.count);
|
|
715
|
+
for (size_t j = 0; j < feature->destinations.count; j++) {
|
|
716
|
+
const struct ddog_ffe_BorrowedStr destination = feature->destinations.elements[j];
|
|
717
|
+
rb_ary_push(destinations, rb_utf8_str_new((const char *)destination.ptr, destination.len));
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
VALUE key = rb_utf8_str_new((const char *)feature->key.ptr, feature->key.len);
|
|
721
|
+
rb_ary_push(result, rb_ary_new_from_args(3, key, feature_value_to_ruby(&feature->value), destinations));
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return result;
|
|
725
|
+
}
|
|
@@ -32,9 +32,9 @@ void process_discovery_init(VALUE core_module) {
|
|
|
32
32
|
VALUE tracer_memfd_class = rb_define_class_under(process_discovery_module, "TracerMemfd", rb_cObject);
|
|
33
33
|
rb_undef_alloc_func(tracer_memfd_class); // Class cannot be instantiated from Ruby
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
rb_define_singleton_method(process_discovery_module, "_native_store_tracer_metadata", _native_store_tracer_metadata, -1);
|
|
36
|
+
rb_define_singleton_method(process_discovery_module, "_native_to_rb_int", _native_to_rb_int, 1);
|
|
37
|
+
rb_define_singleton_method(process_discovery_module, "_native_close_tracer_memfd", _native_close_tracer_memfd, 2);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
static VALUE _native_store_tracer_metadata(int argc, VALUE *argv, VALUE self) {
|
|
@@ -11,7 +11,7 @@ module Datadog
|
|
|
11
11
|
module LibdatadogExtconfHelpers
|
|
12
12
|
# Used to make sure the correct gem version gets loaded, as extconf.rb does not get run with "bundle exec" and thus
|
|
13
13
|
# may see multiple libdatadog versions. See https://github.com/DataDog/dd-trace-rb/pull/2531 for the horror story.
|
|
14
|
-
LIBDATADOG_VERSION = "~>
|
|
14
|
+
LIBDATADOG_VERSION = "~> 48.0.0.1.1"
|
|
15
15
|
|
|
16
16
|
# Used as an workaround for a limitation with how dynamic linking works in environments where the datadog gem and
|
|
17
17
|
# libdatadog are moved after the extension gets compiled.
|
|
@@ -6,17 +6,15 @@ module Datadog
|
|
|
6
6
|
module Rack
|
|
7
7
|
# Patcher for Rack integration
|
|
8
8
|
module Patcher
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def patched?
|
|
9
|
+
def self.patched?
|
|
12
10
|
!!Patcher.instance_variable_get(:@patched)
|
|
13
11
|
end
|
|
14
12
|
|
|
15
|
-
def target_version
|
|
13
|
+
def self.target_version
|
|
16
14
|
Integration.version
|
|
17
15
|
end
|
|
18
16
|
|
|
19
|
-
def patch
|
|
17
|
+
def self.patch
|
|
20
18
|
Patcher.instance_variable_set(:@patched, true)
|
|
21
19
|
end
|
|
22
20
|
end
|
|
@@ -15,28 +15,26 @@ module Datadog
|
|
|
15
15
|
module Patcher
|
|
16
16
|
BEFORE_INITIALIZE_ONLY_ONCE_PER_APP = Hash.new { |h, key| h[key] = Datadog::Core::Utils::OnlyOnce.new }
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def patched?
|
|
18
|
+
def self.patched?
|
|
21
19
|
!!Patcher.instance_variable_get(:@patched)
|
|
22
20
|
end
|
|
23
21
|
|
|
24
|
-
def target_version
|
|
22
|
+
def self.target_version
|
|
25
23
|
Integration.version
|
|
26
24
|
end
|
|
27
25
|
|
|
28
|
-
def patch
|
|
26
|
+
def self.patch
|
|
29
27
|
patch_before_initialize
|
|
30
28
|
Patcher.instance_variable_set(:@patched, true)
|
|
31
29
|
end
|
|
32
30
|
|
|
33
|
-
def patch_before_initialize
|
|
31
|
+
def self.patch_before_initialize
|
|
34
32
|
::ActiveSupport.on_load(:before_initialize) do
|
|
35
33
|
Datadog::AIGuard::Contrib::Rails::Patcher.before_initialize(self)
|
|
36
34
|
end
|
|
37
35
|
end
|
|
38
36
|
|
|
39
|
-
def before_initialize(app)
|
|
37
|
+
def self.before_initialize(app)
|
|
40
38
|
BEFORE_INITIALIZE_ONLY_ONCE_PER_APP[app].run do
|
|
41
39
|
# Middleware must be added before the application is initialized.
|
|
42
40
|
# Otherwise the middleware stack will be frozen.
|
|
@@ -44,7 +42,7 @@ module Datadog
|
|
|
44
42
|
end
|
|
45
43
|
end
|
|
46
44
|
|
|
47
|
-
def add_middleware(app)
|
|
45
|
+
def self.add_middleware(app)
|
|
48
46
|
if include_middleware?(Datadog::Tracing::Contrib::Rack::TraceMiddleware, app)
|
|
49
47
|
app.middleware.insert_after(
|
|
50
48
|
Datadog::Tracing::Contrib::Rack::TraceMiddleware,
|
|
@@ -55,7 +53,7 @@ module Datadog
|
|
|
55
53
|
end
|
|
56
54
|
end
|
|
57
55
|
|
|
58
|
-
def include_middleware?(middleware, app)
|
|
56
|
+
def self.include_middleware?(middleware, app)
|
|
59
57
|
found = false
|
|
60
58
|
|
|
61
59
|
# find tracer middleware reference in Rails::Configuration::MiddlewareStackProxy
|
|
@@ -9,17 +9,15 @@ module Datadog
|
|
|
9
9
|
module RubyLLM
|
|
10
10
|
# AIGuard patcher module for RubyLLM
|
|
11
11
|
module Patcher
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def patched?
|
|
12
|
+
def self.patched?
|
|
15
13
|
!!Patcher.instance_variable_get(:@patched)
|
|
16
14
|
end
|
|
17
15
|
|
|
18
|
-
def target_version
|
|
16
|
+
def self.target_version
|
|
19
17
|
Integration.version
|
|
20
18
|
end
|
|
21
19
|
|
|
22
|
-
def patch
|
|
20
|
+
def self.patch
|
|
23
21
|
::RubyLLM::Chat.prepend(ChatInstrumentation)
|
|
24
22
|
|
|
25
23
|
Patcher.instance_variable_set(:@patched, true)
|
|
@@ -12,9 +12,7 @@ module Datadog
|
|
|
12
12
|
CLIENT_ERROR = "client_error"
|
|
13
13
|
REDACTION_ERROR = "redaction_error"
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def report_evaluation(outcome, blocked:)
|
|
15
|
+
def self.report_evaluation(outcome, blocked:)
|
|
18
16
|
telemetry = AIGuard.telemetry
|
|
19
17
|
return unless telemetry
|
|
20
18
|
|
|
@@ -30,7 +28,7 @@ module Datadog
|
|
|
30
28
|
end
|
|
31
29
|
end
|
|
32
30
|
|
|
33
|
-
def report_error
|
|
31
|
+
def self.report_error
|
|
34
32
|
telemetry = AIGuard.telemetry
|
|
35
33
|
return unless telemetry
|
|
36
34
|
|
|
@@ -6,9 +6,7 @@ module Datadog
|
|
|
6
6
|
module AppSec
|
|
7
7
|
# this module encapsulates functions for handling actions that libddawf returns
|
|
8
8
|
module ActionsHandler
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def handle(actions_hash)
|
|
9
|
+
def self.handle(actions_hash)
|
|
12
10
|
# handle actions according their precedence
|
|
13
11
|
# stack and schema generation should be done before we throw an interrupt signal
|
|
14
12
|
generate_stack(actions_hash["generate_stack"]) if actions_hash.key?("generate_stack")
|
|
@@ -17,11 +15,11 @@ module Datadog
|
|
|
17
15
|
interrupt_execution(actions_hash["block_request"]) if actions_hash.key?("block_request")
|
|
18
16
|
end
|
|
19
17
|
|
|
20
|
-
def interrupt_execution(action_params)
|
|
21
|
-
|
|
18
|
+
def self.interrupt_execution(action_params)
|
|
19
|
+
AppSec.active_context&.interrupt!(action_params)
|
|
22
20
|
end
|
|
23
21
|
|
|
24
|
-
def generate_stack(action_params)
|
|
22
|
+
def self.generate_stack(action_params)
|
|
25
23
|
return unless Datadog.configuration.appsec.stack_trace.enabled
|
|
26
24
|
|
|
27
25
|
stack_id = action_params["stack_id"]
|
|
@@ -42,7 +40,7 @@ module Datadog
|
|
|
42
40
|
active_span.set_metastruct_tag(tag_key, existing_stack_data)
|
|
43
41
|
end
|
|
44
42
|
|
|
45
|
-
def generate_schema(_action_params)
|
|
43
|
+
def self.generate_schema(_action_params)
|
|
46
44
|
end
|
|
47
45
|
end
|
|
48
46
|
end
|
|
@@ -6,9 +6,7 @@ module Datadog
|
|
|
6
6
|
module EndpointCollection
|
|
7
7
|
# This module serializes Grape routes.
|
|
8
8
|
module GrapeRouteSerializer
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def serialize(route, path_prefix: "")
|
|
9
|
+
def self.serialize(route, path_prefix: "")
|
|
12
10
|
path = path_prefix + route.pattern.origin
|
|
13
11
|
|
|
14
12
|
{
|
|
@@ -8,9 +8,7 @@ module Datadog
|
|
|
8
8
|
module RailsRouteSerializer
|
|
9
9
|
FORMAT_SUFFIX = "(.:format)"
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def serialize(route, method_override: nil)
|
|
11
|
+
def self.serialize(route, method_override: nil)
|
|
14
12
|
method = if method_override
|
|
15
13
|
method_override
|
|
16
14
|
elsif route.verb.empty?
|
|
@@ -6,9 +6,7 @@ module Datadog
|
|
|
6
6
|
module EndpointCollection
|
|
7
7
|
# This module serializes Sinatra routes.
|
|
8
8
|
module SinatraRouteSerializer
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def serialize(route, method:, path_prefix: "")
|
|
9
|
+
def self.serialize(route, method:, path_prefix: "")
|
|
12
10
|
path = path_prefix + route.safe_string
|
|
13
11
|
|
|
14
12
|
{
|