ddtrace 1.9.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -1
- data/LICENSE-3rdparty.csv +1 -0
- data/ext/ddtrace_profiling_loader/extconf.rb +0 -2
- data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +81 -36
- data/ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.c +3 -3
- data/ext/ddtrace_profiling_native_extension/collectors_stack.c +37 -48
- data/ext/ddtrace_profiling_native_extension/collectors_stack.h +3 -1
- data/ext/ddtrace_profiling_native_extension/{collectors_cpu_and_wall_time.c → collectors_thread_context.c} +222 -143
- data/ext/ddtrace_profiling_native_extension/collectors_thread_context.h +14 -0
- data/ext/ddtrace_profiling_native_extension/extconf.rb +7 -18
- data/ext/ddtrace_profiling_native_extension/http_transport.c +25 -32
- data/ext/ddtrace_profiling_native_extension/libdatadog_helpers.h +9 -2
- data/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +9 -9
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +7 -121
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +1 -1
- data/ext/ddtrace_profiling_native_extension/profiling.c +2 -2
- data/ext/ddtrace_profiling_native_extension/ruby_helpers.c +2 -2
- data/ext/ddtrace_profiling_native_extension/ruby_helpers.h +1 -1
- data/ext/ddtrace_profiling_native_extension/stack_recorder.c +125 -21
- data/ext/ddtrace_profiling_native_extension/stack_recorder.h +9 -34
- data/lib/datadog/appsec/assets/waf_rules/recommended.json +321 -185
- data/lib/datadog/appsec/assets/waf_rules/strict.json +59 -2
- data/lib/datadog/appsec/assets.rb +0 -2
- data/lib/datadog/appsec/autoload.rb +4 -11
- data/lib/datadog/appsec/component.rb +41 -0
- data/lib/datadog/appsec/configuration/settings.rb +8 -3
- data/lib/datadog/appsec/configuration.rb +4 -2
- data/lib/datadog/appsec/contrib/auto_instrument.rb +0 -2
- data/lib/datadog/appsec/contrib/configuration/settings.rb +0 -2
- data/lib/datadog/appsec/contrib/integration.rb +0 -2
- data/lib/datadog/appsec/contrib/patcher.rb +0 -2
- data/lib/datadog/appsec/contrib/rack/configuration/settings.rb +0 -2
- data/lib/datadog/appsec/contrib/rack/ext.rb +0 -2
- data/lib/datadog/appsec/contrib/rack/gateway/request.rb +97 -0
- data/lib/datadog/appsec/contrib/rack/gateway/response.rb +30 -0
- data/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +111 -109
- data/lib/datadog/appsec/contrib/rack/integration.rb +0 -2
- data/lib/datadog/appsec/contrib/rack/patcher.rb +2 -2
- data/lib/datadog/appsec/contrib/rack/reactive/request.rb +18 -21
- data/lib/datadog/appsec/contrib/rack/reactive/request_body.rb +10 -11
- data/lib/datadog/appsec/contrib/rack/reactive/response.rb +10 -11
- data/lib/datadog/appsec/contrib/rack/request_body_middleware.rb +6 -4
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +40 -26
- data/lib/datadog/appsec/contrib/rails/configuration/settings.rb +0 -2
- data/lib/datadog/appsec/contrib/rails/ext.rb +0 -2
- data/lib/datadog/appsec/contrib/rails/framework.rb +0 -2
- data/lib/datadog/appsec/contrib/rails/gateway/request.rb +67 -0
- data/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +41 -37
- data/lib/datadog/appsec/contrib/rails/integration.rb +0 -2
- data/lib/datadog/appsec/contrib/rails/patcher.rb +3 -3
- data/lib/datadog/appsec/contrib/rails/reactive/action.rb +12 -11
- data/lib/datadog/appsec/contrib/rails/request.rb +0 -2
- data/lib/datadog/appsec/contrib/rails/request_middleware.rb +0 -2
- data/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb +0 -2
- data/lib/datadog/appsec/contrib/sinatra/ext.rb +0 -2
- data/lib/datadog/appsec/contrib/sinatra/framework.rb +0 -2
- data/lib/datadog/appsec/contrib/sinatra/gateway/request.rb +17 -0
- data/lib/datadog/appsec/contrib/sinatra/gateway/route_params.rb +23 -0
- data/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb +76 -71
- data/lib/datadog/appsec/contrib/sinatra/integration.rb +0 -2
- data/lib/datadog/appsec/contrib/sinatra/patcher.rb +12 -4
- data/lib/datadog/appsec/contrib/sinatra/reactive/routed.rb +10 -9
- data/lib/datadog/appsec/contrib/sinatra/request_middleware.rb +0 -2
- data/lib/datadog/appsec/event.rb +4 -8
- data/lib/datadog/appsec/ext.rb +9 -0
- data/lib/datadog/appsec/extensions.rb +10 -2
- data/lib/datadog/appsec/instrumentation/gateway/argument.rb +24 -0
- data/lib/datadog/appsec/instrumentation/gateway.rb +11 -5
- data/lib/datadog/appsec/instrumentation.rb +9 -0
- data/lib/datadog/appsec/monitor/gateway/watcher.rb +86 -0
- data/lib/datadog/appsec/monitor/reactive/set_user.rb +61 -0
- data/lib/datadog/appsec/monitor.rb +11 -0
- data/lib/datadog/appsec/processor.rb +74 -25
- data/lib/datadog/appsec/rate_limiter.rb +0 -2
- data/lib/datadog/appsec/reactive/address_hash.rb +6 -2
- data/lib/datadog/appsec/reactive/engine.rb +10 -7
- data/lib/datadog/appsec/reactive/operation.rb +19 -2
- data/lib/datadog/appsec/reactive/subscriber.rb +2 -1
- data/lib/datadog/appsec/response.rb +0 -2
- data/lib/datadog/appsec/utils/http/media_range.rb +0 -2
- data/lib/datadog/appsec/utils/http/media_type.rb +0 -2
- data/lib/datadog/appsec.rb +20 -2
- data/lib/datadog/ci/configuration/components.rb +0 -2
- data/lib/datadog/ci/configuration/settings.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/ext.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/integration.rb +0 -2
- data/lib/datadog/ci/contrib/cucumber/patcher.rb +0 -2
- data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +0 -2
- data/lib/datadog/ci/contrib/rspec/example.rb +0 -2
- data/lib/datadog/ci/contrib/rspec/ext.rb +0 -2
- data/lib/datadog/ci/contrib/rspec/integration.rb +0 -2
- data/lib/datadog/ci/contrib/rspec/patcher.rb +0 -2
- data/lib/datadog/ci/ext/app_types.rb +0 -2
- data/lib/datadog/ci/ext/environment.rb +2 -24
- data/lib/datadog/ci/ext/settings.rb +0 -2
- data/lib/datadog/ci/ext/test.rb +0 -2
- data/lib/datadog/ci/extensions.rb +0 -2
- data/lib/datadog/ci/flush.rb +0 -2
- data/lib/datadog/ci/test.rb +0 -2
- data/lib/datadog/ci.rb +0 -2
- data/lib/datadog/core/buffer/cruby.rb +0 -2
- data/lib/datadog/core/buffer/random.rb +0 -2
- data/lib/datadog/core/buffer/thread_safe.rb +0 -2
- data/lib/datadog/core/chunker.rb +0 -2
- data/lib/datadog/core/configuration/agent_settings_resolver.rb +0 -17
- data/lib/datadog/core/configuration/base.rb +0 -2
- data/lib/datadog/core/configuration/components.rb +14 -318
- data/lib/datadog/core/configuration/dependency_resolver.rb +0 -2
- data/lib/datadog/core/configuration/ext.rb +0 -2
- data/lib/datadog/core/configuration/option.rb +0 -2
- data/lib/datadog/core/configuration/option_definition.rb +0 -2
- data/lib/datadog/core/configuration/option_definition_set.rb +0 -2
- data/lib/datadog/core/configuration/option_set.rb +0 -2
- data/lib/datadog/core/configuration/options.rb +0 -2
- data/lib/datadog/core/configuration/settings.rb +14 -5
- data/lib/datadog/core/configuration.rb +0 -4
- data/lib/datadog/core/diagnostics/environment_logger.rb +0 -2
- data/lib/datadog/core/diagnostics/health.rb +0 -2
- data/lib/datadog/core/encoding.rb +0 -4
- data/lib/datadog/core/environment/cgroup.rb +0 -4
- data/lib/datadog/core/environment/class_count.rb +0 -2
- data/lib/datadog/core/environment/container.rb +0 -4
- data/lib/datadog/core/environment/ext.rb +0 -2
- data/lib/datadog/core/environment/gc.rb +0 -2
- data/lib/datadog/core/environment/identity.rb +0 -2
- data/lib/datadog/core/environment/platform.rb +0 -2
- data/lib/datadog/core/environment/socket.rb +0 -2
- data/lib/datadog/core/environment/thread_count.rb +0 -2
- data/lib/datadog/core/environment/variable_helpers.rb +0 -2
- data/lib/datadog/core/environment/vm_cache.rb +17 -2
- data/lib/datadog/core/error.rb +0 -2
- data/lib/datadog/core/extensions.rb +0 -2
- data/lib/datadog/core/git/ext.rb +0 -2
- data/lib/datadog/core/logger.rb +0 -2
- data/lib/datadog/core/metrics/client.rb +0 -2
- data/lib/datadog/core/metrics/ext.rb +0 -2
- data/lib/datadog/core/metrics/helpers.rb +0 -2
- data/lib/datadog/core/metrics/logging.rb +0 -2
- data/lib/datadog/core/metrics/metric.rb +0 -2
- data/lib/datadog/core/metrics/options.rb +0 -2
- data/lib/datadog/core/pin.rb +0 -2
- data/lib/datadog/core/runtime/ext.rb +2 -2
- data/lib/datadog/core/runtime/metrics.rb +21 -7
- data/lib/datadog/core/telemetry/client.rb +0 -2
- data/lib/datadog/core/telemetry/collector.rb +0 -2
- data/lib/datadog/core/telemetry/emitter.rb +0 -2
- data/lib/datadog/core/telemetry/event.rb +0 -4
- data/lib/datadog/core/telemetry/ext.rb +0 -2
- data/lib/datadog/core/telemetry/heartbeat.rb +0 -2
- data/lib/datadog/core/telemetry/http/adapters/net.rb +0 -2
- data/lib/datadog/core/telemetry/http/env.rb +0 -2
- data/lib/datadog/core/telemetry/http/response.rb +0 -4
- data/lib/datadog/core/telemetry/http/transport.rb +0 -2
- data/lib/datadog/core/telemetry/v1/app_event.rb +0 -2
- data/lib/datadog/core/utils/compression.rb +0 -2
- data/lib/datadog/core/utils/forking.rb +0 -2
- data/lib/datadog/core/utils/network.rb +140 -0
- data/lib/datadog/core/utils/object_set.rb +0 -2
- data/lib/datadog/core/utils/only_once.rb +0 -2
- data/lib/datadog/core/utils/safe_dup.rb +0 -2
- data/lib/datadog/core/utils/sequence.rb +0 -2
- data/lib/datadog/core/utils/string_table.rb +0 -2
- data/lib/datadog/core/utils/time.rb +0 -4
- data/lib/datadog/core/utils.rb +0 -2
- data/lib/datadog/core/vendor/ipaddr.rb +78 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post/composite_read_io.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/multipart/post/parts.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/multipart/post/version.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/multipart/post.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/multipart.rb +0 -2
- data/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb +0 -2
- data/lib/datadog/core/worker.rb +0 -2
- data/lib/datadog/core/workers/async.rb +0 -2
- data/lib/datadog/core/workers/interval_loop.rb +0 -2
- data/lib/datadog/core/workers/polling.rb +0 -2
- data/lib/datadog/core/workers/queue.rb +0 -2
- data/lib/datadog/core/workers/runtime_metrics.rb +0 -2
- data/lib/datadog/core.rb +0 -1
- data/lib/datadog/kit/appsec/events.rb +1 -2
- data/lib/datadog/kit/enable_core_dumps.rb +5 -6
- data/lib/datadog/kit/identity.rb +7 -1
- data/lib/datadog/kit.rb +0 -2
- data/lib/datadog/opentelemetry/api/context.rb +0 -1
- data/lib/datadog/opentelemetry/api/trace/span.rb +0 -1
- data/lib/datadog/opentelemetry/sdk/configurator.rb +0 -1
- data/lib/datadog/opentelemetry/sdk/id_generator.rb +0 -1
- data/lib/datadog/opentelemetry/sdk/propagator.rb +0 -1
- data/lib/datadog/opentelemetry/sdk/span_processor.rb +0 -1
- data/lib/datadog/opentelemetry.rb +0 -1
- data/lib/datadog/opentracer/binary_propagator.rb +0 -2
- data/lib/datadog/opentracer/carrier.rb +0 -2
- data/lib/datadog/opentracer/distributed_headers.rb +0 -2
- data/lib/datadog/opentracer/global_tracer.rb +0 -2
- data/lib/datadog/opentracer/propagator.rb +0 -2
- data/lib/datadog/opentracer/rack_propagator.rb +0 -2
- data/lib/datadog/opentracer/scope.rb +0 -2
- data/lib/datadog/opentracer/scope_manager.rb +0 -2
- data/lib/datadog/opentracer/span.rb +0 -2
- data/lib/datadog/opentracer/span_context.rb +0 -2
- data/lib/datadog/opentracer/span_context_factory.rb +0 -2
- data/lib/datadog/opentracer/text_map_propagator.rb +0 -2
- data/lib/datadog/opentracer/thread_local_scope.rb +0 -2
- data/lib/datadog/opentracer/thread_local_scope_manager.rb +0 -2
- data/lib/datadog/opentracer/tracer.rb +0 -2
- data/lib/datadog/opentracer.rb +0 -2
- data/lib/datadog/profiling/backtrace_location.rb +0 -2
- data/lib/datadog/profiling/buffer.rb +0 -2
- data/lib/datadog/profiling/collectors/code_provenance.rb +0 -2
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +12 -7
- data/lib/datadog/profiling/collectors/dynamic_sampling_rate.rb +0 -2
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +1 -3
- data/lib/datadog/profiling/collectors/old_stack.rb +1 -5
- data/lib/datadog/profiling/collectors/stack.rb +0 -2
- data/lib/datadog/profiling/collectors/{cpu_and_wall_time.rb → thread_context.rb} +8 -5
- data/lib/datadog/profiling/component.rb +161 -0
- data/lib/datadog/profiling/encoding/profile.rb +0 -2
- data/lib/datadog/profiling/event.rb +0 -2
- data/lib/datadog/profiling/events/stack.rb +0 -2
- data/lib/datadog/profiling/exporter.rb +0 -2
- data/lib/datadog/profiling/ext/forking.rb +0 -2
- data/lib/datadog/profiling/ext.rb +0 -2
- data/lib/datadog/profiling/flush.rb +0 -2
- data/lib/datadog/profiling/http_transport.rb +0 -2
- data/lib/datadog/profiling/load_native_extension.rb +0 -2
- data/lib/datadog/profiling/native_extension.rb +0 -2
- data/lib/datadog/profiling/old_recorder.rb +0 -2
- data/lib/datadog/profiling/pprof/builder.rb +0 -2
- data/lib/datadog/profiling/pprof/converter.rb +0 -2
- data/lib/datadog/profiling/pprof/message_set.rb +0 -2
- data/lib/datadog/profiling/pprof/payload.rb +0 -2
- data/lib/datadog/profiling/pprof/pprof_pb.rb +0 -2
- data/lib/datadog/profiling/pprof/stack_sample.rb +0 -2
- data/lib/datadog/profiling/pprof/string_table.rb +0 -2
- data/lib/datadog/profiling/pprof/template.rb +0 -2
- data/lib/datadog/profiling/preload.rb +0 -2
- data/lib/datadog/profiling/profiler.rb +0 -2
- data/lib/datadog/profiling/scheduler.rb +0 -2
- data/lib/datadog/profiling/stack_recorder.rb +3 -8
- data/lib/datadog/profiling/tag_builder.rb +0 -2
- data/lib/datadog/profiling/tasks/exec.rb +0 -2
- data/lib/datadog/profiling/tasks/help.rb +0 -2
- data/lib/datadog/profiling/tasks/setup.rb +0 -2
- data/lib/datadog/profiling/trace_identifiers/ddtrace.rb +0 -2
- data/lib/datadog/profiling/trace_identifiers/helper.rb +0 -2
- data/lib/datadog/profiling.rb +44 -7
- data/lib/datadog/tracing/analytics.rb +0 -2
- data/lib/datadog/tracing/buffer.rb +0 -4
- data/lib/datadog/tracing/client_ip.rb +38 -141
- data/lib/datadog/tracing/component.rb +176 -0
- data/lib/datadog/tracing/configuration/ext.rb +2 -2
- data/lib/datadog/tracing/configuration/settings.rb +20 -2
- data/lib/datadog/tracing/context.rb +0 -2
- data/lib/datadog/tracing/context_provider.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/event.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/events.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/action_cable/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/event.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/events/process.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/events.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/action_mailer/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/action_pack/utils.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/event.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/events/render_template.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/events.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/action_view/utils.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/event.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/discard.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/perform.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/events.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/log_injection.rb +0 -2
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/event.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/events.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/configuration/makara_resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/event.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/events.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/utils.rb +0 -2
- data/lib/datadog/tracing/contrib/active_record/vendor/connection_specification.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/cache/redis.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/notifications/event.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/notifications/subscription.rb +0 -2
- data/lib/datadog/tracing/contrib/active_support/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/analytics.rb +0 -2
- data/lib/datadog/tracing/contrib/auto_instrument.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/parsed_context.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/aws/services.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/configurable.rb +0 -2
- data/lib/datadog/tracing/contrib/configuration/resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/configuration/settings.rb +0 -4
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/dalli/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/dalli/instrumentation.rb +2 -2
- data/lib/datadog/tracing/contrib/dalli/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/dalli/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/dalli/quantize.rb +0 -2
- data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/delayed_job/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/delayed_job/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/delayed_job/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/delayed_job/plugin.rb +4 -2
- data/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb +2 -2
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/elasticsearch/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/elasticsearch/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +3 -4
- data/lib/datadog/tracing/contrib/elasticsearch/quantize.rb +0 -4
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +0 -2
- data/lib/datadog/tracing/contrib/ethon/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/ethon/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +0 -2
- data/lib/datadog/tracing/contrib/ethon/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/excon/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/excon/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/excon/middleware.rb +0 -2
- data/lib/datadog/tracing/contrib/excon/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/ext.rb +5 -0
- data/lib/datadog/tracing/contrib/extensions.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/connection.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/faraday/rack_builder.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/endpoint.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/grape/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/graphql/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/graphql/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/distributed/fetcher.rb +0 -1
- data/lib/datadog/tracing/contrib/grpc/distributed/propagation.rb +0 -1
- data/lib/datadog/tracing/contrib/grpc/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/integration.rb +8 -3
- data/lib/datadog/tracing/contrib/grpc/intercept_with_datadog.rb +0 -2
- data/lib/datadog/tracing/contrib/grpc/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/hanami/action_tracer.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/plugin.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/renderer_policy_tracing.rb +0 -2
- data/lib/datadog/tracing/contrib/hanami/router_tracing.rb +0 -2
- data/lib/datadog/tracing/contrib/http/circuit_breaker.rb +0 -2
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/http/distributed/fetcher.rb +0 -1
- data/lib/datadog/tracing/contrib/http/distributed/propagation.rb +0 -1
- data/lib/datadog/tracing/contrib/http/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/http/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/http/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/http/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/http_annotation_helper.rb +0 -2
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/httpclient/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/httpclient/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/httpclient/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/httprb/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/httprb/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/httprb/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/consumer_event.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/consumer_group_event.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/event.rb +1 -2
- data/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/events.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/ext.rb +1 -2
- data/lib/datadog/tracing/contrib/kafka/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/kafka/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/lograge/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/lograge/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/lograge/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/parsers.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +0 -2
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/mysql2/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/mysql2/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/mysql2/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/patchable.rb +0 -2
- data/lib/datadog/tracing/contrib/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/pg/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/pg/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/pg/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/presto/ext.rb +1 -2
- data/lib/datadog/tracing/contrib/presto/instrumentation.rb +3 -2
- data/lib/datadog/tracing/contrib/presto/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/presto/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/propagation/sql_comment/comment.rb +0 -2
- data/lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/propagation/sql_comment/mode.rb +0 -2
- data/lib/datadog/tracing/contrib/propagation/sql_comment.rb +0 -2
- data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/qless/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/qless/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/qless/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/qless/qless_job.rb +3 -2
- data/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +0 -2
- data/lib/datadog/tracing/contrib/que/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/que/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/que/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/que/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/que/tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/event.rb +1 -2
- data/lib/datadog/tracing/contrib/racecar/events/batch.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/events/consume.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/events/message.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/events.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/ext.rb +1 -2
- data/lib/datadog/tracing/contrib/racecar/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/racecar/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/rack/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/rack/ext.rb +5 -2
- data/lib/datadog/tracing/contrib/rack/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +42 -18
- data/lib/datadog/tracing/contrib/rack/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/rack/request_queue.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/framework.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/log_injection.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/middlewares.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/railtie.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/utils.rb +0 -2
- data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/rake/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/rake/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/rake/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/rake/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/configuration/resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/quantize.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/tags.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/trace_middleware.rb +0 -2
- data/lib/datadog/tracing/contrib/redis/vendor/resolver.rb +0 -2
- data/lib/datadog/tracing/contrib/registerable.rb +0 -2
- data/lib/datadog/tracing/contrib/registry.rb +0 -2
- data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/resque/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/resque/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/resque/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/resque/resque_job.rb +2 -2
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/rest_client/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/rest_client/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/rest_client/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +0 -2
- data/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/semantic_logger/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/semantic_logger/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/database.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/dataset.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/sequel/utils.rb +0 -2
- data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/shoryuken/ext.rb +1 -2
- data/lib/datadog/tracing/contrib/shoryuken/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/shoryuken/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/shoryuken/tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/sidekiq/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/sidekiq/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/sidekiq/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb +4 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb +4 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/tracing.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/env.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/framework.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/headers.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/sinatra/tracer.rb +0 -2
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +0 -2
- data/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/sneakers/ext.rb +1 -2
- data/lib/datadog/tracing/contrib/sneakers/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/sneakers/patcher.rb +0 -2
- data/lib/datadog/tracing/contrib/sneakers/tracer.rb +3 -2
- data/lib/datadog/tracing/contrib/status_code_matcher.rb +0 -2
- data/lib/datadog/tracing/contrib/stripe/patcher.rb +0 -1
- data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +0 -2
- data/lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb +0 -2
- data/lib/datadog/tracing/contrib/sucker_punch/ext.rb +0 -2
- data/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +0 -2
- data/lib/datadog/tracing/contrib/sucker_punch/integration.rb +0 -2
- data/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +0 -3
- data/lib/datadog/tracing/contrib/utils/database.rb +0 -2
- data/lib/datadog/tracing/contrib/utils/quantization/hash.rb +0 -2
- data/lib/datadog/tracing/contrib/utils/quantization/http.rb +0 -4
- data/lib/datadog/tracing/contrib.rb +0 -2
- data/lib/datadog/tracing/correlation.rb +15 -3
- data/lib/datadog/tracing/diagnostics/ext.rb +0 -2
- data/lib/datadog/tracing/diagnostics/health.rb +0 -2
- data/lib/datadog/tracing/distributed/b3_multi.rb +12 -6
- data/lib/datadog/tracing/distributed/b3_single.rb +8 -6
- data/lib/datadog/tracing/distributed/datadog.rb +58 -11
- data/lib/datadog/tracing/distributed/datadog_tags_codec.rb +0 -1
- data/lib/datadog/tracing/distributed/fetcher.rb +0 -9
- data/lib/datadog/tracing/distributed/headers/ext.rb +0 -1
- data/lib/datadog/tracing/distributed/helpers.rb +21 -36
- data/lib/datadog/tracing/distributed/none.rb +0 -1
- data/lib/datadog/tracing/distributed/propagation.rb +0 -1
- data/lib/datadog/tracing/distributed/trace_context.rb +8 -13
- data/lib/datadog/tracing/event.rb +0 -2
- data/lib/datadog/tracing/flush.rb +0 -2
- data/lib/datadog/tracing/metadata/analytics.rb +0 -2
- data/lib/datadog/tracing/metadata/errors.rb +0 -2
- data/lib/datadog/tracing/metadata/ext.rb +6 -2
- data/lib/datadog/tracing/metadata/tagging.rb +0 -2
- data/lib/datadog/tracing/metadata.rb +0 -2
- data/lib/datadog/tracing/pipeline/span_filter.rb +0 -2
- data/lib/datadog/tracing/pipeline/span_processor.rb +0 -2
- data/lib/datadog/tracing/pipeline.rb +0 -2
- data/lib/datadog/tracing/propagation/http.rb +0 -2
- data/lib/datadog/tracing/runtime/metrics.rb +0 -2
- data/lib/datadog/tracing/sampling/all_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/ext.rb +0 -2
- data/lib/datadog/tracing/sampling/matcher.rb +0 -2
- data/lib/datadog/tracing/sampling/priority_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/rate_by_key_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/rate_limiter.rb +0 -2
- data/lib/datadog/tracing/sampling/rate_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/rule.rb +0 -2
- data/lib/datadog/tracing/sampling/rule_sampler.rb +0 -2
- data/lib/datadog/tracing/sampling/sampler.rb +0 -2
- data/lib/datadog/tracing/span.rb +0 -2
- data/lib/datadog/tracing/span_operation.rb +1 -3
- data/lib/datadog/tracing/sync_writer.rb +0 -2
- data/lib/datadog/tracing/trace_digest.rb +0 -2
- data/lib/datadog/tracing/trace_operation.rb +1 -3
- data/lib/datadog/tracing/trace_segment.rb +7 -2
- data/lib/datadog/tracing/tracer.rb +0 -2
- data/lib/datadog/tracing/utils.rb +33 -2
- data/lib/datadog/tracing/workers/trace_writer.rb +0 -2
- data/lib/datadog/tracing/workers.rb +0 -2
- data/lib/datadog/tracing/writer.rb +0 -2
- data/lib/datadog/tracing.rb +0 -2
- data/lib/ddtrace/auto_instrument.rb +0 -2
- data/lib/ddtrace/auto_instrument_base.rb +0 -2
- data/lib/ddtrace/profiling/preload.rb +0 -2
- data/lib/ddtrace/transport/ext.rb +0 -2
- data/lib/ddtrace/transport/http/adapters/net.rb +0 -2
- data/lib/ddtrace/transport/http/adapters/registry.rb +0 -2
- data/lib/ddtrace/transport/http/adapters/test.rb +0 -2
- data/lib/ddtrace/transport/http/adapters/unix_socket.rb +0 -2
- data/lib/ddtrace/transport/http/api/endpoint.rb +0 -2
- data/lib/ddtrace/transport/http/api/fallbacks.rb +0 -2
- data/lib/ddtrace/transport/http/api/instance.rb +0 -2
- data/lib/ddtrace/transport/http/api/map.rb +0 -2
- data/lib/ddtrace/transport/http/api/spec.rb +0 -2
- data/lib/ddtrace/transport/http/api.rb +0 -2
- data/lib/ddtrace/transport/http/builder.rb +0 -2
- data/lib/ddtrace/transport/http/client.rb +0 -2
- data/lib/ddtrace/transport/http/env.rb +0 -2
- data/lib/ddtrace/transport/http/response.rb +0 -2
- data/lib/ddtrace/transport/http/statistics.rb +0 -2
- data/lib/ddtrace/transport/http/traces.rb +1 -3
- data/lib/ddtrace/transport/http.rb +0 -4
- data/lib/ddtrace/transport/io/client.rb +0 -2
- data/lib/ddtrace/transport/io/response.rb +0 -2
- data/lib/ddtrace/transport/io/traces.rb +0 -4
- data/lib/ddtrace/transport/io.rb +0 -2
- data/lib/ddtrace/transport/parcel.rb +0 -4
- data/lib/ddtrace/transport/request.rb +0 -2
- data/lib/ddtrace/transport/response.rb +0 -2
- data/lib/ddtrace/transport/serializable_trace.rb +9 -5
- data/lib/ddtrace/transport/statistics.rb +0 -2
- data/lib/ddtrace/transport/trace_formatter.rb +7 -2
- data/lib/ddtrace/transport/traces.rb +1 -3
- data/lib/ddtrace/version.rb +2 -4
- data/lib/ddtrace.rb +1 -5
- metadata +26 -13
- data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h +0 -9
- data/lib/datadog/appsec/assets/waf_rules/risky.json +0 -1499
- data/lib/datadog/appsec/contrib/rack/request.rb +0 -78
- data/lib/datadog/appsec/contrib/rack/response.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 005fcbaaa9553287f8652a9f437abd144c2ba2ca0f26c83f67de171646f5aae3
|
4
|
+
data.tar.gz: 032c0d3f09ea01779b17ba45a95086ab890b3869208c84b82b548b3cbd41a977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc868d2e56e5282771cbc7e9447f1fa7504212d31b5bc94db4db9e5f029a00b0a9f988bcab7111f1889eb1f203fffcd81b73700c69f433be4bdaa2045dbfba72
|
7
|
+
data.tar.gz: d2679f725e7991bfa2e34dc6de650e928a59aa02124239d340a396ea40f331ff0a4a2159067df5ade22c1c36daab8e7cbe25db3ddaf55b8c8cb14137e7b2d220
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,48 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [1.10.1] - 2023-03-10
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
* CI: Update TeamCity environment variable support ([#2668][])
|
10
|
+
* Core: Fix spurious dependency on AppSec when loading CI with `require 'datadog/ci'` ([#2679][])
|
11
|
+
* Core: Allow multiple headers and multiple IPs per header for client IP ([#2665][])
|
12
|
+
* AppSec: prevent side-effect on AppSec login event tracking method arguments ([#2663][]) ([@coneill-enhance][])
|
13
|
+
|
14
|
+
## [1.10.0] - 2023-03-06
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
* Support Ruby 3.2 ([#2601][])
|
19
|
+
* Publish init container image (beta) for `dd-trace-rb` injection through K8s admission controller ([#2606][])
|
20
|
+
* Tracing: Support 128 bits trace id ([#2543][])
|
21
|
+
* Tracing: Add tags to integrations (`que` / `racecar` / `resque`/ `shoryken` / `sneakers` / `qless` / `delayed_job` / `kafka` / `sidekiq` / `dalli` / `presto` / `elasticsearch`) ([#2619][], [#2613][] , [#2608][], [#2590][])
|
22
|
+
* Appsec: Introduce `AppSec::Instrumentation::Gateway::Argument` ([#2648][])
|
23
|
+
* Appsec: Block request when user ID matches rules ([#2642][])
|
24
|
+
* Appsec: Block request base on response addresses matches ([#2605][])
|
25
|
+
* Appsec: Allow to set user id denylist ([#2612][])
|
26
|
+
* Profiling: Show profiler overhead in flamegraph for CPU Profiling 2.0 ([#2607][])
|
27
|
+
* Profiling: Add support for allocation samples to `ThreadContext` ([#2657][])
|
28
|
+
* Profiling: Exclude disabled profiling sample value types from output ([#2634][])
|
29
|
+
* Profiling: Extend stack collector to record the alloc-samples metric ([#2618][])
|
30
|
+
* Profiling: Add `Profiling.allocation_count` API for new profiler ([#2635][])
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
* Tracing: `rack` instrumentation counts time spent in queue as part of the `http_server.queue` span ([#2591][]) ([@agrobbin][])
|
35
|
+
* Appsec: Update ruleset to 1.5.2 ([#2662][], [#2659][], [#2598][])
|
36
|
+
* Appsec: Update `libddwaf` version to 1.6.2.0.0 ([#2614][])
|
37
|
+
* Profiling: Upgrade profiler to use `libdatadog` v2.0.0 ([#2599][])
|
38
|
+
* Profiling: Remove support for profiling Ruby 2.2 ([#2592][])
|
39
|
+
|
40
|
+
### Fixed
|
41
|
+
|
42
|
+
* Fix broken Ruby VM statistics for Ruby 3.2 ([#2600][])
|
43
|
+
* Tracing: Fix 'uninitialized constant GRPC::Interceptor' error with 'gapic-common' gem ([#2649][])
|
44
|
+
* Profiling: Fix profiler not adding the "In native code" placeholder ([#2594][])
|
45
|
+
* Fix profiler detection for google-protobuf installation ([#2595][])
|
46
|
+
|
5
47
|
## [1.9.0] - 2023-01-30
|
6
48
|
|
7
49
|
As of ddtrace 1.9.0, CPU Profiling 2.0 is now in opt-in (that is, disabled by default) public beta. For more details, check the release notes.
|
@@ -2281,7 +2323,9 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
2281
2323
|
|
2282
2324
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
2283
2325
|
|
2284
|
-
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.
|
2326
|
+
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.10.1...master
|
2327
|
+
[1.10.1]: https://github.com/DataDog/dd-trace-rb/compare/v1.10.0...v1.10.1
|
2328
|
+
[1.10.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.9.0...v1.10.0
|
2285
2329
|
[1.9.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.8.0...v1.9.0
|
2286
2330
|
[1.8.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.7.0...v1.8.0
|
2287
2331
|
[1.7.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.6.1...v1.7.0
|
@@ -3254,12 +3298,43 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
3254
3298
|
[#2530]: https://github.com/DataDog/dd-trace-rb/issues/2530
|
3255
3299
|
[#2531]: https://github.com/DataDog/dd-trace-rb/issues/2531
|
3256
3300
|
[#2541]: https://github.com/DataDog/dd-trace-rb/issues/2541
|
3301
|
+
[#2543]: https://github.com/DataDog/dd-trace-rb/issues/2543
|
3257
3302
|
[#2557]: https://github.com/DataDog/dd-trace-rb/issues/2557
|
3258
3303
|
[#2562]: https://github.com/DataDog/dd-trace-rb/issues/2562
|
3259
3304
|
[#2573]: https://github.com/DataDog/dd-trace-rb/issues/2573
|
3260
3305
|
[#2576]: https://github.com/DataDog/dd-trace-rb/issues/2576
|
3261
3306
|
[#2580]: https://github.com/DataDog/dd-trace-rb/issues/2580
|
3262
3307
|
[#2586]: https://github.com/DataDog/dd-trace-rb/issues/2586
|
3308
|
+
[#2590]: https://github.com/DataDog/dd-trace-rb/issues/2590
|
3309
|
+
[#2591]: https://github.com/DataDog/dd-trace-rb/issues/2591
|
3310
|
+
[#2592]: https://github.com/DataDog/dd-trace-rb/issues/2592
|
3311
|
+
[#2594]: https://github.com/DataDog/dd-trace-rb/issues/2594
|
3312
|
+
[#2595]: https://github.com/DataDog/dd-trace-rb/issues/2595
|
3313
|
+
[#2598]: https://github.com/DataDog/dd-trace-rb/issues/2598
|
3314
|
+
[#2599]: https://github.com/DataDog/dd-trace-rb/issues/2599
|
3315
|
+
[#2600]: https://github.com/DataDog/dd-trace-rb/issues/2600
|
3316
|
+
[#2601]: https://github.com/DataDog/dd-trace-rb/issues/2601
|
3317
|
+
[#2605]: https://github.com/DataDog/dd-trace-rb/issues/2605
|
3318
|
+
[#2606]: https://github.com/DataDog/dd-trace-rb/issues/2606
|
3319
|
+
[#2607]: https://github.com/DataDog/dd-trace-rb/issues/2607
|
3320
|
+
[#2608]: https://github.com/DataDog/dd-trace-rb/issues/2608
|
3321
|
+
[#2612]: https://github.com/DataDog/dd-trace-rb/issues/2612
|
3322
|
+
[#2613]: https://github.com/DataDog/dd-trace-rb/issues/2613
|
3323
|
+
[#2614]: https://github.com/DataDog/dd-trace-rb/issues/2614
|
3324
|
+
[#2618]: https://github.com/DataDog/dd-trace-rb/issues/2618
|
3325
|
+
[#2619]: https://github.com/DataDog/dd-trace-rb/issues/2619
|
3326
|
+
[#2634]: https://github.com/DataDog/dd-trace-rb/issues/2634
|
3327
|
+
[#2635]: https://github.com/DataDog/dd-trace-rb/issues/2635
|
3328
|
+
[#2642]: https://github.com/DataDog/dd-trace-rb/issues/2642
|
3329
|
+
[#2648]: https://github.com/DataDog/dd-trace-rb/issues/2648
|
3330
|
+
[#2649]: https://github.com/DataDog/dd-trace-rb/issues/2649
|
3331
|
+
[#2657]: https://github.com/DataDog/dd-trace-rb/issues/2657
|
3332
|
+
[#2659]: https://github.com/DataDog/dd-trace-rb/issues/2659
|
3333
|
+
[#2662]: https://github.com/DataDog/dd-trace-rb/issues/2662
|
3334
|
+
[#2663]: https://github.com/DataDog/dd-trace-rb/issues/2663
|
3335
|
+
[#2665]: https://github.com/DataDog/dd-trace-rb/issues/2665
|
3336
|
+
[#2668]: https://github.com/DataDog/dd-trace-rb/issues/2668
|
3337
|
+
[#2679]: https://github.com/DataDog/dd-trace-rb/issues/2679
|
3263
3338
|
[@AdrianLC]: https://github.com/AdrianLC
|
3264
3339
|
[@Azure7111]: https://github.com/Azure7111
|
3265
3340
|
[@BabyGroot]: https://github.com/BabyGroot
|
@@ -3304,6 +3379,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
|
3304
3379
|
[@cjford]: https://github.com/cjford
|
3305
3380
|
[@ck3g]: https://github.com/ck3g
|
3306
3381
|
[@components]: https://github.com/components
|
3382
|
+
[@coneill-enhance]: https://github.com/coneill-enhance
|
3307
3383
|
[@cswatt]: https://github.com/cswatt
|
3308
3384
|
[@cwoodcox]: https://github.com/cwoodcox
|
3309
3385
|
[@danhodge]: https://github.com/danhodge
|
data/LICENSE-3rdparty.csv
CHANGED
@@ -5,3 +5,4 @@ lib/datadog/tracing/contrib/utils/quantization/http.rb,https://github.com/ruby/u
|
|
5
5
|
ext/ddtrace_profiling_native_extension/private_vm_api_access,https://github.com/ruby/ruby,BSD-2-Clause,"Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
|
6
6
|
msgpack,https://rubygems.org/gems/msgpack,Apache-2.0,"Copyright (c) 2008-2015 Sadayuki Furuhashi"
|
7
7
|
debase-ruby_core_source,https://rubygems.org/gems/debase-ruby_core_source,MIT for gem and BSD-2-Clause for Ruby sources,"Copyright (c) 2012 Gabriel Horner. Files from Ruby sources are Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved."
|
8
|
+
lib/datadog/core/vendor/ipaddr,https://github.com/ruby/ipaddr/blob/master/lib/ipaddr.rb,BSD 2-Clause "Simplified" License,"Copyright (c) 2002 Hajimu UMEMOTO <ume@mahoroba.org> Copyright (c) 2007-2017 Akinori MUSHA <knu@iDaemons.org>"
|
@@ -9,15 +9,15 @@
|
|
9
9
|
|
10
10
|
#include "helpers.h"
|
11
11
|
#include "ruby_helpers.h"
|
12
|
-
#include "
|
12
|
+
#include "collectors_thread_context.h"
|
13
13
|
#include "collectors_dynamic_sampling_rate.h"
|
14
14
|
#include "collectors_idle_sampling_helper.h"
|
15
15
|
#include "private_vm_api_access.h"
|
16
16
|
#include "setup_signal_handler.h"
|
17
17
|
#include "time_helpers.h"
|
18
18
|
|
19
|
-
// Used to trigger the
|
20
|
-
// itself; this class only implements the "
|
19
|
+
// Used to trigger the execution of Collectors::ThreadState, which implements all of the sampling logic
|
20
|
+
// itself; this class only implements the "when to do it" part.
|
21
21
|
//
|
22
22
|
// This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTimeWorker class
|
23
23
|
|
@@ -61,7 +61,7 @@
|
|
61
61
|
// "as soon as it can".
|
62
62
|
//
|
63
63
|
// 4. The Ruby VM calls our `sample_from_postponed_job` from a thread holding the global VM lock. A sample is recorded by
|
64
|
-
// calling `
|
64
|
+
// calling `thread_context_collector_sample`.
|
65
65
|
//
|
66
66
|
// ### TracePoints and Forking
|
67
67
|
//
|
@@ -80,8 +80,9 @@ struct cpu_and_wall_time_worker_state {
|
|
80
80
|
atomic_bool should_run;
|
81
81
|
|
82
82
|
bool gc_profiling_enabled;
|
83
|
+
bool allocation_counting_enabled;
|
83
84
|
VALUE self_instance;
|
84
|
-
VALUE
|
85
|
+
VALUE thread_context_collector_instance;
|
85
86
|
VALUE idle_sampling_helper_instance;
|
86
87
|
VALUE owner_thread;
|
87
88
|
dynamic_sampling_rate_state dynamic_sampling_rate;
|
@@ -95,6 +96,8 @@ struct cpu_and_wall_time_worker_state {
|
|
95
96
|
// Used to get gc start/finish information
|
96
97
|
VALUE gc_tracepoint;
|
97
98
|
|
99
|
+
VALUE object_allocation_tracepoint;
|
100
|
+
|
98
101
|
struct stats {
|
99
102
|
// How many times we tried to trigger a sample
|
100
103
|
unsigned int trigger_sample_attempts;
|
@@ -119,9 +122,10 @@ static VALUE _native_new(VALUE klass);
|
|
119
122
|
static VALUE _native_initialize(
|
120
123
|
DDTRACE_UNUSED VALUE _self,
|
121
124
|
VALUE self_instance,
|
122
|
-
VALUE
|
125
|
+
VALUE thread_context_collector_instance,
|
123
126
|
VALUE gc_profiling_enabled,
|
124
|
-
VALUE idle_sampling_helper_instance
|
127
|
+
VALUE idle_sampling_helper_instance,
|
128
|
+
VALUE allocation_counting_enabled
|
125
129
|
);
|
126
130
|
static void cpu_and_wall_time_worker_typed_data_mark(void *state_ptr);
|
127
131
|
static VALUE _native_sampling_loop(VALUE self, VALUE instance);
|
@@ -153,6 +157,9 @@ void *simulate_sampling_signal_delivery(DDTRACE_UNUSED void *_unused);
|
|
153
157
|
static void grab_gvl_and_sample(void);
|
154
158
|
static void reset_stats(struct cpu_and_wall_time_worker_state *state);
|
155
159
|
static void sleep_for(uint64_t time_ns);
|
160
|
+
static VALUE _native_allocation_count(DDTRACE_UNUSED VALUE self);
|
161
|
+
static void on_newobj_event(DDTRACE_UNUSED VALUE tracepoint_data, DDTRACE_UNUSED void *unused);
|
162
|
+
static void disable_tracepoints(struct cpu_and_wall_time_worker_state *state);
|
156
163
|
|
157
164
|
// Note on sampler global state safety:
|
158
165
|
//
|
@@ -163,7 +170,14 @@ static void sleep_for(uint64_t time_ns);
|
|
163
170
|
// This global state is needed because a bunch of functions on this file need to access it from situations
|
164
171
|
// (e.g. signal handler) where it's impossible or just awkward to pass it as an argument.
|
165
172
|
static VALUE active_sampler_instance = Qnil;
|
166
|
-
struct cpu_and_wall_time_worker_state *active_sampler_instance_state = NULL;
|
173
|
+
static struct cpu_and_wall_time_worker_state *active_sampler_instance_state = NULL;
|
174
|
+
|
175
|
+
// Used to implement CpuAndWallTimeWorker._native_allocation_count . To be able to use cheap thread-local variables
|
176
|
+
// (here with `__thread`, see https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html), this needs to be global.
|
177
|
+
//
|
178
|
+
// Carryover of state between profiler instances can happen and is not considered to be a problem -- see expectations for this
|
179
|
+
// API documented in profiling.rb .
|
180
|
+
__thread uint64_t allocation_count = 0;
|
167
181
|
|
168
182
|
void collectors_cpu_and_wall_time_worker_init(VALUE profiling_module) {
|
169
183
|
rb_global_variable(&active_sampler_instance);
|
@@ -183,11 +197,12 @@ void collectors_cpu_and_wall_time_worker_init(VALUE profiling_module) {
|
|
183
197
|
// https://bugs.ruby-lang.org/issues/18007 for a discussion around this.
|
184
198
|
rb_define_alloc_func(collectors_cpu_and_wall_time_worker_class, _native_new);
|
185
199
|
|
186
|
-
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_initialize", _native_initialize,
|
200
|
+
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_initialize", _native_initialize, 5);
|
187
201
|
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_sampling_loop", _native_sampling_loop, 1);
|
188
202
|
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_stop", _native_stop, 2);
|
189
203
|
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_reset_after_fork", _native_reset_after_fork, 1);
|
190
204
|
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_stats", _native_stats, 1);
|
205
|
+
rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_allocation_count", _native_allocation_count, 0);
|
191
206
|
rb_define_singleton_method(testing_module, "_native_current_sigprof_signal_handler", _native_current_sigprof_signal_handler, 0);
|
192
207
|
rb_define_singleton_method(testing_module, "_native_is_running?", _native_is_running, 1);
|
193
208
|
rb_define_singleton_method(testing_module, "_native_install_testing_signal_handler", _native_install_testing_signal_handler, 0);
|
@@ -217,13 +232,15 @@ static VALUE _native_new(VALUE klass) {
|
|
217
232
|
|
218
233
|
atomic_init(&state->should_run, false);
|
219
234
|
state->gc_profiling_enabled = false;
|
220
|
-
state->
|
235
|
+
state->allocation_counting_enabled = false;
|
236
|
+
state->thread_context_collector_instance = Qnil;
|
221
237
|
state->idle_sampling_helper_instance = Qnil;
|
222
238
|
state->owner_thread = Qnil;
|
223
239
|
dynamic_sampling_rate_init(&state->dynamic_sampling_rate);
|
224
240
|
state->failure_exception = Qnil;
|
225
241
|
state->stop_thread = Qnil;
|
226
242
|
state->gc_tracepoint = Qnil;
|
243
|
+
state->object_allocation_tracepoint = Qnil;
|
227
244
|
reset_stats(state);
|
228
245
|
|
229
246
|
return state->self_instance = TypedData_Wrap_Struct(klass, &cpu_and_wall_time_worker_typed_data, state);
|
@@ -232,19 +249,23 @@ static VALUE _native_new(VALUE klass) {
|
|
232
249
|
static VALUE _native_initialize(
|
233
250
|
DDTRACE_UNUSED VALUE _self,
|
234
251
|
VALUE self_instance,
|
235
|
-
VALUE
|
252
|
+
VALUE thread_context_collector_instance,
|
236
253
|
VALUE gc_profiling_enabled,
|
237
|
-
VALUE idle_sampling_helper_instance
|
254
|
+
VALUE idle_sampling_helper_instance,
|
255
|
+
VALUE allocation_counting_enabled
|
238
256
|
) {
|
239
257
|
ENFORCE_BOOLEAN(gc_profiling_enabled);
|
258
|
+
ENFORCE_BOOLEAN(allocation_counting_enabled);
|
240
259
|
|
241
260
|
struct cpu_and_wall_time_worker_state *state;
|
242
261
|
TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state);
|
243
262
|
|
244
263
|
state->gc_profiling_enabled = (gc_profiling_enabled == Qtrue);
|
245
|
-
state->
|
264
|
+
state->allocation_counting_enabled = (allocation_counting_enabled == Qtrue);
|
265
|
+
state->thread_context_collector_instance = enforce_thread_context_collector_instance(thread_context_collector_instance);
|
246
266
|
state->idle_sampling_helper_instance = idle_sampling_helper_instance;
|
247
267
|
state->gc_tracepoint = rb_tracepoint_new(Qnil, RUBY_INTERNAL_EVENT_GC_ENTER | RUBY_INTERNAL_EVENT_GC_EXIT, on_gc_event, NULL /* unused */);
|
268
|
+
state->object_allocation_tracepoint = rb_tracepoint_new(Qnil, RUBY_INTERNAL_EVENT_NEWOBJ, on_newobj_event, NULL /* unused */);
|
248
269
|
|
249
270
|
return Qtrue;
|
250
271
|
}
|
@@ -253,12 +274,13 @@ static VALUE _native_initialize(
|
|
253
274
|
static void cpu_and_wall_time_worker_typed_data_mark(void *state_ptr) {
|
254
275
|
struct cpu_and_wall_time_worker_state *state = (struct cpu_and_wall_time_worker_state *) state_ptr;
|
255
276
|
|
256
|
-
rb_gc_mark(state->
|
277
|
+
rb_gc_mark(state->thread_context_collector_instance);
|
257
278
|
rb_gc_mark(state->idle_sampling_helper_instance);
|
258
279
|
rb_gc_mark(state->owner_thread);
|
259
280
|
rb_gc_mark(state->failure_exception);
|
260
281
|
rb_gc_mark(state->stop_thread);
|
261
282
|
rb_gc_mark(state->gc_tracepoint);
|
283
|
+
rb_gc_mark(state->object_allocation_tracepoint);
|
262
284
|
}
|
263
285
|
|
264
286
|
// Called in a background thread created in CpuAndWallTimeWorker#start
|
@@ -275,14 +297,13 @@ static VALUE _native_sampling_loop(DDTRACE_UNUSED VALUE _self, VALUE instance) {
|
|
275
297
|
);
|
276
298
|
} else {
|
277
299
|
// The previously active thread seems to have died without cleaning up after itself.
|
278
|
-
// In this case, we can still go ahead and start the profiler BUT we make sure to disable any existing
|
300
|
+
// In this case, we can still go ahead and start the profiler BUT we make sure to disable any existing tracepoint
|
279
301
|
// first as:
|
280
302
|
// a) If this is a new instance of the CpuAndWallTimeWorker, we don't want the tracepoint from the old instance
|
281
303
|
// being kept around
|
282
304
|
// b) If this is the same instance of the CpuAndWallTimeWorker if we call enable on a tracepoint that is already
|
283
305
|
// enabled, it will start firing more than once, see https://bugs.ruby-lang.org/issues/19114 for details.
|
284
|
-
|
285
|
-
rb_tracepoint_disable(old_state->gc_tracepoint);
|
306
|
+
disable_tracepoints(old_state);
|
286
307
|
}
|
287
308
|
}
|
288
309
|
|
@@ -308,7 +329,7 @@ static VALUE _native_sampling_loop(DDTRACE_UNUSED VALUE _self, VALUE instance) {
|
|
308
329
|
|
309
330
|
// The sample trigger loop finished (either cleanly or with an error); let's clean up
|
310
331
|
|
311
|
-
|
332
|
+
disable_tracepoints(state);
|
312
333
|
|
313
334
|
active_sampler_instance_state = NULL;
|
314
335
|
active_sampler_instance = Qnil;
|
@@ -360,8 +381,8 @@ static VALUE stop(VALUE self_instance, VALUE optional_exception) {
|
|
360
381
|
atomic_store(&state->should_run, false);
|
361
382
|
state->failure_exception = optional_exception;
|
362
383
|
|
363
|
-
// Disable the
|
364
|
-
|
384
|
+
// Disable the tracepoints as soon as possible, so the VM doesn't keep on calling them
|
385
|
+
disable_tracepoints(state);
|
365
386
|
|
366
387
|
return Qtrue;
|
367
388
|
}
|
@@ -481,7 +502,8 @@ static VALUE rescued_sample_from_postponed_job(VALUE self_instance) {
|
|
481
502
|
|
482
503
|
state->stats.sampled++;
|
483
504
|
|
484
|
-
|
505
|
+
VALUE profiler_overhead_stack_thread = state->owner_thread; // Used to attribute profiler overhead to a different stack
|
506
|
+
thread_context_collector_sample(state->thread_context_collector_instance, wall_time_ns_before_sample, profiler_overhead_stack_thread);
|
485
507
|
|
486
508
|
long wall_time_ns_after_sample = monotonic_wall_time_now_ns(RAISE_ON_FAILURE);
|
487
509
|
long delta_ns = wall_time_ns_after_sample - wall_time_ns_before_sample;
|
@@ -527,10 +549,11 @@ static VALUE release_gvl_and_run_sampling_trigger_loop(VALUE instance) {
|
|
527
549
|
struct cpu_and_wall_time_worker_state *state;
|
528
550
|
TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state);
|
529
551
|
|
530
|
-
// Final preparations: Setup signal handler and enable
|
552
|
+
// Final preparations: Setup signal handler and enable tracepoints. We run these here and not in `_native_sampling_loop`
|
531
553
|
// because they may raise exceptions.
|
532
554
|
install_sigprof_signal_handler(handle_sampling_signal, "handle_sampling_signal");
|
533
555
|
if (state->gc_profiling_enabled) rb_tracepoint_enable(state->gc_tracepoint);
|
556
|
+
if (state->allocation_counting_enabled) rb_tracepoint_enable(state->object_allocation_tracepoint);
|
534
557
|
|
535
558
|
rb_thread_call_without_gvl(run_sampling_trigger_loop, state, interrupt_sampling_trigger_loop, state);
|
536
559
|
|
@@ -586,9 +609,9 @@ static VALUE _native_gc_tracepoint(DDTRACE_UNUSED VALUE self, VALUE instance) {
|
|
586
609
|
// when the RUBY_INTERNAL_EVENT_GC_ENTER and RUBY_INTERNAL_EVENT_GC_EXIT events are triggered.
|
587
610
|
//
|
588
611
|
// See the comments on
|
589
|
-
// *
|
590
|
-
// *
|
591
|
-
// *
|
612
|
+
// * thread_context_collector_on_gc_start
|
613
|
+
// * thread_context_collector_on_gc_finish
|
614
|
+
// * thread_context_collector_sample_after_gc
|
592
615
|
//
|
593
616
|
// For the expected times in which to call them, and their assumptions.
|
594
617
|
//
|
@@ -610,11 +633,11 @@ static void on_gc_event(VALUE tracepoint_data, DDTRACE_UNUSED void *unused) {
|
|
610
633
|
if (state == NULL) return;
|
611
634
|
|
612
635
|
if (event == RUBY_INTERNAL_EVENT_GC_ENTER) {
|
613
|
-
|
636
|
+
thread_context_collector_on_gc_start(state->thread_context_collector_instance);
|
614
637
|
} else if (event == RUBY_INTERNAL_EVENT_GC_EXIT) {
|
615
638
|
// Design: In an earlier iteration of this feature (see https://github.com/DataDog/dd-trace-rb/pull/2308) we
|
616
|
-
// actually had a single method to implement the behavior of both
|
617
|
-
// and
|
639
|
+
// actually had a single method to implement the behavior of both thread_context_collector_on_gc_finish
|
640
|
+
// and thread_context_collector_sample_after_gc (the latter is called via after_gc_from_postponed_job).
|
618
641
|
//
|
619
642
|
// Unfortunately, then we discovered the safety issue around no allocations, and thus decided to separate them -- so that
|
620
643
|
// the sampling could run outside the tight safety constraints of the garbage collection process.
|
@@ -624,11 +647,11 @@ static void on_gc_event(VALUE tracepoint_data, DDTRACE_UNUSED void *unused) {
|
|
624
647
|
// it should be pointing at.
|
625
648
|
// Alternatives to solve this would be to capture no stack for garbage collection (as we do for Java and .net);
|
626
649
|
// making the sampling process allocation-safe (very hard); or separate stack sampling from sample recording,
|
627
|
-
// e.g. enabling us to capture the stack in
|
650
|
+
// e.g. enabling us to capture the stack in thread_context_collector_on_gc_finish and do the rest later
|
628
651
|
// (medium hard).
|
629
652
|
|
630
|
-
|
631
|
-
// We use rb_postponed_job_register_one to ask Ruby to run
|
653
|
+
thread_context_collector_on_gc_finish(state->thread_context_collector_instance);
|
654
|
+
// We use rb_postponed_job_register_one to ask Ruby to run thread_context_collector_sample_after_gc after if
|
632
655
|
// fully finishes the garbage collection, so that one is allowed to do allocations and throw exceptions as usual.
|
633
656
|
//
|
634
657
|
// Note: If we ever want to get rid of rb_postponed_job_register_one, remember not to clobber Ruby exceptions, as
|
@@ -649,8 +672,8 @@ static void after_gc_from_postponed_job(DDTRACE_UNUSED void *_unused) {
|
|
649
672
|
return; // We're not on the main Ractor; we currently don't support profiling non-main Ractors
|
650
673
|
}
|
651
674
|
|
652
|
-
// Trigger sampling using the Collectors::
|
653
|
-
safely_call(
|
675
|
+
// Trigger sampling using the Collectors::ThreadState; rescue against any exceptions that happen during sampling
|
676
|
+
safely_call(thread_context_collector_sample_after_gc, state->thread_context_collector_instance, state->self_instance);
|
654
677
|
}
|
655
678
|
|
656
679
|
// Equivalent to Ruby begin/rescue call, where we call a C function and jump to the exception handler if an
|
@@ -694,12 +717,12 @@ static VALUE _native_reset_after_fork(DDTRACE_UNUSED VALUE self, VALUE instance)
|
|
694
717
|
TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state);
|
695
718
|
|
696
719
|
// Disable all tracepoints, so that there are no more attempts to mutate the profile
|
697
|
-
|
720
|
+
disable_tracepoints(state);
|
698
721
|
|
699
722
|
reset_stats(state);
|
700
723
|
|
701
|
-
// Remove all state from the `Collectors::
|
702
|
-
rb_funcall(state->
|
724
|
+
// Remove all state from the `Collectors::ThreadState` and connected downstream components
|
725
|
+
rb_funcall(state->thread_context_collector_instance, rb_intern("reset_after_fork"), 0);
|
703
726
|
|
704
727
|
return Qtrue;
|
705
728
|
}
|
@@ -774,3 +797,25 @@ static void sleep_for(uint64_t time_ns) {
|
|
774
797
|
}
|
775
798
|
}
|
776
799
|
}
|
800
|
+
|
801
|
+
static VALUE _native_allocation_count(DDTRACE_UNUSED VALUE self) {
|
802
|
+
bool is_profiler_running = active_sampler_instance_state != NULL;
|
803
|
+
|
804
|
+
return is_profiler_running ? ULL2NUM(allocation_count) : Qnil;
|
805
|
+
}
|
806
|
+
|
807
|
+
// Implements memory-related profiling events. This function is called by Ruby via the `object_allocation_tracepoint`
|
808
|
+
// when the RUBY_INTERNAL_EVENT_NEWOBJ event is triggered.
|
809
|
+
static void on_newobj_event(DDTRACE_UNUSED VALUE tracepoint_data, DDTRACE_UNUSED void *unused) {
|
810
|
+
// Update thread-local allocation count
|
811
|
+
if (RB_UNLIKELY(allocation_count == UINT64_MAX)) {
|
812
|
+
allocation_count = 0;
|
813
|
+
} else {
|
814
|
+
allocation_count++;
|
815
|
+
}
|
816
|
+
}
|
817
|
+
|
818
|
+
static void disable_tracepoints(struct cpu_and_wall_time_worker_state *state) {
|
819
|
+
rb_tracepoint_disable(state->gc_tracepoint);
|
820
|
+
rb_tracepoint_disable(state->object_allocation_tracepoint);
|
821
|
+
}
|
@@ -170,15 +170,15 @@ static void interrupt_idle_sampling_loop(void *state_ptr) {
|
|
170
170
|
// ask the thread to stop, instead of exiting early.
|
171
171
|
|
172
172
|
error = pthread_mutex_lock(&state->wakeup_mutex);
|
173
|
-
if (error) { fprintf(stderr, "[
|
173
|
+
if (error) { fprintf(stderr, "[ddtrace] Error during pthread_mutex_lock in interrupt_idle_sampling_loop (%s)\n", strerror(error)); }
|
174
174
|
|
175
175
|
state->requested_action = ACTION_STOP;
|
176
176
|
|
177
177
|
error = pthread_mutex_unlock(&state->wakeup_mutex);
|
178
|
-
if (error) { fprintf(stderr, "[
|
178
|
+
if (error) { fprintf(stderr, "[ddtrace] Error during pthread_mutex_unlock in interrupt_idle_sampling_loop (%s)\n", strerror(error)); }
|
179
179
|
|
180
180
|
error = pthread_cond_broadcast(&state->wakeup);
|
181
|
-
if (error) { fprintf(stderr, "[
|
181
|
+
if (error) { fprintf(stderr, "[ddtrace] Error during pthread_cond_broadcast in interrupt_idle_sampling_loop (%s)\n", strerror(error)); }
|
182
182
|
}
|
183
183
|
|
184
184
|
static VALUE _native_stop(DDTRACE_UNUSED VALUE self, VALUE self_instance) {
|