ddtrace 0.42.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +274 -137
- data/.circleci/images/primary/Dockerfile-3.0.0 +73 -0
- data/.circleci/images/primary/{Dockerfile-jruby-9.2 → Dockerfile-jruby-9.2-latest} +2 -1
- data/.circleci/images/primary/Dockerfile-jruby-9.2.0.0 +73 -0
- data/.circleci/images/primary/Dockerfile-truffleruby-21.0.0 +73 -0
- data/.github/workflows/add-milestone-to-pull-requests.yml +42 -0
- data/.github/workflows/create-next-milestone.yml +20 -0
- data/.rubocop.yml +250 -7
- data/.rubocop_todo.yml +397 -0
- data/.simplecov +9 -0
- data/Appraisals +386 -142
- data/CHANGELOG.md +1218 -362
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +55 -3
- data/LICENSE-3rdparty.csv +2 -0
- data/README.md +1 -0
- data/Rakefile +216 -29
- data/ddtrace.gemspec +4 -36
- data/docker-compose.yml +105 -7
- data/docs/DevelopmentGuide.md +30 -2
- data/docs/GettingStarted.md +242 -22
- data/integration/README.md +68 -0
- data/integration/apps/rack/.dockerignore +1 -0
- data/integration/apps/rack/.envrc.sample +1 -0
- data/integration/apps/rack/.gitignore +4 -0
- data/integration/apps/rack/.rspec +1 -0
- data/integration/apps/rack/Dockerfile +25 -0
- data/integration/apps/rack/Dockerfile-ci +11 -0
- data/integration/apps/rack/Gemfile +24 -0
- data/integration/apps/rack/README.md +93 -0
- data/integration/apps/rack/app/acme.rb +80 -0
- data/integration/apps/rack/app/datadog.rb +17 -0
- data/integration/apps/rack/bin/run +22 -0
- data/integration/apps/rack/bin/setup +17 -0
- data/integration/apps/rack/bin/test +24 -0
- data/integration/apps/rack/config.ru +6 -0
- data/integration/apps/rack/config/puma.rb +14 -0
- data/integration/apps/rack/config/unicorn.rb +23 -0
- data/integration/apps/rack/docker-compose.ci.yml +62 -0
- data/integration/apps/rack/docker-compose.yml +78 -0
- data/integration/apps/rack/script/build-images +38 -0
- data/integration/apps/rack/script/ci +50 -0
- data/integration/apps/rack/spec/integration/basic_spec.rb +10 -0
- data/integration/apps/rack/spec/spec_helper.rb +16 -0
- data/integration/apps/rack/spec/support/integration_helper.rb +22 -0
- data/integration/apps/rails-five/.dockerignore +1 -0
- data/integration/apps/rails-five/.env +3 -0
- data/integration/apps/rails-five/.envrc.sample +1 -0
- data/integration/apps/rails-five/.gitignore +30 -0
- data/integration/apps/rails-five/Dockerfile +25 -0
- data/integration/apps/rails-five/Dockerfile-ci +11 -0
- data/integration/apps/rails-five/Gemfile +104 -0
- data/integration/apps/rails-five/README.md +94 -0
- data/integration/apps/rails-five/Rakefile +6 -0
- data/integration/apps/rails-five/app/channels/application_cable/channel.rb +4 -0
- data/integration/apps/rails-five/app/channels/application_cable/connection.rb +4 -0
- data/integration/apps/rails-five/app/controllers/application_controller.rb +2 -0
- data/integration/apps/rails-five/app/controllers/basic_controller.rb +36 -0
- data/integration/apps/rails-five/app/controllers/concerns/.keep +0 -0
- data/integration/apps/rails-five/app/controllers/health_controller.rb +9 -0
- data/integration/apps/rails-five/app/controllers/jobs_controller.rb +12 -0
- data/integration/apps/rails-five/app/jobs/application_job.rb +2 -0
- data/integration/apps/rails-five/app/jobs/test_job.rb +12 -0
- data/integration/apps/rails-five/app/mailers/application_mailer.rb +4 -0
- data/integration/apps/rails-five/app/models/application_record.rb +3 -0
- data/integration/apps/rails-five/app/models/concerns/.keep +0 -0
- data/integration/apps/rails-five/app/models/test.rb +2 -0
- data/integration/apps/rails-five/app/views/layouts/mailer.html.erb +13 -0
- data/integration/apps/rails-five/app/views/layouts/mailer.text.erb +1 -0
- data/integration/apps/rails-five/bin/bundle +3 -0
- data/integration/apps/rails-five/bin/rails +9 -0
- data/integration/apps/rails-five/bin/rake +9 -0
- data/integration/apps/rails-five/bin/run +24 -0
- data/integration/apps/rails-five/bin/setup +27 -0
- data/integration/apps/rails-five/bin/spring +17 -0
- data/integration/apps/rails-five/bin/test +21 -0
- data/integration/apps/rails-five/bin/update +28 -0
- data/integration/apps/rails-five/config.ru +5 -0
- data/integration/apps/rails-five/config/application.rb +97 -0
- data/integration/apps/rails-five/config/boot.rb +4 -0
- data/integration/apps/rails-five/config/cable.yml +10 -0
- data/integration/apps/rails-five/config/credentials.yml.enc +1 -0
- data/integration/apps/rails-five/config/database.yml +28 -0
- data/integration/apps/rails-five/config/environment.rb +5 -0
- data/integration/apps/rails-five/config/environments/development.rb +51 -0
- data/integration/apps/rails-five/config/environments/production.rb +82 -0
- data/integration/apps/rails-five/config/environments/test.rb +43 -0
- data/integration/apps/rails-five/config/initializers/datadog.rb +18 -0
- data/integration/apps/rails-five/config/initializers/filter_parameter_logging.rb +4 -0
- data/integration/apps/rails-five/config/initializers/resque.rb +4 -0
- data/integration/apps/rails-five/config/initializers/rollbar.rb +5 -0
- data/integration/apps/rails-five/config/initializers/wrap_parameters.rb +14 -0
- data/integration/apps/rails-five/config/locales/en.yml +33 -0
- data/integration/apps/rails-five/config/puma.rb +24 -0
- data/integration/apps/rails-five/config/routes.rb +11 -0
- data/integration/apps/rails-five/config/spring.rb +6 -0
- data/integration/apps/rails-five/config/unicorn.rb +29 -0
- data/integration/apps/rails-five/db/migrate/20190927215052_create_tests.rb +11 -0
- data/integration/apps/rails-five/db/schema.rb +23 -0
- data/integration/apps/rails-five/db/seeds.rb +7 -0
- data/integration/apps/rails-five/docker-compose.ci.yml +98 -0
- data/integration/apps/rails-five/docker-compose.yml +100 -0
- data/integration/apps/rails-five/lib/tasks/.keep +0 -0
- data/integration/apps/rails-five/log/.keep +0 -0
- data/integration/apps/rails-five/public/robots.txt +1 -0
- data/integration/apps/rails-five/script/build-images +35 -0
- data/integration/apps/rails-five/script/ci +50 -0
- data/integration/apps/rails-five/spec/integration/basic_spec.rb +10 -0
- data/integration/apps/rails-five/spec/spec_helper.rb +16 -0
- data/integration/apps/rails-five/spec/support/integration_helper.rb +22 -0
- data/integration/apps/rails-five/storage/.keep +0 -0
- data/integration/apps/rails-five/tmp/.keep +0 -0
- data/integration/apps/rails-five/vendor/.keep +0 -0
- data/integration/apps/ruby/.dockerignore +1 -0
- data/integration/apps/ruby/.envrc.sample +1 -0
- data/integration/apps/ruby/.gitignore +2 -0
- data/integration/apps/ruby/Dockerfile +25 -0
- data/integration/apps/ruby/Dockerfile-ci +11 -0
- data/integration/apps/ruby/Gemfile +11 -0
- data/integration/apps/ruby/README.md +70 -0
- data/integration/apps/ruby/agent.yaml +3 -0
- data/integration/apps/ruby/app/datadog.rb +13 -0
- data/integration/apps/ruby/app/fibonacci.rb +58 -0
- data/integration/apps/ruby/bin/run +20 -0
- data/integration/apps/ruby/bin/setup +17 -0
- data/integration/apps/ruby/bin/test +21 -0
- data/integration/apps/ruby/docker-compose.ci.yml +51 -0
- data/integration/apps/ruby/docker-compose.yml +63 -0
- data/integration/apps/ruby/script/build-images +38 -0
- data/integration/apps/ruby/script/ci +50 -0
- data/integration/images/agent/Dockerfile +2 -0
- data/integration/images/agent/agent.yaml +3 -0
- data/integration/images/include/datadog/analyzer.rb +71 -0
- data/integration/images/include/datadog/demo_env.rb +101 -0
- data/integration/images/include/http-health-check +33 -0
- data/integration/images/ruby/2.0/Dockerfile +54 -0
- data/integration/images/ruby/2.1/Dockerfile +54 -0
- data/integration/images/ruby/2.2/Dockerfile +54 -0
- data/integration/images/ruby/2.3/Dockerfile +70 -0
- data/integration/images/ruby/2.4/Dockerfile +54 -0
- data/integration/images/ruby/2.5/Dockerfile +54 -0
- data/integration/images/ruby/2.6/Dockerfile +54 -0
- data/integration/images/ruby/2.7/Dockerfile +54 -0
- data/integration/images/ruby/3.0/Dockerfile +54 -0
- data/integration/images/wrk/Dockerfile +33 -0
- data/integration/images/wrk/scripts/entrypoint.sh +17 -0
- data/integration/images/wrk/scripts/scenarios/basic/default.lua +1 -0
- data/integration/images/wrk/scripts/scenarios/basic/fibonacci.lua +1 -0
- data/integration/script/build-images +43 -0
- data/lib/ddtrace.rb +10 -5
- data/lib/ddtrace/analytics.rb +2 -0
- data/lib/ddtrace/auto_instrument.rb +3 -0
- data/lib/ddtrace/auto_instrument_base.rb +6 -0
- data/lib/ddtrace/buffer.rb +4 -4
- data/lib/ddtrace/configuration.rb +108 -23
- data/lib/ddtrace/configuration/base.rb +1 -1
- data/lib/ddtrace/configuration/components.rb +2 -2
- data/lib/ddtrace/configuration/option_definition.rb +1 -3
- data/lib/ddtrace/configuration/options.rb +4 -7
- data/lib/ddtrace/configuration/settings.rb +21 -5
- data/lib/ddtrace/context.rb +23 -6
- data/lib/ddtrace/context_provider.rb +12 -2
- data/lib/ddtrace/contrib/action_cable/event.rb +1 -0
- data/lib/ddtrace/contrib/action_cable/integration.rb +7 -0
- data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +1 -3
- data/lib/ddtrace/contrib/action_pack/integration.rb +7 -0
- data/lib/ddtrace/contrib/action_view/event.rb +1 -5
- data/lib/ddtrace/contrib/action_view/events/render_partial.rb +1 -0
- data/lib/ddtrace/contrib/action_view/events/render_template.rb +1 -0
- data/lib/ddtrace/contrib/action_view/integration.rb +7 -0
- data/lib/ddtrace/contrib/action_view/utils.rb +1 -1
- data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +101 -18
- data/lib/ddtrace/contrib/active_record/integration.rb +7 -0
- data/lib/ddtrace/contrib/active_record/utils.rb +68 -21
- data/lib/ddtrace/contrib/active_support/cache/instrumentation.rb +104 -3
- data/lib/ddtrace/contrib/active_support/cache/patcher.rb +21 -0
- data/lib/ddtrace/contrib/active_support/ext.rb +3 -0
- data/lib/ddtrace/contrib/active_support/integration.rb +7 -1
- data/lib/ddtrace/contrib/active_support/notifications/event.rb +12 -1
- data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +1 -0
- data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +9 -5
- data/lib/ddtrace/contrib/auto_instrument.rb +49 -0
- data/lib/ddtrace/contrib/aws/instrumentation.rb +2 -1
- data/lib/ddtrace/contrib/aws/patcher.rb +1 -1
- data/lib/ddtrace/contrib/aws/services.rb +3 -0
- data/lib/ddtrace/contrib/configurable.rb +63 -37
- data/lib/ddtrace/contrib/configuration/resolver.rb +70 -5
- data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +20 -20
- data/lib/ddtrace/contrib/configuration/settings.rb +7 -6
- data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +28 -0
- data/lib/ddtrace/contrib/cucumber/ext.rb +17 -0
- data/lib/ddtrace/contrib/cucumber/formatter.rb +98 -0
- data/lib/ddtrace/contrib/cucumber/instrumentation.rb +24 -0
- data/lib/ddtrace/contrib/cucumber/integration.rb +45 -0
- data/lib/ddtrace/contrib/cucumber/patcher.rb +23 -0
- data/lib/ddtrace/contrib/dalli/patcher.rb +0 -38
- data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/delayed_job/plugin.rb +2 -1
- data/lib/ddtrace/contrib/elasticsearch/patcher.rb +1 -0
- data/lib/ddtrace/contrib/elasticsearch/quantize.rb +3 -2
- data/lib/ddtrace/contrib/ethon/easy_patch.rb +11 -10
- data/lib/ddtrace/contrib/ethon/ext.rb +1 -0
- data/lib/ddtrace/contrib/excon/middleware.rb +9 -7
- data/lib/ddtrace/contrib/extensions.rb +53 -3
- data/lib/ddtrace/contrib/faraday/middleware.rb +1 -3
- data/lib/ddtrace/contrib/faraday/patcher.rb +0 -36
- data/lib/ddtrace/contrib/grape/configuration/settings.rb +7 -0
- data/lib/ddtrace/contrib/grape/endpoint.rb +47 -21
- data/lib/ddtrace/contrib/grape/ext.rb +1 -0
- data/lib/ddtrace/contrib/grape/patcher.rb +0 -42
- data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +8 -8
- data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +1 -0
- data/lib/ddtrace/contrib/grpc/patcher.rb +0 -36
- data/lib/ddtrace/contrib/http/circuit_breaker.rb +1 -3
- data/lib/ddtrace/contrib/http/instrumentation.rb +7 -7
- data/lib/ddtrace/contrib/httpclient/configuration/settings.rb +32 -0
- data/lib/ddtrace/contrib/httpclient/ext.rb +17 -0
- data/lib/ddtrace/contrib/httpclient/instrumentation.rb +147 -0
- data/lib/ddtrace/contrib/httpclient/integration.rb +43 -0
- data/lib/ddtrace/contrib/httpclient/patcher.rb +38 -0
- data/lib/ddtrace/contrib/httprb/instrumentation.rb +15 -21
- data/lib/ddtrace/contrib/httprb/patcher.rb +5 -2
- data/lib/ddtrace/contrib/kafka/event.rb +1 -1
- data/lib/ddtrace/contrib/mongodb/instrumentation.rb +2 -0
- data/lib/ddtrace/contrib/mongodb/subscribers.rb +2 -3
- data/lib/ddtrace/contrib/patchable.rb +18 -7
- data/lib/ddtrace/contrib/patcher.rb +9 -6
- data/lib/ddtrace/contrib/presto/patcher.rb +5 -2
- data/lib/ddtrace/contrib/qless/configuration/settings.rb +35 -0
- data/lib/ddtrace/contrib/qless/ext.rb +20 -0
- data/lib/ddtrace/contrib/qless/integration.rb +38 -0
- data/lib/ddtrace/contrib/qless/patcher.rb +35 -0
- data/lib/ddtrace/contrib/qless/qless_job.rb +73 -0
- data/lib/ddtrace/contrib/qless/tracer_cleaner.rb +33 -0
- data/lib/ddtrace/contrib/que/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/que/ext.rb +19 -19
- data/lib/ddtrace/contrib/que/tracer.rb +3 -2
- data/lib/ddtrace/contrib/racecar/event.rb +1 -0
- data/lib/ddtrace/contrib/rack/configuration/settings.rb +3 -3
- data/lib/ddtrace/contrib/rack/integration.rb +7 -0
- data/lib/ddtrace/contrib/rack/middlewares.rb +6 -11
- data/lib/ddtrace/contrib/rack/patcher.rb +1 -3
- data/lib/ddtrace/contrib/rack/request_queue.rb +6 -1
- data/lib/ddtrace/contrib/rails/auto_instrument_railtie.rb +10 -0
- data/lib/ddtrace/contrib/rails/patcher.rb +11 -4
- data/lib/ddtrace/contrib/rails/utils.rb +4 -0
- data/lib/ddtrace/contrib/rake/instrumentation.rb +4 -2
- data/lib/ddtrace/contrib/rake/integration.rb +1 -1
- data/lib/ddtrace/contrib/redis/configuration/resolver.rb +14 -5
- data/lib/ddtrace/contrib/redis/configuration/settings.rb +5 -0
- data/lib/ddtrace/contrib/redis/ext.rb +1 -0
- data/lib/ddtrace/contrib/redis/patcher.rb +20 -3
- data/lib/ddtrace/contrib/redis/quantize.rb +28 -0
- data/lib/ddtrace/contrib/redis/tags.rb +5 -1
- data/lib/ddtrace/contrib/redis/vendor/LICENSE +20 -0
- data/lib/ddtrace/contrib/redis/vendor/resolver.rb +6 -7
- data/lib/ddtrace/contrib/registry.rb +2 -2
- data/lib/ddtrace/contrib/resque/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/resque/integration.rb +1 -1
- data/lib/ddtrace/contrib/resque/resque_job.rb +3 -1
- data/lib/ddtrace/contrib/rest_client/request_patch.rb +1 -3
- data/lib/ddtrace/contrib/rspec/configuration/settings.rb +28 -0
- data/lib/ddtrace/contrib/rspec/example.rb +75 -0
- data/lib/ddtrace/contrib/rspec/ext.rb +16 -0
- data/lib/ddtrace/contrib/rspec/integration.rb +46 -0
- data/lib/ddtrace/contrib/rspec/patcher.rb +23 -0
- data/lib/ddtrace/contrib/sequel/utils.rb +5 -6
- data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/shoryuken/tracer.rb +3 -1
- data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +5 -7
- data/lib/ddtrace/contrib/sidekiq/tracing.rb +0 -1
- data/lib/ddtrace/contrib/sinatra/env.rb +1 -3
- data/lib/ddtrace/contrib/sinatra/headers.rb +1 -3
- data/lib/ddtrace/contrib/sinatra/tracer.rb +1 -3
- data/lib/ddtrace/contrib/sinatra/tracer_middleware.rb +5 -5
- data/lib/ddtrace/contrib/sneakers/configuration/settings.rb +1 -0
- data/lib/ddtrace/contrib/sneakers/ext.rb +11 -11
- data/lib/ddtrace/contrib/sneakers/tracer.rb +16 -21
- data/lib/ddtrace/contrib/status_code_matcher.rb +69 -0
- data/lib/ddtrace/correlation.rb +1 -0
- data/lib/ddtrace/diagnostics/environment_logger.rb +2 -1
- data/lib/ddtrace/distributed_tracing/headers/headers.rb +1 -0
- data/lib/ddtrace/distributed_tracing/headers/helpers.rb +1 -3
- data/lib/ddtrace/ext/app_types.rb +1 -0
- data/lib/ddtrace/ext/ci.rb +297 -0
- data/lib/ddtrace/ext/distributed.rb +8 -2
- data/lib/ddtrace/ext/git.rb +11 -0
- data/lib/ddtrace/ext/http.rb +1 -1
- data/lib/ddtrace/ext/runtime.rb +4 -1
- data/lib/ddtrace/ext/test.rb +24 -0
- data/lib/ddtrace/forced_tracing.rb +2 -0
- data/lib/ddtrace/logger.rb +1 -1
- data/lib/ddtrace/metrics.rb +10 -6
- data/lib/ddtrace/opentracer/distributed_headers.rb +3 -0
- data/lib/ddtrace/opentracer/span.rb +2 -6
- data/lib/ddtrace/opentracer/thread_local_scope.rb +1 -0
- data/lib/ddtrace/patcher.rb +25 -4
- data/lib/ddtrace/pin.rb +8 -61
- data/lib/ddtrace/pipeline/span_filter.rb +1 -1
- data/lib/ddtrace/propagation/grpc_propagator.rb +1 -0
- data/lib/ddtrace/propagation/http_propagator.rb +17 -2
- data/lib/ddtrace/quantization/http.rb +1 -0
- data/lib/ddtrace/runtime/cgroup.rb +2 -2
- data/lib/ddtrace/runtime/container.rb +27 -29
- data/lib/ddtrace/runtime/identity.rb +12 -5
- data/lib/ddtrace/sampler.rb +1 -1
- data/lib/ddtrace/sampling/rate_limiter.rb +65 -16
- data/lib/ddtrace/sampling/rule_sampler.rb +1 -0
- data/lib/ddtrace/span.rb +7 -7
- data/lib/ddtrace/sync_writer.rb +12 -12
- data/lib/ddtrace/tracer.rb +21 -6
- data/lib/ddtrace/transport/http.rb +15 -8
- data/lib/ddtrace/transport/http/adapters/net.rb +27 -8
- data/lib/ddtrace/transport/http/adapters/registry.rb +1 -0
- data/lib/ddtrace/transport/http/adapters/unix_socket.rb +2 -4
- data/lib/ddtrace/transport/http/builder.rb +7 -1
- data/lib/ddtrace/transport/http/env.rb +8 -0
- data/lib/ddtrace/transport/http/traces.rb +2 -3
- data/lib/ddtrace/transport/io.rb +1 -1
- data/lib/ddtrace/transport/io/response.rb +1 -3
- data/lib/ddtrace/transport/io/traces.rb +6 -0
- data/lib/ddtrace/transport/traces.rb +18 -1
- data/lib/ddtrace/utils.rb +10 -11
- data/lib/ddtrace/utils/compression.rb +27 -0
- data/lib/ddtrace/utils/forking.rb +52 -0
- data/lib/ddtrace/utils/object_set.rb +41 -0
- data/lib/ddtrace/utils/only_once.rb +40 -0
- data/lib/ddtrace/utils/sequence.rb +17 -0
- data/lib/ddtrace/utils/string_table.rb +45 -0
- data/lib/ddtrace/utils/time.rb +32 -1
- data/lib/ddtrace/vendor/active_record/MIT-LICENSE +20 -0
- data/lib/ddtrace/vendor/multipart-post/LICENSE +11 -0
- data/lib/ddtrace/vendor/multipart-post/multipart.rb +12 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +8 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +116 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +57 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +135 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +9 -0
- data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +32 -0
- data/lib/ddtrace/version.rb +1 -1
- data/lib/ddtrace/workers.rb +5 -0
- data/lib/ddtrace/workers/async.rb +11 -3
- data/lib/ddtrace/workers/loop.rb +17 -3
- data/lib/ddtrace/workers/polling.rb +1 -0
- data/lib/ddtrace/workers/queue.rb +1 -0
- data/lib/ddtrace/workers/runtime_metrics.rb +7 -3
- data/lib/ddtrace/workers/trace_writer.rb +10 -10
- data/lib/ddtrace/writer.rb +26 -5
- metadata +186 -373
- data/lib/ddtrace/augmentation.rb +0 -13
- 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/monkey.rb +0 -58
data/lib/ddtrace/sampler.rb
CHANGED
|
@@ -81,7 +81,7 @@ module Datadog
|
|
|
81
81
|
:default_key
|
|
82
82
|
|
|
83
83
|
def initialize(default_key, default_rate = 1.0, &block)
|
|
84
|
-
raise ArgumentError, 'No resolver given!' unless
|
|
84
|
+
raise ArgumentError, 'No resolver given!' unless block
|
|
85
85
|
|
|
86
86
|
@default_key = default_key
|
|
87
87
|
@resolver = block
|
|
@@ -38,6 +38,10 @@ module Datadog
|
|
|
38
38
|
@tokens = max_tokens
|
|
39
39
|
@total_messages = 0
|
|
40
40
|
@conforming_messages = 0
|
|
41
|
+
@prev_conforming_messages = nil
|
|
42
|
+
@prev_total_messages = nil
|
|
43
|
+
@current_window = nil
|
|
44
|
+
|
|
41
45
|
@last_refill = Utils::Time.get_time
|
|
42
46
|
end
|
|
43
47
|
|
|
@@ -47,28 +51,17 @@ module Datadog
|
|
|
47
51
|
# If it does, return +true+ and remove +size+
|
|
48
52
|
# tokens from the bucket.
|
|
49
53
|
# If it does not, return +false+ without affecting
|
|
50
|
-
# the tokens
|
|
54
|
+
# the tokens from the bucket.
|
|
51
55
|
#
|
|
52
56
|
# @return [Boolean] +true+ if message conforms with current bucket limit
|
|
53
57
|
def allow?(size)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
refill_since_last_message
|
|
58
|
-
|
|
59
|
-
increment_total_count
|
|
60
|
-
|
|
61
|
-
return false if @tokens < size
|
|
62
|
-
|
|
63
|
-
increment_conforming_count
|
|
64
|
-
|
|
65
|
-
@tokens -= size
|
|
66
|
-
|
|
67
|
-
true
|
|
58
|
+
allowed = should_allow?(size)
|
|
59
|
+
update_rate_counts(allowed)
|
|
60
|
+
allowed
|
|
68
61
|
end
|
|
69
62
|
|
|
70
63
|
# Ratio of 'conformance' per 'total messages' checked
|
|
71
|
-
#
|
|
64
|
+
# averaged for the past 2 buckets
|
|
72
65
|
#
|
|
73
66
|
# Returns +1.0+ when no messages have been checked yet.
|
|
74
67
|
#
|
|
@@ -77,6 +70,20 @@ module Datadog
|
|
|
77
70
|
return 0.0 if @rate.zero?
|
|
78
71
|
return 1.0 if @rate < 0 || @total_messages.zero?
|
|
79
72
|
|
|
73
|
+
return current_window_rate if @prev_conforming_messages.nil? || @prev_total_messages.nil?
|
|
74
|
+
|
|
75
|
+
(@conforming_messages.to_f + @prev_conforming_messages.to_f) / (@total_messages + @prev_total_messages)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Ratio of 'conformance' per 'total messages' checked
|
|
79
|
+
# on this bucket
|
|
80
|
+
#
|
|
81
|
+
# Returns +1.0+ when no messages have been checked yet.
|
|
82
|
+
#
|
|
83
|
+
# @return [Float] Conformance ratio, between +[0,1]+
|
|
84
|
+
def current_window_rate
|
|
85
|
+
return 1.0 if @total_messages.zero?
|
|
86
|
+
|
|
80
87
|
@conforming_messages.to_f / @total_messages
|
|
81
88
|
end
|
|
82
89
|
|
|
@@ -91,6 +98,8 @@ module Datadog
|
|
|
91
98
|
now = Utils::Time.get_time
|
|
92
99
|
elapsed = now - @last_refill
|
|
93
100
|
|
|
101
|
+
# Update the number of available tokens, but ensure we do not exceed the max
|
|
102
|
+
# we return the min of tokens + rate*elapsed, or max tokens
|
|
94
103
|
refill_tokens(@rate * elapsed)
|
|
95
104
|
|
|
96
105
|
@last_refill = now
|
|
@@ -108,6 +117,46 @@ module Datadog
|
|
|
108
117
|
def increment_conforming_count
|
|
109
118
|
@conforming_messages += 1
|
|
110
119
|
end
|
|
120
|
+
|
|
121
|
+
def should_allow?(size)
|
|
122
|
+
# rate limit of 0 blocks everything
|
|
123
|
+
return false if @rate.zero?
|
|
124
|
+
|
|
125
|
+
# negative rate limit disables rate limiting
|
|
126
|
+
return true if @rate < 0
|
|
127
|
+
|
|
128
|
+
refill_since_last_message
|
|
129
|
+
|
|
130
|
+
# if tokens < 1 we don't allow?
|
|
131
|
+
return false if @tokens < size
|
|
132
|
+
|
|
133
|
+
@tokens -= size
|
|
134
|
+
|
|
135
|
+
true
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Sets and Updates the past two 1 second windows for which
|
|
139
|
+
# the rate limiter must compute it's rate over and updates
|
|
140
|
+
# the total count, and conforming message count if +allowed+
|
|
141
|
+
def update_rate_counts(allowed)
|
|
142
|
+
now = Utils::Time.get_time
|
|
143
|
+
|
|
144
|
+
# No tokens have been seen yet, start a new window
|
|
145
|
+
if @current_window.nil?
|
|
146
|
+
@current_window = now
|
|
147
|
+
# If more than 1 second has past since last window, reset
|
|
148
|
+
elsif now - @current_window >= 1
|
|
149
|
+
@prev_conforming_messages = @conforming_messages
|
|
150
|
+
@prev_total_messages = @total_messages
|
|
151
|
+
@conforming_messages = 0
|
|
152
|
+
@total_messages = 0
|
|
153
|
+
@current_window = now
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
increment_conforming_count if allowed
|
|
157
|
+
|
|
158
|
+
increment_total_count
|
|
159
|
+
end
|
|
111
160
|
end
|
|
112
161
|
|
|
113
162
|
# \RateLimiter that accepts all resources,
|
data/lib/ddtrace/span.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'time'
|
|
4
|
-
require 'thread'
|
|
5
|
-
|
|
6
4
|
require 'ddtrace/utils'
|
|
7
5
|
require 'ddtrace/ext/errors'
|
|
8
6
|
require 'ddtrace/ext/priority'
|
|
@@ -38,14 +36,16 @@ module Datadog
|
|
|
38
36
|
EXTERNAL_MAX_ID = 1 << 64
|
|
39
37
|
|
|
40
38
|
# This limit is for numeric tags because uint64 could end up rounded.
|
|
41
|
-
NUMERIC_TAG_SIZE_RANGE = (-1 << 53..1 << 53)
|
|
39
|
+
NUMERIC_TAG_SIZE_RANGE = (-1 << 53..1 << 53).freeze
|
|
42
40
|
|
|
43
41
|
attr_accessor :name, :service, :resource, :span_type,
|
|
44
42
|
:span_id, :trace_id, :parent_id,
|
|
45
43
|
:status, :sampled,
|
|
46
|
-
:tracer, :context
|
|
44
|
+
:tracer, :context
|
|
45
|
+
|
|
46
|
+
attr_reader :parent, :start_time, :end_time
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
attr_writer :duration
|
|
49
49
|
|
|
50
50
|
# Create a new span linked to the given tracer. Call the \Tracer method <tt>start_span()</tt>
|
|
51
51
|
# and then <tt>finish()</tt> once the tracer operation is over.
|
|
@@ -180,7 +180,7 @@ module Datadog
|
|
|
180
180
|
# behavior and so we maintain it for backward compatibility for those
|
|
181
181
|
# who are using async manual instrumentation that may rely on this
|
|
182
182
|
|
|
183
|
-
@start_time = start_time || Time.now.utc
|
|
183
|
+
@start_time = start_time || Utils::Time.now.utc
|
|
184
184
|
@duration_start = start_time.nil? ? duration_marker : nil
|
|
185
185
|
|
|
186
186
|
self
|
|
@@ -206,7 +206,7 @@ module Datadog
|
|
|
206
206
|
|
|
207
207
|
@allocation_count_finish = now_allocations
|
|
208
208
|
|
|
209
|
-
now = Time.now.utc
|
|
209
|
+
now = Utils::Time.now.utc
|
|
210
210
|
|
|
211
211
|
# Provide a default start_time if unset.
|
|
212
212
|
# Using `now` here causes duration to be 0; this is expected
|
data/lib/ddtrace/sync_writer.rb
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
require 'ddtrace/ext/net'
|
|
2
2
|
require 'ddtrace/runtime/socket'
|
|
3
3
|
require 'ddtrace/runtime/metrics'
|
|
4
|
+
require 'ddtrace/utils/only_once'
|
|
4
5
|
|
|
5
6
|
module Datadog
|
|
6
7
|
# SyncWriter flushes both services and traces synchronously
|
|
7
8
|
# DEV: To be replaced by Datadog::Workers::TraceWriter.
|
|
9
|
+
#
|
|
10
|
+
# Note: If you're wondering if this class is used at all, since there are no other references to it on the codebase,
|
|
11
|
+
# the separate `datadog-lambda` uses it as of February 2021:
|
|
12
|
+
# <https://github.com/DataDog/datadog-lambda-rb/blob/c15f0f0916c90123416dc44e7d6800ef4a7cfdbf/lib/datadog/lambda.rb#L38>
|
|
8
13
|
class SyncWriter
|
|
14
|
+
DEPRECATION_WARN_ONLY_ONCE = Datadog::Utils::OnlyOnce.new
|
|
15
|
+
|
|
9
16
|
attr_reader \
|
|
10
17
|
:priority_sampler,
|
|
11
18
|
:transport
|
|
@@ -21,17 +28,15 @@ module Datadog
|
|
|
21
28
|
|
|
22
29
|
def write(trace, services = nil)
|
|
23
30
|
unless services.nil?
|
|
24
|
-
|
|
31
|
+
DEPRECATION_WARN_ONLY_ONCE.run do
|
|
25
32
|
Datadog.logger.warn(%(
|
|
26
33
|
write: Writing services has been deprecated and no longer need to be provided.
|
|
27
|
-
write(traces, services) can be
|
|
34
|
+
write(traces, services) can be updated to write(traces)
|
|
28
35
|
))
|
|
29
36
|
end
|
|
30
37
|
end
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
proc { flush_trace(trace) }
|
|
34
|
-
)
|
|
39
|
+
flush_trace(trace)
|
|
35
40
|
rescue => e
|
|
36
41
|
Datadog.logger.debug(e)
|
|
37
42
|
end
|
|
@@ -44,13 +49,10 @@ module Datadog
|
|
|
44
49
|
|
|
45
50
|
private
|
|
46
51
|
|
|
47
|
-
def perform_concurrently(*tasks)
|
|
48
|
-
tasks.map { |task| Thread.new(&task) }.each(&:join)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
52
|
def flush_trace(trace)
|
|
52
53
|
processed_traces = Pipeline.process!([trace])
|
|
53
54
|
return if processed_traces.empty?
|
|
55
|
+
|
|
54
56
|
inject_hostname!(processed_traces.first) if Datadog.configuration.report_hostname
|
|
55
57
|
transport.send_traces(processed_traces)
|
|
56
58
|
end
|
|
@@ -58,9 +60,7 @@ module Datadog
|
|
|
58
60
|
def inject_hostname!(trace)
|
|
59
61
|
unless trace.first.nil?
|
|
60
62
|
hostname = Datadog::Runtime::Socket.hostname
|
|
61
|
-
unless hostname.nil? || hostname.empty?
|
|
62
|
-
trace.first.set_tag(Ext::NET::TAG_HOSTNAME, hostname)
|
|
63
|
-
end
|
|
63
|
+
trace.first.set_tag(Ext::NET::TAG_HOSTNAME, hostname) unless hostname.nil? || hostname.empty?
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
66
|
end
|
data/lib/ddtrace/tracer.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'thread'
|
|
2
1
|
require 'logger'
|
|
3
2
|
require 'pathname'
|
|
4
3
|
|
|
@@ -7,9 +6,11 @@ require 'ddtrace/span'
|
|
|
7
6
|
require 'ddtrace/context'
|
|
8
7
|
require 'ddtrace/logger'
|
|
9
8
|
require 'ddtrace/writer'
|
|
9
|
+
require 'ddtrace/runtime/identity'
|
|
10
10
|
require 'ddtrace/sampler'
|
|
11
11
|
require 'ddtrace/sampling'
|
|
12
12
|
require 'ddtrace/correlation'
|
|
13
|
+
require 'ddtrace/utils/only_once'
|
|
13
14
|
|
|
14
15
|
# \Datadog global namespace that includes all tracing functionality for Tracer and Span classes.
|
|
15
16
|
module Datadog
|
|
@@ -19,6 +20,9 @@ module Datadog
|
|
|
19
20
|
# of these function calls and sub-requests would be encapsulated within a single trace.
|
|
20
21
|
# rubocop:disable Metrics/ClassLength
|
|
21
22
|
class Tracer
|
|
23
|
+
SERVICES_DEPRECATION_WARN_ONLY_ONCE = Datadog::Utils::OnlyOnce.new
|
|
24
|
+
SET_SERVICE_INFO_DEPRECATION_WARN_ONLY_ONCE = Datadog::Utils::OnlyOnce.new
|
|
25
|
+
|
|
22
26
|
attr_reader :sampler, :tags, :provider, :context_flush
|
|
23
27
|
attr_accessor :enabled, :writer
|
|
24
28
|
attr_writer :default_service
|
|
@@ -27,8 +31,7 @@ module Datadog
|
|
|
27
31
|
DEFAULT_ON_ERROR = proc { |span, error| span.set_error(error) unless span.nil? }
|
|
28
32
|
|
|
29
33
|
def services
|
|
30
|
-
|
|
31
|
-
Datadog::Patcher.do_once('Tracer#set_service_info') do
|
|
34
|
+
SERVICES_DEPRECATION_WARN_ONLY_ONCE.run do
|
|
32
35
|
Datadog.logger.warn('services: Usage of Tracer.services has been deprecated')
|
|
33
36
|
end
|
|
34
37
|
|
|
@@ -129,8 +132,7 @@ module Datadog
|
|
|
129
132
|
#
|
|
130
133
|
# set_service_info is deprecated, no service information needs to be tracked
|
|
131
134
|
def set_service_info(service, app, app_type)
|
|
132
|
-
|
|
133
|
-
Datadog::Patcher.do_once('Tracer#set_service_info') do
|
|
135
|
+
SET_SERVICE_INFO_DEPRECATION_WARN_ONLY_ONCE.run do
|
|
134
136
|
Datadog.logger.warn(%(
|
|
135
137
|
set_service_info: Usage of set_service_info has been deprecated,
|
|
136
138
|
service information no longer needs to be reported to the trace agent.
|
|
@@ -143,6 +145,7 @@ module Datadog
|
|
|
143
145
|
# a service would be invalid and rejected.
|
|
144
146
|
def default_service
|
|
145
147
|
return @default_service if instance_variable_defined?(:@default_service) && @default_service
|
|
148
|
+
|
|
146
149
|
begin
|
|
147
150
|
@default_service = File.basename($PROGRAM_NAME, '.*')
|
|
148
151
|
rescue StandardError => e
|
|
@@ -201,6 +204,7 @@ module Datadog
|
|
|
201
204
|
# root span
|
|
202
205
|
@sampler.sample!(span)
|
|
203
206
|
span.set_tag('system.pid', Process.pid)
|
|
207
|
+
span.set_tag(Datadog::Ext::Runtime::TAG_ID, Datadog::Runtime::Identity.id)
|
|
204
208
|
|
|
205
209
|
if ctx && ctx.trace_id
|
|
206
210
|
span.trace_id = ctx.trace_id
|
|
@@ -287,8 +291,19 @@ module Datadog
|
|
|
287
291
|
# and it is user code which should be executed no matter what.
|
|
288
292
|
# It's not a problem since we re-raise it afterwards so for example a
|
|
289
293
|
# SignalException::Interrupt would still bubble up.
|
|
294
|
+
# rubocop:disable Metrics/BlockNesting
|
|
290
295
|
rescue Exception => e
|
|
291
|
-
(options[:on_error]
|
|
296
|
+
if (on_error_handler = options[:on_error]) && on_error_handler.respond_to?(:call)
|
|
297
|
+
begin
|
|
298
|
+
on_error_handler.call(span, e)
|
|
299
|
+
rescue
|
|
300
|
+
Datadog.logger.debug('Custom on_error handler failed, falling back to default')
|
|
301
|
+
DEFAULT_ON_ERROR.call(span, e)
|
|
302
|
+
end
|
|
303
|
+
else
|
|
304
|
+
Datadog.logger.debug('Custom on_error handler must be a callable, falling back to default') if on_error_handler
|
|
305
|
+
DEFAULT_ON_ERROR.call(span, e)
|
|
306
|
+
end
|
|
292
307
|
raise e
|
|
293
308
|
ensure
|
|
294
309
|
span.finish unless span.nil?
|
|
@@ -27,7 +27,7 @@ module Datadog
|
|
|
27
27
|
# Pass a block to override any settings.
|
|
28
28
|
def default(options = {})
|
|
29
29
|
new do |transport|
|
|
30
|
-
transport.adapter
|
|
30
|
+
transport.adapter default_adapter, default_hostname, default_port, timeout: 1
|
|
31
31
|
transport.headers default_headers
|
|
32
32
|
|
|
33
33
|
apis = API.defaults
|
|
@@ -39,10 +39,15 @@ module Datadog
|
|
|
39
39
|
# Apply any settings given by options
|
|
40
40
|
unless options.empty?
|
|
41
41
|
# Change hostname/port
|
|
42
|
-
if
|
|
43
|
-
hostname = options
|
|
44
|
-
port = options
|
|
45
|
-
|
|
42
|
+
if [:hostname, :port, :timeout, :ssl].any? { |key| options.key?(key) }
|
|
43
|
+
hostname = options[:hostname] || default_hostname
|
|
44
|
+
port = options[:port] || default_port
|
|
45
|
+
|
|
46
|
+
adapter_options = { timeout: 1 }
|
|
47
|
+
adapter_options[:timeout] = options[:timeout] if options.key?(:timeout)
|
|
48
|
+
adapter_options[:ssl] = options[:ssl] if options.key?(:ssl)
|
|
49
|
+
|
|
50
|
+
transport.adapter default_adapter, hostname, port, adapter_options
|
|
46
51
|
end
|
|
47
52
|
|
|
48
53
|
# Change default API
|
|
@@ -69,12 +74,14 @@ module Datadog
|
|
|
69
74
|
}.tap do |headers|
|
|
70
75
|
# Add container ID, if present.
|
|
71
76
|
container_id = Datadog::Runtime::Container.container_id
|
|
72
|
-
unless container_id.nil?
|
|
73
|
-
headers[Datadog::Ext::Transport::HTTP::HEADER_CONTAINER_ID] = container_id
|
|
74
|
-
end
|
|
77
|
+
headers[Datadog::Ext::Transport::HTTP::HEADER_CONTAINER_ID] = container_id unless container_id.nil?
|
|
75
78
|
end
|
|
76
79
|
end
|
|
77
80
|
|
|
81
|
+
def default_adapter
|
|
82
|
+
:net_http
|
|
83
|
+
end
|
|
84
|
+
|
|
78
85
|
def default_hostname
|
|
79
86
|
return default_url.hostname if default_url
|
|
80
87
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'ddtrace/transport/response'
|
|
2
|
+
require 'ddtrace/vendor/multipart-post/net/http/post/multipart'
|
|
2
3
|
|
|
3
4
|
module Datadog
|
|
4
5
|
module Transport
|
|
@@ -9,27 +10,28 @@ module Datadog
|
|
|
9
10
|
attr_reader \
|
|
10
11
|
:hostname,
|
|
11
12
|
:port,
|
|
12
|
-
:timeout
|
|
13
|
+
:timeout,
|
|
14
|
+
:ssl
|
|
13
15
|
|
|
14
|
-
DEFAULT_TIMEOUT =
|
|
16
|
+
DEFAULT_TIMEOUT = 30
|
|
15
17
|
|
|
16
18
|
def initialize(hostname, port, options = {})
|
|
17
19
|
@hostname = hostname
|
|
18
20
|
@port = port
|
|
19
21
|
@timeout = options[:timeout] || DEFAULT_TIMEOUT
|
|
22
|
+
@ssl = options.key?(:ssl) ? options[:ssl] == true : false
|
|
20
23
|
end
|
|
21
24
|
|
|
22
|
-
def open
|
|
25
|
+
def open(&block)
|
|
23
26
|
# DEV Initializing +Net::HTTP+ directly help us avoid expensive
|
|
24
27
|
# options processing done in +Net::HTTP.start+:
|
|
25
28
|
# https://github.com/ruby/ruby/blob/b2d96abb42abbe2e01f010ffc9ac51f0f9a50002/lib/net/http.rb#L614-L618
|
|
26
29
|
req = ::Net::HTTP.new(hostname, port, nil)
|
|
27
30
|
|
|
31
|
+
req.use_ssl = ssl
|
|
28
32
|
req.open_timeout = req.read_timeout = timeout
|
|
29
33
|
|
|
30
|
-
req.start
|
|
31
|
-
yield(http)
|
|
32
|
-
end
|
|
34
|
+
req.start(&block)
|
|
33
35
|
end
|
|
34
36
|
|
|
35
37
|
def call(env)
|
|
@@ -41,8 +43,18 @@ module Datadog
|
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
def post(env)
|
|
44
|
-
post =
|
|
45
|
-
|
|
46
|
+
post = nil
|
|
47
|
+
|
|
48
|
+
if env.form.nil? || env.form.empty?
|
|
49
|
+
post = ::Net::HTTP::Post.new(env.path, env.headers)
|
|
50
|
+
post.body = env.body
|
|
51
|
+
else
|
|
52
|
+
post = ::Datadog::Vendor::Net::HTTP::Post::Multipart.new(
|
|
53
|
+
env.path,
|
|
54
|
+
env.form,
|
|
55
|
+
env.headers
|
|
56
|
+
)
|
|
57
|
+
end
|
|
46
58
|
|
|
47
59
|
# Connect and send the request
|
|
48
60
|
http_response = open do |http|
|
|
@@ -82,36 +94,43 @@ module Datadog
|
|
|
82
94
|
|
|
83
95
|
def payload
|
|
84
96
|
return super if http_response.nil?
|
|
97
|
+
|
|
85
98
|
http_response.body
|
|
86
99
|
end
|
|
87
100
|
|
|
88
101
|
def code
|
|
89
102
|
return super if http_response.nil?
|
|
103
|
+
|
|
90
104
|
http_response.code.to_i
|
|
91
105
|
end
|
|
92
106
|
|
|
93
107
|
def ok?
|
|
94
108
|
return super if http_response.nil?
|
|
109
|
+
|
|
95
110
|
code.between?(200, 299)
|
|
96
111
|
end
|
|
97
112
|
|
|
98
113
|
def unsupported?
|
|
99
114
|
return super if http_response.nil?
|
|
115
|
+
|
|
100
116
|
code == 415
|
|
101
117
|
end
|
|
102
118
|
|
|
103
119
|
def not_found?
|
|
104
120
|
return super if http_response.nil?
|
|
121
|
+
|
|
105
122
|
code == 404
|
|
106
123
|
end
|
|
107
124
|
|
|
108
125
|
def client_error?
|
|
109
126
|
return super if http_response.nil?
|
|
127
|
+
|
|
110
128
|
code.between?(400, 499)
|
|
111
129
|
end
|
|
112
130
|
|
|
113
131
|
def server_error?
|
|
114
132
|
return super if http_response.nil?
|
|
133
|
+
|
|
115
134
|
code.between?(500, 599)
|
|
116
135
|
end
|
|
117
136
|
|