ddtrace 0.34.1 → 1.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3321 -277
- data/LICENSE-3rdparty.csv +8 -0
- data/README.md +17 -9
- data/bin/ddprofrb +15 -0
- data/bin/ddtracerb +17 -0
- data/ext/datadog_profiling_loader/datadog_profiling_loader.c +134 -0
- data/ext/datadog_profiling_loader/extconf.rb +72 -0
- data/ext/datadog_profiling_native_extension/NativeExtensionDesign.md +156 -0
- data/ext/datadog_profiling_native_extension/clock_id.h +22 -0
- data/ext/datadog_profiling_native_extension/clock_id_from_pthread.c +56 -0
- data/ext/datadog_profiling_native_extension/clock_id_noop.c +22 -0
- data/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +1161 -0
- data/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c +422 -0
- data/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.h +101 -0
- data/ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.c +150 -0
- data/ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.h +18 -0
- data/ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.c +156 -0
- data/ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.h +5 -0
- data/ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.c +244 -0
- data/ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.h +3 -0
- data/ext/datadog_profiling_native_extension/collectors_stack.c +372 -0
- data/ext/datadog_profiling_native_extension/collectors_stack.h +27 -0
- data/ext/datadog_profiling_native_extension/collectors_thread_context.c +1402 -0
- data/ext/datadog_profiling_native_extension/collectors_thread_context.h +15 -0
- data/ext/datadog_profiling_native_extension/extconf.rb +302 -0
- data/ext/datadog_profiling_native_extension/heap_recorder.c +1047 -0
- data/ext/datadog_profiling_native_extension/heap_recorder.h +166 -0
- data/ext/datadog_profiling_native_extension/helpers.h +23 -0
- data/ext/datadog_profiling_native_extension/http_transport.c +375 -0
- data/ext/datadog_profiling_native_extension/libdatadog_helpers.c +62 -0
- data/ext/datadog_profiling_native_extension/libdatadog_helpers.h +42 -0
- data/ext/datadog_profiling_native_extension/native_extension_helpers.rb +319 -0
- data/ext/datadog_profiling_native_extension/private_vm_api_access.c +892 -0
- data/ext/datadog_profiling_native_extension/private_vm_api_access.h +61 -0
- data/ext/datadog_profiling_native_extension/profiling.c +267 -0
- data/ext/datadog_profiling_native_extension/ruby_helpers.c +267 -0
- data/ext/datadog_profiling_native_extension/ruby_helpers.h +122 -0
- data/ext/datadog_profiling_native_extension/setup_signal_handler.c +115 -0
- data/ext/datadog_profiling_native_extension/setup_signal_handler.h +11 -0
- data/ext/datadog_profiling_native_extension/stack_recorder.c +1040 -0
- data/ext/datadog_profiling_native_extension/stack_recorder.h +27 -0
- data/ext/datadog_profiling_native_extension/time_helpers.c +53 -0
- data/ext/datadog_profiling_native_extension/time_helpers.h +26 -0
- data/lib/datadog/appsec/assets/blocked.html +99 -0
- data/lib/datadog/appsec/assets/blocked.json +1 -0
- data/lib/datadog/appsec/assets/blocked.text +5 -0
- data/lib/datadog/appsec/assets/waf_rules/README.md +7 -0
- data/lib/datadog/appsec/assets/waf_rules/processors.json +92 -0
- data/lib/datadog/appsec/assets/waf_rules/recommended.json +7703 -0
- data/lib/datadog/appsec/assets/waf_rules/scanners.json +114 -0
- data/lib/datadog/appsec/assets/waf_rules/strict.json +1635 -0
- data/lib/datadog/appsec/assets.rb +44 -0
- data/lib/datadog/appsec/autoload.rb +11 -0
- data/lib/datadog/appsec/component.rb +94 -0
- data/lib/datadog/appsec/configuration/settings.rb +202 -0
- data/lib/datadog/appsec/configuration.rb +11 -0
- data/lib/datadog/appsec/contrib/auto_instrument.rb +25 -0
- data/lib/datadog/appsec/contrib/devise/event.rb +57 -0
- data/lib/datadog/appsec/contrib/devise/ext.rb +13 -0
- data/lib/datadog/appsec/contrib/devise/integration.rb +42 -0
- data/lib/datadog/appsec/contrib/devise/patcher/authenticatable_patch.rb +76 -0
- data/lib/datadog/appsec/contrib/devise/patcher/registration_controller_patch.rb +54 -0
- data/lib/datadog/appsec/contrib/devise/patcher.rb +45 -0
- data/lib/datadog/appsec/contrib/devise/resource.rb +35 -0
- data/lib/datadog/appsec/contrib/devise/tracking.rb +57 -0
- data/lib/datadog/appsec/contrib/integration.rb +37 -0
- data/lib/datadog/appsec/contrib/patcher.rb +12 -0
- data/lib/datadog/appsec/contrib/rack/ext.rb +13 -0
- data/lib/datadog/appsec/contrib/rack/gateway/request.rb +104 -0
- data/lib/datadog/appsec/contrib/rack/gateway/response.rb +30 -0
- data/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +160 -0
- data/lib/datadog/appsec/contrib/rack/integration.rb +42 -0
- data/lib/datadog/appsec/contrib/rack/patcher.rb +34 -0
- data/lib/datadog/appsec/contrib/rack/reactive/request.rb +81 -0
- data/lib/datadog/appsec/contrib/rack/reactive/request_body.rb +60 -0
- data/lib/datadog/appsec/contrib/rack/reactive/response.rb +66 -0
- data/lib/datadog/appsec/contrib/rack/request_body_middleware.rb +44 -0
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +224 -0
- data/lib/datadog/appsec/contrib/rails/ext.rb +13 -0
- data/lib/datadog/appsec/contrib/rails/framework.rb +16 -0
- data/lib/datadog/appsec/contrib/rails/gateway/request.rb +67 -0
- data/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +69 -0
- data/lib/datadog/appsec/contrib/rails/integration.rb +41 -0
- data/lib/datadog/appsec/contrib/rails/patcher.rb +165 -0
- data/lib/datadog/appsec/contrib/rails/reactive/action.rb +66 -0
- data/lib/datadog/appsec/contrib/rails/request.rb +36 -0
- data/lib/datadog/appsec/contrib/rails/request_middleware.rb +20 -0
- data/lib/datadog/appsec/contrib/sinatra/ext.rb +14 -0
- data/lib/datadog/appsec/contrib/sinatra/framework.rb +20 -0
- 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 +115 -0
- data/lib/datadog/appsec/contrib/sinatra/integration.rb +41 -0
- data/lib/datadog/appsec/contrib/sinatra/patcher.rb +166 -0
- data/lib/datadog/appsec/contrib/sinatra/reactive/routed.rb +61 -0
- data/lib/datadog/appsec/contrib/sinatra/request_middleware.rb +20 -0
- data/lib/datadog/appsec/event.rb +169 -0
- data/lib/datadog/appsec/ext.rb +10 -0
- data/lib/datadog/appsec/extensions.rb +15 -0
- data/lib/datadog/appsec/instrumentation/gateway/argument.rb +22 -0
- data/lib/datadog/appsec/instrumentation/gateway.rb +64 -0
- data/lib/datadog/appsec/instrumentation.rb +9 -0
- data/lib/datadog/appsec/monitor/gateway/watcher.rb +67 -0
- data/lib/datadog/appsec/monitor/reactive/set_user.rb +58 -0
- data/lib/datadog/appsec/monitor.rb +11 -0
- data/lib/datadog/appsec/processor/actions.rb +49 -0
- data/lib/datadog/appsec/processor/rule_loader.rb +123 -0
- data/lib/datadog/appsec/processor/rule_merger.rb +152 -0
- data/lib/datadog/appsec/processor.rb +171 -0
- data/lib/datadog/appsec/rate_limiter.rb +58 -0
- data/lib/datadog/appsec/reactive/address_hash.rb +22 -0
- data/lib/datadog/appsec/reactive/engine.rb +47 -0
- data/lib/datadog/appsec/reactive/operation.rb +68 -0
- data/lib/datadog/appsec/reactive/subscriber.rb +19 -0
- data/lib/datadog/appsec/remote.rb +129 -0
- data/lib/datadog/appsec/response.rb +151 -0
- data/lib/datadog/appsec/sample_rate.rb +21 -0
- data/lib/datadog/appsec/scope.rb +61 -0
- data/lib/datadog/appsec/utils/http/media_range.rb +199 -0
- data/lib/datadog/appsec/utils/http/media_type.rb +85 -0
- data/lib/datadog/appsec/utils/http.rb +11 -0
- data/lib/datadog/appsec/utils.rb +9 -0
- data/lib/datadog/appsec.rb +60 -0
- data/lib/datadog/auto_instrument.rb +3 -0
- data/lib/datadog/core/backport.rb +51 -0
- data/lib/datadog/core/buffer/cruby.rb +55 -0
- data/lib/datadog/core/buffer/random.rb +134 -0
- data/lib/datadog/core/buffer/thread_safe.rb +58 -0
- data/lib/datadog/core/chunker.rb +35 -0
- data/lib/datadog/core/configuration/agent_settings_resolver.rb +405 -0
- data/lib/datadog/core/configuration/base.rb +89 -0
- data/lib/datadog/core/configuration/components.rb +174 -0
- data/lib/datadog/core/configuration/ext.rb +47 -0
- data/lib/datadog/core/configuration/option.rb +319 -0
- data/lib/datadog/core/configuration/option_definition.rb +176 -0
- data/lib/datadog/core/configuration/options.rb +128 -0
- data/lib/datadog/core/configuration/settings.rb +848 -0
- data/lib/datadog/core/configuration.rb +309 -0
- data/lib/datadog/core/diagnostics/environment_logger.rb +183 -0
- data/lib/datadog/core/diagnostics/health.rb +19 -0
- data/lib/datadog/core/encoding.rb +72 -0
- data/lib/datadog/core/environment/cgroup.rb +51 -0
- data/lib/datadog/core/environment/class_count.rb +21 -0
- data/lib/datadog/core/environment/container.rb +89 -0
- data/lib/datadog/core/environment/execution.rb +103 -0
- data/lib/datadog/core/environment/ext.rb +46 -0
- data/lib/datadog/core/environment/gc.rb +20 -0
- data/lib/datadog/core/environment/git.rb +25 -0
- data/lib/datadog/core/environment/identity.rb +84 -0
- data/lib/datadog/core/environment/platform.rb +44 -0
- data/lib/datadog/core/environment/socket.rb +24 -0
- data/lib/datadog/core/environment/thread_count.rb +20 -0
- data/lib/datadog/core/environment/variable_helpers.rb +53 -0
- data/lib/datadog/core/environment/vm_cache.rb +64 -0
- data/lib/datadog/core/environment/yjit.rb +58 -0
- data/lib/datadog/core/error.rb +100 -0
- data/lib/datadog/core/extensions.rb +16 -0
- data/lib/datadog/core/git/ext.rb +16 -0
- data/lib/datadog/core/header_collection.rb +43 -0
- data/lib/datadog/core/logger.rb +44 -0
- data/lib/datadog/core/logging/ext.rb +13 -0
- data/lib/datadog/core/metrics/client.rb +197 -0
- data/lib/datadog/core/metrics/ext.rb +18 -0
- data/lib/datadog/core/metrics/helpers.rb +25 -0
- data/lib/datadog/core/metrics/logging.rb +42 -0
- data/lib/datadog/core/metrics/metric.rb +14 -0
- data/lib/datadog/core/metrics/options.rb +48 -0
- data/lib/datadog/core/pin.rb +73 -0
- data/lib/datadog/core/remote/client/capabilities.rb +62 -0
- data/lib/datadog/core/remote/client.rb +232 -0
- data/lib/datadog/core/remote/component.rb +162 -0
- data/lib/datadog/core/remote/configuration/content.rb +111 -0
- data/lib/datadog/core/remote/configuration/digest.rb +62 -0
- data/lib/datadog/core/remote/configuration/path.rb +90 -0
- data/lib/datadog/core/remote/configuration/repository.rb +294 -0
- data/lib/datadog/core/remote/configuration/target.rb +74 -0
- data/lib/datadog/core/remote/configuration.rb +18 -0
- data/lib/datadog/core/remote/dispatcher.rb +59 -0
- data/lib/datadog/core/remote/ext.rb +13 -0
- data/lib/datadog/core/remote/negotiation.rb +70 -0
- data/lib/datadog/core/remote/tie/tracing.rb +39 -0
- data/lib/datadog/core/remote/tie.rb +27 -0
- data/lib/datadog/core/remote/transport/config.rb +60 -0
- data/lib/datadog/core/remote/transport/http/api/instance.rb +39 -0
- data/lib/datadog/core/remote/transport/http/api/spec.rb +21 -0
- data/lib/datadog/core/remote/transport/http/api.rb +58 -0
- data/lib/datadog/core/remote/transport/http/builder.rb +219 -0
- data/lib/datadog/core/remote/transport/http/client.rb +48 -0
- data/lib/datadog/core/remote/transport/http/config.rb +280 -0
- data/lib/datadog/core/remote/transport/http/negotiation.rb +146 -0
- data/lib/datadog/core/remote/transport/http.rb +179 -0
- data/lib/datadog/core/remote/transport/negotiation.rb +62 -0
- data/lib/datadog/core/remote/worker.rb +102 -0
- data/lib/datadog/core/remote.rb +24 -0
- data/lib/datadog/core/runtime/ext.rb +38 -0
- data/lib/datadog/core/runtime/metrics.rb +183 -0
- data/lib/datadog/core/telemetry/client.rb +95 -0
- data/lib/datadog/core/telemetry/emitter.rb +44 -0
- data/lib/datadog/core/telemetry/event.rb +273 -0
- data/lib/datadog/core/telemetry/ext.rb +16 -0
- data/lib/datadog/core/telemetry/heartbeat.rb +33 -0
- data/lib/datadog/core/telemetry/http/adapters/net.rb +111 -0
- data/lib/datadog/core/telemetry/http/env.rb +20 -0
- data/lib/datadog/core/telemetry/http/ext.rb +25 -0
- data/lib/datadog/core/telemetry/http/response.rb +68 -0
- data/lib/datadog/core/telemetry/http/transport.rb +61 -0
- data/lib/datadog/core/telemetry/request.rb +59 -0
- data/lib/datadog/core/transport/ext.rb +49 -0
- data/lib/datadog/core/transport/http/adapters/net.rb +168 -0
- data/lib/datadog/core/transport/http/adapters/registry.rb +29 -0
- data/lib/datadog/core/transport/http/adapters/test.rb +89 -0
- data/lib/datadog/core/transport/http/adapters/unix_socket.rb +83 -0
- data/lib/datadog/core/transport/http/api/endpoint.rb +31 -0
- data/lib/datadog/core/transport/http/api/fallbacks.rb +26 -0
- data/lib/datadog/core/transport/http/api/map.rb +18 -0
- data/lib/datadog/core/transport/http/env.rb +62 -0
- data/lib/datadog/core/transport/http/response.rb +60 -0
- data/lib/datadog/core/transport/parcel.rb +22 -0
- data/lib/datadog/core/transport/request.rb +17 -0
- data/lib/datadog/core/transport/response.rb +64 -0
- data/lib/datadog/core/utils/compression.rb +36 -0
- data/lib/datadog/core/utils/duration.rb +52 -0
- data/lib/datadog/core/utils/forking.rb +61 -0
- data/lib/datadog/core/utils/hash.rb +79 -0
- data/lib/datadog/core/utils/network.rb +140 -0
- data/lib/datadog/core/utils/only_once.rb +42 -0
- data/lib/datadog/core/utils/safe_dup.rb +50 -0
- data/lib/datadog/core/utils/sequence.rb +26 -0
- data/lib/datadog/core/utils/time.rb +52 -0
- data/lib/datadog/core/utils/url.rb +25 -0
- data/lib/datadog/core/utils.rb +92 -0
- data/lib/datadog/core/vendor/ipaddr.rb +78 -0
- data/lib/datadog/core/vendor/multipart-post/LICENSE +11 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post/composite_read_io.rb +118 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb +59 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post/parts.rb +137 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post/version.rb +11 -0
- data/lib/datadog/core/vendor/multipart-post/multipart/post.rb +10 -0
- data/lib/datadog/core/vendor/multipart-post/multipart.rb +14 -0
- data/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb +34 -0
- data/lib/datadog/core/worker.rb +24 -0
- data/lib/datadog/core/workers/async.rb +183 -0
- data/lib/datadog/core/workers/interval_loop.rb +123 -0
- data/lib/datadog/core/workers/polling.rb +57 -0
- data/lib/datadog/core/workers/queue.rb +44 -0
- data/lib/datadog/core/workers/runtime_metrics.rb +62 -0
- data/lib/datadog/core.rb +45 -0
- data/lib/datadog/kit/appsec/events.rb +169 -0
- data/lib/datadog/kit/enable_core_dumps.rb +49 -0
- data/lib/datadog/kit/identity.rb +104 -0
- data/lib/datadog/kit.rb +11 -0
- data/lib/datadog/opentelemetry/api/context.rb +193 -0
- data/lib/datadog/opentelemetry/api/trace/span.rb +14 -0
- data/lib/datadog/opentelemetry/sdk/configurator.rb +37 -0
- data/lib/datadog/opentelemetry/sdk/id_generator.rb +26 -0
- data/lib/datadog/opentelemetry/sdk/propagator.rb +92 -0
- data/lib/datadog/opentelemetry/sdk/span_processor.rb +134 -0
- data/lib/datadog/opentelemetry/sdk/trace/span.rb +167 -0
- data/lib/datadog/opentelemetry/trace.rb +58 -0
- data/lib/datadog/opentelemetry.rb +51 -0
- data/lib/datadog/opentracer/binary_propagator.rb +26 -0
- data/lib/datadog/opentracer/carrier.rb +9 -0
- data/lib/datadog/opentracer/distributed_headers.rb +54 -0
- data/lib/datadog/opentracer/global_tracer.rb +17 -0
- data/lib/datadog/opentracer/propagator.rb +26 -0
- data/lib/datadog/opentracer/rack_propagator.rb +71 -0
- data/lib/datadog/opentracer/scope.rb +18 -0
- data/lib/datadog/opentracer/scope_manager.rb +9 -0
- data/lib/datadog/opentracer/span.rb +99 -0
- data/lib/datadog/opentracer/span_context.rb +19 -0
- data/lib/datadog/opentracer/span_context_factory.rb +27 -0
- data/lib/datadog/opentracer/text_map_propagator.rb +87 -0
- data/lib/datadog/opentracer/thread_local_scope.rb +34 -0
- data/lib/datadog/opentracer/thread_local_scope_manager.rb +64 -0
- data/lib/datadog/opentracer/tracer.rb +212 -0
- data/lib/datadog/opentracer.rb +33 -0
- data/lib/datadog/profiling/collectors/code_provenance.rb +119 -0
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +137 -0
- data/lib/datadog/profiling/collectors/dynamic_sampling_rate.rb +14 -0
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +68 -0
- data/lib/datadog/profiling/collectors/info.rb +101 -0
- data/lib/datadog/profiling/collectors/stack.rb +13 -0
- data/lib/datadog/profiling/collectors/thread_context.rb +61 -0
- data/lib/datadog/profiling/component.rb +426 -0
- data/lib/datadog/profiling/exporter.rb +104 -0
- data/lib/datadog/profiling/ext/forking.rb +96 -0
- data/lib/datadog/profiling/ext.rb +35 -0
- data/lib/datadog/profiling/flush.rb +43 -0
- data/lib/datadog/profiling/http_transport.rb +147 -0
- data/lib/datadog/profiling/load_native_extension.rb +39 -0
- data/lib/datadog/profiling/native_extension.rb +20 -0
- data/lib/datadog/profiling/preload.rb +5 -0
- data/lib/datadog/profiling/profiler.rb +62 -0
- data/lib/datadog/profiling/scheduler.rb +135 -0
- data/lib/datadog/profiling/stack_recorder.rb +71 -0
- data/lib/datadog/profiling/tag_builder.rb +58 -0
- data/lib/datadog/profiling/tasks/exec.rb +48 -0
- data/lib/datadog/profiling/tasks/help.rb +16 -0
- data/lib/datadog/profiling/tasks/setup.rb +58 -0
- data/lib/datadog/profiling.rb +161 -0
- data/lib/datadog/tracing/analytics.rb +25 -0
- data/lib/datadog/tracing/buffer.rb +127 -0
- data/lib/datadog/tracing/client_ip.rb +61 -0
- data/lib/datadog/tracing/component.rb +235 -0
- data/lib/datadog/tracing/configuration/agent_settings_resolver.rb +13 -0
- data/lib/datadog/tracing/configuration/dynamic/option.rb +71 -0
- data/lib/datadog/tracing/configuration/dynamic.rb +64 -0
- data/lib/datadog/tracing/configuration/ext.rb +108 -0
- data/lib/datadog/tracing/configuration/http.rb +74 -0
- data/lib/datadog/tracing/configuration/settings.rb +502 -0
- data/lib/datadog/tracing/context.rb +68 -0
- data/lib/datadog/tracing/context_provider.rb +80 -0
- data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +39 -0
- data/lib/datadog/tracing/contrib/action_cable/event.rb +71 -0
- data/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +56 -0
- data/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +61 -0
- data/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +57 -0
- data/lib/datadog/tracing/contrib/action_cable/events.rb +37 -0
- data/lib/datadog/tracing/contrib/action_cable/ext.rb +33 -0
- data/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +88 -0
- data/lib/datadog/tracing/contrib/action_cable/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/action_cable/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +40 -0
- data/lib/datadog/tracing/contrib/action_mailer/event.rb +52 -0
- data/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +58 -0
- data/lib/datadog/tracing/contrib/action_mailer/events/process.rb +45 -0
- data/lib/datadog/tracing/contrib/action_mailer/events.rb +34 -0
- data/lib/datadog/tracing/contrib/action_mailer/ext.rb +34 -0
- data/lib/datadog/tracing/contrib/action_mailer/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/action_mailer/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +136 -0
- data/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +50 -0
- data/lib/datadog/tracing/contrib/action_pack/ext.rb +23 -0
- data/lib/datadog/tracing/contrib/action_pack/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/action_pack/patcher.rb +27 -0
- data/lib/datadog/tracing/contrib/action_pack/utils.rb +38 -0
- data/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +38 -0
- data/lib/datadog/tracing/contrib/action_view/event.rb +35 -0
- data/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +52 -0
- data/lib/datadog/tracing/contrib/action_view/events/render_template.rb +55 -0
- data/lib/datadog/tracing/contrib/action_view/events.rb +34 -0
- data/lib/datadog/tracing/contrib/action_view/ext.rb +25 -0
- data/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb +76 -0
- data/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb +89 -0
- data/lib/datadog/tracing/contrib/action_view/integration.rb +55 -0
- data/lib/datadog/tracing/contrib/action_view/patcher.rb +45 -0
- data/lib/datadog/tracing/contrib/action_view/utils.rb +34 -0
- data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +44 -0
- data/lib/datadog/tracing/contrib/active_job/event.rb +58 -0
- data/lib/datadog/tracing/contrib/active_job/events/discard.rb +48 -0
- data/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +47 -0
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +47 -0
- data/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +49 -0
- data/lib/datadog/tracing/contrib/active_job/events/perform.rb +47 -0
- data/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +48 -0
- data/lib/datadog/tracing/contrib/active_job/events.rb +42 -0
- data/lib/datadog/tracing/contrib/active_job/ext.rb +40 -0
- data/lib/datadog/tracing/contrib/active_job/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/active_job/log_injection.rb +24 -0
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +36 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +37 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/event.rb +68 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +43 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +45 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/events.rb +34 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/ext.rb +25 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/integration.rb +43 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +32 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/makara_resolver.rb +34 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +150 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +47 -0
- data/lib/datadog/tracing/contrib/active_record/event.rb +30 -0
- data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +56 -0
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +75 -0
- data/lib/datadog/tracing/contrib/active_record/events.rb +34 -0
- data/lib/datadog/tracing/contrib/active_record/ext.rb +30 -0
- data/lib/datadog/tracing/contrib/active_record/integration.rb +54 -0
- data/lib/datadog/tracing/contrib/active_record/patcher.rb +27 -0
- data/lib/datadog/tracing/contrib/active_record/utils.rb +126 -0
- data/lib/datadog/tracing/contrib/active_record/vendor/MIT-LICENSE +20 -0
- data/lib/datadog/tracing/contrib/active_record/vendor/connection_specification.rb +305 -0
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +186 -0
- data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +76 -0
- data/lib/datadog/tracing/contrib/active_support/cache/redis.rb +47 -0
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +46 -0
- data/lib/datadog/tracing/contrib/active_support/ext.rb +32 -0
- data/lib/datadog/tracing/contrib/active_support/integration.rb +49 -0
- data/lib/datadog/tracing/contrib/active_support/notifications/event.rb +71 -0
- data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +71 -0
- data/lib/datadog/tracing/contrib/active_support/notifications/subscription.rb +162 -0
- data/lib/datadog/tracing/contrib/active_support/patcher.rb +27 -0
- data/lib/datadog/tracing/contrib/analytics.rb +28 -0
- data/lib/datadog/tracing/contrib/auto_instrument.rb +53 -0
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +52 -0
- data/lib/datadog/tracing/contrib/aws/ext.rb +50 -0
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +119 -0
- data/lib/datadog/tracing/contrib/aws/integration.rb +45 -0
- data/lib/datadog/tracing/contrib/aws/parsed_context.rb +62 -0
- data/lib/datadog/tracing/contrib/aws/patcher.rb +57 -0
- data/lib/datadog/tracing/contrib/aws/service/base.rb +16 -0
- data/lib/datadog/tracing/contrib/aws/service/dynamodb.rb +22 -0
- data/lib/datadog/tracing/contrib/aws/service/eventbridge.rb +22 -0
- data/lib/datadog/tracing/contrib/aws/service/kinesis.rb +32 -0
- data/lib/datadog/tracing/contrib/aws/service/s3.rb +22 -0
- data/lib/datadog/tracing/contrib/aws/service/sns.rb +30 -0
- data/lib/datadog/tracing/contrib/aws/service/sqs.rb +27 -0
- data/lib/datadog/tracing/contrib/aws/service/states.rb +40 -0
- data/lib/datadog/tracing/contrib/aws/services.rb +137 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/async_patch.rb +20 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +24 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb +53 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/ext.rb +16 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb +20 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +49 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/promises_future_patch.rb +22 -0
- data/lib/datadog/tracing/contrib/configurable.rb +102 -0
- data/lib/datadog/tracing/contrib/configuration/resolver.rb +85 -0
- data/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb +43 -0
- data/lib/datadog/tracing/contrib/configuration/settings.rb +39 -0
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +57 -0
- data/lib/datadog/tracing/contrib/dalli/ext.rb +40 -0
- data/lib/datadog/tracing/contrib/dalli/instrumentation.rb +73 -0
- data/lib/datadog/tracing/contrib/dalli/integration.rb +50 -0
- data/lib/datadog/tracing/contrib/dalli/patcher.rb +28 -0
- data/lib/datadog/tracing/contrib/dalli/quantize.rb +24 -0
- data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +45 -0
- data/lib/datadog/tracing/contrib/delayed_job/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/delayed_job/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/delayed_job/patcher.rb +37 -0
- data/lib/datadog/tracing/contrib/delayed_job/plugin.rb +108 -0
- data/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb +34 -0
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +53 -0
- data/lib/datadog/tracing/contrib/elasticsearch/ext.rb +34 -0
- data/lib/datadog/tracing/contrib/elasticsearch/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +160 -0
- data/lib/datadog/tracing/contrib/elasticsearch/quantize.rb +85 -0
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +55 -0
- data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +221 -0
- data/lib/datadog/tracing/contrib/ethon/ext.rb +32 -0
- data/lib/datadog/tracing/contrib/ethon/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +102 -0
- data/lib/datadog/tracing/contrib/ethon/patcher.rb +30 -0
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +57 -0
- data/lib/datadog/tracing/contrib/excon/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/excon/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/excon/middleware.rb +192 -0
- data/lib/datadog/tracing/contrib/excon/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib/ext.rb +55 -0
- data/lib/datadog/tracing/contrib/extensions.rb +233 -0
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +68 -0
- data/lib/datadog/tracing/contrib/faraday/connection.rb +22 -0
- data/lib/datadog/tracing/contrib/faraday/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/faraday/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +110 -0
- data/lib/datadog/tracing/contrib/faraday/patcher.rb +54 -0
- data/lib/datadog/tracing/contrib/faraday/rack_builder.rb +22 -0
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +45 -0
- data/lib/datadog/tracing/contrib/grape/endpoint.rb +248 -0
- data/lib/datadog/tracing/contrib/grape/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/grape/instrumentation.rb +35 -0
- data/lib/datadog/tracing/contrib/grape/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/grape/patcher.rb +33 -0
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +39 -0
- data/lib/datadog/tracing/contrib/graphql/ext.rb +20 -0
- data/lib/datadog/tracing/contrib/graphql/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +88 -0
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +79 -0
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +119 -0
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +107 -0
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +101 -0
- data/lib/datadog/tracing/contrib/grpc/distributed/fetcher.rb +26 -0
- data/lib/datadog/tracing/contrib/grpc/distributed/propagation.rb +42 -0
- data/lib/datadog/tracing/contrib/grpc/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/grpc/formatting.rb +127 -0
- data/lib/datadog/tracing/contrib/grpc/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/grpc/intercept_with_datadog.rb +53 -0
- data/lib/datadog/tracing/contrib/grpc/patcher.rb +34 -0
- data/lib/datadog/tracing/contrib/hanami/action_tracer.rb +47 -0
- data/lib/datadog/tracing/contrib/hanami/configuration/settings.rb +23 -0
- data/lib/datadog/tracing/contrib/hanami/ext.rb +24 -0
- data/lib/datadog/tracing/contrib/hanami/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/hanami/patcher.rb +33 -0
- data/lib/datadog/tracing/contrib/hanami/plugin.rb +23 -0
- data/lib/datadog/tracing/contrib/hanami/renderer_policy_tracing.rb +41 -0
- data/lib/datadog/tracing/contrib/hanami/router_tracing.rb +44 -0
- data/lib/datadog/tracing/contrib/http/circuit_breaker.rb +40 -0
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +75 -0
- data/lib/datadog/tracing/contrib/http/distributed/fetcher.rb +38 -0
- data/lib/datadog/tracing/contrib/http/distributed/propagation.rb +37 -0
- data/lib/datadog/tracing/contrib/http/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/http/instrumentation.rb +158 -0
- data/lib/datadog/tracing/contrib/http/integration.rb +49 -0
- data/lib/datadog/tracing/contrib/http/patcher.rb +30 -0
- data/lib/datadog/tracing/contrib/http_annotation_helper.rb +17 -0
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +75 -0
- data/lib/datadog/tracing/contrib/httpclient/ext.rb +30 -0
- data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +135 -0
- data/lib/datadog/tracing/contrib/httpclient/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/httpclient/patcher.rb +40 -0
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +75 -0
- data/lib/datadog/tracing/contrib/httprb/ext.rb +29 -0
- data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +145 -0
- data/lib/datadog/tracing/contrib/httprb/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/httprb/patcher.rb +40 -0
- data/lib/datadog/tracing/contrib/integration.rb +78 -0
- data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +39 -0
- data/lib/datadog/tracing/contrib/kafka/consumer_event.rb +19 -0
- data/lib/datadog/tracing/contrib/kafka/consumer_group_event.rb +18 -0
- data/lib/datadog/tracing/contrib/kafka/event.rb +53 -0
- data/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +40 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +47 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +45 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +45 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb +35 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb +35 -0
- data/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb +35 -0
- data/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +39 -0
- data/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +42 -0
- data/lib/datadog/tracing/contrib/kafka/events.rb +48 -0
- data/lib/datadog/tracing/contrib/kafka/ext.rb +55 -0
- data/lib/datadog/tracing/contrib/kafka/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/kafka/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +24 -0
- data/lib/datadog/tracing/contrib/lograge/ext.rb +15 -0
- data/lib/datadog/tracing/contrib/lograge/instrumentation.rb +31 -0
- data/lib/datadog/tracing/contrib/lograge/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +55 -0
- data/lib/datadog/tracing/contrib/mongodb/ext.rb +38 -0
- data/lib/datadog/tracing/contrib/mongodb/instrumentation.rb +47 -0
- data/lib/datadog/tracing/contrib/mongodb/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/mongodb/parsers.rb +47 -0
- data/lib/datadog/tracing/contrib/mongodb/patcher.rb +34 -0
- data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +139 -0
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +63 -0
- data/lib/datadog/tracing/contrib/mysql2/ext.rb +28 -0
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +95 -0
- data/lib/datadog/tracing/contrib/mysql2/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/mysql2/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib/opensearch/configuration/settings.rb +53 -0
- data/lib/datadog/tracing/contrib/opensearch/ext.rb +38 -0
- data/lib/datadog/tracing/contrib/opensearch/integration.rb +44 -0
- data/lib/datadog/tracing/contrib/opensearch/patcher.rb +135 -0
- data/lib/datadog/tracing/contrib/opensearch/quantize.rb +81 -0
- data/lib/datadog/tracing/contrib/patchable.rb +109 -0
- data/lib/datadog/tracing/contrib/patcher.rb +83 -0
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +64 -0
- data/lib/datadog/tracing/contrib/pg/ext.rb +35 -0
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +211 -0
- data/lib/datadog/tracing/contrib/pg/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/pg/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +51 -0
- data/lib/datadog/tracing/contrib/presto/ext.rb +38 -0
- data/lib/datadog/tracing/contrib/presto/instrumentation.rb +136 -0
- data/lib/datadog/tracing/contrib/presto/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/presto/patcher.rb +35 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment/comment.rb +41 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb +33 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment/mode.rb +28 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment.rb +53 -0
- data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +45 -0
- data/lib/datadog/tracing/contrib/qless/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/qless/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/qless/patcher.rb +36 -0
- data/lib/datadog/tracing/contrib/qless/qless_job.rb +75 -0
- data/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +30 -0
- data/lib/datadog/tracing/contrib/que/configuration/settings.rb +57 -0
- data/lib/datadog/tracing/contrib/que/ext.rb +33 -0
- data/lib/datadog/tracing/contrib/que/integration.rb +44 -0
- data/lib/datadog/tracing/contrib/que/patcher.rb +26 -0
- data/lib/datadog/tracing/contrib/que/tracer.rb +63 -0
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +46 -0
- data/lib/datadog/tracing/contrib/racecar/event.rb +81 -0
- data/lib/datadog/tracing/contrib/racecar/events/batch.rb +36 -0
- data/lib/datadog/tracing/contrib/racecar/events/consume.rb +33 -0
- data/lib/datadog/tracing/contrib/racecar/events/message.rb +36 -0
- data/lib/datadog/tracing/contrib/racecar/events.rb +36 -0
- data/lib/datadog/tracing/contrib/racecar/ext.rb +33 -0
- data/lib/datadog/tracing/contrib/racecar/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/racecar/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/rack/configuration/settings.rb +54 -0
- data/lib/datadog/tracing/contrib/rack/ext.rb +31 -0
- data/lib/datadog/tracing/contrib/rack/header_collection.rb +38 -0
- data/lib/datadog/tracing/contrib/rack/header_tagging.rb +63 -0
- data/lib/datadog/tracing/contrib/rack/integration.rb +48 -0
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +315 -0
- data/lib/datadog/tracing/contrib/rack/patcher.rb +117 -0
- data/lib/datadog/tracing/contrib/rack/request_queue.rb +46 -0
- data/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +8 -0
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +84 -0
- data/lib/datadog/tracing/contrib/rails/ext.rb +20 -0
- data/lib/datadog/tracing/contrib/rails/framework.rb +148 -0
- data/lib/datadog/tracing/contrib/rails/integration.rb +47 -0
- data/lib/datadog/tracing/contrib/rails/log_injection.rb +27 -0
- data/lib/datadog/tracing/contrib/rails/middlewares.rb +46 -0
- data/lib/datadog/tracing/contrib/rails/patcher.rb +87 -0
- data/lib/datadog/tracing/contrib/rails/railtie.rb +17 -0
- data/lib/datadog/tracing/contrib/rails/utils.rb +28 -0
- data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +55 -0
- data/lib/datadog/tracing/contrib/rake/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/rake/instrumentation.rb +101 -0
- data/lib/datadog/tracing/contrib/rake/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/rake/patcher.rb +33 -0
- data/lib/datadog/tracing/contrib/redis/configuration/resolver.rb +47 -0
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +57 -0
- data/lib/datadog/tracing/contrib/redis/ext.rb +35 -0
- data/lib/datadog/tracing/contrib/redis/instrumentation.rb +51 -0
- data/lib/datadog/tracing/contrib/redis/integration.rb +78 -0
- data/lib/datadog/tracing/contrib/redis/patcher.rb +90 -0
- data/lib/datadog/tracing/contrib/redis/quantize.rb +80 -0
- data/lib/datadog/tracing/contrib/redis/tags.rb +68 -0
- data/lib/datadog/tracing/contrib/redis/trace_middleware.rb +83 -0
- data/lib/datadog/tracing/contrib/redis/vendor/LICENSE +20 -0
- data/lib/datadog/tracing/contrib/redis/vendor/resolver.rb +160 -0
- data/lib/datadog/tracing/contrib/registerable.rb +50 -0
- data/lib/datadog/tracing/contrib/registry.rb +52 -0
- data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +44 -0
- data/lib/datadog/tracing/contrib/resque/ext.rb +22 -0
- data/lib/datadog/tracing/contrib/resque/integration.rb +46 -0
- data/lib/datadog/tracing/contrib/resque/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/resque/resque_job.rb +106 -0
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +55 -0
- data/lib/datadog/tracing/contrib/rest_client/ext.rb +28 -0
- data/lib/datadog/tracing/contrib/rest_client/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/rest_client/patcher.rb +28 -0
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +129 -0
- data/lib/datadog/tracing/contrib/roda/configuration/settings.rb +38 -0
- data/lib/datadog/tracing/contrib/roda/ext.rb +19 -0
- data/lib/datadog/tracing/contrib/roda/instrumentation.rb +76 -0
- data/lib/datadog/tracing/contrib/roda/integration.rb +45 -0
- data/lib/datadog/tracing/contrib/roda/patcher.rb +30 -0
- data/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb +24 -0
- data/lib/datadog/tracing/contrib/semantic_logger/ext.rb +15 -0
- data/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +35 -0
- data/lib/datadog/tracing/contrib/semantic_logger/integration.rb +50 -0
- data/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +29 -0
- data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +37 -0
- data/lib/datadog/tracing/contrib/sequel/database.rb +60 -0
- data/lib/datadog/tracing/contrib/sequel/dataset.rb +67 -0
- data/lib/datadog/tracing/contrib/sequel/ext.rb +23 -0
- data/lib/datadog/tracing/contrib/sequel/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/sequel/patcher.rb +37 -0
- data/lib/datadog/tracing/contrib/sequel/utils.rb +88 -0
- data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +45 -0
- data/lib/datadog/tracing/contrib/shoryuken/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/shoryuken/integration.rb +42 -0
- data/lib/datadog/tracing/contrib/shoryuken/patcher.rb +28 -0
- data/lib/datadog/tracing/contrib/shoryuken/tracer.rb +65 -0
- data/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +66 -0
- data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +53 -0
- data/lib/datadog/tracing/contrib/sidekiq/distributed/propagation.rb +38 -0
- data/lib/datadog/tracing/contrib/sidekiq/ext.rb +45 -0
- data/lib/datadog/tracing/contrib/sidekiq/integration.rb +59 -0
- data/lib/datadog/tracing/contrib/sidekiq/patcher.rb +90 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb +61 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb +36 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb +34 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb +57 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/stop.rb +34 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +118 -0
- data/lib/datadog/tracing/contrib/sidekiq/utils.rb +44 -0
- data/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +44 -0
- data/lib/datadog/tracing/contrib/sinatra/env.rb +36 -0
- data/lib/datadog/tracing/contrib/sinatra/ext.rb +37 -0
- data/lib/datadog/tracing/contrib/sinatra/framework.rb +114 -0
- data/lib/datadog/tracing/contrib/sinatra/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/sinatra/patcher.rb +75 -0
- data/lib/datadog/tracing/contrib/sinatra/tracer.rb +84 -0
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +116 -0
- data/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +43 -0
- data/lib/datadog/tracing/contrib/sneakers/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/sneakers/integration.rb +44 -0
- data/lib/datadog/tracing/contrib/sneakers/patcher.rb +27 -0
- data/lib/datadog/tracing/contrib/sneakers/tracer.rb +60 -0
- data/lib/datadog/tracing/contrib/span_attribute_schema.rb +92 -0
- data/lib/datadog/tracing/contrib/status_code_matcher.rb +72 -0
- data/lib/datadog/tracing/contrib/stripe/configuration/settings.rb +37 -0
- data/lib/datadog/tracing/contrib/stripe/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/stripe/integration.rb +43 -0
- data/lib/datadog/tracing/contrib/stripe/patcher.rb +28 -0
- data/lib/datadog/tracing/contrib/stripe/request.rb +67 -0
- data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +39 -0
- data/lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb +28 -0
- data/lib/datadog/tracing/contrib/sucker_punch/ext.rb +28 -0
- data/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +102 -0
- data/lib/datadog/tracing/contrib/sucker_punch/integration.rb +41 -0
- data/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +35 -0
- data/lib/datadog/tracing/contrib/trilogy/configuration/settings.rb +58 -0
- data/lib/datadog/tracing/contrib/trilogy/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/trilogy/instrumentation.rb +94 -0
- data/lib/datadog/tracing/contrib/trilogy/integration.rb +43 -0
- data/lib/datadog/tracing/contrib/trilogy/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib/utils/database.rb +31 -0
- data/lib/datadog/tracing/contrib/utils/quantization/hash.rb +109 -0
- data/lib/datadog/tracing/contrib/utils/quantization/http.rb +177 -0
- data/lib/datadog/tracing/contrib.rb +82 -0
- data/lib/datadog/tracing/correlation.rb +128 -0
- data/lib/datadog/tracing/diagnostics/environment_logger.rb +165 -0
- data/lib/datadog/tracing/diagnostics/ext.rb +36 -0
- data/lib/datadog/tracing/diagnostics/health.rb +40 -0
- data/lib/datadog/tracing/distributed/b3_multi.rb +72 -0
- data/lib/datadog/tracing/distributed/b3_single.rb +68 -0
- data/lib/datadog/tracing/distributed/datadog.rb +199 -0
- data/lib/datadog/tracing/distributed/datadog_tags_codec.rb +84 -0
- data/lib/datadog/tracing/distributed/fetcher.rb +21 -0
- data/lib/datadog/tracing/distributed/headers/ext.rb +34 -0
- data/lib/datadog/tracing/distributed/helpers.rb +65 -0
- data/lib/datadog/tracing/distributed/none.rb +18 -0
- data/lib/datadog/tracing/distributed/propagation.rb +127 -0
- data/lib/datadog/tracing/distributed/trace_context.rb +415 -0
- data/lib/datadog/tracing/event.rb +74 -0
- data/lib/datadog/tracing/flush.rb +96 -0
- data/lib/datadog/tracing/metadata/analytics.rb +26 -0
- data/lib/datadog/tracing/metadata/errors.rb +24 -0
- data/lib/datadog/tracing/metadata/ext.rb +191 -0
- data/lib/datadog/tracing/metadata/tagging.rb +129 -0
- data/lib/datadog/tracing/metadata.rb +20 -0
- data/lib/datadog/tracing/pipeline/span_filter.rb +46 -0
- data/lib/datadog/tracing/pipeline/span_processor.rb +39 -0
- data/lib/datadog/tracing/pipeline.rb +61 -0
- data/lib/datadog/tracing/propagation/http.rb +14 -0
- data/lib/datadog/tracing/remote.rb +78 -0
- data/lib/datadog/tracing/runtime/metrics.rb +17 -0
- data/lib/datadog/tracing/sampling/all_sampler.rb +25 -0
- data/lib/datadog/tracing/sampling/ext.rb +56 -0
- data/lib/datadog/tracing/sampling/matcher.rb +88 -0
- data/lib/datadog/tracing/sampling/priority_sampler.rb +165 -0
- data/lib/datadog/tracing/sampling/rate_by_key_sampler.rb +94 -0
- data/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +62 -0
- data/lib/datadog/tracing/sampling/rate_limiter.rb +186 -0
- data/lib/datadog/tracing/sampling/rate_sampler.rb +68 -0
- data/lib/datadog/tracing/sampling/rule.rb +77 -0
- data/lib/datadog/tracing/sampling/rule_sampler.rb +159 -0
- data/lib/datadog/tracing/sampling/sampler.rb +42 -0
- data/lib/datadog/tracing/sampling/span/ext.rb +25 -0
- data/lib/datadog/tracing/sampling/span/matcher.rb +89 -0
- data/lib/datadog/tracing/sampling/span/rule.rb +82 -0
- data/lib/datadog/tracing/sampling/span/rule_parser.rb +104 -0
- data/lib/datadog/tracing/sampling/span/sampler.rb +77 -0
- data/lib/datadog/tracing/span.rb +214 -0
- data/lib/datadog/tracing/span_operation.rb +505 -0
- data/lib/datadog/tracing/sync_writer.rb +67 -0
- data/lib/datadog/tracing/trace_digest.rb +177 -0
- data/lib/datadog/tracing/trace_operation.rb +485 -0
- data/lib/datadog/tracing/trace_segment.rb +220 -0
- data/lib/datadog/tracing/tracer.rb +541 -0
- data/lib/datadog/tracing/transport/http/api/instance.rb +37 -0
- data/lib/datadog/tracing/transport/http/api/spec.rb +19 -0
- data/lib/datadog/tracing/transport/http/api.rb +43 -0
- data/lib/datadog/tracing/transport/http/builder.rb +162 -0
- data/lib/datadog/tracing/transport/http/client.rb +57 -0
- data/lib/datadog/tracing/transport/http/statistics.rb +47 -0
- data/lib/datadog/tracing/transport/http/traces.rb +152 -0
- data/lib/datadog/tracing/transport/http.rb +125 -0
- data/lib/datadog/tracing/transport/io/client.rb +89 -0
- data/lib/datadog/tracing/transport/io/response.rb +27 -0
- data/lib/datadog/tracing/transport/io/traces.rb +101 -0
- data/lib/datadog/tracing/transport/io.rb +30 -0
- data/lib/datadog/tracing/transport/serializable_trace.rb +126 -0
- data/lib/datadog/tracing/transport/statistics.rb +77 -0
- data/lib/datadog/tracing/transport/trace_formatter.rb +240 -0
- data/lib/datadog/tracing/transport/traces.rb +224 -0
- data/lib/datadog/tracing/utils.rb +83 -0
- data/lib/datadog/tracing/workers/trace_writer.rb +194 -0
- data/lib/datadog/tracing/workers.rb +123 -0
- data/lib/datadog/tracing/writer.rb +186 -0
- data/lib/datadog/tracing.rb +148 -0
- data/lib/ddtrace/auto_instrument.rb +16 -0
- data/lib/ddtrace/auto_instrument_base.rb +8 -0
- data/lib/ddtrace/profiling/preload.rb +2 -0
- data/lib/ddtrace/transport/ext.rb +47 -0
- data/lib/ddtrace/version.rb +19 -5
- data/lib/ddtrace.rb +9 -72
- metadata +808 -632
- data/.circleci/config.yml +0 -441
- data/.circleci/images/primary/Dockerfile-2.0.0 +0 -73
- data/.circleci/images/primary/Dockerfile-2.1.10 +0 -73
- data/.circleci/images/primary/Dockerfile-2.2.10 +0 -73
- data/.circleci/images/primary/Dockerfile-2.3.8 +0 -75
- data/.circleci/images/primary/Dockerfile-2.4.6 +0 -73
- data/.circleci/images/primary/Dockerfile-2.5.6 +0 -73
- data/.circleci/images/primary/Dockerfile-2.6.4 +0 -73
- data/.circleci/images/primary/Dockerfile-2.7.0 +0 -73
- data/.dockerignore +0 -1
- data/.env +0 -26
- data/.github/CODEOWNERS +0 -1
- data/.gitignore +0 -59
- data/.rspec +0 -1
- data/.rubocop.yml +0 -81
- data/.yardopts +0 -5
- data/Appraisals +0 -944
- data/CONTRIBUTING.md +0 -85
- data/Gemfile +0 -7
- data/Rakefile +0 -722
- data/benchmarks/postgres_database.yml +0 -9
- data/benchmarks/sidekiq_test.rb +0 -154
- data/ddtrace.gemspec +0 -64
- data/docker-compose.yml +0 -335
- data/docs/DevelopmentGuide.md +0 -195
- data/docs/GettingStarted.md +0 -2142
- data/lib/ddtrace/analytics.rb +0 -36
- data/lib/ddtrace/augmentation/method_wrapper.rb +0 -20
- data/lib/ddtrace/augmentation/method_wrapping.rb +0 -38
- data/lib/ddtrace/augmentation/shim.rb +0 -102
- data/lib/ddtrace/augmentation.rb +0 -13
- data/lib/ddtrace/buffer.rb +0 -119
- data/lib/ddtrace/configuration/base.rb +0 -84
- data/lib/ddtrace/configuration/dependency_resolver.rb +0 -24
- data/lib/ddtrace/configuration/option.rb +0 -64
- data/lib/ddtrace/configuration/option_definition.rb +0 -123
- data/lib/ddtrace/configuration/option_definition_set.rb +0 -18
- data/lib/ddtrace/configuration/option_set.rb +0 -6
- data/lib/ddtrace/configuration/options.rb +0 -112
- data/lib/ddtrace/configuration/pin_setup.rb +0 -30
- data/lib/ddtrace/configuration/settings.rb +0 -187
- data/lib/ddtrace/configuration.rb +0 -30
- data/lib/ddtrace/context.rb +0 -305
- data/lib/ddtrace/context_flush.rb +0 -69
- data/lib/ddtrace/context_provider.rb +0 -50
- data/lib/ddtrace/contrib/action_cable/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/action_cable/event.rb +0 -65
- data/lib/ddtrace/contrib/action_cable/events/broadcast.rb +0 -49
- data/lib/ddtrace/contrib/action_cable/events/perform_action.rb +0 -55
- data/lib/ddtrace/contrib/action_cable/events/transmit.rb +0 -50
- data/lib/ddtrace/contrib/action_cable/events.rb +0 -33
- data/lib/ddtrace/contrib/action_cable/ext.rb +0 -23
- data/lib/ddtrace/contrib/action_cable/instrumentation.rb +0 -31
- data/lib/ddtrace/contrib/action_cable/integration.rb +0 -38
- data/lib/ddtrace/contrib/action_cable/patcher.rb +0 -27
- data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +0 -148
- data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +0 -25
- data/lib/ddtrace/contrib/action_pack/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/action_pack/ext.rb +0 -16
- data/lib/ddtrace/contrib/action_pack/integration.rb +0 -38
- data/lib/ddtrace/contrib/action_pack/patcher.rb +0 -23
- data/lib/ddtrace/contrib/action_pack/utils.rb +0 -36
- data/lib/ddtrace/contrib/action_view/configuration/settings.rb +0 -26
- data/lib/ddtrace/contrib/action_view/event.rb +0 -39
- data/lib/ddtrace/contrib/action_view/events/render_partial.rb +0 -45
- data/lib/ddtrace/contrib/action_view/events/render_template.rb +0 -48
- data/lib/ddtrace/contrib/action_view/events.rb +0 -30
- data/lib/ddtrace/contrib/action_view/ext.rb +0 -17
- data/lib/ddtrace/contrib/action_view/instrumentation/partial_renderer.rb +0 -74
- data/lib/ddtrace/contrib/action_view/instrumentation/template_renderer.rb +0 -167
- data/lib/ddtrace/contrib/action_view/integration.rb +0 -45
- data/lib/ddtrace/contrib/action_view/patcher.rb +0 -47
- data/lib/ddtrace/contrib/action_view/utils.rb +0 -32
- data/lib/ddtrace/contrib/active_model_serializers/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/active_model_serializers/event.rb +0 -68
- data/lib/ddtrace/contrib/active_model_serializers/events/render.rb +0 -32
- data/lib/ddtrace/contrib/active_model_serializers/events/serialize.rb +0 -35
- data/lib/ddtrace/contrib/active_model_serializers/events.rb +0 -30
- data/lib/ddtrace/contrib/active_model_serializers/ext.rb +0 -17
- data/lib/ddtrace/contrib/active_model_serializers/integration.rb +0 -40
- data/lib/ddtrace/contrib/active_model_serializers/patcher.rb +0 -29
- data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +0 -45
- data/lib/ddtrace/contrib/active_record/configuration/settings.rb +0 -30
- data/lib/ddtrace/contrib/active_record/event.rb +0 -30
- data/lib/ddtrace/contrib/active_record/events/instantiation.rb +0 -60
- data/lib/ddtrace/contrib/active_record/events/sql.rb +0 -64
- data/lib/ddtrace/contrib/active_record/events.rb +0 -30
- data/lib/ddtrace/contrib/active_record/ext.rb +0 -21
- data/lib/ddtrace/contrib/active_record/integration.rb +0 -46
- data/lib/ddtrace/contrib/active_record/patcher.rb +0 -23
- data/lib/ddtrace/contrib/active_record/utils.rb +0 -76
- data/lib/ddtrace/contrib/active_support/cache/instrumentation.rb +0 -157
- data/lib/ddtrace/contrib/active_support/cache/patcher.rb +0 -48
- data/lib/ddtrace/contrib/active_support/cache/redis.rb +0 -47
- data/lib/ddtrace/contrib/active_support/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/active_support/ext.rb +0 -21
- data/lib/ddtrace/contrib/active_support/integration.rb +0 -40
- data/lib/ddtrace/contrib/active_support/notifications/event.rb +0 -62
- data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +0 -66
- data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +0 -159
- data/lib/ddtrace/contrib/active_support/patcher.rb +0 -23
- data/lib/ddtrace/contrib/analytics.rb +0 -24
- data/lib/ddtrace/contrib/aws/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/aws/ext.rb +0 -20
- data/lib/ddtrace/contrib/aws/instrumentation.rb +0 -56
- data/lib/ddtrace/contrib/aws/integration.rb +0 -42
- data/lib/ddtrace/contrib/aws/parsed_context.rb +0 -56
- data/lib/ddtrace/contrib/aws/patcher.rb +0 -49
- data/lib/ddtrace/contrib/aws/services.rb +0 -115
- data/lib/ddtrace/contrib/concurrent_ruby/configuration/settings.rb +0 -15
- data/lib/ddtrace/contrib/concurrent_ruby/context_composite_executor_service.rb +0 -35
- data/lib/ddtrace/contrib/concurrent_ruby/ext.rb +0 -11
- data/lib/ddtrace/contrib/concurrent_ruby/future_patch.rb +0 -23
- data/lib/ddtrace/contrib/concurrent_ruby/integration.rb +0 -38
- data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +0 -28
- data/lib/ddtrace/contrib/configurable.rb +0 -76
- data/lib/ddtrace/contrib/configuration/resolver.rb +0 -16
- data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +0 -39
- data/lib/ddtrace/contrib/configuration/settings.rb +0 -35
- data/lib/ddtrace/contrib/dalli/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/dalli/ext.rb +0 -17
- data/lib/ddtrace/contrib/dalli/instrumentation.rb +0 -50
- data/lib/ddtrace/contrib/dalli/integration.rb +0 -38
- data/lib/ddtrace/contrib/dalli/patcher.rb +0 -67
- data/lib/ddtrace/contrib/dalli/quantize.rb +0 -22
- data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/delayed_job/ext.rb +0 -18
- data/lib/ddtrace/contrib/delayed_job/integration.rb +0 -38
- data/lib/ddtrace/contrib/delayed_job/patcher.rb +0 -28
- data/lib/ddtrace/contrib/delayed_job/plugin.rb +0 -61
- data/lib/ddtrace/contrib/elasticsearch/configuration/settings.rb +0 -26
- data/lib/ddtrace/contrib/elasticsearch/ext.rb +0 -19
- data/lib/ddtrace/contrib/elasticsearch/integration.rb +0 -39
- data/lib/ddtrace/contrib/elasticsearch/patcher.rb +0 -118
- data/lib/ddtrace/contrib/elasticsearch/quantize.rb +0 -80
- data/lib/ddtrace/contrib/ethon/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/ethon/easy_patch.rb +0 -148
- data/lib/ddtrace/contrib/ethon/ext.rb +0 -15
- data/lib/ddtrace/contrib/ethon/integration.rb +0 -43
- data/lib/ddtrace/contrib/ethon/multi_patch.rb +0 -80
- data/lib/ddtrace/contrib/ethon/patcher.rb +0 -25
- data/lib/ddtrace/contrib/excon/configuration/settings.rb +0 -28
- data/lib/ddtrace/contrib/excon/ext.rb +0 -14
- data/lib/ddtrace/contrib/excon/integration.rb +0 -43
- data/lib/ddtrace/contrib/excon/middleware.rb +0 -157
- data/lib/ddtrace/contrib/excon/patcher.rb +0 -27
- data/lib/ddtrace/contrib/extensions.rb +0 -59
- data/lib/ddtrace/contrib/faraday/configuration/settings.rb +0 -33
- data/lib/ddtrace/contrib/faraday/connection.rb +0 -18
- data/lib/ddtrace/contrib/faraday/ext.rb +0 -14
- data/lib/ddtrace/contrib/faraday/integration.rb +0 -43
- data/lib/ddtrace/contrib/faraday/middleware.rb +0 -81
- data/lib/ddtrace/contrib/faraday/patcher.rb +0 -81
- data/lib/ddtrace/contrib/faraday/rack_builder.rb +0 -18
- data/lib/ddtrace/contrib/grape/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/grape/endpoint.rb +0 -208
- data/lib/ddtrace/contrib/grape/ext.rb +0 -19
- data/lib/ddtrace/contrib/grape/instrumentation.rb +0 -33
- data/lib/ddtrace/contrib/grape/integration.rb +0 -39
- data/lib/ddtrace/contrib/grape/patcher.rb +0 -73
- data/lib/ddtrace/contrib/graphql/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/graphql/ext.rb +0 -13
- data/lib/ddtrace/contrib/graphql/integration.rb +0 -39
- data/lib/ddtrace/contrib/graphql/patcher.rb +0 -57
- data/lib/ddtrace/contrib/grpc/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/grpc/datadog_interceptor/client.rb +0 -56
- data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +0 -76
- data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +0 -74
- data/lib/ddtrace/contrib/grpc/ext.rb +0 -15
- data/lib/ddtrace/contrib/grpc/integration.rb +0 -38
- data/lib/ddtrace/contrib/grpc/intercept_with_datadog.rb +0 -49
- data/lib/ddtrace/contrib/grpc/patcher.rb +0 -72
- data/lib/ddtrace/contrib/http/circuit_breaker.rb +0 -63
- data/lib/ddtrace/contrib/http/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/http/ext.rb +0 -14
- data/lib/ddtrace/contrib/http/instrumentation.rb +0 -170
- data/lib/ddtrace/contrib/http/integration.rb +0 -45
- data/lib/ddtrace/contrib/http/patcher.rb +0 -26
- data/lib/ddtrace/contrib/http_annotation_helper.rb +0 -10
- data/lib/ddtrace/contrib/integration.rb +0 -16
- data/lib/ddtrace/contrib/mongodb/configuration/settings.rb +0 -28
- data/lib/ddtrace/contrib/mongodb/ext.rb +0 -20
- data/lib/ddtrace/contrib/mongodb/instrumentation.rb +0 -68
- data/lib/ddtrace/contrib/mongodb/integration.rb +0 -38
- data/lib/ddtrace/contrib/mongodb/parsers.rb +0 -68
- data/lib/ddtrace/contrib/mongodb/patcher.rb +0 -31
- data/lib/ddtrace/contrib/mongodb/subscribers.rb +0 -108
- data/lib/ddtrace/contrib/mysql2/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/mysql2/ext.rb +0 -15
- data/lib/ddtrace/contrib/mysql2/instrumentation.rb +0 -60
- data/lib/ddtrace/contrib/mysql2/integration.rb +0 -38
- data/lib/ddtrace/contrib/mysql2/patcher.rb +0 -27
- data/lib/ddtrace/contrib/patchable.rb +0 -59
- data/lib/ddtrace/contrib/patcher.rb +0 -56
- data/lib/ddtrace/contrib/presto/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/presto/ext.rb +0 -25
- data/lib/ddtrace/contrib/presto/instrumentation.rb +0 -107
- data/lib/ddtrace/contrib/presto/integration.rb +0 -38
- data/lib/ddtrace/contrib/presto/patcher.rb +0 -30
- data/lib/ddtrace/contrib/racecar/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/racecar/event.rb +0 -71
- data/lib/ddtrace/contrib/racecar/events/batch.rb +0 -27
- data/lib/ddtrace/contrib/racecar/events/message.rb +0 -27
- data/lib/ddtrace/contrib/racecar/events.rb +0 -30
- data/lib/ddtrace/contrib/racecar/ext.rb +0 -21
- data/lib/ddtrace/contrib/racecar/integration.rb +0 -39
- data/lib/ddtrace/contrib/racecar/patcher.rb +0 -26
- data/lib/ddtrace/contrib/rack/configuration/settings.rb +0 -41
- data/lib/ddtrace/contrib/rack/ext.rb +0 -18
- data/lib/ddtrace/contrib/rack/integration.rb +0 -38
- data/lib/ddtrace/contrib/rack/middlewares.rb +0 -287
- data/lib/ddtrace/contrib/rack/patcher.rb +0 -107
- data/lib/ddtrace/contrib/rack/request_queue.rb +0 -39
- data/lib/ddtrace/contrib/rails/configuration/settings.rb +0 -81
- data/lib/ddtrace/contrib/rails/ext.rb +0 -13
- data/lib/ddtrace/contrib/rails/framework.rb +0 -125
- data/lib/ddtrace/contrib/rails/integration.rb +0 -44
- data/lib/ddtrace/contrib/rails/middlewares.rb +0 -38
- data/lib/ddtrace/contrib/rails/patcher.rb +0 -74
- data/lib/ddtrace/contrib/rails/railtie.rb +0 -17
- data/lib/ddtrace/contrib/rails/utils.rb +0 -20
- data/lib/ddtrace/contrib/rake/configuration/settings.rb +0 -27
- data/lib/ddtrace/contrib/rake/ext.rb +0 -18
- data/lib/ddtrace/contrib/rake/instrumentation.rb +0 -88
- data/lib/ddtrace/contrib/rake/integration.rb +0 -38
- data/lib/ddtrace/contrib/rake/patcher.rb +0 -30
- data/lib/ddtrace/contrib/redis/configuration/resolver.rb +0 -36
- data/lib/ddtrace/contrib/redis/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/redis/ext.rb +0 -18
- data/lib/ddtrace/contrib/redis/integration.rb +0 -42
- data/lib/ddtrace/contrib/redis/patcher.rb +0 -97
- data/lib/ddtrace/contrib/redis/quantize.rb +0 -47
- data/lib/ddtrace/contrib/redis/tags.rb +0 -38
- data/lib/ddtrace/contrib/redis/vendor/resolver.rb +0 -159
- data/lib/ddtrace/contrib/registerable.rb +0 -33
- data/lib/ddtrace/contrib/registry.rb +0 -42
- data/lib/ddtrace/contrib/resque/configuration/settings.rb +0 -26
- data/lib/ddtrace/contrib/resque/ext.rb +0 -14
- data/lib/ddtrace/contrib/resque/integration.rb +0 -47
- data/lib/ddtrace/contrib/resque/patcher.rb +0 -29
- data/lib/ddtrace/contrib/resque/resque_job.rb +0 -80
- data/lib/ddtrace/contrib/rest_client/configuration/settings.rb +0 -26
- data/lib/ddtrace/contrib/rest_client/ext.rb +0 -14
- data/lib/ddtrace/contrib/rest_client/integration.rb +0 -38
- data/lib/ddtrace/contrib/rest_client/patcher.rb +0 -23
- data/lib/ddtrace/contrib/rest_client/request_patch.rb +0 -89
- data/lib/ddtrace/contrib/sequel/configuration/settings.rb +0 -23
- data/lib/ddtrace/contrib/sequel/database.rb +0 -61
- data/lib/ddtrace/contrib/sequel/dataset.rb +0 -62
- data/lib/ddtrace/contrib/sequel/ext.rb +0 -15
- data/lib/ddtrace/contrib/sequel/integration.rb +0 -38
- data/lib/ddtrace/contrib/sequel/patcher.rb +0 -33
- data/lib/ddtrace/contrib/sequel/utils.rb +0 -46
- data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +0 -24
- data/lib/ddtrace/contrib/shoryuken/ext.rb +0 -18
- data/lib/ddtrace/contrib/shoryuken/integration.rb +0 -39
- data/lib/ddtrace/contrib/shoryuken/patcher.rb +0 -24
- data/lib/ddtrace/contrib/shoryuken/tracer.rb +0 -49
- data/lib/ddtrace/contrib/sidekiq/client_tracer.rb +0 -43
- data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +0 -31
- data/lib/ddtrace/contrib/sidekiq/ext.rb +0 -23
- data/lib/ddtrace/contrib/sidekiq/integration.rb +0 -38
- data/lib/ddtrace/contrib/sidekiq/patcher.rb +0 -34
- data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +0 -66
- data/lib/ddtrace/contrib/sidekiq/tracing.rb +0 -45
- data/lib/ddtrace/contrib/sinatra/configuration/settings.rb +0 -34
- data/lib/ddtrace/contrib/sinatra/env.rb +0 -38
- data/lib/ddtrace/contrib/sinatra/ext.rb +0 -18
- data/lib/ddtrace/contrib/sinatra/headers.rb +0 -31
- data/lib/ddtrace/contrib/sinatra/integration.rb +0 -38
- data/lib/ddtrace/contrib/sinatra/patcher.rb +0 -27
- data/lib/ddtrace/contrib/sinatra/tracer.rb +0 -87
- data/lib/ddtrace/contrib/sinatra/tracer_middleware.rb +0 -75
- data/lib/ddtrace/contrib/sucker_punch/configuration/settings.rb +0 -25
- data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +0 -26
- data/lib/ddtrace/contrib/sucker_punch/ext.rb +0 -18
- data/lib/ddtrace/contrib/sucker_punch/instrumentation.rb +0 -84
- data/lib/ddtrace/contrib/sucker_punch/integration.rb +0 -38
- data/lib/ddtrace/contrib/sucker_punch/patcher.rb +0 -42
- data/lib/ddtrace/correlation.rb +0 -35
- data/lib/ddtrace/diagnostics/health.rb +0 -37
- data/lib/ddtrace/distributed_tracing/headers/b3.rb +0 -44
- data/lib/ddtrace/distributed_tracing/headers/b3_single.rb +0 -56
- data/lib/ddtrace/distributed_tracing/headers/datadog.rb +0 -42
- data/lib/ddtrace/distributed_tracing/headers/headers.rb +0 -70
- data/lib/ddtrace/distributed_tracing/headers/helpers.rb +0 -45
- data/lib/ddtrace/encoding.rb +0 -95
- data/lib/ddtrace/environment.rb +0 -27
- data/lib/ddtrace/error.rb +0 -27
- data/lib/ddtrace/event.rb +0 -52
- data/lib/ddtrace/ext/analytics.rb +0 -12
- data/lib/ddtrace/ext/app_types.rb +0 -11
- data/lib/ddtrace/ext/correlation.rb +0 -10
- data/lib/ddtrace/ext/diagnostics.rb +0 -31
- data/lib/ddtrace/ext/distributed.rb +0 -33
- data/lib/ddtrace/ext/environment.rb +0 -13
- data/lib/ddtrace/ext/errors.rb +0 -10
- data/lib/ddtrace/ext/forced_tracing.rb +0 -25
- data/lib/ddtrace/ext/http.rb +0 -46
- data/lib/ddtrace/ext/manual_tracing.rb +0 -9
- data/lib/ddtrace/ext/metrics.rb +0 -15
- data/lib/ddtrace/ext/net.rb +0 -10
- data/lib/ddtrace/ext/priority.rb +0 -16
- data/lib/ddtrace/ext/runtime.rb +0 -26
- data/lib/ddtrace/ext/sampling.rb +0 -16
- data/lib/ddtrace/ext/sql.rb +0 -8
- data/lib/ddtrace/ext/transport.rb +0 -17
- data/lib/ddtrace/forced_tracing.rb +0 -36
- data/lib/ddtrace/logger.rb +0 -81
- data/lib/ddtrace/metrics.rb +0 -222
- data/lib/ddtrace/monkey.rb +0 -58
- data/lib/ddtrace/opentelemetry/extensions.rb +0 -13
- data/lib/ddtrace/opentelemetry/span.rb +0 -33
- data/lib/ddtrace/opentracer/binary_propagator.rb +0 -24
- data/lib/ddtrace/opentracer/carrier.rb +0 -6
- data/lib/ddtrace/opentracer/distributed_headers.rb +0 -52
- data/lib/ddtrace/opentracer/global_tracer.rb +0 -15
- data/lib/ddtrace/opentracer/propagator.rb +0 -22
- data/lib/ddtrace/opentracer/rack_propagator.rb +0 -60
- data/lib/ddtrace/opentracer/scope.rb +0 -15
- data/lib/ddtrace/opentracer/scope_manager.rb +0 -6
- data/lib/ddtrace/opentracer/span.rb +0 -98
- data/lib/ddtrace/opentracer/span_context.rb +0 -14
- data/lib/ddtrace/opentracer/span_context_factory.rb +0 -23
- data/lib/ddtrace/opentracer/text_map_propagator.rb +0 -75
- data/lib/ddtrace/opentracer/thread_local_scope.rb +0 -30
- data/lib/ddtrace/opentracer/thread_local_scope_manager.rb +0 -40
- data/lib/ddtrace/opentracer/tracer.rb +0 -208
- data/lib/ddtrace/opentracer.rb +0 -40
- data/lib/ddtrace/patcher.rb +0 -47
- data/lib/ddtrace/pin.rb +0 -114
- data/lib/ddtrace/pipeline/span_filter.rb +0 -38
- data/lib/ddtrace/pipeline/span_processor.rb +0 -20
- data/lib/ddtrace/pipeline.rb +0 -46
- data/lib/ddtrace/propagation/grpc_propagator.rb +0 -61
- data/lib/ddtrace/propagation/http_propagator.rb +0 -75
- data/lib/ddtrace/quantization/hash.rb +0 -103
- data/lib/ddtrace/quantization/http.rb +0 -86
- data/lib/ddtrace/runtime/cgroup.rb +0 -44
- data/lib/ddtrace/runtime/class_count.rb +0 -17
- data/lib/ddtrace/runtime/container.rb +0 -73
- data/lib/ddtrace/runtime/gc.rb +0 -16
- data/lib/ddtrace/runtime/identity.rb +0 -41
- data/lib/ddtrace/runtime/metrics.rb +0 -93
- data/lib/ddtrace/runtime/object_space.rb +0 -19
- data/lib/ddtrace/runtime/socket.rb +0 -14
- data/lib/ddtrace/runtime/thread_count.rb +0 -16
- data/lib/ddtrace/sampler.rb +0 -290
- data/lib/ddtrace/sampling/matcher.rb +0 -57
- data/lib/ddtrace/sampling/rate_limiter.rb +0 -127
- data/lib/ddtrace/sampling/rule.rb +0 -61
- data/lib/ddtrace/sampling/rule_sampler.rb +0 -125
- data/lib/ddtrace/sampling.rb +0 -2
- data/lib/ddtrace/span.rb +0 -297
- data/lib/ddtrace/sync_writer.rb +0 -72
- data/lib/ddtrace/tracer.rb +0 -437
- data/lib/ddtrace/transport/http/adapters/net.rb +0 -112
- data/lib/ddtrace/transport/http/adapters/registry.rb +0 -24
- data/lib/ddtrace/transport/http/adapters/test.rb +0 -77
- data/lib/ddtrace/transport/http/adapters/unix_socket.rb +0 -64
- data/lib/ddtrace/transport/http/api/endpoint.rb +0 -27
- data/lib/ddtrace/transport/http/api/fallbacks.rb +0 -22
- data/lib/ddtrace/transport/http/api/instance.rb +0 -29
- data/lib/ddtrace/transport/http/api/map.rb +0 -14
- data/lib/ddtrace/transport/http/api/spec.rb +0 -15
- data/lib/ddtrace/transport/http/api.rb +0 -46
- data/lib/ddtrace/transport/http/builder.rb +0 -165
- data/lib/ddtrace/transport/http/client.rb +0 -107
- data/lib/ddtrace/transport/http/env.rb +0 -48
- data/lib/ddtrace/transport/http/response.rb +0 -26
- data/lib/ddtrace/transport/http/statistics.rb +0 -30
- data/lib/ddtrace/transport/http/traces.rb +0 -140
- data/lib/ddtrace/transport/http.rb +0 -91
- data/lib/ddtrace/transport/io/client.rb +0 -76
- data/lib/ddtrace/transport/io/response.rb +0 -23
- data/lib/ddtrace/transport/io/traces.rb +0 -44
- data/lib/ddtrace/transport/io.rb +0 -26
- data/lib/ddtrace/transport/parcel.rb +0 -17
- data/lib/ddtrace/transport/request.rb +0 -13
- data/lib/ddtrace/transport/response.rb +0 -49
- data/lib/ddtrace/transport/statistics.rb +0 -72
- data/lib/ddtrace/transport/traces.rb +0 -33
- data/lib/ddtrace/utils/database.rb +0 -25
- data/lib/ddtrace/utils/time.rb +0 -14
- data/lib/ddtrace/utils.rb +0 -65
- data/lib/ddtrace/vendor/active_record/connection_specification.rb +0 -301
- data/lib/ddtrace/worker.rb +0 -20
- data/lib/ddtrace/workers/async.rb +0 -165
- data/lib/ddtrace/workers/loop.rb +0 -105
- data/lib/ddtrace/workers/polling.rb +0 -48
- data/lib/ddtrace/workers/queue.rb +0 -39
- data/lib/ddtrace/workers.rb +0 -125
- data/lib/ddtrace/writer.rb +0 -161
- data/tasks/release_gem.rake +0 -28
@@ -0,0 +1,166 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <datadog/profiling.h>
|
4
|
+
#include <ruby.h>
|
5
|
+
|
6
|
+
// A heap recorder keeps track of a collection of live heap objects.
|
7
|
+
//
|
8
|
+
// All allocations observed by this recorder for which a corresponding free was
|
9
|
+
// not yet observed are deemed as alive and can be iterated on to produce a
|
10
|
+
// live heap profile.
|
11
|
+
//
|
12
|
+
// NOTE: All public APIs of heap_recorder support receiving a NULL heap_recorder
|
13
|
+
// in which case the behaviour will be a noop.
|
14
|
+
//
|
15
|
+
// WARN: Unless otherwise stated the heap recorder APIs assume calls are done
|
16
|
+
// under the GVL.
|
17
|
+
typedef struct heap_recorder heap_recorder;
|
18
|
+
|
19
|
+
// Extra data associated with each live object being tracked.
|
20
|
+
typedef struct live_object_data {
|
21
|
+
// The weight of this object from a sampling perspective.
|
22
|
+
//
|
23
|
+
// A notion of weight is preserved for each tracked object to allow for an approximate
|
24
|
+
// extrapolation to an unsampled view.
|
25
|
+
//
|
26
|
+
// Example: If we were sampling every 50 objects, then each sampled object
|
27
|
+
// could be seen as being representative of 50 objects.
|
28
|
+
unsigned int weight;
|
29
|
+
|
30
|
+
// Size of this object in memory.
|
31
|
+
// NOTE: This only gets updated during heap_recorder_prepare_iteration and only
|
32
|
+
// for those objects that meet the minimum iteration age requirements.
|
33
|
+
size_t size;
|
34
|
+
|
35
|
+
// The class of the object that we're tracking.
|
36
|
+
// NOTE: This is optional and will be set to NULL if not set.
|
37
|
+
char* class;
|
38
|
+
|
39
|
+
// The GC allocation gen in which we saw this object being allocated.
|
40
|
+
//
|
41
|
+
// This enables us to calculate the age of this object in terms of GC executions.
|
42
|
+
size_t alloc_gen;
|
43
|
+
|
44
|
+
// The age of this object in terms of GC generations.
|
45
|
+
// NOTE: This only gets updated during heap_recorder_prepare_iteration
|
46
|
+
size_t gen_age;
|
47
|
+
|
48
|
+
// Whether this object was previously seen as being frozen. If this is the case,
|
49
|
+
// we'll skip any further size updates since frozen objects are supposed to be
|
50
|
+
// immutable.
|
51
|
+
bool is_frozen;
|
52
|
+
} live_object_data;
|
53
|
+
|
54
|
+
// Data that is made available to iterators of heap recorder data for each live object
|
55
|
+
// tracked therein.
|
56
|
+
typedef struct {
|
57
|
+
ddog_prof_Slice_Location locations;
|
58
|
+
live_object_data object_data;
|
59
|
+
} heap_recorder_iteration_data;
|
60
|
+
|
61
|
+
// Initialize a new heap recorder.
|
62
|
+
heap_recorder* heap_recorder_new(void);
|
63
|
+
|
64
|
+
// Free a previously initialized heap recorder.
|
65
|
+
void heap_recorder_free(heap_recorder *heap_recorder);
|
66
|
+
|
67
|
+
// Sets whether this heap recorder should keep track of sizes or not.
|
68
|
+
//
|
69
|
+
// If set to true, the heap recorder will attempt to determine the approximate sizes of
|
70
|
+
// tracked objects and wield them during iteration.
|
71
|
+
// If set to false, sizes returned during iteration should not be used/relied on (they
|
72
|
+
// may be 0 or the last determined size before disabling the tracking of sizes).
|
73
|
+
//
|
74
|
+
// NOTE: Default is true, i.e., it will attempt to determine approximate sizes of tracked
|
75
|
+
// objects.
|
76
|
+
void heap_recorder_set_size_enabled(heap_recorder *heap_recorder, bool size_enabled);
|
77
|
+
|
78
|
+
// Set sample rate used by this heap recorder.
|
79
|
+
//
|
80
|
+
// Controls how many recordings will be ignored before committing a heap allocation and
|
81
|
+
// the weight of the committed heap allocation.
|
82
|
+
//
|
83
|
+
// A value of 1 will effectively track all objects that are passed through
|
84
|
+
// start/end_heap_allocation_recording pairs. A value of 10 will only track every 10th
|
85
|
+
// object passed through such calls and its effective weight for the purposes of heap
|
86
|
+
// profiling will be multiplied by 10.
|
87
|
+
//
|
88
|
+
// NOTE: Default is 1, i.e., track all heap allocation recordings.
|
89
|
+
//
|
90
|
+
// WARN: Non-positive values will lead to an exception being thrown.
|
91
|
+
void heap_recorder_set_sample_rate(heap_recorder *heap_recorder, int sample_rate);
|
92
|
+
|
93
|
+
// Do any cleanup needed after forking.
|
94
|
+
// WARN: Assumes this gets called before profiler is reinitialized on the fork
|
95
|
+
void heap_recorder_after_fork(heap_recorder *heap_recorder);
|
96
|
+
|
97
|
+
// Start a heap allocation recording on the heap recorder for a new object.
|
98
|
+
//
|
99
|
+
// This heap allocation recording needs to be ended via ::end_heap_allocation_recording
|
100
|
+
// before it will become fully committed and able to be iterated on.
|
101
|
+
//
|
102
|
+
// @param new_obj
|
103
|
+
// The newly allocated Ruby object/value.
|
104
|
+
// @param weight
|
105
|
+
// The sampling weight of this object.
|
106
|
+
//
|
107
|
+
// WARN: It needs to be paired with a ::end_heap_allocation_recording call.
|
108
|
+
void start_heap_allocation_recording(heap_recorder *heap_recorder, VALUE new_obj, unsigned int weight, ddog_CharSlice *alloc_class);
|
109
|
+
|
110
|
+
// End a previously started heap allocation recording on the heap recorder.
|
111
|
+
//
|
112
|
+
// It is at this point that an allocated object will become fully tracked and able to be iterated on.
|
113
|
+
//
|
114
|
+
// @param locations The stacktrace representing the location of the allocation.
|
115
|
+
//
|
116
|
+
// WARN: It is illegal to call this without previously having called ::start_heap_allocation_recording.
|
117
|
+
void end_heap_allocation_recording(heap_recorder *heap_recorder, ddog_prof_Slice_Location locations);
|
118
|
+
|
119
|
+
// Update the heap recorder to reflect the latest state of the VM and prepare internal structures
|
120
|
+
// for efficient iteration.
|
121
|
+
//
|
122
|
+
// WARN: This must be called strictly before iteration. Failing to do so will result in exceptions.
|
123
|
+
void heap_recorder_prepare_iteration(heap_recorder *heap_recorder);
|
124
|
+
|
125
|
+
// Optimize the heap recorder by cleaning up any data that might have been prepared specifically
|
126
|
+
// for the purpose of iterating over the heap recorder data.
|
127
|
+
//
|
128
|
+
// WARN: This must be called strictly after iteration to ensure proper cleanup and to keep the memory
|
129
|
+
// profile of the heap recorder low.
|
130
|
+
void heap_recorder_finish_iteration(heap_recorder *heap_recorder);
|
131
|
+
|
132
|
+
// Iterate over each live object being tracked by the heap recorder.
|
133
|
+
//
|
134
|
+
// NOTE: Iteration can be called without holding the Ruby Global VM lock.
|
135
|
+
// WARN: This must be called strictly after heap_recorder_prepare_iteration and before
|
136
|
+
// heap_recorder_finish_iteration.
|
137
|
+
//
|
138
|
+
// @param for_each_callback
|
139
|
+
// A callback function that shall be called for each live object being tracked
|
140
|
+
// by the heap recorder. Alongside the iteration_data for each live object,
|
141
|
+
// a second argument will be forwarded with the contents of the optional
|
142
|
+
// for_each_callback_extra_arg. Iteration will continue until the callback
|
143
|
+
// returns false or we run out of objects.
|
144
|
+
// @param for_each_callback_extra_arg
|
145
|
+
// Optional (NULL if empty) extra data that should be passed to the
|
146
|
+
// callback function alongside the data for each live tracked object.
|
147
|
+
// @return true if iteration ran, false if something prevented it from running.
|
148
|
+
bool heap_recorder_for_each_live_object(
|
149
|
+
heap_recorder *heap_recorder,
|
150
|
+
bool (*for_each_callback)(heap_recorder_iteration_data data, void* extra_arg),
|
151
|
+
void *for_each_callback_extra_arg);
|
152
|
+
|
153
|
+
// Return a Ruby hash containing a snapshot of this recorder's interesting state at calling time.
|
154
|
+
// WARN: This allocates in the Ruby VM and therefore should not be called without the
|
155
|
+
// VM lock or during GC.
|
156
|
+
VALUE heap_recorder_state_snapshot(heap_recorder *heap_recorder);
|
157
|
+
|
158
|
+
// v--- TEST-ONLY APIs ---v
|
159
|
+
|
160
|
+
// Assert internal hashing logic is valid for the provided locations and its
|
161
|
+
// corresponding internal representations in heap recorder.
|
162
|
+
void heap_recorder_testonly_assert_hash_matches(ddog_prof_Slice_Location locations);
|
163
|
+
|
164
|
+
// Returns a Ruby string with a representation of internal data helpful to
|
165
|
+
// troubleshoot issues such as unexpected test failures.
|
166
|
+
VALUE heap_recorder_testonly_debug(heap_recorder *heap_recorder);
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <stdint.h>
|
4
|
+
|
5
|
+
// Used to mark symbols to be exported to the outside of the extension.
|
6
|
+
// Consider very carefully before tagging a function with this.
|
7
|
+
#define DDTRACE_EXPORT __attribute__ ((visibility ("default")))
|
8
|
+
|
9
|
+
// Used to mark function arguments that are deliberately left unused
|
10
|
+
#ifdef __GNUC__
|
11
|
+
#define DDTRACE_UNUSED __attribute__((unused))
|
12
|
+
#else
|
13
|
+
#define DDTRACE_UNUSED
|
14
|
+
#endif
|
15
|
+
|
16
|
+
// @ivoanjo: After trying to read through https://stackoverflow.com/questions/3437404/min-and-max-in-c I decided I
|
17
|
+
// don't like C and I just implemented this as a function.
|
18
|
+
inline static uint64_t uint64_max_of(uint64_t a, uint64_t b) { return a > b ? a : b; }
|
19
|
+
inline static uint64_t uint64_min_of(uint64_t a, uint64_t b) { return a > b ? b : a; }
|
20
|
+
inline static long long_max_of(long a, long b) { return a > b ? a : b; }
|
21
|
+
inline static long long_min_of(long a, long b) { return a > b ? b : a; }
|
22
|
+
inline static double double_max_of(double a, double b) { return a > b ? a : b; }
|
23
|
+
inline static double double_min_of(double a, double b) { return a > b ? b : a; }
|
@@ -0,0 +1,375 @@
|
|
1
|
+
#include <ruby.h>
|
2
|
+
#include <ruby/thread.h>
|
3
|
+
#include <datadog/profiling.h>
|
4
|
+
#include "helpers.h"
|
5
|
+
#include "libdatadog_helpers.h"
|
6
|
+
#include "ruby_helpers.h"
|
7
|
+
|
8
|
+
// Used to report profiling data to Datadog.
|
9
|
+
// This file implements the native bits of the Datadog::Profiling::HttpTransport class
|
10
|
+
|
11
|
+
static VALUE ok_symbol = Qnil; // :ok in Ruby
|
12
|
+
static VALUE error_symbol = Qnil; // :error in Ruby
|
13
|
+
|
14
|
+
static ID agentless_id; // id of :agentless in Ruby
|
15
|
+
static ID agent_id; // id of :agent in Ruby
|
16
|
+
|
17
|
+
static ID log_failure_to_process_tag_id; // id of :log_failure_to_process_tag in Ruby
|
18
|
+
|
19
|
+
static VALUE library_version_string = Qnil;
|
20
|
+
|
21
|
+
struct call_exporter_without_gvl_arguments {
|
22
|
+
ddog_prof_Exporter *exporter;
|
23
|
+
ddog_prof_Exporter_Request_BuildResult *build_result;
|
24
|
+
ddog_CancellationToken *cancel_token;
|
25
|
+
ddog_prof_Exporter_SendResult result;
|
26
|
+
bool send_ran;
|
27
|
+
};
|
28
|
+
|
29
|
+
inline static ddog_ByteSlice byte_slice_from_ruby_string(VALUE string);
|
30
|
+
static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration);
|
31
|
+
static ddog_prof_Exporter_NewResult create_exporter(VALUE exporter_configuration, VALUE tags_as_array);
|
32
|
+
static VALUE handle_exporter_failure(ddog_prof_Exporter_NewResult exporter_result);
|
33
|
+
static ddog_prof_Endpoint endpoint_from(VALUE exporter_configuration);
|
34
|
+
static ddog_Vec_Tag convert_tags(VALUE tags_as_array);
|
35
|
+
static void safely_log_failure_to_process_tag(ddog_Vec_Tag tags, VALUE err_details);
|
36
|
+
static VALUE _native_do_export(
|
37
|
+
VALUE self,
|
38
|
+
VALUE exporter_configuration,
|
39
|
+
VALUE upload_timeout_milliseconds,
|
40
|
+
VALUE start_timespec_seconds,
|
41
|
+
VALUE start_timespec_nanoseconds,
|
42
|
+
VALUE finish_timespec_seconds,
|
43
|
+
VALUE finish_timespec_nanoseconds,
|
44
|
+
VALUE pprof_file_name,
|
45
|
+
VALUE pprof_data,
|
46
|
+
VALUE code_provenance_file_name,
|
47
|
+
VALUE code_provenance_data,
|
48
|
+
VALUE tags_as_array,
|
49
|
+
VALUE internal_metadata_json,
|
50
|
+
VALUE info_json
|
51
|
+
);
|
52
|
+
static void *call_exporter_without_gvl(void *call_args);
|
53
|
+
static void interrupt_exporter_call(void *cancel_token);
|
54
|
+
|
55
|
+
void http_transport_init(VALUE profiling_module) {
|
56
|
+
VALUE http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject);
|
57
|
+
|
58
|
+
rb_define_singleton_method(http_transport_class, "_native_validate_exporter", _native_validate_exporter, 1);
|
59
|
+
rb_define_singleton_method(http_transport_class, "_native_do_export", _native_do_export, 13);
|
60
|
+
|
61
|
+
ok_symbol = ID2SYM(rb_intern_const("ok"));
|
62
|
+
error_symbol = ID2SYM(rb_intern_const("error"));
|
63
|
+
agentless_id = rb_intern_const("agentless");
|
64
|
+
agent_id = rb_intern_const("agent");
|
65
|
+
log_failure_to_process_tag_id = rb_intern_const("log_failure_to_process_tag");
|
66
|
+
|
67
|
+
library_version_string = ddtrace_version();
|
68
|
+
rb_global_variable(&library_version_string);
|
69
|
+
}
|
70
|
+
|
71
|
+
inline static ddog_ByteSlice byte_slice_from_ruby_string(VALUE string) {
|
72
|
+
ENFORCE_TYPE(string, T_STRING);
|
73
|
+
ddog_ByteSlice byte_slice = {.ptr = (uint8_t *) StringValuePtr(string), .len = RSTRING_LEN(string)};
|
74
|
+
return byte_slice;
|
75
|
+
}
|
76
|
+
|
77
|
+
static VALUE _native_validate_exporter(DDTRACE_UNUSED VALUE _self, VALUE exporter_configuration) {
|
78
|
+
ENFORCE_TYPE(exporter_configuration, T_ARRAY);
|
79
|
+
ddog_prof_Exporter_NewResult exporter_result = create_exporter(exporter_configuration, rb_ary_new());
|
80
|
+
|
81
|
+
VALUE failure_tuple = handle_exporter_failure(exporter_result);
|
82
|
+
if (!NIL_P(failure_tuple)) return failure_tuple;
|
83
|
+
|
84
|
+
// We don't actually need the exporter for now -- we just wanted to validate that we could create it with the
|
85
|
+
// settings we were given
|
86
|
+
ddog_prof_Exporter_drop(exporter_result.ok);
|
87
|
+
|
88
|
+
return rb_ary_new_from_args(2, ok_symbol, Qnil);
|
89
|
+
}
|
90
|
+
|
91
|
+
static ddog_prof_Exporter_NewResult create_exporter(VALUE exporter_configuration, VALUE tags_as_array) {
|
92
|
+
ENFORCE_TYPE(exporter_configuration, T_ARRAY);
|
93
|
+
ENFORCE_TYPE(tags_as_array, T_ARRAY);
|
94
|
+
|
95
|
+
// This needs to be called BEFORE convert_tags since it can raise an exception and thus cause the ddog_Vec_Tag
|
96
|
+
// to be leaked.
|
97
|
+
ddog_prof_Endpoint endpoint = endpoint_from(exporter_configuration);
|
98
|
+
|
99
|
+
ddog_Vec_Tag tags = convert_tags(tags_as_array);
|
100
|
+
|
101
|
+
ddog_CharSlice library_name = DDOG_CHARSLICE_C("dd-trace-rb");
|
102
|
+
ddog_CharSlice library_version = char_slice_from_ruby_string(library_version_string);
|
103
|
+
ddog_CharSlice profiling_family = DDOG_CHARSLICE_C("ruby");
|
104
|
+
|
105
|
+
ddog_prof_Exporter_NewResult exporter_result =
|
106
|
+
ddog_prof_Exporter_new(library_name, library_version, profiling_family, &tags, endpoint);
|
107
|
+
|
108
|
+
ddog_Vec_Tag_drop(tags);
|
109
|
+
|
110
|
+
return exporter_result;
|
111
|
+
}
|
112
|
+
|
113
|
+
static VALUE handle_exporter_failure(ddog_prof_Exporter_NewResult exporter_result) {
|
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));
|
117
|
+
}
|
118
|
+
|
119
|
+
static ddog_prof_Endpoint endpoint_from(VALUE exporter_configuration) {
|
120
|
+
ENFORCE_TYPE(exporter_configuration, T_ARRAY);
|
121
|
+
|
122
|
+
ID working_mode = SYM2ID(rb_ary_entry(exporter_configuration, 0)); // SYM2ID verifies its input so we can do this safely
|
123
|
+
|
124
|
+
if (working_mode != agentless_id && working_mode != agent_id) {
|
125
|
+
rb_raise(rb_eArgError, "Failed to initialize transport: Unexpected working mode, expected :agentless or :agent");
|
126
|
+
}
|
127
|
+
|
128
|
+
if (working_mode == agentless_id) {
|
129
|
+
VALUE site = rb_ary_entry(exporter_configuration, 1);
|
130
|
+
VALUE api_key = rb_ary_entry(exporter_configuration, 2);
|
131
|
+
ENFORCE_TYPE(site, T_STRING);
|
132
|
+
ENFORCE_TYPE(api_key, T_STRING);
|
133
|
+
|
134
|
+
return ddog_prof_Endpoint_agentless(char_slice_from_ruby_string(site), char_slice_from_ruby_string(api_key));
|
135
|
+
} else { // agent_id
|
136
|
+
VALUE base_url = rb_ary_entry(exporter_configuration, 1);
|
137
|
+
ENFORCE_TYPE(base_url, T_STRING);
|
138
|
+
|
139
|
+
return ddog_prof_Endpoint_agent(char_slice_from_ruby_string(base_url));
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
__attribute__((warn_unused_result))
|
144
|
+
static ddog_Vec_Tag convert_tags(VALUE tags_as_array) {
|
145
|
+
ENFORCE_TYPE(tags_as_array, T_ARRAY);
|
146
|
+
|
147
|
+
long tags_count = RARRAY_LEN(tags_as_array);
|
148
|
+
ddog_Vec_Tag tags = ddog_Vec_Tag_new();
|
149
|
+
|
150
|
+
for (long i = 0; i < tags_count; i++) {
|
151
|
+
VALUE name_value_pair = rb_ary_entry(tags_as_array, i);
|
152
|
+
|
153
|
+
if (!RB_TYPE_P(name_value_pair, T_ARRAY)) {
|
154
|
+
ddog_Vec_Tag_drop(tags);
|
155
|
+
ENFORCE_TYPE(name_value_pair, T_ARRAY);
|
156
|
+
}
|
157
|
+
|
158
|
+
// Note: We can index the array without checking its size first because rb_ary_entry returns Qnil if out of bounds
|
159
|
+
VALUE tag_name = rb_ary_entry(name_value_pair, 0);
|
160
|
+
VALUE tag_value = rb_ary_entry(name_value_pair, 1);
|
161
|
+
|
162
|
+
if (!(RB_TYPE_P(tag_name, T_STRING) && RB_TYPE_P(tag_value, T_STRING))) {
|
163
|
+
ddog_Vec_Tag_drop(tags);
|
164
|
+
ENFORCE_TYPE(tag_name, T_STRING);
|
165
|
+
ENFORCE_TYPE(tag_value, T_STRING);
|
166
|
+
}
|
167
|
+
|
168
|
+
ddog_Vec_Tag_PushResult push_result =
|
169
|
+
ddog_Vec_Tag_push(&tags, char_slice_from_ruby_string(tag_name), char_slice_from_ruby_string(tag_value));
|
170
|
+
|
171
|
+
if (push_result.tag == DDOG_VEC_TAG_PUSH_RESULT_ERR) {
|
172
|
+
// libdatadog validates tags and may catch invalid tags that ddtrace didn't actually catch.
|
173
|
+
// We warn users about such tags, and then just ignore them.
|
174
|
+
safely_log_failure_to_process_tag(tags, get_error_details_and_drop(&push_result.err));
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
return tags;
|
179
|
+
}
|
180
|
+
|
181
|
+
static VALUE log_failure_to_process_tag(VALUE err_details) {
|
182
|
+
VALUE datadog_module = rb_const_get(rb_cObject, rb_intern("Datadog"));
|
183
|
+
VALUE profiling_module = rb_const_get(datadog_module, rb_intern("Profiling"));
|
184
|
+
VALUE http_transport_class = rb_const_get(profiling_module, rb_intern("HttpTransport"));
|
185
|
+
|
186
|
+
return rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, err_details);
|
187
|
+
}
|
188
|
+
|
189
|
+
// Since we are calling into Ruby code, it may raise an exception. This method ensure that dynamically-allocated tags
|
190
|
+
// get cleaned before propagating the exception.
|
191
|
+
static void safely_log_failure_to_process_tag(ddog_Vec_Tag tags, VALUE err_details) {
|
192
|
+
int exception_state;
|
193
|
+
rb_protect(log_failure_to_process_tag, err_details, &exception_state);
|
194
|
+
|
195
|
+
if (exception_state) { // An exception was raised
|
196
|
+
ddog_Vec_Tag_drop(tags); // clean up
|
197
|
+
rb_jump_tag(exception_state); // "Re-raise" exception
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
// Note: This function handles a bunch of libdatadog dynamically-allocated objects, so it MUST not use any Ruby APIs
|
202
|
+
// which can raise exceptions, otherwise the objects will be leaked.
|
203
|
+
static VALUE perform_export(
|
204
|
+
ddog_prof_Exporter *exporter,
|
205
|
+
ddog_Timespec start,
|
206
|
+
ddog_Timespec finish,
|
207
|
+
ddog_prof_Exporter_Slice_File files_to_compress_and_export,
|
208
|
+
ddog_prof_Exporter_Slice_File files_to_export_unmodified,
|
209
|
+
ddog_Vec_Tag *additional_tags,
|
210
|
+
ddog_CharSlice internal_metadata,
|
211
|
+
ddog_CharSlice info,
|
212
|
+
uint64_t timeout_milliseconds
|
213
|
+
) {
|
214
|
+
ddog_prof_ProfiledEndpointsStats *endpoints_stats = NULL; // Not in use yet
|
215
|
+
ddog_prof_Exporter_Request_BuildResult build_result = ddog_prof_Exporter_Request_build(
|
216
|
+
exporter,
|
217
|
+
start,
|
218
|
+
finish,
|
219
|
+
files_to_compress_and_export,
|
220
|
+
files_to_export_unmodified,
|
221
|
+
additional_tags,
|
222
|
+
endpoints_stats,
|
223
|
+
&internal_metadata,
|
224
|
+
&info,
|
225
|
+
timeout_milliseconds
|
226
|
+
);
|
227
|
+
|
228
|
+
if (build_result.tag == DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR) {
|
229
|
+
ddog_prof_Exporter_drop(exporter);
|
230
|
+
return rb_ary_new_from_args(2, error_symbol, get_error_details_and_drop(&build_result.err));
|
231
|
+
}
|
232
|
+
|
233
|
+
ddog_CancellationToken *cancel_token = ddog_CancellationToken_new();
|
234
|
+
|
235
|
+
// We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this
|
236
|
+
// is pending
|
237
|
+
struct call_exporter_without_gvl_arguments args =
|
238
|
+
{.exporter = exporter, .build_result = &build_result, .cancel_token = cancel_token, .send_ran = false};
|
239
|
+
|
240
|
+
// We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the gvl2 variant never raises any
|
241
|
+
// exceptions.
|
242
|
+
//
|
243
|
+
// (With rb_thread_call_without_gvl, if someone calls Thread#kill or something like it on the current thread,
|
244
|
+
// the exception will be raised without us being able to clean up dynamically-allocated stuff, which would leak.)
|
245
|
+
//
|
246
|
+
// Instead, we take care of our own exception checking, and delay the exception raising (`rb_jump_tag` call) until
|
247
|
+
// after we cleaned up any dynamically-allocated resources.
|
248
|
+
//
|
249
|
+
// We run rb_thread_call_without_gvl2 in a loop since an "interrupt" may cause it to return before even running
|
250
|
+
// our code. In such a case, we retry the call -- unless the interrupt was caused by an exception being pending,
|
251
|
+
// and in that case we also give up and break out of the loop.
|
252
|
+
int pending_exception = 0;
|
253
|
+
|
254
|
+
while (!args.send_ran && !pending_exception) {
|
255
|
+
rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token);
|
256
|
+
|
257
|
+
// To make sure we don't leak memory, we never check for pending exceptions if send ran
|
258
|
+
if (!args.send_ran) pending_exception = check_if_pending_exception();
|
259
|
+
}
|
260
|
+
|
261
|
+
// Cleanup exporter and token, no longer needed
|
262
|
+
ddog_CancellationToken_drop(cancel_token);
|
263
|
+
ddog_prof_Exporter_drop(exporter);
|
264
|
+
|
265
|
+
if (pending_exception) {
|
266
|
+
// If we got here send did not run, so we need to explicitly dispose of the request
|
267
|
+
ddog_prof_Exporter_Request_drop(&build_result.ok);
|
268
|
+
|
269
|
+
// Let Ruby propagate the exception. This will not return.
|
270
|
+
rb_jump_tag(pending_exception);
|
271
|
+
}
|
272
|
+
|
273
|
+
// The request itself does not need to be freed as libdatadog takes ownership of it as part of sending.
|
274
|
+
|
275
|
+
ddog_prof_Exporter_SendResult result = args.result;
|
276
|
+
|
277
|
+
return result.tag == DDOG_PROF_EXPORTER_SEND_RESULT_HTTP_RESPONSE ?
|
278
|
+
rb_ary_new_from_args(2, ok_symbol, UINT2NUM(result.http_response.code)) :
|
279
|
+
rb_ary_new_from_args(2, error_symbol, get_error_details_and_drop(&result.err));
|
280
|
+
}
|
281
|
+
|
282
|
+
static VALUE _native_do_export(
|
283
|
+
DDTRACE_UNUSED VALUE _self,
|
284
|
+
VALUE exporter_configuration,
|
285
|
+
VALUE upload_timeout_milliseconds,
|
286
|
+
VALUE start_timespec_seconds,
|
287
|
+
VALUE start_timespec_nanoseconds,
|
288
|
+
VALUE finish_timespec_seconds,
|
289
|
+
VALUE finish_timespec_nanoseconds,
|
290
|
+
VALUE pprof_file_name,
|
291
|
+
VALUE pprof_data,
|
292
|
+
VALUE code_provenance_file_name,
|
293
|
+
VALUE code_provenance_data,
|
294
|
+
VALUE tags_as_array,
|
295
|
+
VALUE internal_metadata_json,
|
296
|
+
VALUE info_json
|
297
|
+
) {
|
298
|
+
ENFORCE_TYPE(upload_timeout_milliseconds, T_FIXNUM);
|
299
|
+
ENFORCE_TYPE(start_timespec_seconds, T_FIXNUM);
|
300
|
+
ENFORCE_TYPE(start_timespec_nanoseconds, T_FIXNUM);
|
301
|
+
ENFORCE_TYPE(finish_timespec_seconds, T_FIXNUM);
|
302
|
+
ENFORCE_TYPE(finish_timespec_nanoseconds, T_FIXNUM);
|
303
|
+
ENFORCE_TYPE(pprof_file_name, T_STRING);
|
304
|
+
ENFORCE_TYPE(pprof_data, T_STRING);
|
305
|
+
ENFORCE_TYPE(code_provenance_file_name, T_STRING);
|
306
|
+
ENFORCE_TYPE(internal_metadata_json, T_STRING);
|
307
|
+
ENFORCE_TYPE(info_json, T_STRING);
|
308
|
+
|
309
|
+
// Code provenance can be disabled and in that case will be set to nil
|
310
|
+
bool have_code_provenance = !NIL_P(code_provenance_data);
|
311
|
+
if (have_code_provenance) ENFORCE_TYPE(code_provenance_data, T_STRING);
|
312
|
+
|
313
|
+
uint64_t timeout_milliseconds = NUM2ULONG(upload_timeout_milliseconds);
|
314
|
+
|
315
|
+
ddog_Timespec start =
|
316
|
+
{.seconds = NUM2LONG(start_timespec_seconds), .nanoseconds = NUM2UINT(start_timespec_nanoseconds)};
|
317
|
+
ddog_Timespec finish =
|
318
|
+
{.seconds = NUM2LONG(finish_timespec_seconds), .nanoseconds = NUM2UINT(finish_timespec_nanoseconds)};
|
319
|
+
|
320
|
+
int to_compress_length = have_code_provenance ? 1 : 0;
|
321
|
+
ddog_prof_Exporter_File to_compress[to_compress_length];
|
322
|
+
int already_compressed_length = 1; // pprof
|
323
|
+
ddog_prof_Exporter_File already_compressed[already_compressed_length];
|
324
|
+
|
325
|
+
ddog_prof_Exporter_Slice_File files_to_compress_and_export = {.ptr = to_compress, .len = to_compress_length};
|
326
|
+
ddog_prof_Exporter_Slice_File files_to_export_unmodified = {.ptr = already_compressed, .len = already_compressed_length};
|
327
|
+
|
328
|
+
already_compressed[0] = (ddog_prof_Exporter_File) {
|
329
|
+
.name = char_slice_from_ruby_string(pprof_file_name),
|
330
|
+
.file = byte_slice_from_ruby_string(pprof_data),
|
331
|
+
};
|
332
|
+
|
333
|
+
if (have_code_provenance) {
|
334
|
+
to_compress[0] = (ddog_prof_Exporter_File) {
|
335
|
+
.name = char_slice_from_ruby_string(code_provenance_file_name),
|
336
|
+
.file = byte_slice_from_ruby_string(code_provenance_data),
|
337
|
+
};
|
338
|
+
}
|
339
|
+
|
340
|
+
ddog_Vec_Tag *null_additional_tags = NULL;
|
341
|
+
ddog_CharSlice internal_metadata = char_slice_from_ruby_string(internal_metadata_json);
|
342
|
+
ddog_CharSlice info = char_slice_from_ruby_string(info_json);
|
343
|
+
|
344
|
+
ddog_prof_Exporter_NewResult exporter_result = create_exporter(exporter_configuration, tags_as_array);
|
345
|
+
// Note: Do not add anything that can raise exceptions after this line, as otherwise the exporter memory will leak
|
346
|
+
|
347
|
+
VALUE failure_tuple = handle_exporter_failure(exporter_result);
|
348
|
+
if (!NIL_P(failure_tuple)) return failure_tuple;
|
349
|
+
|
350
|
+
return perform_export(
|
351
|
+
exporter_result.ok,
|
352
|
+
start,
|
353
|
+
finish,
|
354
|
+
files_to_compress_and_export,
|
355
|
+
files_to_export_unmodified,
|
356
|
+
null_additional_tags,
|
357
|
+
internal_metadata,
|
358
|
+
info,
|
359
|
+
timeout_milliseconds
|
360
|
+
);
|
361
|
+
}
|
362
|
+
|
363
|
+
static void *call_exporter_without_gvl(void *call_args) {
|
364
|
+
struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) call_args;
|
365
|
+
|
366
|
+
args->result = ddog_prof_Exporter_send(args->exporter, &args->build_result->ok, args->cancel_token);
|
367
|
+
args->send_ran = true;
|
368
|
+
|
369
|
+
return NULL; // Unused
|
370
|
+
}
|
371
|
+
|
372
|
+
// Called by Ruby when it wants to interrupt call_exporter_without_gvl above, e.g. when the app wants to exit cleanly
|
373
|
+
static void interrupt_exporter_call(void *cancel_token) {
|
374
|
+
ddog_CancellationToken_cancel((ddog_CancellationToken *) cancel_token);
|
375
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#include "libdatadog_helpers.h"
|
2
|
+
|
3
|
+
#include <ruby.h>
|
4
|
+
|
5
|
+
const char *ruby_value_type_to_string(enum ruby_value_type type) {
|
6
|
+
return ruby_value_type_to_char_slice(type).ptr;
|
7
|
+
}
|
8
|
+
|
9
|
+
ddog_CharSlice ruby_value_type_to_char_slice(enum ruby_value_type type) {
|
10
|
+
switch (type) {
|
11
|
+
case(RUBY_T_NONE ): return DDOG_CHARSLICE_C("T_NONE");
|
12
|
+
case(RUBY_T_OBJECT ): return DDOG_CHARSLICE_C("T_OBJECT");
|
13
|
+
case(RUBY_T_CLASS ): return DDOG_CHARSLICE_C("T_CLASS");
|
14
|
+
case(RUBY_T_MODULE ): return DDOG_CHARSLICE_C("T_MODULE");
|
15
|
+
case(RUBY_T_FLOAT ): return DDOG_CHARSLICE_C("T_FLOAT");
|
16
|
+
case(RUBY_T_STRING ): return DDOG_CHARSLICE_C("T_STRING");
|
17
|
+
case(RUBY_T_REGEXP ): return DDOG_CHARSLICE_C("T_REGEXP");
|
18
|
+
case(RUBY_T_ARRAY ): return DDOG_CHARSLICE_C("T_ARRAY");
|
19
|
+
case(RUBY_T_HASH ): return DDOG_CHARSLICE_C("T_HASH");
|
20
|
+
case(RUBY_T_STRUCT ): return DDOG_CHARSLICE_C("T_STRUCT");
|
21
|
+
case(RUBY_T_BIGNUM ): return DDOG_CHARSLICE_C("T_BIGNUM");
|
22
|
+
case(RUBY_T_FILE ): return DDOG_CHARSLICE_C("T_FILE");
|
23
|
+
case(RUBY_T_DATA ): return DDOG_CHARSLICE_C("T_DATA");
|
24
|
+
case(RUBY_T_MATCH ): return DDOG_CHARSLICE_C("T_MATCH");
|
25
|
+
case(RUBY_T_COMPLEX ): return DDOG_CHARSLICE_C("T_COMPLEX");
|
26
|
+
case(RUBY_T_RATIONAL): return DDOG_CHARSLICE_C("T_RATIONAL");
|
27
|
+
case(RUBY_T_NIL ): return DDOG_CHARSLICE_C("T_NIL");
|
28
|
+
case(RUBY_T_TRUE ): return DDOG_CHARSLICE_C("T_TRUE");
|
29
|
+
case(RUBY_T_FALSE ): return DDOG_CHARSLICE_C("T_FALSE");
|
30
|
+
case(RUBY_T_SYMBOL ): return DDOG_CHARSLICE_C("T_SYMBOL");
|
31
|
+
case(RUBY_T_FIXNUM ): return DDOG_CHARSLICE_C("T_FIXNUM");
|
32
|
+
case(RUBY_T_UNDEF ): return DDOG_CHARSLICE_C("T_UNDEF");
|
33
|
+
case(RUBY_T_IMEMO ): return DDOG_CHARSLICE_C("T_IMEMO");
|
34
|
+
case(RUBY_T_NODE ): return DDOG_CHARSLICE_C("T_NODE");
|
35
|
+
case(RUBY_T_ICLASS ): return DDOG_CHARSLICE_C("T_ICLASS");
|
36
|
+
case(RUBY_T_ZOMBIE ): return DDOG_CHARSLICE_C("T_ZOMBIE");
|
37
|
+
#ifndef NO_T_MOVED
|
38
|
+
case(RUBY_T_MOVED ): return DDOG_CHARSLICE_C("T_MOVED");
|
39
|
+
#endif
|
40
|
+
default: return DDOG_CHARSLICE_C("BUG: Unknown value for ruby_value_type");
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
size_t read_ddogerr_string_and_drop(ddog_Error *error, char *string, size_t capacity) {
|
45
|
+
if (capacity == 0 || string == NULL) {
|
46
|
+
// short-circuit, we can't write anything
|
47
|
+
ddog_Error_drop(error);
|
48
|
+
return 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
ddog_CharSlice error_msg_slice = ddog_Error_message(error);
|
52
|
+
size_t error_msg_size = error_msg_slice.len;
|
53
|
+
// Account for extra null char for proper cstring
|
54
|
+
if (error_msg_size >= capacity) {
|
55
|
+
// Error message too big, lets truncate it to capacity - 1 to allow for extra null at end
|
56
|
+
error_msg_size = capacity - 1;
|
57
|
+
}
|
58
|
+
strncpy(string, error_msg_slice.ptr, error_msg_size);
|
59
|
+
string[error_msg_size] = '\0';
|
60
|
+
ddog_Error_drop(error);
|
61
|
+
return error_msg_size;
|
62
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <datadog/profiling.h>
|
4
|
+
#include "ruby_helpers.h"
|
5
|
+
|
6
|
+
inline static ddog_CharSlice char_slice_from_ruby_string(VALUE string) {
|
7
|
+
ENFORCE_TYPE(string, T_STRING);
|
8
|
+
ddog_CharSlice char_slice = {.ptr = StringValuePtr(string), .len = RSTRING_LEN(string)};
|
9
|
+
return char_slice;
|
10
|
+
}
|
11
|
+
|
12
|
+
inline static VALUE ruby_string_from_vec_u8(ddog_Vec_U8 string) {
|
13
|
+
return rb_str_new((char *) string.ptr, string.len);
|
14
|
+
}
|
15
|
+
|
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;
|
25
|
+
}
|
26
|
+
|
27
|
+
// Utility function to be able to extract an error cstring from a ddog_Error.
|
28
|
+
// Returns the amount of characters written to string (which are necessarily
|
29
|
+
// bounded by capacity - 1 since the string will be null-terminated).
|
30
|
+
size_t read_ddogerr_string_and_drop(ddog_Error *error, char *string, size_t capacity);
|
31
|
+
|
32
|
+
// Used for pretty printing this Ruby enum. Returns "T_UNKNOWN_OR_MISSING_RUBY_VALUE_TYPE_ENTRY" for unknown elements.
|
33
|
+
// In practice, there's a few types that the profiler will probably never encounter, but I've added all entries of
|
34
|
+
// ruby_value_type that Ruby uses so that we can also use this for debugging.
|
35
|
+
const char *ruby_value_type_to_string(enum ruby_value_type type);
|
36
|
+
ddog_CharSlice ruby_value_type_to_char_slice(enum ruby_value_type type);
|
37
|
+
|
38
|
+
// Returns a dynamically allocated string from the provided char slice.
|
39
|
+
// WARN: The returned string must be explicitly freed with ruby_xfree.
|
40
|
+
inline static char* string_from_char_slice(ddog_CharSlice slice) {
|
41
|
+
return ruby_strndup(slice.ptr, slice.len);
|
42
|
+
}
|