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
@@ -0,0 +1,14 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <ruby.h>
|
4
|
+
|
5
|
+
void thread_context_collector_sample(
|
6
|
+
VALUE self_instance,
|
7
|
+
long current_monotonic_wall_time_ns,
|
8
|
+
VALUE profiler_overhead_stack_thread
|
9
|
+
);
|
10
|
+
void thread_context_collector_sample_allocation(VALUE self_instance, unsigned int sample_weight);
|
11
|
+
VALUE thread_context_collector_sample_after_gc(VALUE self_instance);
|
12
|
+
void thread_context_collector_on_gc_start(VALUE self_instance);
|
13
|
+
void thread_context_collector_on_gc_finish(VALUE self_instance);
|
14
|
+
VALUE enforce_thread_context_collector_instance(VALUE object);
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# typed: ignore
|
2
|
-
|
3
1
|
# rubocop:disable Style/StderrPuts
|
4
2
|
# rubocop:disable Style/GlobalVars
|
5
3
|
|
@@ -28,7 +26,7 @@ def skip_building_extension!(reason)
|
|
28
26
|
if fail_install_if_missing_extension
|
29
27
|
require 'mkmf'
|
30
28
|
Logging.message(
|
31
|
-
'
|
29
|
+
'[ddtrace] Failure cause: ' \
|
32
30
|
"#{Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason)}\n"
|
33
31
|
)
|
34
32
|
else
|
@@ -67,9 +65,9 @@ $stderr.puts(
|
|
67
65
|
# that may fail on an environment not properly setup for building Ruby extensions.
|
68
66
|
require 'mkmf'
|
69
67
|
|
70
|
-
Logging.message("
|
68
|
+
Logging.message("[ddtrace] Using compiler:\n")
|
71
69
|
xsystem("#{CONFIG['CC']} -v")
|
72
|
-
Logging.message("
|
70
|
+
Logging.message("[ddtrace] End of compiler information\n")
|
73
71
|
|
74
72
|
# mkmf on modern Rubies actually has an append_cflags that does something similar
|
75
73
|
# (see https://github.com/ruby/ruby/pull/5760), but as usual we need a bit more boilerplate to deal with legacy Rubies
|
@@ -125,7 +123,7 @@ if RUBY_PLATFORM.include?('linux')
|
|
125
123
|
# have_library 'pthread'
|
126
124
|
# have_func 'pthread_getcpuclockid'
|
127
125
|
# ```
|
128
|
-
# but it broke the build on Windows
|
126
|
+
# but a) it broke the build on Windows, b) on older Ruby versions (2.2 and below) and c) It's slower to build
|
129
127
|
# so instead we just assume that we have the function we need on Linux, and nowhere else
|
130
128
|
$defs << '-DHAVE_PTHREAD_GETCPUCLOCKID'
|
131
129
|
end
|
@@ -162,19 +160,10 @@ if RUBY_VERSION < '2.4'
|
|
162
160
|
$defs << '-DUSE_LEGACY_RB_VM_FRAME_METHOD_ENTRY'
|
163
161
|
end
|
164
162
|
|
165
|
-
# For REALLY OLD Rubies...
|
166
|
-
if RUBY_VERSION < '2.3'
|
167
|
-
# ...there was no rb_time_timespec_new function
|
168
|
-
$defs << '-DNO_RB_TIME_TIMESPEC_NEW'
|
169
|
-
# ...the VM changed enough that we need an alternative legacy rb_profile_frames
|
170
|
-
$defs << '-DUSE_LEGACY_RB_PROFILE_FRAMES'
|
171
|
-
# ... you couldn't name threads
|
172
|
-
$defs << '-DNO_THREAD_NAMES'
|
173
|
-
end
|
174
|
-
|
175
163
|
# If we got here, libdatadog is available and loaded
|
176
164
|
ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libdatadog.pkgconfig_folder}"
|
177
|
-
Logging.message("
|
165
|
+
Logging.message("[ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n")
|
166
|
+
$stderr.puts("Using libdatadog #{Libdatadog::VERSION} from #{Libdatadog.pkgconfig_folder}")
|
178
167
|
|
179
168
|
unless pkg_config('datadog_profiling_with_rpath')
|
180
169
|
skip_building_extension!(
|
@@ -197,7 +186,7 @@ end
|
|
197
186
|
$LDFLAGS += \
|
198
187
|
' -Wl,-rpath,$$$\\\\{ORIGIN\\}/' \
|
199
188
|
"#{Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_native_lib_folder}"
|
200
|
-
Logging.message("
|
189
|
+
Logging.message("[ddtrace] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n")
|
201
190
|
|
202
191
|
# Tag the native extension library with the Ruby version and Ruby platform.
|
203
192
|
# This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that
|
@@ -21,7 +21,7 @@ static VALUE library_version_string = Qnil;
|
|
21
21
|
|
22
22
|
struct call_exporter_without_gvl_arguments {
|
23
23
|
ddog_prof_Exporter *exporter;
|
24
|
-
|
24
|
+
ddog_prof_Exporter_Request_BuildResult *build_result;
|
25
25
|
ddog_CancellationToken *cancel_token;
|
26
26
|
ddog_prof_Exporter_SendResult result;
|
27
27
|
bool send_ran;
|
@@ -83,7 +83,7 @@ static VALUE _native_validate_exporter(DDTRACE_UNUSED VALUE _self, VALUE exporte
|
|
83
83
|
|
84
84
|
// We don't actually need the exporter for now -- we just wanted to validate that we could create it with the
|
85
85
|
// settings we were given
|
86
|
-
|
86
|
+
ddog_prof_Exporter_drop(exporter_result.ok);
|
87
87
|
|
88
88
|
return rb_ary_new_from_args(2, ok_symbol, Qnil);
|
89
89
|
}
|
@@ -111,13 +111,9 @@ static ddog_prof_Exporter_NewResult create_exporter(VALUE exporter_configuration
|
|
111
111
|
}
|
112
112
|
|
113
113
|
static VALUE handle_exporter_failure(ddog_prof_Exporter_NewResult exporter_result) {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
ddog_prof_Exporter_NewResult_drop(exporter_result);
|
119
|
-
|
120
|
-
return rb_ary_new_from_args(2, error_symbol, err_details);
|
114
|
+
return exporter_result.tag == DDOG_PROF_EXPORTER_NEW_RESULT_OK ?
|
115
|
+
Qnil :
|
116
|
+
rb_ary_new_from_args(2, error_symbol, get_error_details_and_drop(&exporter_result.err));
|
121
117
|
}
|
122
118
|
|
123
119
|
static ddog_Endpoint endpoint_from(VALUE exporter_configuration) {
|
@@ -173,14 +169,9 @@ static ddog_Vec_Tag convert_tags(VALUE tags_as_array) {
|
|
173
169
|
ddog_Vec_Tag_push(&tags, char_slice_from_ruby_string(tag_name), char_slice_from_ruby_string(tag_value));
|
174
170
|
|
175
171
|
if (push_result.tag == DDOG_VEC_TAG_PUSH_RESULT_ERR) {
|
176
|
-
VALUE err_details = ruby_string_from_vec_u8(push_result.err);
|
177
|
-
ddog_Vec_Tag_PushResult_drop(push_result);
|
178
|
-
|
179
172
|
// libdatadog validates tags and may catch invalid tags that ddtrace didn't actually catch.
|
180
173
|
// We warn users about such tags, and then just ignore them.
|
181
|
-
safely_log_failure_to_process_tag(tags,
|
182
|
-
} else {
|
183
|
-
ddog_Vec_Tag_PushResult_drop(push_result);
|
174
|
+
safely_log_failure_to_process_tag(tags, get_error_details_and_drop(&push_result.err));
|
184
175
|
}
|
185
176
|
}
|
186
177
|
|
@@ -206,23 +197,28 @@ static void safely_log_failure_to_process_tag(ddog_Vec_Tag tags, VALUE err_detai
|
|
206
197
|
// Note: This function handles a bunch of libdatadog dynamically-allocated objects, so it MUST not use any Ruby APIs
|
207
198
|
// which can raise exceptions, otherwise the objects will be leaked.
|
208
199
|
static VALUE perform_export(
|
209
|
-
|
200
|
+
ddog_prof_Exporter *exporter,
|
210
201
|
ddog_Timespec start,
|
211
202
|
ddog_Timespec finish,
|
212
203
|
ddog_prof_Exporter_Slice_File slice_files,
|
213
204
|
ddog_Vec_Tag *additional_tags,
|
214
205
|
uint64_t timeout_milliseconds
|
215
206
|
) {
|
216
|
-
ddog_prof_Exporter *exporter = valid_exporter_result.ok;
|
217
|
-
ddog_CancellationToken *cancel_token = ddog_CancellationToken_new();
|
218
207
|
ddog_prof_ProfiledEndpointsStats *endpoints_stats = NULL; // Not in use yet
|
219
|
-
|
208
|
+
ddog_prof_Exporter_Request_BuildResult build_result =
|
220
209
|
ddog_prof_Exporter_Request_build(exporter, start, finish, slice_files, additional_tags, endpoints_stats, timeout_milliseconds);
|
221
210
|
|
211
|
+
if (build_result.tag == DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR) {
|
212
|
+
ddog_prof_Exporter_drop(exporter);
|
213
|
+
return rb_ary_new_from_args(2, error_symbol, get_error_details_and_drop(&build_result.err));
|
214
|
+
}
|
215
|
+
|
216
|
+
ddog_CancellationToken *cancel_token = ddog_CancellationToken_new();
|
217
|
+
|
222
218
|
// We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this
|
223
219
|
// is pending
|
224
220
|
struct call_exporter_without_gvl_arguments args =
|
225
|
-
{.exporter = exporter, .
|
221
|
+
{.exporter = exporter, .build_result = &build_result, .cancel_token = cancel_token, .send_ran = false};
|
226
222
|
|
227
223
|
// We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the gvl2 variant never raises any
|
228
224
|
// exceptions.
|
@@ -247,26 +243,23 @@ static VALUE perform_export(
|
|
247
243
|
|
248
244
|
// Cleanup exporter and token, no longer needed
|
249
245
|
ddog_CancellationToken_drop(cancel_token);
|
250
|
-
|
246
|
+
ddog_prof_Exporter_drop(exporter);
|
251
247
|
|
252
248
|
if (pending_exception) {
|
253
249
|
// If we got here send did not run, so we need to explicitly dispose of the request
|
254
|
-
ddog_prof_Exporter_Request_drop(
|
250
|
+
ddog_prof_Exporter_Request_drop(&build_result.ok);
|
255
251
|
|
256
252
|
// Let Ruby propagate the exception. This will not return.
|
257
253
|
rb_jump_tag(pending_exception);
|
258
254
|
}
|
259
255
|
|
260
|
-
|
261
|
-
bool success = result.tag == DDOG_PROF_EXPORTER_SEND_RESULT_HTTP_RESPONSE;
|
262
|
-
|
263
|
-
VALUE ruby_status = success ? ok_symbol : error_symbol;
|
264
|
-
VALUE ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_prof_vec_u8(result.err);
|
256
|
+
// The request itself does not need to be freed as libdatadog takes ownership of it as part of sending.
|
265
257
|
|
266
|
-
|
267
|
-
// The request itself does not need to be freed as libdatadog takes care of it as part of sending.
|
258
|
+
ddog_prof_Exporter_SendResult result = args.result;
|
268
259
|
|
269
|
-
return
|
260
|
+
return result.tag == DDOG_PROF_EXPORTER_SEND_RESULT_HTTP_RESPONSE ?
|
261
|
+
rb_ary_new_from_args(2, ok_symbol, UINT2NUM(result.http_response.code)) :
|
262
|
+
rb_ary_new_from_args(2, error_symbol, get_error_details_and_drop(&result.err));
|
270
263
|
}
|
271
264
|
|
272
265
|
static VALUE _native_do_export(
|
@@ -326,13 +319,13 @@ static VALUE _native_do_export(
|
|
326
319
|
VALUE failure_tuple = handle_exporter_failure(exporter_result);
|
327
320
|
if (!NIL_P(failure_tuple)) return failure_tuple;
|
328
321
|
|
329
|
-
return perform_export(exporter_result, start, finish, slice_files, null_additional_tags, timeout_milliseconds);
|
322
|
+
return perform_export(exporter_result.ok, start, finish, slice_files, null_additional_tags, timeout_milliseconds);
|
330
323
|
}
|
331
324
|
|
332
325
|
static void *call_exporter_without_gvl(void *call_args) {
|
333
326
|
struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) call_args;
|
334
327
|
|
335
|
-
args->result = ddog_prof_Exporter_send(args->exporter, args->
|
328
|
+
args->result = ddog_prof_Exporter_send(args->exporter, &args->build_result->ok, args->cancel_token);
|
336
329
|
args->send_ran = true;
|
337
330
|
|
338
331
|
return NULL; // Unused
|
@@ -13,6 +13,13 @@ inline static VALUE ruby_string_from_vec_u8(ddog_Vec_U8 string) {
|
|
13
13
|
return rb_str_new((char *) string.ptr, string.len);
|
14
14
|
}
|
15
15
|
|
16
|
-
inline static VALUE
|
17
|
-
|
16
|
+
inline static VALUE ruby_string_from_error(const ddog_Error *error) {
|
17
|
+
ddog_CharSlice char_slice = ddog_Error_message(error);
|
18
|
+
return rb_str_new(char_slice.ptr, char_slice.len);
|
19
|
+
}
|
20
|
+
|
21
|
+
inline static VALUE get_error_details_and_drop(ddog_Error *error) {
|
22
|
+
VALUE result = ruby_string_from_error(error);
|
23
|
+
ddog_Error_drop(error);
|
24
|
+
return result;
|
18
25
|
}
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# typed: ignore
|
4
|
-
|
5
3
|
require 'rubygems'
|
6
4
|
require 'pathname'
|
7
5
|
|
@@ -17,7 +15,7 @@ module Datadog
|
|
17
15
|
# Older Rubies don't have the MJIT header, used by the JIT compiler, so we need to use a different approach
|
18
16
|
CAN_USE_MJIT_HEADER = RUBY_VERSION >= '2.6'
|
19
17
|
|
20
|
-
LIBDATADOG_VERSION = '~>
|
18
|
+
LIBDATADOG_VERSION = '~> 2.0.0.1.0'
|
21
19
|
|
22
20
|
def self.fail_install_if_missing_extension?
|
23
21
|
ENV[ENV_FAIL_INSTALL_IF_MISSING_EXTENSION].to_s.strip.downcase == 'true'
|
@@ -87,8 +85,8 @@ module Datadog
|
|
87
85
|
on_windows? ||
|
88
86
|
on_macos? ||
|
89
87
|
on_unknown_os? ||
|
90
|
-
|
91
|
-
|
88
|
+
on_unsupported_cpu_arch? ||
|
89
|
+
on_unsupported_ruby_version? ||
|
92
90
|
expected_to_use_mjit_but_mjit_is_disabled? ||
|
93
91
|
libdatadog_not_available? ||
|
94
92
|
libdatadog_not_usable?
|
@@ -174,6 +172,8 @@ module Datadog
|
|
174
172
|
'the `pkg-config` package on Homebrew and Debian/Ubuntu-based Linux;',
|
175
173
|
'the `pkgconf` package on Arch and Alpine-based Linux;',
|
176
174
|
'the `pkgconf-pkg-config` package on Fedora/Red Hat-based Linux.',
|
175
|
+
'(Tip: When fixing this, ensure `pkg-config` is installed **before**',
|
176
|
+
'running `bundle install`, and remember to clear any installed gems cache).',
|
177
177
|
suggested: CONTACT_SUPPORT,
|
178
178
|
)
|
179
179
|
|
@@ -251,7 +251,7 @@ module Datadog
|
|
251
251
|
unknown_os_not_supported unless RUBY_PLATFORM.include?('darwin') || RUBY_PLATFORM.include?('linux')
|
252
252
|
end
|
253
253
|
|
254
|
-
private_class_method def self.
|
254
|
+
private_class_method def self.on_unsupported_cpu_arch?
|
255
255
|
architecture_not_supported = explain_issue(
|
256
256
|
'your CPU architecture is not supported by the Datadog Continuous Profiler.',
|
257
257
|
suggested: GET_IN_TOUCH,
|
@@ -260,13 +260,13 @@ module Datadog
|
|
260
260
|
architecture_not_supported unless RUBY_PLATFORM.start_with?('x86_64', 'aarch64', 'arm64')
|
261
261
|
end
|
262
262
|
|
263
|
-
private_class_method def self.
|
263
|
+
private_class_method def self.on_unsupported_ruby_version?
|
264
264
|
ruby_version_not_supported = explain_issue(
|
265
|
-
'the profiler only supports Ruby 2.
|
265
|
+
'the profiler only supports Ruby 2.3 or newer.',
|
266
266
|
suggested: UPGRADE_RUBY,
|
267
267
|
)
|
268
268
|
|
269
|
-
ruby_version_not_supported if RUBY_VERSION.start_with?('2.1.')
|
269
|
+
ruby_version_not_supported if RUBY_VERSION.start_with?('2.1.', '2.2.')
|
270
270
|
end
|
271
271
|
|
272
272
|
# On some Rubies, we require the mjit header to be present. If Ruby was installed without MJIT support, we also skip
|
@@ -204,8 +204,7 @@ ptrdiff_t stack_depth_for(VALUE thread) {
|
|
204
204
|
#endif
|
205
205
|
|
206
206
|
// Tries to match rb_thread_list() but that method isn't accessible to extensions
|
207
|
-
|
208
|
-
VALUE result = rb_ary_new();
|
207
|
+
void ddtrace_thread_list(VALUE result_array) {
|
209
208
|
rb_thread_t *thread = NULL;
|
210
209
|
|
211
210
|
// Ruby 3 Safety: Our implementation is inspired by `rb_ractor_thread_list` BUT that method wraps the operations below
|
@@ -234,32 +233,20 @@ VALUE ddtrace_thread_list(void) {
|
|
234
233
|
case THREAD_RUNNABLE:
|
235
234
|
case THREAD_STOPPED:
|
236
235
|
case THREAD_STOPPED_FOREVER:
|
237
|
-
rb_ary_push(
|
236
|
+
rb_ary_push(result_array, thread->self);
|
238
237
|
default:
|
239
238
|
break;
|
240
239
|
}
|
241
240
|
}
|
242
|
-
|
243
|
-
return result;
|
244
241
|
}
|
245
242
|
|
246
243
|
bool is_thread_alive(VALUE thread) {
|
247
244
|
return thread_struct_from_object(thread)->status != THREAD_KILLED;
|
248
245
|
}
|
249
246
|
|
250
|
-
// `thread` gets used on all Rubies except 2.2
|
251
|
-
// To avoid getting false "unused argument" warnings in setups where it's not used, we need to do this weird dance
|
252
|
-
// with diagnostic stuff. See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details.
|
253
|
-
#pragma GCC diagnostic push
|
254
|
-
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
255
247
|
VALUE thread_name_for(VALUE thread) {
|
256
|
-
|
257
|
-
return Qnil;
|
258
|
-
#else
|
259
|
-
return thread_struct_from_object(thread)->name;
|
260
|
-
#endif
|
248
|
+
return thread_struct_from_object(thread)->name;
|
261
249
|
}
|
262
|
-
#pragma GCC diagnostic pop
|
263
250
|
|
264
251
|
// -----------------------------------------------------------------------------
|
265
252
|
// The sources below are modified versions of code extracted from the Ruby project.
|
@@ -290,8 +277,6 @@ VALUE thread_name_for(VALUE thread) {
|
|
290
277
|
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
291
278
|
// SUCH DAMAGE.
|
292
279
|
|
293
|
-
#ifndef USE_LEGACY_RB_PROFILE_FRAMES // Modern Rubies
|
294
|
-
|
295
280
|
// Taken from upstream vm_core.h at commit 5f10bd634fb6ae8f74a4ea730176233b0ca96954 (March 2022, Ruby 3.2 trunk)
|
296
281
|
// Copyright (C) 2004-2007 Koichi Sasada
|
297
282
|
// to support our custom rb_profile_frames (see below)
|
@@ -392,9 +377,6 @@ calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
|
|
392
377
|
// was called from.
|
393
378
|
// * Imported fix from https://github.com/ruby/ruby/pull/7116 to avoid sampling threads that are still being created
|
394
379
|
//
|
395
|
-
// **IMPORTANT: WHEN CHANGING THIS FUNCTION, CONSIDER IF THE SAME CHANGE ALSO NEEDS TO BE MADE TO THE VARIANT FOR
|
396
|
-
// RUBY 2.2 AND BELOW WHICH IS ALSO PRESENT ON THIS FILE**
|
397
|
-
//
|
398
380
|
// What is rb_profile_frames?
|
399
381
|
// `rb_profile_frames` is a Ruby VM debug API added for use by profilers for sampling the stack trace of a Ruby thread.
|
400
382
|
// Its main other user is the stackprof profiler: https://github.com/tmm1/stackprof .
|
@@ -437,10 +419,6 @@ int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, i
|
|
437
419
|
const rb_control_frame_t *cfp = ec->cfp, *end_cfp = RUBY_VM_END_CONTROL_FRAME(ec);
|
438
420
|
const rb_callable_method_entry_t *cme;
|
439
421
|
|
440
|
-
// This should not happen for ddtrace (it can only happen when a thread is still being created), but I've imported
|
441
|
-
// it from https://github.com/ruby/ruby/pull/7116 in a "just in case" kind of mindset.
|
442
|
-
if (cfp == NULL) return 0;
|
443
|
-
|
444
422
|
// Avoid sampling dead threads
|
445
423
|
if (th->status == THREAD_KILLED) return 0;
|
446
424
|
|
@@ -448,6 +426,10 @@ int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, i
|
|
448
426
|
// also (not entirely sure) happen on dead threads
|
449
427
|
if (end_cfp == NULL) return PLACEHOLDER_STACK_IN_NATIVE_CODE;
|
450
428
|
|
429
|
+
// This should not happen for ddtrace (it can only happen when a thread is still being created), but I've imported
|
430
|
+
// it from https://github.com/ruby/ruby/pull/7116 in a "just in case" kind of mindset.
|
431
|
+
if (cfp == NULL) return 0;
|
432
|
+
|
451
433
|
// Fix: Skip dummy frame that shows up in main thread.
|
452
434
|
//
|
453
435
|
// According to a comment in `backtrace_each` (`vm_backtrace.c`), there's two dummy frames that we should ignore
|
@@ -722,104 +704,8 @@ check_method_entry(VALUE obj, int can_be_svar)
|
|
722
704
|
return check_method_entry(ep[-1], TRUE);
|
723
705
|
}
|
724
706
|
#endif // USE_LEGACY_RB_VM_FRAME_METHOD_ENTRY
|
725
|
-
|
726
707
|
#endif // RUBY_MJIT_HEADER
|
727
708
|
|
728
|
-
#else // USE_LEGACY_RB_PROFILE_FRAMES, Ruby < 2.3
|
729
|
-
|
730
|
-
// Taken from upstream vm_backtrace.c at commit bbda1a027475bf7ce5e1a9583a7b55d0be71c8fe (March 2018, ruby_2_2 branch)
|
731
|
-
// Copyright (C) 1993-2012 Yukihiro Matsumoto
|
732
|
-
// to support our custom rb_profile_frames (see below)
|
733
|
-
// Modifications: None
|
734
|
-
inline static int
|
735
|
-
calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
|
736
|
-
{
|
737
|
-
return rb_iseq_line_no(iseq, pc - iseq->iseq_encoded);
|
738
|
-
}
|
739
|
-
|
740
|
-
// Taken from upstream vm_backtrace.c at commit bbda1a027475bf7ce5e1a9583a7b55d0be71c8fe (March 2018, ruby_2_2 branch)
|
741
|
-
// Copyright (C) 1993-2012 Yukihiro Matsumoto
|
742
|
-
// Modifications:
|
743
|
-
// * Renamed rb_profile_frames => ddtrace_rb_profile_frames
|
744
|
-
// * Add thread argument
|
745
|
-
// * Add is_ruby_frame argument
|
746
|
-
// * Removed `if (lines)` tests -- require/assume that like `buff`, `lines` is always specified
|
747
|
-
// * Added support for getting the name from native methods by getting inspiration from `backtrace_each` in
|
748
|
-
// `vm_backtrace.c`. Note that unlike the `rb_profile_frames` for modern Rubies, this version actually returns the
|
749
|
-
// method name as as `VALUE` containing a Ruby string in the `buff`.
|
750
|
-
// * Skip dummy frame that shows up in main thread
|
751
|
-
// * Add `end_cfp == NULL` and `end_cfp <= cfp` safety checks. These are used in a bunch of places in
|
752
|
-
// `vm_backtrace.c` (`backtrace_each`, `backtrace_size`, `rb_ec_partial_backtrace_object`) but are conspicuously
|
753
|
-
// absent from `rb_profile_frames`. Oversight?
|
754
|
-
// * Check thread status and do not sample if thread has been killed.
|
755
|
-
// * Imported fix from https://github.com/ruby/ruby/pull/7116 to avoid sampling threads that are still being created
|
756
|
-
//
|
757
|
-
// The `rb_profile_frames` function changed quite a bit between Ruby 2.2 and 2.3. Since the change was quite complex
|
758
|
-
// I opted not to try to extend support to Ruby 2.2 using the same custom function, and instead I started
|
759
|
-
// anew from the Ruby 2.2 version of the function, applying some of the same fixes that we have for the modern version.
|
760
|
-
int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame)
|
761
|
-
{
|
762
|
-
// **IMPORTANT: THIS IS A CUSTOM RB_PROFILE_FRAMES JUST FOR RUBY 2.2;
|
763
|
-
// SEE ABOVE FOR THE FUNCTION THAT GETS USED FOR MODERN RUBIES**
|
764
|
-
|
765
|
-
int i;
|
766
|
-
rb_thread_t *th = thread_struct_from_object(thread);
|
767
|
-
rb_control_frame_t *cfp = th->cfp, *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
|
768
|
-
|
769
|
-
// This should not happen for ddtrace (it can only happen when a thread is still being created), but I've imported
|
770
|
-
// it from https://github.com/ruby/ruby/pull/7116 in a "just in case" kind of mindset.
|
771
|
-
if (cfp == NULL) return 0;
|
772
|
-
|
773
|
-
// Avoid sampling dead threads
|
774
|
-
if (th->status == THREAD_KILLED) return 0;
|
775
|
-
|
776
|
-
// `vm_backtrace.c` includes this check in several methods. This happens on newly-created threads, and may
|
777
|
-
// also (not entirely sure) happen on dead threads
|
778
|
-
if (end_cfp == NULL) return PLACEHOLDER_STACK_IN_NATIVE_CODE;
|
779
|
-
|
780
|
-
// Fix: Skip dummy frame that shows up in main thread.
|
781
|
-
//
|
782
|
-
// According to a comment in `backtrace_each` (`vm_backtrace.c`), there's two dummy frames that we should ignore
|
783
|
-
// at the base of every thread's stack.
|
784
|
-
// (see https://github.com/ruby/ruby/blob/4bd38e8120f2fdfdd47a34211720e048502377f1/vm_backtrace.c#L890-L914 )
|
785
|
-
//
|
786
|
-
// One is being pointed to by `RUBY_VM_END_CONTROL_FRAME(ec)`, and so we need to advance to the next one, and
|
787
|
-
// reaching it will be used as a condition to break out of the loop below.
|
788
|
-
//
|
789
|
-
// Note that in `backtrace_each` there's two calls to `RUBY_VM_NEXT_CONTROL_FRAME`, but the loop bounds there
|
790
|
-
// are computed in a different way, so the two calls really are equivalent to one here.
|
791
|
-
end_cfp = RUBY_VM_NEXT_CONTROL_FRAME(end_cfp);
|
792
|
-
|
793
|
-
// See comment on `record_placeholder_stack_in_native_code` for a full explanation of what this means (and why we don't just return 0)
|
794
|
-
if (end_cfp <= cfp) return PLACEHOLDER_STACK_IN_NATIVE_CODE;
|
795
|
-
|
796
|
-
for (i=0; i<limit && cfp != end_cfp;) {
|
797
|
-
if (cfp->iseq && cfp->pc) { /* should be NORMAL_ISEQ */
|
798
|
-
if (start > 0) {
|
799
|
-
start--;
|
800
|
-
continue;
|
801
|
-
}
|
802
|
-
|
803
|
-
/* record frame info */
|
804
|
-
buff[i] = cfp->iseq->self;
|
805
|
-
lines[i] = calc_lineno(cfp->iseq, cfp->pc);
|
806
|
-
is_ruby_frame[i] = true;
|
807
|
-
i++;
|
808
|
-
} else if (RUBYVM_CFUNC_FRAME_P(cfp)) {
|
809
|
-
ID mid = cfp->me->def ? cfp->me->def->original_id : cfp->me->called_id;
|
810
|
-
buff[i] = rb_id2str(mid);
|
811
|
-
lines[i] = 0;
|
812
|
-
is_ruby_frame[i] = false;
|
813
|
-
i++;
|
814
|
-
}
|
815
|
-
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
816
|
-
}
|
817
|
-
|
818
|
-
return i;
|
819
|
-
}
|
820
|
-
|
821
|
-
#endif // USE_LEGACY_RB_PROFILE_FRAMES
|
822
|
-
|
823
709
|
#ifndef NO_RACTORS
|
824
710
|
// This API and definition are exported as a public symbol by the VM BUT the function header is not defined in any public header, so we
|
825
711
|
// repeat it here to be able to use in our code.
|
@@ -23,7 +23,7 @@ bool is_current_thread_holding_the_gvl(void);
|
|
23
23
|
current_gvl_owner gvl_owner(void);
|
24
24
|
uint64_t native_thread_id_for(VALUE thread);
|
25
25
|
ptrdiff_t stack_depth_for(VALUE thread);
|
26
|
-
|
26
|
+
void ddtrace_thread_list(VALUE result_array);
|
27
27
|
bool is_thread_alive(VALUE thread);
|
28
28
|
VALUE thread_name_for(VALUE thread);
|
29
29
|
|
@@ -10,11 +10,11 @@
|
|
10
10
|
#include "time_helpers.h"
|
11
11
|
|
12
12
|
// Each class/module here is implemented in their separate file
|
13
|
-
void collectors_cpu_and_wall_time_init(VALUE profiling_module);
|
14
13
|
void collectors_cpu_and_wall_time_worker_init(VALUE profiling_module);
|
15
14
|
void collectors_dynamic_sampling_rate_init(VALUE profiling_module);
|
16
15
|
void collectors_idle_sampling_helper_init(VALUE profiling_module);
|
17
16
|
void collectors_stack_init(VALUE profiling_module);
|
17
|
+
void collectors_thread_context_init(VALUE profiling_module);
|
18
18
|
void http_transport_init(VALUE profiling_module);
|
19
19
|
void stack_recorder_init(VALUE profiling_module);
|
20
20
|
|
@@ -43,11 +43,11 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) {
|
|
43
43
|
|
44
44
|
rb_define_singleton_method(native_extension_module, "clock_id_for", clock_id_for, 1); // from clock_id.h
|
45
45
|
|
46
|
-
collectors_cpu_and_wall_time_init(profiling_module);
|
47
46
|
collectors_cpu_and_wall_time_worker_init(profiling_module);
|
48
47
|
collectors_dynamic_sampling_rate_init(profiling_module);
|
49
48
|
collectors_idle_sampling_helper_init(profiling_module);
|
50
49
|
collectors_stack_init(profiling_module);
|
50
|
+
collectors_thread_context_init(profiling_module);
|
51
51
|
http_transport_init(profiling_module);
|
52
52
|
stack_recorder_init(profiling_module);
|
53
53
|
|
@@ -58,7 +58,7 @@ void grab_gvl_and_raise(VALUE exception_class, const char *format_string, ...) {
|
|
58
58
|
|
59
59
|
rb_thread_call_with_gvl(trigger_raise, &args);
|
60
60
|
|
61
|
-
rb_bug("[
|
61
|
+
rb_bug("[ddtrace] Unexpected: Reached the end of grab_gvl_and_raise while raising '%s'\n", args.exception_message);
|
62
62
|
}
|
63
63
|
|
64
64
|
struct syserr_raise_arguments {
|
@@ -91,7 +91,7 @@ void grab_gvl_and_raise_syserr(int syserr_errno, const char *format_string, ...)
|
|
91
91
|
|
92
92
|
rb_thread_call_with_gvl(trigger_syserr_raise, &args);
|
93
93
|
|
94
|
-
rb_bug("[
|
94
|
+
rb_bug("[ddtrace] Unexpected: Reached the end of grab_gvl_and_raise_syserr while raising '%s'\n", args.exception_message);
|
95
95
|
}
|
96
96
|
|
97
97
|
void raise_syserr(
|
@@ -12,7 +12,7 @@ static inline VALUE process_pending_interruptions(DDTRACE_UNUSED VALUE _) {
|
|
12
12
|
return Qnil;
|
13
13
|
}
|
14
14
|
|
15
|
-
// RB_UNLIKELY is not supported on Ruby 2.
|
15
|
+
// RB_UNLIKELY is not supported on Ruby 2.3
|
16
16
|
#ifndef RB_UNLIKELY
|
17
17
|
#define RB_UNLIKELY(x) x
|
18
18
|
#endif
|