ddtrace 1.10.0 → 1.11.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -2
- data/LICENSE-3rdparty.csv +1 -0
- data/README.md +8 -9
- data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +76 -11
- data/ext/ddtrace_profiling_native_extension/collectors_thread_context.c +26 -3
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +3 -0
- data/lib/datadog/appsec/component.rb +41 -7
- data/lib/datadog/appsec/configuration/settings.rb +20 -4
- data/lib/datadog/appsec/configuration.rb +8 -0
- data/lib/datadog/appsec/contrib/auto_instrument.rb +2 -0
- data/lib/datadog/appsec/contrib/configuration/settings.rb +2 -0
- data/lib/datadog/appsec/contrib/integration.rb +2 -0
- data/lib/datadog/appsec/contrib/patcher.rb +2 -0
- data/lib/datadog/appsec/contrib/rack/configuration/settings.rb +2 -0
- data/lib/datadog/appsec/contrib/rack/gateway/request.rb +7 -25
- data/lib/datadog/appsec/contrib/rack/gateway/response.rb +1 -1
- data/lib/datadog/appsec/contrib/rack/patcher.rb +2 -0
- data/lib/datadog/appsec/contrib/rack/reactive/response.rb +6 -0
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +17 -3
- data/lib/datadog/appsec/contrib/rails/configuration/settings.rb +2 -0
- data/lib/datadog/appsec/contrib/rails/framework.rb +2 -0
- data/lib/datadog/appsec/contrib/rails/gateway/request.rb +1 -1
- data/lib/datadog/appsec/contrib/rails/request.rb +2 -0
- data/lib/datadog/appsec/contrib/rails/request_middleware.rb +2 -0
- data/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb +2 -0
- data/lib/datadog/appsec/contrib/sinatra/framework.rb +2 -0
- data/lib/datadog/appsec/contrib/sinatra/gateway/route_params.rb +1 -1
- data/lib/datadog/appsec/contrib/sinatra/request_middleware.rb +2 -0
- data/lib/datadog/appsec/extensions.rb +2 -0
- data/lib/datadog/appsec/instrumentation/gateway/argument.rb +2 -4
- data/lib/datadog/appsec/processor/rule_loader.rb +63 -0
- data/lib/datadog/appsec/processor/rule_merger.rb +146 -0
- data/lib/datadog/appsec/processor.rb +15 -70
- data/lib/datadog/appsec/remote.rb +121 -0
- data/lib/datadog/appsec/utils/http.rb +2 -0
- data/lib/datadog/appsec/utils.rb +2 -0
- data/lib/datadog/appsec.rb +18 -4
- data/lib/datadog/ci/configuration/components.rb +2 -0
- data/lib/datadog/ci/configuration/settings.rb +2 -0
- data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +2 -0
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +2 -0
- data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +2 -0
- data/lib/datadog/ci/contrib/cucumber/patcher.rb +2 -0
- data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +2 -0
- data/lib/datadog/ci/contrib/rspec/patcher.rb +2 -0
- data/lib/datadog/ci/ext/environment.rb +2 -20
- data/lib/datadog/ci/extensions.rb +2 -0
- data/lib/datadog/ci/flush.rb +2 -0
- data/lib/datadog/ci.rb +2 -0
- data/lib/datadog/core/buffer/cruby.rb +2 -0
- data/lib/datadog/core/buffer/random.rb +2 -0
- data/lib/datadog/core/buffer/thread_safe.rb +2 -0
- data/lib/datadog/core/chunker.rb +2 -0
- data/lib/datadog/core/configuration/agent_settings_resolver.rb +6 -6
- data/lib/datadog/core/configuration/components.rb +12 -15
- data/lib/datadog/core/configuration/dependency_resolver.rb +2 -0
- data/lib/datadog/core/configuration/option.rb +2 -0
- data/lib/datadog/core/configuration/option_definition.rb +2 -0
- data/lib/datadog/core/configuration/option_definition_set.rb +2 -0
- data/lib/datadog/core/configuration/option_set.rb +2 -0
- data/lib/datadog/core/configuration/settings.rb +68 -13
- data/lib/datadog/core/diagnostics/health.rb +2 -0
- data/lib/datadog/core/environment/class_count.rb +2 -0
- data/lib/datadog/core/environment/gc.rb +2 -0
- data/lib/datadog/core/environment/identity.rb +2 -0
- data/lib/datadog/core/environment/socket.rb +2 -0
- data/lib/datadog/core/environment/thread_count.rb +2 -0
- data/lib/datadog/core/environment/variable_helpers.rb +10 -2
- data/lib/datadog/core/environment/vm_cache.rb +2 -0
- data/lib/datadog/core/extensions.rb +2 -0
- data/lib/datadog/core/header_collection.rb +2 -0
- data/lib/datadog/core/metrics/helpers.rb +2 -0
- data/lib/datadog/core/metrics/metric.rb +2 -0
- data/lib/datadog/core/remote/client/capabilities.rb +57 -0
- data/lib/datadog/core/remote/client.rb +146 -0
- data/lib/datadog/core/remote/component.rb +150 -0
- data/lib/datadog/core/remote/configuration/content.rb +82 -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 +278 -0
- data/lib/datadog/core/remote/configuration/target.rb +72 -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 +12 -0
- data/lib/datadog/core/remote/worker.rb +96 -0
- data/lib/datadog/core/remote.rb +24 -0
- data/lib/datadog/core/telemetry/collector.rb +8 -9
- data/lib/datadog/core/telemetry/heartbeat.rb +2 -0
- data/lib/datadog/core/telemetry/http/env.rb +2 -0
- data/lib/datadog/core/telemetry/http/transport.rb +2 -0
- data/lib/datadog/core/telemetry/v1/app_event.rb +2 -0
- data/lib/datadog/core/telemetry/v1/application.rb +7 -1
- data/lib/datadog/core/telemetry/v1/dependency.rb +7 -1
- data/lib/datadog/core/telemetry/v1/host.rb +9 -1
- data/lib/datadog/core/telemetry/v1/integration.rb +7 -1
- data/lib/datadog/core/telemetry/v1/product.rb +9 -1
- data/lib/datadog/core/telemetry/v1/telemetry_request.rb +7 -1
- data/lib/datadog/core/transport/config.rb +58 -0
- data/lib/datadog/core/transport/http/api/instance.rb +37 -0
- data/lib/datadog/core/transport/http/api/spec.rb +19 -0
- data/lib/datadog/core/transport/http/api.rb +57 -0
- data/lib/datadog/core/transport/http/builder.rb +217 -0
- data/lib/datadog/core/transport/http/client.rb +45 -0
- data/lib/datadog/core/transport/http/config.rb +268 -0
- data/lib/datadog/core/transport/http/negotiation.rb +144 -0
- data/lib/datadog/core/transport/http.rb +169 -0
- data/lib/datadog/core/transport/negotiation.rb +60 -0
- data/lib/datadog/core/utils/compression.rb +2 -0
- data/lib/datadog/core/utils/hash.rb +32 -0
- data/lib/datadog/core/utils/network.rb +140 -0
- data/lib/datadog/core/utils/object_set.rb +2 -0
- data/lib/datadog/core/utils/safe_dup.rb +20 -2
- data/lib/datadog/core/utils/sequence.rb +2 -0
- data/lib/datadog/core/utils/time.rb +2 -0
- data/lib/datadog/core/vendor/ipaddr.rb +78 -0
- data/lib/datadog/core/worker.rb +2 -0
- data/lib/datadog/core/workers/interval_loop.rb +2 -0
- data/lib/datadog/core/workers/queue.rb +2 -0
- data/lib/datadog/core/workers/runtime_metrics.rb +2 -0
- data/lib/datadog/kit/appsec/events.rb +1 -1
- data/lib/datadog/kit.rb +2 -0
- data/lib/datadog/opentracer/binary_propagator.rb +2 -0
- data/lib/datadog/opentracer/carrier.rb +2 -0
- data/lib/datadog/opentracer/global_tracer.rb +2 -0
- data/lib/datadog/opentracer/propagator.rb +2 -0
- data/lib/datadog/opentracer/scope.rb +2 -0
- data/lib/datadog/opentracer/scope_manager.rb +2 -0
- data/lib/datadog/opentracer/span_context.rb +2 -0
- data/lib/datadog/opentracer/span_context_factory.rb +2 -0
- data/lib/datadog/opentracer/thread_local_scope.rb +2 -0
- data/lib/datadog/opentracer.rb +2 -0
- data/lib/datadog/profiling/backtrace_location.rb +2 -0
- data/lib/datadog/profiling/buffer.rb +2 -0
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +19 -3
- data/lib/datadog/profiling/collectors/dynamic_sampling_rate.rb +2 -0
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +1 -1
- data/lib/datadog/profiling/collectors/stack.rb +2 -0
- data/lib/datadog/profiling/collectors/thread_context.rb +2 -2
- data/lib/datadog/profiling/component.rb +103 -29
- data/lib/datadog/profiling/event.rb +2 -0
- data/lib/datadog/profiling/events/stack.rb +2 -0
- data/lib/datadog/profiling/ext.rb +28 -26
- data/lib/datadog/profiling/flush.rb +2 -0
- data/lib/datadog/profiling/native_extension.rb +2 -0
- data/lib/datadog/profiling/pprof/message_set.rb +2 -0
- data/lib/datadog/profiling/pprof/payload.rb +2 -0
- data/lib/datadog/profiling/pprof/string_table.rb +2 -0
- data/lib/datadog/profiling/preload.rb +2 -0
- data/lib/datadog/profiling/scheduler.rb +3 -1
- data/lib/datadog/profiling/stack_recorder.rb +0 -18
- data/lib/datadog/profiling/tag_builder.rb +2 -0
- data/lib/datadog/profiling/tasks/setup.rb +0 -26
- data/lib/datadog/profiling.rb +2 -1
- data/lib/datadog/tracing/analytics.rb +2 -0
- data/lib/datadog/tracing/client_ip.rb +39 -140
- data/lib/datadog/tracing/configuration/ext.rb +7 -0
- data/lib/datadog/tracing/configuration/settings.rb +14 -0
- data/lib/datadog/tracing/context.rb +2 -0
- data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/action_cable/event.rb +2 -0
- data/lib/datadog/tracing/contrib/action_cable/events.rb +2 -0
- data/lib/datadog/tracing/contrib/action_cable/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/action_mailer/event.rb +2 -0
- data/lib/datadog/tracing/contrib/action_mailer/events.rb +2 -0
- data/lib/datadog/tracing/contrib/action_mailer/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +2 -24
- data/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +14 -1
- data/lib/datadog/tracing/contrib/action_pack/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/action_view/event.rb +2 -0
- data/lib/datadog/tracing/contrib/action_view/events.rb +2 -0
- data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/active_job/event.rb +2 -0
- data/lib/datadog/tracing/contrib/active_job/events.rb +2 -0
- data/lib/datadog/tracing/contrib/active_job/log_injection.rb +2 -0
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/event.rb +2 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/events.rb +2 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/active_record/event.rb +2 -0
- data/lib/datadog/tracing/contrib/active_record/events.rb +2 -0
- data/lib/datadog/tracing/contrib/active_record/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/cache/redis.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/notifications/event.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +2 -0
- data/lib/datadog/tracing/contrib/active_support/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/analytics.rb +2 -0
- data/lib/datadog/tracing/contrib/auto_instrument.rb +2 -0
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +9 -1
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +8 -2
- data/lib/datadog/tracing/contrib/aws/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb +2 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb +2 -0
- data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/configurable.rb +2 -0
- data/lib/datadog/tracing/contrib/configuration/resolver.rb +2 -0
- data/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb +2 -0
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/dalli/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/delayed_job/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/delayed_job/plugin.rb +2 -0
- data/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb +2 -0
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +2 -0
- data/lib/datadog/tracing/contrib/ethon/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/excon/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/faraday/connection.rb +2 -0
- data/lib/datadog/tracing/contrib/faraday/rack_builder.rb +2 -0
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/grape/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/grpc/intercept_with_datadog.rb +2 -0
- data/lib/datadog/tracing/contrib/grpc/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/action_tracer.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/plugin.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/renderer_policy_tracing.rb +2 -0
- data/lib/datadog/tracing/contrib/hanami/router_tracing.rb +2 -0
- data/lib/datadog/tracing/contrib/http/circuit_breaker.rb +2 -0
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/http/integration.rb +2 -0
- data/lib/datadog/tracing/contrib/http/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/http_annotation_helper.rb +2 -0
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/integration.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/consumer_event.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/consumer_group_event.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/event.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/events.rb +2 -0
- data/lib/datadog/tracing/contrib/kafka/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/lograge/instrumentation.rb +2 -0
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/mongodb/instrumentation.rb +2 -0
- data/lib/datadog/tracing/contrib/mongodb/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +2 -0
- data/lib/datadog/tracing/contrib/mysql2/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/patchable.rb +2 -0
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +2 -0
- data/lib/datadog/tracing/contrib/pg/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/propagation/sql_comment/mode.rb +2 -0
- data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/qless/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +2 -0
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/racecar/event.rb +2 -0
- data/lib/datadog/tracing/contrib/racecar/events.rb +2 -0
- data/lib/datadog/tracing/contrib/racecar/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +9 -2
- data/lib/datadog/tracing/contrib/rails/framework.rb +2 -0
- data/lib/datadog/tracing/contrib/rails/middlewares.rb +2 -0
- data/lib/datadog/tracing/contrib/rails/utils.rb +3 -1
- data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/rake/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/redis/tags.rb +2 -0
- data/lib/datadog/tracing/contrib/registerable.rb +2 -0
- data/lib/datadog/tracing/contrib/registry.rb +2 -0
- data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/resque/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/resque/resque_job.rb +2 -0
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/rest_client/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +2 -0
- data/lib/datadog/tracing/contrib/roda/configuration/settings.rb +34 -0
- data/lib/datadog/tracing/contrib/roda/ext.rb +18 -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 +2 -0
- data/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +3 -0
- data/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/sequel/dataset.rb +2 -0
- data/lib/datadog/tracing/contrib/sequel/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/shoryuken/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/shoryuken/tracer.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +12 -3
- data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +3 -0
- data/lib/datadog/tracing/contrib/sidekiq/distributed/propagation.rb +38 -0
- data/lib/datadog/tracing/contrib/sidekiq/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb +2 -0
- data/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +18 -2
- data/lib/datadog/tracing/contrib/sidekiq/{tracing.rb → utils.rb} +3 -1
- data/lib/datadog/tracing/contrib/sinatra/headers.rb +2 -0
- data/lib/datadog/tracing/contrib/sinatra/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +2 -0
- data/lib/datadog/tracing/contrib/span_attribute_schema.rb +28 -0
- data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +2 -0
- data/lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb +2 -0
- data/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +2 -0
- data/lib/datadog/tracing/contrib/utils/quantization/http.rb +2 -2
- data/lib/datadog/tracing/contrib.rb +3 -0
- data/lib/datadog/tracing/correlation.rb +10 -10
- data/lib/datadog/tracing/diagnostics/health.rb +2 -0
- data/lib/datadog/tracing/distributed/trace_context.rb +22 -15
- data/lib/datadog/tracing/flush.rb +2 -0
- data/lib/datadog/tracing/metadata/analytics.rb +2 -0
- data/lib/datadog/tracing/metadata/errors.rb +2 -0
- data/lib/datadog/tracing/metadata/ext.rb +6 -0
- data/lib/datadog/tracing/metadata.rb +2 -0
- data/lib/datadog/tracing/pipeline/span_filter.rb +2 -0
- data/lib/datadog/tracing/pipeline/span_processor.rb +2 -0
- data/lib/datadog/tracing/propagation/http.rb +2 -0
- data/lib/datadog/tracing/runtime/metrics.rb +2 -0
- data/lib/datadog/tracing/sampling/all_sampler.rb +2 -0
- data/lib/datadog/tracing/sampling/matcher.rb +2 -0
- data/lib/datadog/tracing/sampling/priority_sampler.rb +2 -0
- data/lib/datadog/tracing/sampling/span/sampler.rb +2 -0
- data/lib/datadog/tracing/sync_writer.rb +2 -0
- data/lib/datadog/tracing/trace_digest.rb +2 -0
- data/lib/datadog/tracing/utils.rb +2 -0
- data/lib/datadog/tracing.rb +2 -0
- data/lib/ddtrace/auto_instrument.rb +2 -0
- data/lib/ddtrace/auto_instrument_base.rb +2 -0
- data/lib/ddtrace/transport/http/adapters/net.rb +12 -0
- data/lib/ddtrace/transport/http/adapters/registry.rb +2 -0
- data/lib/ddtrace/transport/http/api/endpoint.rb +2 -0
- data/lib/ddtrace/transport/http/api/fallbacks.rb +2 -0
- data/lib/ddtrace/transport/http/api/instance.rb +2 -0
- data/lib/ddtrace/transport/http/api/map.rb +2 -0
- data/lib/ddtrace/transport/http/api/spec.rb +2 -0
- data/lib/ddtrace/transport/http/env.rb +2 -0
- data/lib/ddtrace/transport/http/response.rb +2 -0
- data/lib/ddtrace/transport/http/traces.rb +1 -1
- data/lib/ddtrace/transport/io/response.rb +2 -0
- data/lib/ddtrace/transport/io/traces.rb +2 -0
- data/lib/ddtrace/transport/io.rb +2 -0
- data/lib/ddtrace/transport/parcel.rb +2 -0
- data/lib/ddtrace/transport/request.rb +3 -1
- data/lib/ddtrace/transport/statistics.rb +2 -0
- data/lib/ddtrace/transport/trace_formatter.rb +2 -0
- data/lib/ddtrace/transport/traces.rb +1 -1
- data/lib/ddtrace/version.rb +6 -4
- data/lib/ddtrace.rb +2 -0
- metadata +45 -9
@@ -1,5 +1,7 @@
|
|
1
1
|
require_relative '../../configuration/settings'
|
2
2
|
|
3
|
+
require_relative '../../../../core'
|
4
|
+
|
3
5
|
module Datadog
|
4
6
|
module Tracing
|
5
7
|
module Contrib
|
@@ -48,10 +50,15 @@ module Datadog
|
|
48
50
|
|
49
51
|
option :request_queuing, default: false
|
50
52
|
|
53
|
+
# DEV-2.0: Breaking changes for removal.
|
51
54
|
option :exception_controller do |o|
|
52
55
|
o.on_set do |value|
|
53
|
-
|
54
|
-
|
56
|
+
if value
|
57
|
+
Datadog::Core.log_deprecation do
|
58
|
+
'The error controller is now automatically detected. '\
|
59
|
+
"Option `#{o.instance_variable_get(:@name)}` is no longer required and will be removed."
|
60
|
+
end
|
61
|
+
end
|
55
62
|
end
|
56
63
|
end
|
57
64
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative '../analytics'
|
2
4
|
|
3
5
|
module Datadog
|
@@ -17,7 +19,7 @@ module Datadog
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def self.railtie_supported?
|
20
|
-
|
22
|
+
!!(defined?(::Rails::VERSION::MAJOR) && ::Rails::VERSION::MAJOR >= 3 && defined?(::Rails::Railtie))
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../configuration/settings'
|
4
|
+
require_relative '../ext'
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module Tracing
|
8
|
+
module Contrib
|
9
|
+
module Roda
|
10
|
+
module Configuration
|
11
|
+
# Custom settings for the Roda integration
|
12
|
+
class Settings < Contrib::Configuration::Settings
|
13
|
+
option :enabled do |o|
|
14
|
+
o.default { env_to_bool(Ext::ENV_ENABLED, true) }
|
15
|
+
o.lazy
|
16
|
+
end
|
17
|
+
|
18
|
+
option :analytics_enabled do |o|
|
19
|
+
o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
|
20
|
+
o.lazy
|
21
|
+
end
|
22
|
+
|
23
|
+
option :analytics_sample_rate do |o|
|
24
|
+
o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
|
25
|
+
o.lazy
|
26
|
+
end
|
27
|
+
|
28
|
+
option :service_name
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module Tracing
|
5
|
+
module Contrib
|
6
|
+
module Roda
|
7
|
+
# Roda integration constants
|
8
|
+
module Ext
|
9
|
+
APP = 'roda'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_RODA_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_RODA_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_RODA_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SPAN_REQUEST = 'roda.request'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../metadata/ext'
|
4
|
+
require_relative 'ext'
|
5
|
+
require_relative '../analytics'
|
6
|
+
|
7
|
+
module Datadog
|
8
|
+
module Tracing
|
9
|
+
module Contrib
|
10
|
+
module Roda
|
11
|
+
# Instrumentation for Roda
|
12
|
+
module Instrumentation
|
13
|
+
def _roda_handle_main_route
|
14
|
+
instrument(Ext::SPAN_REQUEST) { super }
|
15
|
+
end
|
16
|
+
|
17
|
+
def call
|
18
|
+
instrument(Ext::SPAN_REQUEST) { super }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def instrument(span_name, &block)
|
24
|
+
Tracing.trace(span_name) do |span|
|
25
|
+
begin
|
26
|
+
request_method = request.request_method.to_s.upcase
|
27
|
+
|
28
|
+
span.service = configuration[:service_name] if configuration[:service_name]
|
29
|
+
|
30
|
+
span.span_type = Tracing::Metadata::Ext::HTTP::TYPE_INBOUND
|
31
|
+
|
32
|
+
# Using the http method as a resource, since the URL/path can trigger
|
33
|
+
# a possibly infinite number of resources.
|
34
|
+
span.resource = request_method
|
35
|
+
|
36
|
+
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_URL, request.path)
|
37
|
+
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD, request_method)
|
38
|
+
|
39
|
+
# Add analytics tag to the span
|
40
|
+
if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
|
41
|
+
Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Measure service stats
|
45
|
+
Contrib::Analytics.set_measured(span)
|
46
|
+
ensure
|
47
|
+
begin
|
48
|
+
response = yield
|
49
|
+
rescue StandardError
|
50
|
+
# The status code is unknown to Roda and decided by the upstream web runner.
|
51
|
+
# In this case, spans default to status code 500 rather than a blank status code.
|
52
|
+
default_error_status = '500'
|
53
|
+
span.resource = "#{request_method} #{default_error_status}"
|
54
|
+
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_STATUS_CODE, default_error_status)
|
55
|
+
raise
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
status_code = response[0]
|
60
|
+
|
61
|
+
# Adds status code to the resource name once the resource comes back
|
62
|
+
span.resource = "#{request_method} #{status_code}"
|
63
|
+
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_STATUS_CODE, status_code)
|
64
|
+
span.status = 1 if status_code.to_s.start_with?('5')
|
65
|
+
response
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def configuration
|
70
|
+
Datadog.configuration.tracing[:roda]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# typed: false
|
4
|
+
|
5
|
+
require_relative '../integration'
|
6
|
+
require_relative 'configuration/settings'
|
7
|
+
require_relative 'patcher'
|
8
|
+
|
9
|
+
module Datadog
|
10
|
+
module Tracing
|
11
|
+
module Contrib
|
12
|
+
module Roda
|
13
|
+
# Description of Roda integration
|
14
|
+
class Integration
|
15
|
+
include Contrib::Integration
|
16
|
+
|
17
|
+
MINIMUM_VERSION = Gem::Version.new('2.0.0')
|
18
|
+
MAXIMUM_VERSION = Gem::Version.new('4.0.0')
|
19
|
+
|
20
|
+
register_as :roda
|
21
|
+
|
22
|
+
def self.version
|
23
|
+
Gem.loaded_specs['roda'] && Gem.loaded_specs['roda'].version
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.loaded?
|
27
|
+
!defined?(::Roda).nil?
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.compatible?
|
31
|
+
super && version >= MINIMUM_VERSION && version < MAXIMUM_VERSION
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_configuration
|
35
|
+
Configuration::Settings.new
|
36
|
+
end
|
37
|
+
|
38
|
+
def patcher
|
39
|
+
Patcher
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# typed: ignore
|
4
|
+
|
5
|
+
require_relative 'patcher'
|
6
|
+
require_relative 'ext'
|
7
|
+
require_relative 'instrumentation'
|
8
|
+
|
9
|
+
module Datadog
|
10
|
+
module Tracing
|
11
|
+
module Contrib
|
12
|
+
module Roda
|
13
|
+
# Patcher enables patching of 'roda'
|
14
|
+
module Patcher
|
15
|
+
include Contrib::Patcher
|
16
|
+
|
17
|
+
module_function
|
18
|
+
|
19
|
+
def target_version
|
20
|
+
Integration.version
|
21
|
+
end
|
22
|
+
|
23
|
+
def patch
|
24
|
+
::Roda.prepend(Instrumentation)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative '../../../core/logging/ext'
|
2
4
|
|
3
5
|
module Datadog
|
@@ -14,6 +16,7 @@ module Datadog
|
|
14
16
|
module InstanceMethods
|
15
17
|
def log(log, message = nil, progname = nil, &block)
|
16
18
|
return super unless Datadog.configuration.tracing[:semantic_logger].enabled
|
19
|
+
return super unless log.is_a?(::SemanticLogger::Log)
|
17
20
|
|
18
21
|
original_named_tags = log.named_tags || {}
|
19
22
|
|