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,848 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'ext'
|
5
|
+
require_relative '../environment/execution'
|
6
|
+
require_relative '../environment/ext'
|
7
|
+
require_relative '../runtime/ext'
|
8
|
+
require_relative '../telemetry/ext'
|
9
|
+
require_relative '../remote/ext'
|
10
|
+
require_relative '../../profiling/ext'
|
11
|
+
|
12
|
+
require_relative '../../tracing/configuration/settings'
|
13
|
+
|
14
|
+
module Datadog
|
15
|
+
module Core
|
16
|
+
module Configuration
|
17
|
+
# Global configuration settings for the Datadog library.
|
18
|
+
# @public_api
|
19
|
+
# rubocop:disable Metrics/BlockLength
|
20
|
+
class Settings
|
21
|
+
include Base
|
22
|
+
|
23
|
+
# @!visibility private
|
24
|
+
def initialize(*_)
|
25
|
+
super
|
26
|
+
|
27
|
+
# WORKAROUND: The values for services, version, and env can get set either directly OR as a side effect of
|
28
|
+
# accessing tags (reading or writing). This is of course really confusing and error-prone, e.g. in an app
|
29
|
+
# WITHOUT this workaround where you define `DD_TAGS=env:envenvtag,service:envservicetag,version:envversiontag`
|
30
|
+
# and do:
|
31
|
+
#
|
32
|
+
# puts Datadog.configuration.instance_exec { "#{service} #{env} #{version}" }
|
33
|
+
# Datadog.configuration.tags
|
34
|
+
# puts Datadog.configuration.instance_exec { "#{service} #{env} #{version}" }
|
35
|
+
#
|
36
|
+
# the output will be:
|
37
|
+
#
|
38
|
+
# [empty]
|
39
|
+
# envservicetag envenvtag envversiontag
|
40
|
+
#
|
41
|
+
# That is -- the proper values for service/env/version are only set AFTER something accidentally or not triggers
|
42
|
+
# the resolution of the tags.
|
43
|
+
# This is really confusing, error prone, etc, so calling tags here is a really hacky but effective way to
|
44
|
+
# avoid this. I could not think of a better way of fixing this issue without massive refactoring of tags parsing
|
45
|
+
# (so that the individual service/env/version get correctly set even from their tags values, not as a side
|
46
|
+
# effect). Sorry :(
|
47
|
+
tags
|
48
|
+
end
|
49
|
+
|
50
|
+
# {https://docs.datadoghq.com/agent/ Datadog Agent} configuration.
|
51
|
+
# @public_api
|
52
|
+
settings :agent do
|
53
|
+
# Agent hostname or IP.
|
54
|
+
# @default `DD_AGENT_HOST` environment variable, otherwise `127.0.0.1`
|
55
|
+
# @return [String,nil]
|
56
|
+
option :host
|
57
|
+
|
58
|
+
# Agent APM TCP port.
|
59
|
+
# @see https://docs.datadoghq.com/getting_started/tracing/#datadog-apm
|
60
|
+
# @default `DD_TRACE_AGENT_PORT` environment variable, otherwise `8126`
|
61
|
+
# @return [String,nil]
|
62
|
+
option :port
|
63
|
+
|
64
|
+
# TODO: add declarative statsd configuration. Currently only usable via an environment variable.
|
65
|
+
# Statsd configuration for agent access.
|
66
|
+
# @public_api
|
67
|
+
# settings :statsd do
|
68
|
+
# # Agent Statsd UDP port.
|
69
|
+
# # @configure_with {Datadog::Statsd}
|
70
|
+
# # @default `DD_AGENT_HOST` environment variable, otherwise `8125`
|
71
|
+
# # @return [String,nil]
|
72
|
+
# option :port
|
73
|
+
# end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Datadog API key.
|
77
|
+
#
|
78
|
+
# For internal use only.
|
79
|
+
#
|
80
|
+
# @default `DD_API_KEY` environment variable, otherwise `nil`
|
81
|
+
# @return [String,nil]
|
82
|
+
option :api_key do |o|
|
83
|
+
o.type :string, nilable: true
|
84
|
+
o.env Core::Environment::Ext::ENV_API_KEY
|
85
|
+
end
|
86
|
+
|
87
|
+
# Datadog diagnostic settings.
|
88
|
+
#
|
89
|
+
# Enabling these surfaces debug information that can be helpful to
|
90
|
+
# diagnose issues related to Datadog internals.
|
91
|
+
# @public_api
|
92
|
+
settings :diagnostics do
|
93
|
+
# Outputs all spans created by the host application to `Datadog.logger`.
|
94
|
+
#
|
95
|
+
# **This option is very verbose!** It's only recommended for non-production
|
96
|
+
# environments.
|
97
|
+
#
|
98
|
+
# This option is helpful when trying to understand what information the
|
99
|
+
# Datadog features are sending to the Agent or backend.
|
100
|
+
# @default `DD_TRACE_DEBUG` environment variable, otherwise `false`
|
101
|
+
# @return [Boolean]
|
102
|
+
option :debug do |o|
|
103
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_DEBUG_ENABLED
|
104
|
+
o.default false
|
105
|
+
o.type :bool
|
106
|
+
o.after_set do |enabled|
|
107
|
+
# Enable rich debug print statements.
|
108
|
+
# We do not need to unnecessarily load 'pp' unless in debugging mode.
|
109
|
+
require 'pp' if enabled
|
110
|
+
end
|
111
|
+
end
|
112
|
+
# Internal {Datadog::Statsd} metrics collection.
|
113
|
+
#
|
114
|
+
# @public_api
|
115
|
+
settings :health_metrics do
|
116
|
+
# Enable health metrics collection.
|
117
|
+
#
|
118
|
+
# @default `DD_HEALTH_METRICS_ENABLED` environment variable, otherwise `false`
|
119
|
+
# @return [Boolean]
|
120
|
+
option :enabled do |o|
|
121
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_HEALTH_METRICS_ENABLED
|
122
|
+
o.default false
|
123
|
+
o.type :bool
|
124
|
+
end
|
125
|
+
|
126
|
+
# {Datadog::Statsd} instance to collect health metrics.
|
127
|
+
#
|
128
|
+
# If `nil`, health metrics creates a new {Datadog::Statsd} client with default agent configuration.
|
129
|
+
#
|
130
|
+
# @default `nil`
|
131
|
+
# @return [Datadog::Statsd,nil] a custom {Datadog::Statsd} instance
|
132
|
+
# @return [nil] an instance with default agent configuration will be lazily created
|
133
|
+
option :statsd
|
134
|
+
end
|
135
|
+
|
136
|
+
# Tracer startup debug log statement configuration.
|
137
|
+
# @public_api
|
138
|
+
settings :startup_logs do
|
139
|
+
# Enable startup logs collection.
|
140
|
+
#
|
141
|
+
# If `nil`, defaults to logging startup logs when `ddtrace` detects that the application
|
142
|
+
# is *not* running in a development environment.
|
143
|
+
#
|
144
|
+
# @default `DD_TRACE_STARTUP_LOGS` environment variable, otherwise `nil`
|
145
|
+
# @return [Boolean, nil]
|
146
|
+
option :enabled do |o|
|
147
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_STARTUP_LOGS_ENABLED
|
148
|
+
# Defaults to nil as we want to know when the default value is being used
|
149
|
+
o.type :bool, nilable: true
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# The `env` tag in Datadog. Use it to separate out your staging, development, and production environments.
|
155
|
+
# @see https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging
|
156
|
+
# @default `DD_ENV` environment variable, otherwise `nil`
|
157
|
+
# @return [String,nil]
|
158
|
+
option :env do |o|
|
159
|
+
# DEV-2.0: Remove this conversion for symbol.
|
160
|
+
o.setter { |v| v.to_s if v }
|
161
|
+
|
162
|
+
# NOTE: env also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
163
|
+
o.env Core::Environment::Ext::ENV_ENVIRONMENT
|
164
|
+
end
|
165
|
+
|
166
|
+
# Internal `Datadog.logger` configuration.
|
167
|
+
#
|
168
|
+
# This logger instance is only used internally by the gem.
|
169
|
+
# @public_api
|
170
|
+
settings :logger do
|
171
|
+
# The `Datadog.logger` object.
|
172
|
+
#
|
173
|
+
# Can be overwritten with a custom logger object that respects the
|
174
|
+
# [built-in Ruby Logger](https://ruby-doc.org/stdlib-3.0.1/libdoc/logger/rdoc/Logger.html)
|
175
|
+
# interface.
|
176
|
+
#
|
177
|
+
# @return Logger::Severity
|
178
|
+
option :instance do |o|
|
179
|
+
o.after_set { |value| set_option(:level, value.level) unless value.nil? }
|
180
|
+
end
|
181
|
+
|
182
|
+
# Log level for `Datadog.logger`.
|
183
|
+
# @see Logger::Severity
|
184
|
+
# @return Logger::Severity
|
185
|
+
option :level, default: ::Logger::INFO
|
186
|
+
end
|
187
|
+
|
188
|
+
# Datadog Profiler-specific configurations.
|
189
|
+
#
|
190
|
+
# @see https://docs.datadoghq.com/tracing/profiler/
|
191
|
+
# @public_api
|
192
|
+
settings :profiling do
|
193
|
+
# Enable profiling.
|
194
|
+
#
|
195
|
+
# @default `DD_PROFILING_ENABLED` environment variable, otherwise `false`
|
196
|
+
# @return [Boolean]
|
197
|
+
option :enabled do |o|
|
198
|
+
o.env Profiling::Ext::ENV_ENABLED
|
199
|
+
o.default false
|
200
|
+
o.type :bool
|
201
|
+
end
|
202
|
+
|
203
|
+
# @public_api
|
204
|
+
settings :exporter do
|
205
|
+
option :transport
|
206
|
+
end
|
207
|
+
|
208
|
+
# Can be used to enable/disable collection of allocation profiles.
|
209
|
+
#
|
210
|
+
# This feature is disabled by default
|
211
|
+
#
|
212
|
+
# @warn Due to bugs in Ruby we only recommend enabling this feature in
|
213
|
+
# Ruby versions 2.x, 3.1.4+, 3.2.3+ and 3.3.0+
|
214
|
+
# (more details in {Datadog::Profiling::Component.enable_allocation_profiling?})
|
215
|
+
#
|
216
|
+
# @default `DD_PROFILING_ALLOCATION_ENABLED` environment variable as a boolean, otherwise `false`
|
217
|
+
option :allocation_enabled do |o|
|
218
|
+
o.type :bool
|
219
|
+
o.deprecated_env 'DD_PROFILING_EXPERIMENTAL_ALLOCATION_ENABLED' # TODO: Remove this for dd-trace-rb 2.0
|
220
|
+
o.env 'DD_PROFILING_ALLOCATION_ENABLED'
|
221
|
+
o.default false
|
222
|
+
end
|
223
|
+
|
224
|
+
# @public_api
|
225
|
+
settings :advanced do
|
226
|
+
# @deprecated No longer does anything, and will be removed on dd-trace-rb 2.0.
|
227
|
+
#
|
228
|
+
# This was used prior to the GA of the new CPU Profiling 2.0 profiler. The CPU Profiling 2.0 profiler does not
|
229
|
+
# use or need this setting and thus it doesn't do anything.
|
230
|
+
option :max_events do |o|
|
231
|
+
o.after_set do |_, _, precedence|
|
232
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
233
|
+
Datadog.logger.warn(
|
234
|
+
'The profiling.advanced.max_events setting has been deprecated for removal and no ' \
|
235
|
+
'longer does anything. Please remove it from your Datadog.configure block.'
|
236
|
+
)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
# Controls the maximum number of frames for each thread sampled. Can be tuned to avoid omitted frames in the
|
242
|
+
# produced profiles. Increasing this may increase the overhead of profiling.
|
243
|
+
#
|
244
|
+
# @default `DD_PROFILING_MAX_FRAMES` environment variable, otherwise 400
|
245
|
+
option :max_frames do |o|
|
246
|
+
o.type :int
|
247
|
+
o.env Profiling::Ext::ENV_MAX_FRAMES
|
248
|
+
o.default 400
|
249
|
+
end
|
250
|
+
|
251
|
+
# @public_api
|
252
|
+
settings :endpoint do
|
253
|
+
settings :collection do
|
254
|
+
# When using profiling together with tracing, this controls if endpoint names
|
255
|
+
# are gathered and reported together with profiles.
|
256
|
+
#
|
257
|
+
# @default `DD_PROFILING_ENDPOINT_COLLECTION_ENABLED` environment variable, otherwise `true`
|
258
|
+
# @return [Boolean]
|
259
|
+
option :enabled do |o|
|
260
|
+
o.env Profiling::Ext::ENV_ENDPOINT_COLLECTION_ENABLED
|
261
|
+
o.default true
|
262
|
+
o.type :bool
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
# Can be used to disable the gathering of names and versions of gems in use by the service, used to power
|
268
|
+
# grouping and categorization of stack traces.
|
269
|
+
option :code_provenance_enabled do |o|
|
270
|
+
o.type :bool
|
271
|
+
o.default true
|
272
|
+
end
|
273
|
+
|
274
|
+
# @deprecated No longer does anything, and will be removed on dd-trace-rb 2.0.
|
275
|
+
#
|
276
|
+
# This was added as a temporary support option in case of issues with the new `Profiling::HttpTransport` class
|
277
|
+
# but we're now confident it's working nicely so we've removed the old code path.
|
278
|
+
option :legacy_transport_enabled do |o|
|
279
|
+
o.after_set do |_, _, precedence|
|
280
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
281
|
+
Datadog.logger.warn(
|
282
|
+
'The profiling.advanced.legacy_transport_enabled setting has been deprecated for removal and no ' \
|
283
|
+
'longer does anything. Please remove it from your Datadog.configure block.'
|
284
|
+
)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
# @deprecated No longer does anything, and will be removed on dd-trace-rb 2.0.
|
290
|
+
#
|
291
|
+
# This was used prior to the GA of the new CPU Profiling 2.0 profiler. Using CPU Profiling 2.0 is now the
|
292
|
+
# default and this doesn't do anything.
|
293
|
+
option :force_enable_new_profiler do |o|
|
294
|
+
o.after_set do |_, _, precedence|
|
295
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
296
|
+
Datadog.logger.warn(
|
297
|
+
'The profiling.advanced.force_enable_new_profiler setting has been deprecated for removal and no ' \
|
298
|
+
'longer does anything. Please remove it from your Datadog.configure block.'
|
299
|
+
)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
# @deprecated No longer does anything, and will be removed on dd-trace-rb 2.0.
|
305
|
+
#
|
306
|
+
# This was used prior to the GA of the new CPU Profiling 2.0 profiler. Using CPU Profiling 2.0 is now the
|
307
|
+
# default and this doesn't do anything.
|
308
|
+
option :force_enable_legacy_profiler do |o|
|
309
|
+
o.after_set do |_, _, precedence|
|
310
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
311
|
+
Datadog.logger.warn(
|
312
|
+
'The profiling.advanced.force_enable_legacy_profiler setting has been deprecated for removal and no ' \
|
313
|
+
'longer does anything. Please remove it from your Datadog.configure block.'
|
314
|
+
)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
# @deprecated No longer does anything, and will be removed on dd-trace-rb 2.0.
|
320
|
+
#
|
321
|
+
# GC profiling is now on by default and controlled by {:gc_enabled}.
|
322
|
+
option :force_enable_gc_profiling do |o|
|
323
|
+
o.after_set do |_, _, precedence|
|
324
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
325
|
+
Datadog.logger.warn(
|
326
|
+
'The profiling.advanced.force_enable_gc_profiling setting has been deprecated for removal and no ' \
|
327
|
+
'longer does anything (the feature is now on by default). ' \
|
328
|
+
'Please remove this setting from your Datadog.configure block.'
|
329
|
+
)
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
# Can be used to enable/disable garbage collection profiling.
|
335
|
+
#
|
336
|
+
# @warn To avoid https://bugs.ruby-lang.org/issues/18464 even when enabled, GC profiling is only started
|
337
|
+
# for Ruby versions 2.x, 3.1.4+, 3.2.3+ and 3.3.0+
|
338
|
+
# (more details in {Datadog::Profiling::Component.enable_gc_profiling?})
|
339
|
+
#
|
340
|
+
# @warn Due to a VM bug in the Ractor implementation (https://bugs.ruby-lang.org/issues/19112) this feature
|
341
|
+
# stops working when Ractors get garbage collected.
|
342
|
+
#
|
343
|
+
# @default `DD_PROFILING_GC_ENABLED` environment variable, otherwise `true`
|
344
|
+
option :gc_enabled do |o|
|
345
|
+
o.type :bool
|
346
|
+
o.env 'DD_PROFILING_GC_ENABLED'
|
347
|
+
o.default true
|
348
|
+
end
|
349
|
+
|
350
|
+
# Can be used to enable/disable the Datadog::Profiling.allocation_count feature.
|
351
|
+
#
|
352
|
+
# @deprecated Use {:allocation_enabled} (outside of advanced section) instead.
|
353
|
+
option :allocation_counting_enabled do |o|
|
354
|
+
o.after_set do |_, _, precedence|
|
355
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
356
|
+
Datadog.logger.warn(
|
357
|
+
'The profiling.advanced.allocation_counting_enabled setting has been deprecated for removal and no ' \
|
358
|
+
'longer does anything. Please remove it from your Datadog.configure block. ' \
|
359
|
+
'Allocation counting is now controlled by the profiling.allocation_enabled setting instead.'
|
360
|
+
)
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
# @deprecated Use {:allocation_enabled} (outside of advanced section) instead.
|
366
|
+
option :experimental_allocation_enabled do |o|
|
367
|
+
o.type :bool
|
368
|
+
o.default false
|
369
|
+
o.after_set do |_, _, precedence|
|
370
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
371
|
+
Datadog.logger.warn(
|
372
|
+
'The profiling.advanced.experimental_allocation_enabled setting has been deprecated for removal and ' \
|
373
|
+
'no longer does anything. Please remove it from your Datadog.configure block. ' \
|
374
|
+
'Allocation profiling is now controlled by the profiling.allocation_enabled setting instead.'
|
375
|
+
)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
# Can be used to enable/disable the collection of heap profiles.
|
381
|
+
#
|
382
|
+
# This feature is alpha and disabled by default
|
383
|
+
#
|
384
|
+
# @warn To enable heap profiling you are required to also enable allocation profiling.
|
385
|
+
#
|
386
|
+
# @default `DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED` environment variable as a boolean, otherwise `false`
|
387
|
+
option :experimental_heap_enabled do |o|
|
388
|
+
o.type :bool
|
389
|
+
o.env 'DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED'
|
390
|
+
o.default false
|
391
|
+
end
|
392
|
+
|
393
|
+
# Can be used to enable/disable the collection of heap size profiles.
|
394
|
+
#
|
395
|
+
# This feature is alpha and enabled by default when heap profiling is enabled.
|
396
|
+
#
|
397
|
+
# @warn To enable heap size profiling you are required to also enable allocation and heap profiling.
|
398
|
+
#
|
399
|
+
# @default `DD_PROFILING_EXPERIMENTAL_HEAP_SIZE_ENABLED` environment variable as a boolean, otherwise
|
400
|
+
# whatever the value of DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED is.
|
401
|
+
option :experimental_heap_size_enabled do |o|
|
402
|
+
o.type :bool
|
403
|
+
o.env 'DD_PROFILING_EXPERIMENTAL_HEAP_SIZE_ENABLED'
|
404
|
+
o.default true # This gets ANDed with experimental_heap_enabled in the profiler component.
|
405
|
+
end
|
406
|
+
|
407
|
+
# Can be used to configure the allocation sampling rate: a sample will be collected every x allocations.
|
408
|
+
#
|
409
|
+
# This feature is now controlled via {:overhead_target_percentage}
|
410
|
+
option :experimental_allocation_sample_rate do |o|
|
411
|
+
o.after_set do |_, _, precedence|
|
412
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
413
|
+
Datadog.logger.warn(
|
414
|
+
'The profiling.advanced.experimental_allocation_sample_rate setting has been deprecated for removal ' \
|
415
|
+
'and no longer does anything. Please remove it from your Datadog.configure block. ' \
|
416
|
+
'Allocation sample rate is now handled by a dynamic sampler which will adjust the sampling rate to ' \
|
417
|
+
'keep to the configured `profiling.advanced.overhead_target_percentage`.'
|
418
|
+
)
|
419
|
+
end
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
423
|
+
# Can be used to configure the heap sampling rate: a heap sample will be collected for every x allocation
|
424
|
+
# samples.
|
425
|
+
#
|
426
|
+
# The lower the value, the more accuracy in heap tracking but the bigger the overhead. In particular, a
|
427
|
+
# value of 1 will track ALL allocations samples for heap profiles.
|
428
|
+
#
|
429
|
+
# The effective heap sampling rate in terms of allocations (not allocation samples) can be calculated via
|
430
|
+
# effective_heap_sample_rate = allocation_sample_rate * heap_sample_rate.
|
431
|
+
#
|
432
|
+
# @default `DD_PROFILING_EXPERIMENTAL_HEAP_SAMPLE_RATE` environment variable, otherwise `10`.
|
433
|
+
option :experimental_heap_sample_rate do |o|
|
434
|
+
o.type :int
|
435
|
+
o.env 'DD_PROFILING_EXPERIMENTAL_HEAP_SAMPLE_RATE'
|
436
|
+
o.default 10
|
437
|
+
end
|
438
|
+
|
439
|
+
# Can be used to disable checking which version of `libmysqlclient` is being used by the `mysql2` gem.
|
440
|
+
#
|
441
|
+
# This setting is only used when the `mysql2` gem is installed.
|
442
|
+
#
|
443
|
+
# @default `DD_PROFILING_SKIP_MYSQL2_CHECK` environment variable, otherwise `false`
|
444
|
+
option :skip_mysql2_check do |o|
|
445
|
+
o.type :bool
|
446
|
+
o.env 'DD_PROFILING_SKIP_MYSQL2_CHECK'
|
447
|
+
o.default false
|
448
|
+
end
|
449
|
+
|
450
|
+
# Enables data collection for the timeline feature. This is still experimental and not recommended yet.
|
451
|
+
#
|
452
|
+
# @default `DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED` environment variable as a boolean, otherwise `false`
|
453
|
+
option :experimental_timeline_enabled do |o|
|
454
|
+
o.after_set do |_, _, precedence|
|
455
|
+
unless precedence == Datadog::Core::Configuration::Option::Precedence::DEFAULT
|
456
|
+
Datadog.logger.warn(
|
457
|
+
'The profiling.advanced.experimental_timeline_enabled setting has been deprecated for removal ' \
|
458
|
+
'and no longer does anything. Please remove it from your Datadog.configure block. ' \
|
459
|
+
'The timeline feature counting is now controlled by the `timeline_enabled` setting instead.'
|
460
|
+
)
|
461
|
+
end
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
# Controls data collection for the timeline feature.
|
466
|
+
#
|
467
|
+
# If you needed to disable this, please tell us why on <https://github.com/DataDog/dd-trace-rb/issues/new>,
|
468
|
+
# so we can fix it!
|
469
|
+
#
|
470
|
+
# @default `DD_PROFILING_TIMELINE_ENABLED` environment variable as a boolean, otherwise `true`
|
471
|
+
option :timeline_enabled do |o|
|
472
|
+
o.type :bool
|
473
|
+
o.env 'DD_PROFILING_TIMELINE_ENABLED'
|
474
|
+
o.default true
|
475
|
+
end
|
476
|
+
|
477
|
+
# The profiler gathers data by sending `SIGPROF` unix signals to Ruby application threads.
|
478
|
+
#
|
479
|
+
# Sending `SIGPROF` is a common profiling approach, and may cause system calls from native
|
480
|
+
# extensions/libraries to be interrupted with a system
|
481
|
+
# [EINTR error code.](https://man7.org/linux/man-pages/man7/signal.7.html#:~:text=Interruption%20of%20system%20calls%20and%20library%20functions%20by%20signal%20handlers)
|
482
|
+
# Rarely, native extensions or libraries called by them may have missing or incorrect error handling for the
|
483
|
+
# `EINTR` error code.
|
484
|
+
#
|
485
|
+
# The "no signals" workaround, when enabled, enables an alternative mode for the profiler where it does not
|
486
|
+
# send `SIGPROF` unix signals. The downside of this approach is that the profiler data will have lower
|
487
|
+
# quality.
|
488
|
+
#
|
489
|
+
# This workaround is automatically enabled when gems that are known to have issues handling
|
490
|
+
# `EINTR` error codes are detected. If you suspect you may be seeing an issue due to the profiler's use of
|
491
|
+
# signals, you can try manually enabling this mode as a fallback.
|
492
|
+
# Please also report these issues to us on <https://github.com/DataDog/dd-trace-rb/issues/new>, so we can
|
493
|
+
# work with the gem authors to fix them!
|
494
|
+
#
|
495
|
+
# @default `DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED` environment variable as a boolean, otherwise `:auto`
|
496
|
+
option :no_signals_workaround_enabled do |o|
|
497
|
+
o.env 'DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED'
|
498
|
+
o.default :auto
|
499
|
+
o.env_parser do |value|
|
500
|
+
if value
|
501
|
+
value = value.strip.downcase
|
502
|
+
['true', '1'].include?(value)
|
503
|
+
end
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
# Configures how much wall-time overhead the profiler targets. The profiler will dynamically adjust the
|
508
|
+
# interval between samples it takes so as to try and maintain the property that it spends no longer than
|
509
|
+
# this amount of wall-clock time profiling. For example, with the default value of 2%, the profiler will
|
510
|
+
# try and cause no more than 1.2 seconds per minute of overhead. Decreasing this value will reduce the
|
511
|
+
# accuracy of the data collected. Increasing will impact the application.
|
512
|
+
#
|
513
|
+
# We do not recommend tweaking this value.
|
514
|
+
#
|
515
|
+
# This value should be a percentage i.e. a number between 0 and 100, not 0 and 1.
|
516
|
+
#
|
517
|
+
# @default `DD_PROFILING_OVERHEAD_TARGET_PERCENTAGE` as a float, otherwise 2.0
|
518
|
+
option :overhead_target_percentage do |o|
|
519
|
+
o.type :float
|
520
|
+
o.env 'DD_PROFILING_OVERHEAD_TARGET_PERCENTAGE'
|
521
|
+
o.default 2.0
|
522
|
+
end
|
523
|
+
|
524
|
+
# Controls how often the profiler reports data, in seconds. Cannot be lower than 60 seconds.
|
525
|
+
#
|
526
|
+
# We do not recommend tweaking this value.
|
527
|
+
#
|
528
|
+
# @default `DD_PROFILING_UPLOAD_PERIOD` environment variable, otherwise 60
|
529
|
+
option :upload_period_seconds do |o|
|
530
|
+
o.type :int
|
531
|
+
o.env 'DD_PROFILING_UPLOAD_PERIOD'
|
532
|
+
o.default 60
|
533
|
+
end
|
534
|
+
end
|
535
|
+
|
536
|
+
# @public_api
|
537
|
+
settings :upload do
|
538
|
+
# Network timeout for reporting profiling data to Datadog.
|
539
|
+
#
|
540
|
+
# @default `DD_PROFILING_UPLOAD_TIMEOUT` environment variable, otherwise `30.0`
|
541
|
+
option :timeout_seconds do |o|
|
542
|
+
o.type :float
|
543
|
+
o.env Profiling::Ext::ENV_UPLOAD_TIMEOUT
|
544
|
+
o.default 30.0
|
545
|
+
end
|
546
|
+
end
|
547
|
+
end
|
548
|
+
|
549
|
+
# [Runtime Metrics](https://docs.datadoghq.com/tracing/runtime_metrics/)
|
550
|
+
# are StatsD metrics collected by the tracer to gain additional insights into an application's performance.
|
551
|
+
# @public_api
|
552
|
+
settings :runtime_metrics do
|
553
|
+
# Enable runtime metrics.
|
554
|
+
# @default `DD_RUNTIME_METRICS_ENABLED` environment variable, otherwise `false`
|
555
|
+
# @return [Boolean]
|
556
|
+
option :enabled do |o|
|
557
|
+
o.env Core::Runtime::Ext::Metrics::ENV_ENABLED
|
558
|
+
o.default false
|
559
|
+
o.type :bool
|
560
|
+
end
|
561
|
+
|
562
|
+
option :opts, default: {}, type: :hash
|
563
|
+
option :statsd
|
564
|
+
end
|
565
|
+
|
566
|
+
# The `service` tag in Datadog. Use it to group related traces into a service.
|
567
|
+
# @see https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging
|
568
|
+
# @default `DD_SERVICE` environment variable, otherwise the program name (e.g. `'ruby'`, `'rails'`, `'pry'`)
|
569
|
+
# @return [String]
|
570
|
+
option :service do |o|
|
571
|
+
# DEV-2.0: Remove this conversion for symbol.
|
572
|
+
o.setter { |v| v.to_s if v }
|
573
|
+
|
574
|
+
# NOTE: service also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
575
|
+
o.env Core::Environment::Ext::ENV_SERVICE
|
576
|
+
o.default Core::Environment::Ext::FALLBACK_SERVICE_NAME
|
577
|
+
|
578
|
+
# There's a few cases where we don't want to use the fallback service name, so this helper allows us to get a
|
579
|
+
# nil instead so that one can do
|
580
|
+
# nice_service_name = Datadog.configuration.service_without_fallback || nice_service_name_default
|
581
|
+
o.helper(:service_without_fallback) do
|
582
|
+
service_name = service
|
583
|
+
service_name unless service_name.equal?(Core::Environment::Ext::FALLBACK_SERVICE_NAME)
|
584
|
+
end
|
585
|
+
end
|
586
|
+
|
587
|
+
# The Datadog site host to send data to.
|
588
|
+
# By default, data is sent to the Datadog US site: `app.datadoghq.com`.
|
589
|
+
#
|
590
|
+
# If your organization is on another site, you must update this value to the new site.
|
591
|
+
#
|
592
|
+
# For internal use only.
|
593
|
+
#
|
594
|
+
# @see https://docs.datadoghq.com/agent/troubleshooting/site/
|
595
|
+
# @default `DD_SITE` environment variable, otherwise `nil` which sends data to `app.datadoghq.com`
|
596
|
+
# @return [String,nil]
|
597
|
+
option :site do |o|
|
598
|
+
o.type :string, nilable: true
|
599
|
+
o.env Core::Environment::Ext::ENV_SITE
|
600
|
+
end
|
601
|
+
|
602
|
+
# Default tags
|
603
|
+
#
|
604
|
+
# These tags are used by all Datadog products, when applicable.
|
605
|
+
# e.g. trace spans, profiles, etc.
|
606
|
+
# @default `DD_TAGS` environment variable (in the format `'tag1:value1,tag2:value2'`), otherwise `{}`
|
607
|
+
# @return [Hash<String,String>]
|
608
|
+
option :tags do |o|
|
609
|
+
o.type :hash, nilable: true
|
610
|
+
o.env Core::Environment::Ext::ENV_TAGS
|
611
|
+
o.env_parser do |env_value|
|
612
|
+
values = if env_value.include?(',')
|
613
|
+
env_value.split(',')
|
614
|
+
else
|
615
|
+
env_value.split(' ') # rubocop:disable Style/RedundantArgument
|
616
|
+
end
|
617
|
+
|
618
|
+
values.map! do |v|
|
619
|
+
v.gsub!(/\A[\s,]*|[\s,]*\Z/, '')
|
620
|
+
|
621
|
+
v.empty? ? nil : v
|
622
|
+
end
|
623
|
+
|
624
|
+
values.compact!
|
625
|
+
values.each_with_object({}) do |tag, tags|
|
626
|
+
key, value = tag.split(':', 2)
|
627
|
+
tags[key] = value if value && !value.empty?
|
628
|
+
end
|
629
|
+
end
|
630
|
+
o.setter do |new_value, old_value|
|
631
|
+
raw_tags = new_value || {}
|
632
|
+
|
633
|
+
env_value = env
|
634
|
+
version_value = version
|
635
|
+
service_name = service_without_fallback
|
636
|
+
|
637
|
+
# Override tags if defined
|
638
|
+
raw_tags[Core::Environment::Ext::TAG_ENV] = env_value unless env_value.nil?
|
639
|
+
raw_tags[Core::Environment::Ext::TAG_VERSION] = version_value unless version_value.nil?
|
640
|
+
|
641
|
+
# Coerce keys to strings
|
642
|
+
string_tags = raw_tags.collect { |k, v| [k.to_s, v] }.to_h
|
643
|
+
|
644
|
+
# Cross-populate tag values with other settings
|
645
|
+
if env_value.nil? && string_tags.key?(Core::Environment::Ext::TAG_ENV)
|
646
|
+
self.env = string_tags[Core::Environment::Ext::TAG_ENV]
|
647
|
+
end
|
648
|
+
|
649
|
+
if version_value.nil? && string_tags.key?(Core::Environment::Ext::TAG_VERSION)
|
650
|
+
self.version = string_tags[Core::Environment::Ext::TAG_VERSION]
|
651
|
+
end
|
652
|
+
|
653
|
+
if service_name.nil? && string_tags.key?(Core::Environment::Ext::TAG_SERVICE)
|
654
|
+
self.service = string_tags[Core::Environment::Ext::TAG_SERVICE]
|
655
|
+
end
|
656
|
+
|
657
|
+
# Merge with previous tags
|
658
|
+
(old_value || {}).merge(string_tags)
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
# The time provider used by Datadog. It must respect the interface of [Time](https://ruby-doc.org/core-3.0.1/Time.html).
|
663
|
+
#
|
664
|
+
# When testing, it can be helpful to use a different time provider.
|
665
|
+
#
|
666
|
+
# For [Timecop](https://rubygems.org/gems/timecop), for example, `->{ Time.now_without_mock_time }`
|
667
|
+
# allows Datadog features to use the real wall time when time is frozen.
|
668
|
+
#
|
669
|
+
# @default `->{ Time.now }`
|
670
|
+
# @return [Proc<Time>]
|
671
|
+
option :time_now_provider do |o|
|
672
|
+
o.default_proc { ::Time.now }
|
673
|
+
o.type :proc
|
674
|
+
|
675
|
+
o.after_set do |time_provider|
|
676
|
+
Core::Utils::Time.now_provider = time_provider
|
677
|
+
end
|
678
|
+
|
679
|
+
o.resetter do |_value|
|
680
|
+
# TODO: Resetter needs access to the default value
|
681
|
+
# TODO: to help reduce duplication.
|
682
|
+
-> { ::Time.now }.tap do |default|
|
683
|
+
Core::Utils::Time.now_provider = default
|
684
|
+
end
|
685
|
+
end
|
686
|
+
end
|
687
|
+
|
688
|
+
# The `version` tag in Datadog. Use it to enable [Deployment Tracking](https://docs.datadoghq.com/tracing/deployment_tracking/).
|
689
|
+
# @see https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging
|
690
|
+
# @default `DD_VERSION` environment variable, otherwise `nils`
|
691
|
+
# @return [String,nil]
|
692
|
+
option :version do |o|
|
693
|
+
# NOTE: version also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
694
|
+
o.type :string, nilable: true
|
695
|
+
o.env Core::Environment::Ext::ENV_VERSION
|
696
|
+
end
|
697
|
+
|
698
|
+
# Client-side telemetry configuration
|
699
|
+
# @public_api
|
700
|
+
settings :telemetry do
|
701
|
+
# Whether the bundled Ruby gems as reported through telemetry.
|
702
|
+
#
|
703
|
+
# @default `DD_TELEMETRY_DEPENDENCY_COLLECTION_ENABLED` environment variable, otherwise `true`.
|
704
|
+
# @return [Boolean]
|
705
|
+
option :dependency_collection do |o|
|
706
|
+
o.type :bool
|
707
|
+
o.env Core::Telemetry::Ext::ENV_DEPENDENCY_COLLECTION
|
708
|
+
o.default true
|
709
|
+
end
|
710
|
+
|
711
|
+
# Enable telemetry collection. This allows telemetry events to be emitted to the telemetry API.
|
712
|
+
#
|
713
|
+
# @default `DD_INSTRUMENTATION_TELEMETRY_ENABLED` environment variable, otherwise `true`.
|
714
|
+
# Can be disabled as documented [here](https://docs.datadoghq.com/tracing/configure_data_security/#telemetry-collection).
|
715
|
+
# By default, telemetry is disabled in development environments.
|
716
|
+
# @return [Boolean]
|
717
|
+
option :enabled do |o|
|
718
|
+
o.env Core::Telemetry::Ext::ENV_ENABLED
|
719
|
+
o.default do
|
720
|
+
if Datadog::Core::Environment::Execution.development?
|
721
|
+
Datadog.logger.debug do
|
722
|
+
'Development environment detected, disabling Telemetry. ' \
|
723
|
+
'You can enable it with DD_INSTRUMENTATION_TELEMETRY_ENABLED=true.'
|
724
|
+
end
|
725
|
+
false
|
726
|
+
else
|
727
|
+
true
|
728
|
+
end
|
729
|
+
end
|
730
|
+
o.type :bool
|
731
|
+
end
|
732
|
+
|
733
|
+
# The interval in seconds when telemetry must be sent.
|
734
|
+
#
|
735
|
+
# This method is used internally, for testing purposes only.
|
736
|
+
#
|
737
|
+
# @default `DD_TELEMETRY_HEARTBEAT_INTERVAL` environment variable, otherwise `60`.
|
738
|
+
# @return [Float]
|
739
|
+
# @!visibility private
|
740
|
+
option :heartbeat_interval_seconds do |o|
|
741
|
+
o.type :float
|
742
|
+
o.env Core::Telemetry::Ext::ENV_HEARTBEAT_INTERVAL
|
743
|
+
o.default 60.0
|
744
|
+
end
|
745
|
+
|
746
|
+
# The install id of the application.
|
747
|
+
#
|
748
|
+
# This method is used internally, by library injection.
|
749
|
+
#
|
750
|
+
# @default `DD_INSTRUMENTATION_INSTALL_ID` environment variable, otherwise `nil`.
|
751
|
+
# @return [String,nil]
|
752
|
+
# @!visibility private
|
753
|
+
option :install_id do |o|
|
754
|
+
o.type :string, nilable: true
|
755
|
+
o.env Core::Telemetry::Ext::ENV_INSTALL_ID
|
756
|
+
end
|
757
|
+
|
758
|
+
# The install type of the application.
|
759
|
+
#
|
760
|
+
# This method is used internally, by library injection.
|
761
|
+
#
|
762
|
+
# @default `DD_INSTRUMENTATION_INSTALL_TYPE` environment variable, otherwise `nil`.
|
763
|
+
# @return [String,nil]
|
764
|
+
# @!visibility private
|
765
|
+
option :install_type do |o|
|
766
|
+
o.type :string, nilable: true
|
767
|
+
o.env Core::Telemetry::Ext::ENV_INSTALL_TYPE
|
768
|
+
end
|
769
|
+
|
770
|
+
# The install time of the application.
|
771
|
+
#
|
772
|
+
# This method is used internally, by library injection.
|
773
|
+
#
|
774
|
+
# @default `DD_INSTRUMENTATION_INSTALL_TIME` environment variable, otherwise `nil`.
|
775
|
+
# @return [String,nil]
|
776
|
+
# @!visibility private
|
777
|
+
option :install_time do |o|
|
778
|
+
o.type :string, nilable: true
|
779
|
+
o.env Core::Telemetry::Ext::ENV_INSTALL_TIME
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
783
|
+
# Remote configuration
|
784
|
+
# @public_api
|
785
|
+
settings :remote do
|
786
|
+
# Enable remote configuration. This allows fetching of remote configuration for live updates.
|
787
|
+
#
|
788
|
+
# @default `DD_REMOTE_CONFIGURATION_ENABLED` environment variable, otherwise `true`.
|
789
|
+
# By default, remote configuration is disabled in development environments.
|
790
|
+
# @return [Boolean]
|
791
|
+
option :enabled do |o|
|
792
|
+
o.env Core::Remote::Ext::ENV_ENABLED
|
793
|
+
o.default do
|
794
|
+
if Datadog::Core::Environment::Execution.development?
|
795
|
+
Datadog.logger.debug do
|
796
|
+
'Development environment detected, disabling Remote Configuration. ' \
|
797
|
+
'You can enable it with DD_REMOTE_CONFIGURATION_ENABLED=true.'
|
798
|
+
end
|
799
|
+
false
|
800
|
+
else
|
801
|
+
true
|
802
|
+
end
|
803
|
+
end
|
804
|
+
o.type :bool
|
805
|
+
end
|
806
|
+
|
807
|
+
# Tune remote configuration polling interval.
|
808
|
+
# This is a private setting. Do not use outside of Datadog. It might change at any point in time.
|
809
|
+
#
|
810
|
+
# @default `DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS` environment variable, otherwise `5.0` seconds.
|
811
|
+
# @return [Float]
|
812
|
+
# @!visibility private
|
813
|
+
option :poll_interval_seconds do |o|
|
814
|
+
o.env Core::Remote::Ext::ENV_POLL_INTERVAL_SECONDS
|
815
|
+
o.type :float
|
816
|
+
o.default 5.0
|
817
|
+
end
|
818
|
+
|
819
|
+
# Tune remote configuration boot timeout.
|
820
|
+
# Early operations such as requests are blocked until RC is ready. In
|
821
|
+
# order to not block the application indefinitely a timeout is
|
822
|
+
# enforced allowing requests to proceed with the local configuration.
|
823
|
+
#
|
824
|
+
# @default `DD_REMOTE_CONFIG_BOOT_TIMEOUT` environment variable, otherwise `1.0` seconds.
|
825
|
+
# @return [Float]
|
826
|
+
option :boot_timeout_seconds do |o|
|
827
|
+
o.env Core::Remote::Ext::ENV_BOOT_TIMEOUT_SECONDS
|
828
|
+
o.type :float
|
829
|
+
o.default 1.0
|
830
|
+
end
|
831
|
+
|
832
|
+
# Declare service name to bind to remote configuration. Use when
|
833
|
+
# DD_SERVICE does not match the correct integration for which remote
|
834
|
+
# configuration applies.
|
835
|
+
#
|
836
|
+
# @default `nil`.
|
837
|
+
# @return [String,nil]
|
838
|
+
option :service
|
839
|
+
end
|
840
|
+
|
841
|
+
# TODO: Tracing should manage its own settings.
|
842
|
+
# Keep this extension here for now to keep things working.
|
843
|
+
extend Datadog::Tracing::Configuration::Settings
|
844
|
+
end
|
845
|
+
# rubocop:enable Metrics/BlockLength
|
846
|
+
end
|
847
|
+
end
|
848
|
+
end
|