From de8db34e6c5da66773498d23da3cd64b5c3e76dc Mon Sep 17 00:00:00 2001 From: Randy Girard Date: Wed, 13 Mar 2019 13:22:22 -0400 Subject: [PATCH 0001/2133] Initial integration of Roda. --- lib/ddtrace.rb | 1 + .../contrib/roda/configuration/settings.rb | 15 ++++ lib/ddtrace/contrib/roda/ext.rb | 24 ++++++ lib/ddtrace/contrib/roda/integration.rb | 36 ++++++++ lib/ddtrace/contrib/roda/patcher.rb | 86 +++++++++++++++++++ 5 files changed, 162 insertions(+) create mode 100644 lib/ddtrace/contrib/roda/configuration/settings.rb create mode 100644 lib/ddtrace/contrib/roda/ext.rb create mode 100644 lib/ddtrace/contrib/roda/integration.rb create mode 100644 lib/ddtrace/contrib/roda/patcher.rb diff --git a/lib/ddtrace.rb b/lib/ddtrace.rb index 6cb0cebd9a6..142a4f9cf6e 100644 --- a/lib/ddtrace.rb +++ b/lib/ddtrace.rb @@ -44,6 +44,7 @@ module Datadog require 'ddtrace/contrib/redis/integration' require 'ddtrace/contrib/resque/integration' require 'ddtrace/contrib/rest_client/integration' +require 'ddtrace/contrib/roda/integration' require 'ddtrace/contrib/sequel/integration' require 'ddtrace/contrib/shoryuken/integration' require 'ddtrace/contrib/sidekiq/integration' diff --git a/lib/ddtrace/contrib/roda/configuration/settings.rb b/lib/ddtrace/contrib/roda/configuration/settings.rb new file mode 100644 index 00000000000..6b3fce50e95 --- /dev/null +++ b/lib/ddtrace/contrib/roda/configuration/settings.rb @@ -0,0 +1,15 @@ +require 'ddtrace/contrib/configuration/settings' +require 'ddtrace/contrib/roda/ext' + +module Datadog + module Contrib + module Roda + module Configuration + # Custom settings for the Roda integration + class Settings < Contrib::Configuration::Settings + option :service_name, default: Ext::SERVICE_NAME + end + end + end + end +end diff --git a/lib/ddtrace/contrib/roda/ext.rb b/lib/ddtrace/contrib/roda/ext.rb new file mode 100644 index 00000000000..5bbf07ad29c --- /dev/null +++ b/lib/ddtrace/contrib/roda/ext.rb @@ -0,0 +1,24 @@ +module Datadog + module Contrib + module Roda + # Roda integration constants + module Ext + APP = 'roda'.freeze + SERVICE_NAME = 'roda'.freeze + + URL = 'url'.freeze + METHOD = 'method'.freeze + + SPAN_REQUEST = 'roda.request'.freeze + + SPAN_ENDPOINT_RENDER = 'roda.endpoint_render'.freeze + SPAN_ENDPOINT_RUN = 'roda.endpoint_run'.freeze + SPAN_ENDPOINT_RUN_FILTERS = 'roda.endpoint_run_filters'.freeze + + TAG_FILTER_TYPE = 'roda.filter.type'.freeze + TAG_ROUTE_ENDPOINT = 'roda.route.endpoint'.freeze + TAG_ROUTE_PATH = 'roda.route.path'.freeze + end + end + end +end diff --git a/lib/ddtrace/contrib/roda/integration.rb b/lib/ddtrace/contrib/roda/integration.rb new file mode 100644 index 00000000000..0ba37231603 --- /dev/null +++ b/lib/ddtrace/contrib/roda/integration.rb @@ -0,0 +1,36 @@ +require 'ddtrace/contrib/integration' +require 'ddtrace/contrib/roda/configuration/settings' +require 'ddtrace/contrib/roda/patcher' + +module Datadog + module Contrib + module Roda + # Description of Roda integration + class Integration + include Contrib::Integration + + register_as :roda + + def self.version + Gem.loaded_specs['roda'] && Gem.loaded_specs['roda'].version + end + + def self.present? + super && defined?(::Roda) + end + + def self.compatible? + super + end + + def default_configuration + Configuration::Settings.new + end + + def patcher + Patcher + end + end + end + end +end diff --git a/lib/ddtrace/contrib/roda/patcher.rb b/lib/ddtrace/contrib/roda/patcher.rb new file mode 100644 index 00000000000..2636ae4c770 --- /dev/null +++ b/lib/ddtrace/contrib/roda/patcher.rb @@ -0,0 +1,86 @@ +require 'ddtrace/contrib/patcher' +require 'ddtrace/contrib/roda/ext' + +module Datadog + module Contrib + # Datadog Roda integration. + module Roda + # Patcher enables patching of 'net/http' module. + module Patcher + include Contrib::Patcher + + module_function + + def patched? + done?(:roda) + end + + # patch applies our patch if needed + def patch + do_once(:roda) do + begin + require 'uri' + require 'ddtrace/pin' + + patch_roda + rescue StandardError => e + Datadog::Tracer.log.error("Unable to apply roda integration: #{e}") + end + end + end + + # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/BlockLength + # rubocop:disable Metrics/AbcSize + def patch_roda + ::Roda::RodaPlugins::Base::InstanceMethods.class_eval do + alias_method :call_without_datadog, :call + remove_method :call + + def datadog_pin + @datadog_pin ||= begin + service = Datadog.configuration[:roda][:service_name] + tracer = Datadog.configuration[:roda][:tracer] + + Datadog::Pin.new(service, app: Ext::APP, app_type: Datadog::Ext::AppTypes::WEB, tracer: tracer) + end + end + + def call(&block) + pin = datadog_pin + return call_without_datadog(&block) unless pin && pin.tracer + + pin.tracer.trace(Ext::SPAN_REQUEST) do |span| + begin + req = ::Rack::Request.new(env) + request_method = req.request_method.to_s.upcase + path = req.path + + parts = path.to_s.rpartition("/") + action = parts.last + controller = parts.first.sub(/\A\//, '').split("/").collect {|w| w.capitalize }.join("::") + operation = "#{controller}##{action}" + + span.service = pin.service + span.span_type = Datadog::Ext::HTTP::TYPE + + span.resource = request_method + # Using the method as a resource, as URL/path can trigger + # a possibly infinite number of resources. + span.set_tag(Ext::URL, path) + span.set_tag(Ext::METHOD, request_method) + rescue StandardError => e + Datadog::Tracer.log.error("error preparing span for roda request: #{e}") + ensure + response = call_without_datadog(&block) + end + + response + end + end + end + end + end + end + end +end From 3d03eda7e92acaaf173f5db15f4cd925a57f90ba Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Tue, 9 Jul 2019 17:27:21 -0400 Subject: [PATCH 0002/2133] Add roda to Appraisals and Rakefile. Start writing tests for Roda integration. --- Appraisals | 1 + Rakefile | 2 + spec/ddtrace/contrib/roda/patcher_spec.rb | 59 +++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 spec/ddtrace/contrib/roda/patcher_spec.rb diff --git a/Appraisals b/Appraisals index 5d41822c2fe..22892703c22 100644 --- a/Appraisals +++ b/Appraisals @@ -585,6 +585,7 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) gem 'redis', '< 4.0' gem 'rest-client' gem 'resque', '< 2.0' + gem 'roda' gem 'sequel' gem 'shoryuken' gem 'sidekiq' diff --git a/Rakefile b/Rakefile index 213e8a8a48f..57dd14d2eb2 100644 --- a/Rakefile +++ b/Rakefile @@ -81,6 +81,7 @@ namespace :spec do :redis, :resque, :rest_client, + :roda, :sequel, :sidekiq, :sinatra, @@ -499,6 +500,7 @@ task :ci do sh 'bundle exec appraisal contrib rake spec:redis' sh 'bundle exec appraisal contrib rake spec:resque' sh 'bundle exec appraisal contrib rake spec:rest_client' + sh 'bundle exec appraisal contrib rake spec:roda' sh 'bundle exec appraisal contrib rake spec:sequel' sh 'bundle exec appraisal contrib rake spec:shoryuken' sh 'bundle exec appraisal contrib rake spec:sinatra' diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb new file mode 100644 index 00000000000..40f5cac6423 --- /dev/null +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -0,0 +1,59 @@ +require 'spec_helper' +require 'ddtrace' +require 'rack/test' +require 'roda' +require 'pry' + +RSpec.describe 'Roda instrumentation' do + include Rack::Test::Methods + + # Gets a faux writer from TracerHelper module + let(:tracer) { get_test_tracer } + let(:configuration_options) { { tracer: tracer } } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + + around do |example| + Datadog.registry[:roda].reset_configuration! + example.run + Datadog.registry[:roda].reset_configuration! + end + + # Basic hello world application + shared_context 'Roda hello world app' do + # On GET /, returns "Hello World!" + let(:app) do + Class.new(Roda) do + route do |r| + r.root do + r.get do + "Hello World!" + end + end + end + end + end + end + + context 'when a basic request is made' do + + include_context 'Roda hello world app' + subject(:response) {get '/'} + it do + is_expected.to be_ok + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + expect(spans).to have(1).items + end + + end + + + + +end From 910d7fe9ff7ece9e9160e123d9a9f3ed80234c11 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Wed, 10 Jul 2019 13:17:14 -0400 Subject: [PATCH 0003/2133] Add and refactor instrumentation module to Roda instead of Base InstanceMethods. --- lib/ddtrace/contrib/roda/instrumentation.rb | 50 +++++++++++++++++++ lib/ddtrace/contrib/roda/patcher.rb | 53 ++------------------- spec/ddtrace/contrib/roda/patcher_spec.rb | 5 -- 3 files changed, 53 insertions(+), 55 deletions(-) create mode 100644 lib/ddtrace/contrib/roda/instrumentation.rb diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb new file mode 100644 index 00000000000..937b5f4b415 --- /dev/null +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -0,0 +1,50 @@ +module Datadog + module Contrib + module Roda + module Instrumentation + + def datadog_pin + @datadog_pin ||= begin + service = Datadog.configuration[:roda][:service_name] + tracer = Datadog.configuration[:roda][:tracer] + + Datadog::Pin.new(service, app: Ext::APP, app_type: Datadog::Ext::AppTypes::WEB, tracer: tracer) + end + end + + def call(*args) + pin = datadog_pin + return super unless pin && pin.tracer + + pin.tracer.trace(Ext::SPAN_REQUEST) do |span| + begin + req = ::Rack::Request.new(env) + request_method = req.request_method.to_s.upcase + path = req.path + + parts = path.to_s.rpartition("/") + action = parts.last + controller = parts.first.sub(/\A\//, '').split("/").collect {|w| w.capitalize }.join("::") + operation = "#{controller}##{action}" + + span.service = pin.service + span.span_type = Datadog::Ext::HTTP::TYPE + + span.resource = request_method + # Using the method as a resource, as URL/path can trigger + # a possibly infinite number of resources. + span.set_tag(Ext::URL, path) + span.set_tag(Ext::METHOD, request_method) + rescue StandardError => e + Datadog::Tracer.log.error("error preparing span for roda request: #{e}") + ensure + response = super + end + + response + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/ddtrace/contrib/roda/patcher.rb b/lib/ddtrace/contrib/roda/patcher.rb index 2636ae4c770..b1d9650d610 100644 --- a/lib/ddtrace/contrib/roda/patcher.rb +++ b/lib/ddtrace/contrib/roda/patcher.rb @@ -1,11 +1,12 @@ require 'ddtrace/contrib/patcher' require 'ddtrace/contrib/roda/ext' +require 'ddtrace/contrib/roda/instrumentation' module Datadog module Contrib # Datadog Roda integration. module Roda - # Patcher enables patching of 'net/http' module. + # Patcher enables patching of 'roda' module. module Patcher include Contrib::Patcher @@ -29,56 +30,8 @@ def patch end end - # rubocop:disable Metrics/MethodLength - # rubocop:disable Metrics/BlockLength - # rubocop:disable Metrics/AbcSize def patch_roda - ::Roda::RodaPlugins::Base::InstanceMethods.class_eval do - alias_method :call_without_datadog, :call - remove_method :call - - def datadog_pin - @datadog_pin ||= begin - service = Datadog.configuration[:roda][:service_name] - tracer = Datadog.configuration[:roda][:tracer] - - Datadog::Pin.new(service, app: Ext::APP, app_type: Datadog::Ext::AppTypes::WEB, tracer: tracer) - end - end - - def call(&block) - pin = datadog_pin - return call_without_datadog(&block) unless pin && pin.tracer - - pin.tracer.trace(Ext::SPAN_REQUEST) do |span| - begin - req = ::Rack::Request.new(env) - request_method = req.request_method.to_s.upcase - path = req.path - - parts = path.to_s.rpartition("/") - action = parts.last - controller = parts.first.sub(/\A\//, '').split("/").collect {|w| w.capitalize }.join("::") - operation = "#{controller}##{action}" - - span.service = pin.service - span.span_type = Datadog::Ext::HTTP::TYPE - - span.resource = request_method - # Using the method as a resource, as URL/path can trigger - # a possibly infinite number of resources. - span.set_tag(Ext::URL, path) - span.set_tag(Ext::METHOD, request_method) - rescue StandardError => e - Datadog::Tracer.log.error("error preparing span for roda request: #{e}") - ensure - response = call_without_datadog(&block) - end - - response - end - end - end + ::Roda.send(:prepend, Instrumentation) end end end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 40f5cac6423..6d7f516f295 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -2,7 +2,6 @@ require 'ddtrace' require 'rack/test' require 'roda' -require 'pry' RSpec.describe 'Roda instrumentation' do include Rack::Test::Methods @@ -52,8 +51,4 @@ end end - - - - end From 91145864d376bd278ef8dfc1f0a8c06cacc27192 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Wed, 10 Jul 2019 18:06:33 -0400 Subject: [PATCH 0004/2133] Update default tagging for http url and method. Add tests for various status codes and without the tracer. --- lib/ddtrace/contrib/roda/instrumentation.rb | 11 ++- spec/ddtrace/contrib/roda/patcher_spec.rb | 81 +++++++++++++++++++-- 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 937b5f4b415..54b8f22de9f 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -1,3 +1,5 @@ +require 'ddtrace/contrib/roda/ext' + module Datadog module Contrib module Roda @@ -33,15 +35,18 @@ def call(*args) span.resource = request_method # Using the method as a resource, as URL/path can trigger # a possibly infinite number of resources. - span.set_tag(Ext::URL, path) - span.set_tag(Ext::METHOD, request_method) + span.set_tag(Datadog::Ext::HTTP::URL, path) + span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) + rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") ensure response = super end - response + # response comes back as [404, {"Content-Type"=>"text/html", "Content-Length"=>"0"}, []] + span.set_error(1) if response[0].to_s.start_with?("5") + response end end end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 6d7f516f295..6e338048b85 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -6,7 +6,6 @@ RSpec.describe 'Roda instrumentation' do include Rack::Test::Methods - # Gets a faux writer from TracerHelper module let(:tracer) { get_test_tracer } let(:configuration_options) { { tracer: tracer } } let(:spans) { tracer.writer.spans } @@ -24,9 +23,7 @@ Datadog.registry[:roda].reset_configuration! end - # Basic hello world application - shared_context 'Roda hello world app' do - # On GET /, returns "Hello World!" + shared_context 'Roda app with 1 successful endpoint' do let(:app) do Class.new(Roda) do route do |r| @@ -40,15 +37,85 @@ end end - context 'when a basic request is made' do + shared_context 'Roda app with server error' do + let(:app) do + Class.new(Roda) do + route do |r| + r.root do + r.get do + r.halt([500, {'Content-Type'=>'text/html'}, ['test']]) + end + end + end + end + end + end - include_context 'Roda hello world app' + context 'when a 200 status code request is made' do + + include_context 'Roda app with 1 successful endpoint' subject(:response) {get '/'} it do is_expected.to be_ok expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + + expect(spans).to have(1).items + expect(span.span_type).to eq("http") + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + end + + + context 'when a 404 status code request is made' do + + include_context 'Roda app with 1 successful endpoint' + subject(:response) {get '/unsuccessful_endpoint'} + it do + expect(response.status).to eq(404) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq("http") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(0) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') end + end + context 'when a 500 status code request is made' do + + include_context 'Roda app with server error' + subject(:response) {get '/'} + it do + expect(response.status).to eq(500) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) + + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq("http") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(1) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + + + context 'when the tracer is disabled' do + include_context 'Roda app with 1 successful endpoint' + subject(:response) {get '/'} + + let(:tracer) { get_test_tracer(enabled: false) } + + it do + is_expected.to be_ok + expect(spans).to be_empty + end end -end +end \ No newline at end of file From 403831a03217b147d9e2f98016c31696223592a4 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Thu, 11 Jul 2019 15:27:48 -0400 Subject: [PATCH 0005/2133] Start adding tags for trace search and analytics and add unit tests. --- lib/ddtrace/contrib/roda/ext.rb | 6 +-- lib/ddtrace/contrib/roda/instrumentation.rb | 4 ++ .../contrib/roda/instrumentation_spec.rb | 37 +++++++++++++++++++ spec/ddtrace/contrib/roda/patcher_spec.rb | 2 +- 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 spec/ddtrace/contrib/roda/instrumentation_spec.rb diff --git a/lib/ddtrace/contrib/roda/ext.rb b/lib/ddtrace/contrib/roda/ext.rb index 5bbf07ad29c..02495091a1e 100644 --- a/lib/ddtrace/contrib/roda/ext.rb +++ b/lib/ddtrace/contrib/roda/ext.rb @@ -4,10 +4,10 @@ module Roda # Roda integration constants module Ext APP = 'roda'.freeze - SERVICE_NAME = 'roda'.freeze + ENV_ANALYTICS_ENABLED = 'DD_RODA_ANALYTICS_ENABLED'.freeze + ENV_ANALYTICS_SAMPLED_RATE = 'DD_RODA_ANALYTICS_SAMPLED_RATE'.freeze - URL = 'url'.freeze - METHOD = 'method'.freeze + SERVICE_NAME = 'roda'.freeze SPAN_REQUEST = 'roda.request'.freeze diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 54b8f22de9f..88db212d9bc 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -1,4 +1,5 @@ require 'ddtrace/contrib/roda/ext' +require 'ddtrace/contrib/analytics' module Datadog module Contrib @@ -38,6 +39,9 @@ def call(*args) span.set_tag(Datadog::Ext::HTTP::URL, path) span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) + # Add analytics tag to the span + Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) + rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") ensure diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb new file mode 100644 index 00000000000..fd74c3af51e --- /dev/null +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' +# require 'ddtrace/contrib/analytics_examples' +require 'roda' +require 'ddtrace' +require 'ddtrace/contrib/roda/instrumentation' +require 'ddtrace/contrib/roda/ext' + +RSpec.describe Datadog::Contrib::Roda::Instrumentation do + describe 'when implemented in Roda' do + let(:test_class) {Class.new(Roda)} + let(:env) {{:REQUEST_METHOD =>'GET'}} + let(:roda) {test_class.new(env)} + + describe '#datadog_pin' do + subject(:datadog_pin) {roda.datadog_pin} + + context 'when roda is configured' do + context 'with a service name' do + let(:custom_service_name) {"custom service name"} + let(:default_service_name) {Datadog::Contrib::Roda::Ext::SERVICE_NAME} + + # before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} + it 'sets a custom service name' do + Datadog.configure {|c| c.use :roda, service_name: custom_service_name} + expect(datadog_pin.service_name).to eq(custom_service_name) + end + + # before {Datadog.configure {|c| c.use :roda}} + it 'sets a default service name' do + Datadog.configure {|c| c.use :roda} + expect(datadog_pin.service_name).to eq(default_service_name) + end + end + end + end + end +end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 6e338048b85..9fc195b7c27 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -95,7 +95,7 @@ it do expect(response.status).to eq(500) expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) - + expect(spans).to have(1).items expect(span.parent).to be nil expect(span.span_type).to eq("http") From c8953fd92108c04eddb581e16813d20a7d8752cf Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Thu, 11 Jul 2019 18:09:02 -0400 Subject: [PATCH 0006/2133] Update span type to reference from updated EXT file, add additional tests to spec for roda. --- lib/ddtrace/contrib/roda/instrumentation.rb | 2 +- .../contrib/roda/instrumentation_spec.rb | 55 +++++++++++++------ spec/ddtrace/contrib/roda/patcher_spec.rb | 31 +++++++++-- 3 files changed, 66 insertions(+), 22 deletions(-) diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 88db212d9bc..223b7b158be 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -31,7 +31,7 @@ def call(*args) operation = "#{controller}##{action}" span.service = pin.service - span.span_type = Datadog::Ext::HTTP::TYPE + span.span_type = Datadog::Ext::HTTP::TYPE_INBOUND span.resource = request_method # Using the method as a resource, as URL/path can trigger diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index fd74c3af51e..aa0bdb7c9e3 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -# require 'ddtrace/contrib/analytics_examples' require 'roda' require 'ddtrace' require 'ddtrace/contrib/roda/instrumentation' @@ -11,27 +10,49 @@ let(:env) {{:REQUEST_METHOD =>'GET'}} let(:roda) {test_class.new(env)} + after(:each) do + Datadog.registry[:roda].reset_configuration! + end + describe '#datadog_pin' do subject(:datadog_pin) {roda.datadog_pin} - context 'when roda is configured' do - context 'with a service name' do - let(:custom_service_name) {"custom service name"} - let(:default_service_name) {Datadog::Contrib::Roda::Ext::SERVICE_NAME} - - # before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} - it 'sets a custom service name' do - Datadog.configure {|c| c.use :roda, service_name: custom_service_name} - expect(datadog_pin.service_name).to eq(custom_service_name) - end - - # before {Datadog.configure {|c| c.use :roda}} - it 'sets a default service name' do - Datadog.configure {|c| c.use :roda} - expect(datadog_pin.service_name).to eq(default_service_name) - end + context 'when roda is configured' do + + context 'tracer is enabled' do + before {Datadog.configure {|c| c.use :roda}} + it 'enables the tracer' do + expect(datadog_pin.tracer.enabled).to eq(true) + end + it 'has a web app type' do + expect(datadog_pin.app_type).to eq(Datadog::Ext::AppTypes::WEB) end end + + context 'with a custom service name' do + let(:custom_service_name) {"custom service name"} + + before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} + it 'sets a custom service name' do + expect(datadog_pin.service_name).to eq(custom_service_name) + end + end + + context 'without a service name' do + before {Datadog.configure {|c| c.use :roda}} + it 'sets a default' do + expect(datadog_pin.service_name).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) + end + end + end end + + + # describe '#call' do + # subject(:datadog_pin) {roda.datadog_pin} + # TODO + # it 'does a thing' do + # end + # end end end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 9fc195b7c27..b11428ae2ee 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -28,10 +28,15 @@ Class.new(Roda) do route do |r| r.root do + # GET / r.get do "Hello World!" end end + # GET /worlds/1 + r.get "worlds", Integer do |world| + "Hello, world #{world}" + end end end end @@ -56,17 +61,33 @@ include_context 'Roda app with 1 successful endpoint' subject(:response) {get '/'} it do - is_expected.to be_ok + expect(response.status).to eq(200) expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) expect(spans).to have(1).items - expect(span.span_type).to eq("http") + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) + expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') expect(span.parent).to be nil end + + subject(:params_response) {get 'worlds/1'} + it do + expect(params_response.status).to eq(200) + expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"14"}) + + expect(spans).to have(1).items + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') + expect(span.parent).to be nil + end end @@ -80,7 +101,8 @@ expect(spans).to have(1).items expect(span.parent).to be nil - expect(span.span_type).to eq("http") + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") expect(span.status).to eq(0) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') @@ -98,7 +120,8 @@ expect(spans).to have(1).items expect(span.parent).to be nil - expect(span.span_type).to eq("http") + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") expect(span.status).to eq(1) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') From 352d1cb0349110b349c55c842127969314634187 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Fri, 12 Jul 2019 17:07:11 -0400 Subject: [PATCH 0007/2133] Fix the tagging for the analytics option and add additional tests for the integration --- .../contrib/roda/configuration/settings.rb | 8 + lib/ddtrace/contrib/roda/ext.rb | 3 +- lib/ddtrace/contrib/roda/instrumentation.rb | 3 +- spec/ddtrace/contrib/roda/analytics_spec.rb | 64 ++++++++ .../contrib/roda/instrumentation_spec.rb | 148 ++++++++++++------ spec/ddtrace/contrib/roda/patcher_spec.rb | 15 +- 6 files changed, 181 insertions(+), 60 deletions(-) create mode 100644 spec/ddtrace/contrib/roda/analytics_spec.rb diff --git a/lib/ddtrace/contrib/roda/configuration/settings.rb b/lib/ddtrace/contrib/roda/configuration/settings.rb index 6b3fce50e95..e1607696def 100644 --- a/lib/ddtrace/contrib/roda/configuration/settings.rb +++ b/lib/ddtrace/contrib/roda/configuration/settings.rb @@ -7,6 +7,14 @@ module Roda module Configuration # Custom settings for the Roda integration class Settings < Contrib::Configuration::Settings + option :analytics_enabled, + default: -> { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, nil) }, + lazy: true + + option :analytics_sample_rate, + default: -> { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }, + lazy: true + option :service_name, default: Ext::SERVICE_NAME end end diff --git a/lib/ddtrace/contrib/roda/ext.rb b/lib/ddtrace/contrib/roda/ext.rb index 02495091a1e..ad65ad952d1 100644 --- a/lib/ddtrace/contrib/roda/ext.rb +++ b/lib/ddtrace/contrib/roda/ext.rb @@ -5,10 +5,9 @@ module Roda module Ext APP = 'roda'.freeze ENV_ANALYTICS_ENABLED = 'DD_RODA_ANALYTICS_ENABLED'.freeze - ENV_ANALYTICS_SAMPLED_RATE = 'DD_RODA_ANALYTICS_SAMPLED_RATE'.freeze + ENV_ANALYTICS_SAMPLE_RATE = 'DD_RODA_ANALYTICS_SAMPLE_RATE'.freeze SERVICE_NAME = 'roda'.freeze - SPAN_REQUEST = 'roda.request'.freeze SPAN_ENDPOINT_RENDER = 'roda.endpoint_render'.freeze diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 223b7b158be..7298e367eb3 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -18,7 +18,6 @@ def datadog_pin def call(*args) pin = datadog_pin return super unless pin && pin.tracer - pin.tracer.trace(Ext::SPAN_REQUEST) do |span| begin req = ::Rack::Request.new(env) @@ -40,7 +39,7 @@ def call(*args) span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) # Add analytics tag to the span - Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, Datadog.configuration[:roda][:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") diff --git a/spec/ddtrace/contrib/roda/analytics_spec.rb b/spec/ddtrace/contrib/roda/analytics_spec.rb new file mode 100644 index 00000000000..a78fc026f5d --- /dev/null +++ b/spec/ddtrace/contrib/roda/analytics_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' +require 'ddtrace' +require 'rack/test' +require 'roda' + +RSpec.describe 'Roda analytics configuration' do + include Rack::Test::Methods + + let(:tracer) { get_test_tracer } + let(:configuration_options) { { tracer: tracer, analytics_enabled: true } } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + + around do |example| + Datadog.registry[:roda].reset_configuration! + example.run + Datadog.registry[:roda].reset_configuration! + end + + shared_context 'Roda app with two endpoints' do + let(:app) do + Class.new(Roda) do + route do |r| + r.root do + # GET / + r.get do + "Hello World!" + end + end + # GET /worlds/1 + r.get "worlds", Integer do |world| + "Hello, world #{world}" + end + end + end + end + end + + context 'when analytics is enabled' do + + include_context 'Roda app with two endpoints' + subject(:response) {get '/'} + + it do + expect(response.status).to eq(200) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(1) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + end +end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index aa0bdb7c9e3..7c0e7807166 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -5,54 +5,102 @@ require 'ddtrace/contrib/roda/ext' RSpec.describe Datadog::Contrib::Roda::Instrumentation do - describe 'when implemented in Roda' do - let(:test_class) {Class.new(Roda)} - let(:env) {{:REQUEST_METHOD =>'GET'}} - let(:roda) {test_class.new(env)} - - after(:each) do - Datadog.registry[:roda].reset_configuration! - end - - describe '#datadog_pin' do - subject(:datadog_pin) {roda.datadog_pin} - - context 'when roda is configured' do - - context 'tracer is enabled' do - before {Datadog.configure {|c| c.use :roda}} - it 'enables the tracer' do - expect(datadog_pin.tracer.enabled).to eq(true) - end - it 'has a web app type' do - expect(datadog_pin.app_type).to eq(Datadog::Ext::AppTypes::WEB) - end - end - - context 'with a custom service name' do - let(:custom_service_name) {"custom service name"} - - before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} - it 'sets a custom service name' do - expect(datadog_pin.service_name).to eq(custom_service_name) - end - end - - context 'without a service name' do - before {Datadog.configure {|c| c.use :roda}} - it 'sets a default' do - expect(datadog_pin.service_name).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) - end - end - end - end - - - # describe '#call' do - # subject(:datadog_pin) {roda.datadog_pin} - # TODO - # it 'does a thing' do - # end - # end - end + describe 'when implemented in Roda' do + let(:test_class) {Class.new(Roda)} + let(:env) {{:REQUEST_METHOD =>'GET'}} + let(:roda) {test_class.new(env)} + + after(:each) do + Datadog.registry[:roda].reset_configuration! + end + + describe '#datadog_pin' do + subject(:datadog_pin) {roda.datadog_pin} + + context 'when roda is configured' do + + context 'tracer is enabled' do + before {Datadog.configure {|c| c.use :roda}} + it 'enables the tracer' do + expect(datadog_pin.tracer.enabled).to eq(true) + end + it 'has a web app type' do + expect(datadog_pin.app_type).to eq(Datadog::Ext::AppTypes::WEB) + end + end + + context 'with a custom service name' do + let(:custom_service_name) {"custom service name"} + + before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} + it 'sets a custom service name' do + expect(datadog_pin.service_name).to eq(custom_service_name) + end + end + + context 'without a service name' do + before {Datadog.configure {|c| c.use :roda}} + it 'sets a default' do + expect(datadog_pin.service_name).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) + end + end + end + end + + + describe '#call' do + subject(:test_class) do + s = spy + e = env + Class.new do + prepend Datadog::Contrib::Roda::Instrumentation + end + .tap do |c| + c.send(:define_method, :call) do |*args| + s.call + end + c.send(:define_method, :env) do + e + end + end + + end + + let(:spy) {instance_double(Roda)} + let(:env) {instance_double(Hash)} + let(:rack_request) do + instance_double( + ::Rack::Request, + request_method: :get, + path: '/' + ) + end + + subject(:roda) {test_class.new} + before do + allow(spy).to receive(:call) + .and_return(response) + allow(::Rack::Request).to receive(:new) + .with(env) + .and_return(rack_request) + end + + context 'when it receives a 200' do + let(:response) {[200,instance_double(Hash), double('body')]} + + it do + roda.call + expect(spy).to have_received(:call) + end + end + context 'when it receives a 500' do + let(:response) {[500,instance_double(Hash), double('body')]} + + it do + roda.call + expect(spy).to have_received(:call) + end + end + end + end end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index b11428ae2ee..c0552335cc9 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -23,7 +23,7 @@ Datadog.registry[:roda].reset_configuration! end - shared_context 'Roda app with 1 successful endpoint' do + shared_context 'Roda app with two endpoints' do let(:app) do Class.new(Roda) do route do |r| @@ -58,13 +58,14 @@ context 'when a 200 status code request is made' do - include_context 'Roda app with 1 successful endpoint' + include_context 'Roda app with two endpoints' subject(:response) {get '/'} + it do expect(response.status).to eq(200) expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.resource).to eq("GET") @@ -81,6 +82,7 @@ expect(spans).to have(1).items expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") @@ -93,7 +95,7 @@ context 'when a 404 status code request is made' do - include_context 'Roda app with 1 successful endpoint' + include_context 'Roda app with two endpoints' subject(:response) {get '/unsuccessful_endpoint'} it do expect(response.status).to eq(404) @@ -101,6 +103,7 @@ expect(spans).to have(1).items expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") @@ -120,6 +123,7 @@ expect(spans).to have(1).items expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") @@ -129,9 +133,8 @@ end end - context 'when the tracer is disabled' do - include_context 'Roda app with 1 successful endpoint' + include_context 'Roda app with two endpoints' subject(:response) {get '/'} let(:tracer) { get_test_tracer(enabled: false) } From 68d3b5d3cc673b85724484d29d1e45b35f87595f Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Mon, 15 Jul 2019 17:41:51 -0400 Subject: [PATCH 0008/2133] Refactor tests. Add distributed tracing to Roda integration. Update unit tests. --- .../contrib/roda/configuration/settings.rb | 2 + lib/ddtrace/contrib/roda/instrumentation.rb | 7 + spec/ddtrace/contrib/roda/analytics_spec.rb | 64 ------ .../contrib/roda/instrumentation_spec.rb | 123 +++++++++-- spec/ddtrace/contrib/roda/patcher_spec.rb | 194 +++++++++++------- 5 files changed, 226 insertions(+), 164 deletions(-) delete mode 100644 spec/ddtrace/contrib/roda/analytics_spec.rb diff --git a/lib/ddtrace/contrib/roda/configuration/settings.rb b/lib/ddtrace/contrib/roda/configuration/settings.rb index e1607696def..ff4a3cb3289 100644 --- a/lib/ddtrace/contrib/roda/configuration/settings.rb +++ b/lib/ddtrace/contrib/roda/configuration/settings.rb @@ -15,6 +15,8 @@ class Settings < Contrib::Configuration::Settings default: -> { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }, lazy: true + option :distributed_tracing, default: true + option :service_name, default: Ext::SERVICE_NAME end end diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 7298e367eb3..26a5fef0d0b 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -18,6 +18,13 @@ def datadog_pin def call(*args) pin = datadog_pin return super unless pin && pin.tracer + + # Distributed tracing - extract before starting the span + if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? + context = HTTPPropagator.extract(env) + Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id + end + pin.tracer.trace(Ext::SPAN_REQUEST) do |span| begin req = ::Rack::Request.new(env) diff --git a/spec/ddtrace/contrib/roda/analytics_spec.rb b/spec/ddtrace/contrib/roda/analytics_spec.rb deleted file mode 100644 index a78fc026f5d..00000000000 --- a/spec/ddtrace/contrib/roda/analytics_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'spec_helper' -require 'ddtrace' -require 'rack/test' -require 'roda' - -RSpec.describe 'Roda analytics configuration' do - include Rack::Test::Methods - - let(:tracer) { get_test_tracer } - let(:configuration_options) { { tracer: tracer, analytics_enabled: true } } - let(:spans) { tracer.writer.spans } - let(:span) { spans.first } - - before(:each) do - Datadog.configure do |c| - c.use :roda, configuration_options - end - end - - around do |example| - Datadog.registry[:roda].reset_configuration! - example.run - Datadog.registry[:roda].reset_configuration! - end - - shared_context 'Roda app with two endpoints' do - let(:app) do - Class.new(Roda) do - route do |r| - r.root do - # GET / - r.get do - "Hello World!" - end - end - # GET /worlds/1 - r.get "worlds", Integer do |world| - "Hello, world #{world}" - end - end - end - end - end - - context 'when analytics is enabled' do - - include_context 'Roda app with two endpoints' - subject(:response) {get '/'} - - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(1) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil - end - end -end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index 7c0e7807166..f5b69de33b3 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -19,29 +19,33 @@ context 'when roda is configured' do - context 'tracer is enabled' do - before {Datadog.configure {|c| c.use :roda}} + context 'with default settings' do + before { Datadog.configure {|c| c.use :roda } } + it 'enables the tracer' do + expect(datadog_pin.tracer).to be(Datadog.configuration[:roda][:tracer]) expect(datadog_pin.tracer.enabled).to eq(true) end + it 'has a web app type' do expect(datadog_pin.app_type).to eq(Datadog::Ext::AppTypes::WEB) end - end - - context 'with a custom service name' do - let(:custom_service_name) {"custom service name"} - before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} - it 'sets a custom service name' do - expect(datadog_pin.service_name).to eq(custom_service_name) + it 'has a default name' do + expect(datadog_pin.app).to eq(Datadog::Contrib::Roda::Ext::APP) + expect(datadog_pin.service).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) + expect(datadog_pin.service_name).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) end - end - context 'without a service name' do - before {Datadog.configure {|c| c.use :roda}} - it 'sets a default' do - expect(datadog_pin.service_name).to eq(Datadog::Contrib::Roda::Ext::SERVICE_NAME) + context 'with a custom service name' do + let(:custom_service_name) {"custom service name"} + + before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} + it 'sets a custom service name' do + expect(datadog_pin.app).to eq(Datadog::Contrib::Roda::Ext::APP) + expect(datadog_pin.service).to eq(custom_service_name) + expect(datadog_pin.service_name).to eq(custom_service_name) + end end end end @@ -49,7 +53,8 @@ describe '#call' do - subject(:test_class) do + subject(:call) { roda.call } + let(:test_class) do s = spy e = env Class.new do @@ -67,7 +72,9 @@ end let(:spy) {instance_double(Roda)} - let(:env) {instance_double(Hash)} + let(:env) {{'HTTP_X_DATADOG_TRACE_ID' => '30000'}} + # let(:env) {instance_double(Hash)} + let(:rack_request) do instance_double( ::Rack::Request, @@ -75,8 +82,13 @@ path: '/' ) end + + let(:configuration_options) { { tracer: tracer } } + let(:tracer) { get_test_tracer } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } - subject(:roda) {test_class.new} + let(:roda) {test_class.new} before do allow(spy).to receive(:call) .and_return(response) @@ -85,20 +97,89 @@ .and_return(rack_request) end - context 'when it receives a 200' do - let(:response) {[200,instance_double(Hash), double('body')]} + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + + context 'when it receives a successful request' do + let(:response) {[200, instance_double(Hash), double('body')]} it do - roda.call + call expect(spy).to have_received(:call) + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + + context 'distributed tracing' do + let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} + context 'with origin' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '10000', + 'HTTP_X_DATADOG_PARENT_ID' => '20000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' + } + end + + it 'passes in headers and sets the context' do + call + expect(spans).to have(1).items + expect(span.trace_id).to eq(10000) + expect(span.parent_id).to eq(20000) + expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') + + end + end + + context 'without origin' do + let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '10000', + 'HTTP_X_DATADOG_PARENT_ID' => '20000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + } + end + + it 'passes in headers' do + call + expect(spans).to have(1).items + expect(span.trace_id).to eq(10000) + expect(span.parent_id).to eq(20000) + expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil + end + end + end end - context 'when it receives a 500' do + context 'when it receives a server error' do let(:response) {[500,instance_double(Hash), double('body')]} it do roda.call expect(spy).to have_received(:call) + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(1) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') end end end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index c0552335cc9..90595815062 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -1,5 +1,6 @@ require 'spec_helper' require 'ddtrace' +require 'ddtrace/contrib/analytics_examples' require 'rack/test' require 'roda' @@ -56,92 +57,127 @@ end end - context 'when a 200 status code request is made' do - - include_context 'Roda app with two endpoints' - subject(:response) {get '/'} - - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil - end + context 'when configured' do + context 'with default settings' do + context 'and a 200 status code request is made' do + + include_context 'Roda app with two endpoints' + subject(:response) {get '/'} + + it do + expect(response.status).to eq(200) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end - subject(:params_response) {get 'worlds/1'} - it do - expect(params_response.status).to eq(200) - expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"14"}) - - expect(spans).to have(1).items - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') - expect(span.parent).to be nil - end - end + it_behaves_like 'analytics for integration', ignore_global_flag: false do + before { is_expected.to be_ok } + let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + # context 'sets X-Request-Id on the response as tags' do + # let(:request_id) { SecureRandom.uuid } + + # let(:app) do + # req_id = request_id + # Class.new(Roda) do + # route do |r| + # r.root do + # r.get do + # r.response['X-Request-Id'] = req_id + # "Distributed tracing!" + # end + # end + # end + # end + # end + + # subject(:response) { get '/' } + # it do + # expect(response.status).to eq(200) + # expect(spans).to have(1).items + # expect(span.get_tag('http.response.headers.x_request_id')).to eq(request_id) + # end + # end + + subject(:params_response) {get 'worlds/1'} + it do + expect(params_response.status).to eq(200) + expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"14"}) + + expect(spans).to have(1).items + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') + expect(span.parent).to be nil + end + end - context 'when a 404 status code request is made' do - - include_context 'Roda app with two endpoints' - subject(:response) {get '/unsuccessful_endpoint'} - it do - expect(response.status).to eq(404) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) - - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.status).to eq(0) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') - end - end - context 'when a 500 status code request is made' do - - include_context 'Roda app with server error' - subject(:response) {get '/'} - it do - expect(response.status).to eq(500) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) - - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.status).to eq(1) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end - end + context 'when a 404 status code request is made' do + + include_context 'Roda app with two endpoints' + subject(:response) {get '/unsuccessful_endpoint'} + it do + expect(response.status).to eq(404) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) + + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(0) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') + end + end - context 'when the tracer is disabled' do - include_context 'Roda app with two endpoints' - subject(:response) {get '/'} + context 'when a 500 status code request is made' do + + include_context 'Roda app with server error' + subject(:response) {get '/'} + it do + expect(response.status).to eq(500) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) + + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(1) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + + context 'when the tracer is disabled' do + include_context 'Roda app with two endpoints' + subject(:response) {get '/'} - let(:tracer) { get_test_tracer(enabled: false) } + let(:tracer) { get_test_tracer(enabled: false) } - it do - is_expected.to be_ok - expect(spans).to be_empty + it do + is_expected.to be_ok + expect(spans).to be_empty + end + end end end end \ No newline at end of file From 72553adebf10b385596e275e93b53af0d2439f03 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Tue, 16 Jul 2019 15:24:21 -0400 Subject: [PATCH 0009/2133] Start to refactor unit tests, remove unused variables and constants from the instrumentation. --- lib/ddtrace/contrib/roda/ext.rb | 8 - lib/ddtrace/contrib/roda/instrumentation.rb | 11 +- .../contrib/roda/instrumentation_spec.rb | 266 +++++++++++------- spec/ddtrace/contrib/roda/patcher_spec.rb | 187 ++++++------ 4 files changed, 254 insertions(+), 218 deletions(-) diff --git a/lib/ddtrace/contrib/roda/ext.rb b/lib/ddtrace/contrib/roda/ext.rb index ad65ad952d1..9650a9254e9 100644 --- a/lib/ddtrace/contrib/roda/ext.rb +++ b/lib/ddtrace/contrib/roda/ext.rb @@ -9,14 +9,6 @@ module Ext SERVICE_NAME = 'roda'.freeze SPAN_REQUEST = 'roda.request'.freeze - - SPAN_ENDPOINT_RENDER = 'roda.endpoint_render'.freeze - SPAN_ENDPOINT_RUN = 'roda.endpoint_run'.freeze - SPAN_ENDPOINT_RUN_FILTERS = 'roda.endpoint_run_filters'.freeze - - TAG_FILTER_TYPE = 'roda.filter.type'.freeze - TAG_ROUTE_ENDPOINT = 'roda.route.endpoint'.freeze - TAG_ROUTE_PATH = 'roda.route.path'.freeze end end end diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 26a5fef0d0b..0ba2e2f4215 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -19,7 +19,7 @@ def call(*args) pin = datadog_pin return super unless pin && pin.tracer - # Distributed tracing - extract before starting the span + # Distributed tracing - extract before starting the span - extract distributed tracing if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? context = HTTPPropagator.extract(env) Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id @@ -27,15 +27,10 @@ def call(*args) pin.tracer.trace(Ext::SPAN_REQUEST) do |span| begin - req = ::Rack::Request.new(env) - request_method = req.request_method.to_s.upcase + req = ::Rack::Request.new(env) + request_method = req.request_method.to_s.upcase # path = req.path - parts = path.to_s.rpartition("/") - action = parts.last - controller = parts.first.sub(/\A\//, '').split("/").collect {|w| w.capitalize }.join("::") - operation = "#{controller}##{action}" - span.service = pin.service span.span_type = Datadog::Ext::HTTP::TYPE_INBOUND diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index f5b69de33b3..b999c1a7a83 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -6,21 +6,31 @@ RSpec.describe Datadog::Contrib::Roda::Instrumentation do describe 'when implemented in Roda' do - let(:test_class) {Class.new(Roda)} - let(:env) {{:REQUEST_METHOD =>'GET'}} - let(:roda) {test_class.new(env)} + + let(:configuration_options) { { tracer: tracer } } + let(:tracer) { get_test_tracer } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + after(:each) do Datadog.registry[:roda].reset_configuration! end describe '#datadog_pin' do - subject(:datadog_pin) {roda.datadog_pin} + let(:test_class) { Class.new(Roda) } + let(:roda) { test_class.new(env) } + let(:env) { {:REQUEST_METHOD =>'GET'} } + subject(:datadog_pin) { roda.datadog_pin } context 'when roda is configured' do context 'with default settings' do - before { Datadog.configure {|c| c.use :roda } } it 'enables the tracer' do expect(datadog_pin.tracer).to be(Datadog.configuration[:roda][:tracer]) @@ -39,8 +49,8 @@ context 'with a custom service name' do let(:custom_service_name) {"custom service name"} + let(:configuration_options) { { tracer: tracer, service_name: custom_service_name } } - before {Datadog.configure {|c| c.use :roda, service_name: custom_service_name}} it 'sets a custom service name' do expect(datadog_pin.app).to eq(Datadog::Contrib::Roda::Ext::APP) expect(datadog_pin.service).to eq(custom_service_name) @@ -51,137 +61,197 @@ end end - describe '#call' do subject(:call) { roda.call } + let(:roda) { test_class.new } let(:test_class) do - s = spy - e = env Class.new do prepend Datadog::Contrib::Roda::Instrumentation end - .tap do |c| - c.send(:define_method, :call) do |*args| - s.call - end - c.send(:define_method, :env) do - e - end - end - end - let(:spy) {instance_double(Roda)} - let(:env) {{'HTTP_X_DATADOG_TRACE_ID' => '30000'}} - # let(:env) {instance_double(Hash)} - - let(:rack_request) do + shared_context 'stubbed request' do + let(:env) { instance_double(Hash) } + let(:response_method) { :get } + let(:path) { '/' } + + let(:request) do instance_double( ::Rack::Request, - request_method: :get, - path: '/' - ) - end + request_method: response_method, + path: path + ) + end - let(:configuration_options) { { tracer: tracer } } - let(:tracer) { get_test_tracer } - let(:spans) { tracer.writer.spans } - let(:span) { spans.first } - - let(:roda) {test_class.new} before do - allow(spy).to receive(:call) - .and_return(response) - allow(::Rack::Request).to receive(:new) + e = env + test_class.send(:define_method, :env) do |*args| + e + end + + expect(::Rack::Request).to receive(:new) .with(env) - .and_return(rack_request) + .and_return(request) end + end + + shared_context 'stubbed response' do + let(:spy) { instance_double(Roda) } + let(:response) {[response_code, instance_double(Hash), double('body')]} + let(:response_code) { 200 } + let(:response_headers) { double('body') } - before(:each) do - Datadog.configure do |c| - c.use :roda, configuration_options + before do + s = spy + test_class.send(:define_method, :call) do |*args| + s.call + end + expect(spy).to receive(:call) + .and_return(response) end end + + context 'when the response code is' do + include_context 'stubbed request' + include_context 'stubbed response' do + let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } + end + + context '200' do + let(:response_code) { 200 } + + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + end - context 'when it receives a successful request' do - let(:response) {[200, instance_double(Hash), double('body')]} - - it do - call - expect(spy).to have_received(:call) - expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil + context '404' do + let(:response_code) { 404 } + let(:path) { '/unsuccessful_endpoint' } + + it do + call + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(0) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') + end end + + context '500' do + let(:response_code) { 500 } - context 'distributed tracing' do - let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} - context 'with origin' do - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '10000', - 'HTTP_X_DATADOG_PARENT_ID' => '20000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, - 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' - } + it do + call + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + expect(span.status).to eq(1) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + end + + + context 'when the verb is' do + + end + + context 'when the path is' do + + end + + context 'when distributed tracing' do + include_context 'stubbed request' + + let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} + + context 'is enabled' do + context 'without origin' do + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '40000', + 'HTTP_X_DATADOG_PARENT_ID' => '50000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + } + end end - it 'passes in headers and sets the context' do + it do call expect(spans).to have(1).items - expect(span.trace_id).to eq(10000) - expect(span.parent_id).to eq(20000) + expect(span.trace_id).to eq(40000) + expect(span.parent_id).to eq(50000) + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) - expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') - + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil end end - context 'without origin' do - let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '10000', - 'HTTP_X_DATADOG_PARENT_ID' => '20000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, - } + context 'with origin' do + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '10000', + 'HTTP_X_DATADOG_PARENT_ID' => '20000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' + } + end end - it 'passes in headers' do + it do call expect(spans).to have(1).items expect(span.trace_id).to eq(10000) expect(span.parent_id).to eq(20000) + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) - expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') end end - end - end - context 'when it receives a server error' do - let(:response) {[500,instance_double(Hash), double('body')]} - - it do - roda.call - expect(spy).to have_received(:call) - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.status).to eq(1) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + + context 'is disabled' do + let(:configuration_options) { { tracer: tracer, distributed_tracing: false } } + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '40000', + 'HTTP_X_DATADOG_PARENT_ID' => '50000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + } + end + end + + it 'does not take on the passed in trace context' do + call + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(false) + expect(spans).to have(1).items + expect(span.trace_id).to_not eq(40000) + expect(span.parent_id).to_not eq(50000) + end end - end + end end end end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 90595815062..d5d31f7678b 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -24,9 +24,10 @@ Datadog.registry[:roda].reset_configuration! end - shared_context 'Roda app with two endpoints' do + shared_context 'basic roda app' do let(:app) do Class.new(Roda) do + plugin :all_verbs route do |r| r.root do # GET / @@ -34,9 +35,14 @@ "Hello World!" end end - # GET /worlds/1 - r.get "worlds", Integer do |world| - "Hello, world #{world}" + r.is 'worlds', Integer do |world| + r.put do + "UPDATE" + end + # GET /worlds/1 + r.get do + "Hello, world #{r.params['world']}" + end end end end @@ -59,116 +65,88 @@ context 'when configured' do context 'with default settings' do - context 'and a 200 status code request is made' do - - include_context 'Roda app with two endpoints' - subject(:response) {get '/'} - - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil - end + context 'and a successful request is made' do + + include_context 'basic roda app' + subject(:response) { get '/' } + + context 'for a basic GET endpoint' do + it do + expect(response.status).to eq(200) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + expect(spans).to have(1).items + # expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + # expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + # expect(span.status).to eq(0) + # expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + # expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + # expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + # expect(span.parent).to be nil + end - it_behaves_like 'analytics for integration', ignore_global_flag: false do - before { is_expected.to be_ok } - let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } - let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } + it_behaves_like 'analytics for integration', ignore_global_flag: false do + before { is_expected.to be_ok } + let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end end - # context 'sets X-Request-Id on the response as tags' do - # let(:request_id) { SecureRandom.uuid } - - # let(:app) do - # req_id = request_id - # Class.new(Roda) do - # route do |r| - # r.root do - # r.get do - # r.response['X-Request-Id'] = req_id - # "Distributed tracing!" - # end - # end - # end - # end - # end - - # subject(:response) { get '/' } - # it do - # expect(response.status).to eq(200) - # expect(spans).to have(1).items - # expect(span.get_tag('http.response.headers.x_request_id')).to eq(request_id) - # end - # end - - subject(:params_response) {get 'worlds/1'} - it do - expect(params_response.status).to eq(200) - expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"14"}) - - expect(spans).to have(1).items - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') - expect(span.parent).to be nil - end + context 'for a GET endpoint with an id' do + + subject(:params_response) { get 'worlds/1' } + + it do + expect(params_response.status).to eq(200) + expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"13"}) + + expect(spans).to have(1).items + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') + expect(span.parent).to be nil + end + end end - - context 'when a 404 status code request is made' do - - include_context 'Roda app with two endpoints' - subject(:response) {get '/unsuccessful_endpoint'} - it do - expect(response.status).to eq(404) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) - - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.status).to eq(0) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') + context 'and an error occurs' do + context 'with a 404' do + include_context 'basic roda app' + subject(:response) { get '/unsuccessful_endpoint' } + it do + expect(response.status).to eq(404) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) + expect(spans).to have(1).items + expect(span.name).to eq("roda.request") + end end - end - context 'when a 500 status code request is made' do - - include_context 'Roda app with server error' - subject(:response) {get '/'} - it do - expect(response.status).to eq(500) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) - - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") - expect(span.status).to eq(1) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end + context 'with a 500' do + include_context 'Roda app with server error' + subject(:response) {get '/'} + it do + expect(response.status).to eq(500) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) + + expect(spans).to have(1).items + # expect(span.parent).to be nil + # expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + # expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + # expect(span.resource).to eq("GET") + expect(span.name).to eq("roda.request") + # expect(span.status).to eq(1) + # expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + # expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end end context 'when the tracer is disabled' do - include_context 'Roda app with two endpoints' + include_context 'basic roda app' subject(:response) {get '/'} let(:tracer) { get_test_tracer(enabled: false) } @@ -178,6 +156,7 @@ expect(spans).to be_empty end end + end end end \ No newline at end of file From ab7d7fed4c032dc94cf012d1d16bbbc10b4ce57a Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Tue, 16 Jul 2019 16:31:40 -0400 Subject: [PATCH 0010/2133] Continue to refactor unit tests and add private method for distributed tracing for the instrumentation. --- lib/ddtrace/contrib/roda/instrumentation.rb | 15 ++- .../contrib/roda/instrumentation_spec.rb | 104 ++++++++++++++++-- spec/ddtrace/contrib/roda/patcher_spec.rb | 56 +++++----- 3 files changed, 132 insertions(+), 43 deletions(-) diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 0ba2e2f4215..5f8f8d423e1 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -19,11 +19,7 @@ def call(*args) pin = datadog_pin return super unless pin && pin.tracer - # Distributed tracing - extract before starting the span - extract distributed tracing - if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? - context = HTTPPropagator.extract(env) - Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id - end + set_distributed_tracing_context(env) pin.tracer.trace(Ext::SPAN_REQUEST) do |span| begin @@ -54,6 +50,15 @@ def call(*args) response end end + + private + + def set_distributed_tracing_context(env) + if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? + context = HTTPPropagator.extract(env) + Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id + end + end end end end diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index b999c1a7a83..d187722c9b4 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -97,7 +97,7 @@ shared_context 'stubbed response' do let(:spy) { instance_double(Roda) } - let(:response) {[response_code, instance_double(Hash), double('body')]} + let(:response) { [response_code, instance_double(Hash), double('body')] } let(:response_code) { 200 } let(:response_headers) { double('body') } @@ -111,12 +111,13 @@ end end + context 'when the response code is' do include_context 'stubbed request' include_context 'stubbed response' do let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } end - + context '200' do let(:response_code) { 200 } @@ -126,8 +127,8 @@ expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') expect(span.parent).to be nil @@ -170,13 +171,102 @@ end end - context 'when the verb is' do + include_context 'stubbed request' + include_context 'stubbed response' do + let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } + end + + context 'GET' do + let(:response_code) { 200 } + + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + end + + context 'PUT' do + let(:response_method) { :put } + + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("PUT") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.parent).to be nil + end + end end context 'when the path is' do + include_context 'stubbed request' + include_context 'stubbed response' do + let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } + end + context '/worlds' do + let(:path) { 'worlds' } + + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.parent).to be nil + end + end + + context '/worlds/:id' do + let(:path) { 'worlds/1' } + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.parent).to be nil + end + end + + context 'articles?id=1' do + let(:path) { 'articles?id=1' } + it do + call + expect(spans).to have(1).items + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq("roda.request") + expect(span.resource).to eq("GET") + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.parent).to be nil + end + end end context 'when distributed tracing' do @@ -198,10 +288,10 @@ it do call + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(spans).to have(1).items expect(span.trace_id).to eq(40000) expect(span.parent_id).to eq(50000) - expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil end @@ -221,10 +311,10 @@ it do call + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(spans).to have(1).items expect(span.trace_id).to eq(10000) expect(span.parent_id).to eq(20000) - expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') end @@ -251,7 +341,7 @@ expect(span.parent_id).to_not eq(50000) end end - end + end end end end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index d5d31f7678b..7383efcc250 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -30,16 +30,19 @@ plugin :all_verbs route do |r| r.root do - # GET / r.get do - "Hello World!" + 'Hello World!' + end + end + r.is 'articles' do + r.get do + 'Articles' end end r.is 'worlds', Integer do |world| r.put do - "UPDATE" + 'UPDATE' end - # GET /worlds/1 r.get do "Hello, world #{r.params['world']}" end @@ -75,14 +78,7 @@ expect(response.status).to eq(200) expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) expect(spans).to have(1).items - # expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - # expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - # expect(span.status).to eq(0) - # expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") - # expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - # expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - # expect(span.parent).to be nil end it_behaves_like 'analytics for integration', ignore_global_flag: false do @@ -97,23 +93,29 @@ subject(:params_response) { get 'worlds/1' } it do - expect(params_response.status).to eq(200) - expect(params_response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"13"}) - + expect(response.status).to eq(200) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) + expect(spans).to have(1).items + expect(span.name).to eq("roda.request") + end + end + + + context 'for a GET endpoint with an id' do + + let(:response) { get 'articles?id=1' } + + it do + expect(response.status).to eq(200) + expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"8"}) expect(spans).to have(1).items - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - expect(span.status).to eq(0) expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/worlds/1') - expect(span.parent).to be nil end - end + end + end - context 'and an error occurs' do + context 'and an unsuccessful response occurs' do context 'with a 404' do include_context 'basic roda app' subject(:response) { get '/unsuccessful_endpoint' } @@ -131,16 +133,8 @@ it do expect(response.status).to eq(500) expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) - expect(spans).to have(1).items - # expect(span.parent).to be nil - # expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - # expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - # expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") - # expect(span.status).to eq(1) - # expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - # expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') end end end From 6103e1f56e1a78c215928612c0cbf62e40108d7b Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Tue, 16 Jul 2019 17:27:08 -0400 Subject: [PATCH 0011/2133] Add unit tests for analytics. --- .../contrib/roda/instrumentation_spec.rb | 54 +++++++++++++------ spec/ddtrace/contrib/roda/patcher_spec.rb | 2 +- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index d187722c9b4..b9bb8f6a303 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -124,14 +124,13 @@ it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil end end @@ -143,7 +142,6 @@ call expect(spans).to have(1).items expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") @@ -160,7 +158,6 @@ call expect(spans).to have(1).items expect(span.parent).to be nil - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.resource).to eq("GET") expect(span.name).to eq("roda.request") @@ -178,19 +175,16 @@ end context 'GET' do - let(:response_code) { 200 } - it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil end end @@ -200,14 +194,13 @@ it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("PUT") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - expect(span.parent).to be nil end end @@ -225,14 +218,13 @@ it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - expect(span.parent).to be nil end end @@ -241,14 +233,13 @@ it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - expect(span.parent).to be nil end end @@ -257,14 +248,13 @@ it do call expect(spans).to have(1).items - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) expect(span.name).to eq("roda.request") expect(span.resource).to eq("GET") expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - expect(span.parent).to be nil end end end @@ -341,7 +331,37 @@ expect(span.parent_id).to_not eq(50000) end end - end + end + + + context 'when analytics' do + include_context 'stubbed request' + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '0' + } + end + end + context 'is not enabled' do + + it do + call + expect(span.name).to eq("roda.request") + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) + end + end + + context 'is enabled' do + let(:configuration_options) { { tracer: tracer, analytics_enabled: true } } + it do + call + expect(span.name).to eq("roda.request") + expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(1.0) + end + end + end + end end end \ No newline at end of file diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 7383efcc250..e02279a3a98 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -101,7 +101,7 @@ end - context 'for a GET endpoint with an id' do + context 'for a GET endpoint with params' do let(:response) { get 'articles?id=1' } From fef14ffff9ff32a9be4f55c123a79ea789353aea Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Wed, 17 Jul 2019 12:59:14 -0400 Subject: [PATCH 0012/2133] Move analytics examples to unit tests and add logic to check for Ruby version. --- lib/ddtrace/contrib/roda/integration.rb | 2 +- .../contrib/roda/instrumentation_spec.rb | 58 +++++-------------- spec/ddtrace/contrib/roda/patcher_spec.rb | 8 +-- 3 files changed, 18 insertions(+), 50 deletions(-) diff --git a/lib/ddtrace/contrib/roda/integration.rb b/lib/ddtrace/contrib/roda/integration.rb index 0ba37231603..672076efdd1 100644 --- a/lib/ddtrace/contrib/roda/integration.rb +++ b/lib/ddtrace/contrib/roda/integration.rb @@ -20,7 +20,7 @@ def self.present? end def self.compatible? - super + super && version >= Gem::Version.new('2.0.0') end def default_configuration diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index b9bb8f6a303..9925feef7de 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -3,6 +3,7 @@ require 'ddtrace' require 'ddtrace/contrib/roda/instrumentation' require 'ddtrace/contrib/roda/ext' +require 'ddtrace/contrib/analytics_examples' RSpec.describe Datadog::Contrib::Roda::Instrumentation do describe 'when implemented in Roda' do @@ -11,7 +12,12 @@ let(:tracer) { get_test_tracer } let(:spans) { tracer.writer.spans } let(:span) { spans.first } - + let(:roda) { test_class.new } + let(:test_class) do + Class.new do + prepend Datadog::Contrib::Roda::Instrumentation + end + end before(:each) do Datadog.configure do |c| c.use :roda, configuration_options @@ -23,8 +29,6 @@ end describe '#datadog_pin' do - let(:test_class) { Class.new(Roda) } - let(:roda) { test_class.new(env) } let(:env) { {:REQUEST_METHOD =>'GET'} } subject(:datadog_pin) { roda.datadog_pin } @@ -63,15 +67,9 @@ describe '#call' do subject(:call) { roda.call } - let(:roda) { test_class.new } - let(:test_class) do - Class.new do - prepend Datadog::Contrib::Roda::Instrumentation - end - end shared_context 'stubbed request' do - let(:env) { instance_double(Hash) } + let(:env) { {} } let(:response_method) { :get } let(:path) { '/' } @@ -114,9 +112,7 @@ context 'when the response code is' do include_context 'stubbed request' - include_context 'stubbed response' do - let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } - end + include_context 'stubbed response' context '200' do let(:response_code) { 200 } @@ -170,9 +166,7 @@ context 'when the verb is' do include_context 'stubbed request' - include_context 'stubbed response' do - let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } - end + include_context 'stubbed response' context 'GET' do it do @@ -208,9 +202,7 @@ context 'when the path is' do include_context 'stubbed request' - include_context 'stubbed response' do - let(:env) { {'HTTP_X_DATADOG_TRACE_ID' => '0'} } - end + include_context 'stubbed response' context '/worlds' do let(:path) { 'worlds' } @@ -336,29 +328,11 @@ context 'when analytics' do include_context 'stubbed request' - include_context 'stubbed response' do - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '0' - } - end - end - context 'is not enabled' do - - it do - call - expect(span.name).to eq("roda.request") - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(nil) - end - end - - context 'is enabled' do - let(:configuration_options) { { tracer: tracer, analytics_enabled: true } } - it do - call - expect(span.name).to eq("roda.request") - expect(span.get_metric(Datadog::Ext::Analytics::TAG_SAMPLE_RATE)).to eq(1.0) - end + include_context 'stubbed response' + it_behaves_like 'analytics for integration', ignore_global_flag: false do + before { call } + let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } end end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index e02279a3a98..8bb145bb426 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -80,12 +80,6 @@ expect(spans).to have(1).items expect(span.name).to eq("roda.request") end - - it_behaves_like 'analytics for integration', ignore_global_flag: false do - before { is_expected.to be_ok } - let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } - let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } - end end context 'for a GET endpoint with an id' do @@ -139,7 +133,7 @@ end end - context 'when the tracer is disabled' do + context 'and the tracer is disabled' do include_context 'basic roda app' subject(:response) {get '/'} From 76c4a38f72cdf0964c7f047458abbc64f2dbd9f7 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Wed, 17 Jul 2019 14:18:51 -0400 Subject: [PATCH 0013/2133] Update formatting for linting --- .../contrib/roda/configuration/settings.rb | 8 +- lib/ddtrace/contrib/roda/instrumentation.rb | 36 ++- .../contrib/roda/instrumentation_spec.rb | 125 ++++---- spec/ddtrace/contrib/roda/patcher_spec.rb | 280 +++++++++--------- 4 files changed, 217 insertions(+), 232 deletions(-) diff --git a/lib/ddtrace/contrib/roda/configuration/settings.rb b/lib/ddtrace/contrib/roda/configuration/settings.rb index ff4a3cb3289..113140f7af6 100644 --- a/lib/ddtrace/contrib/roda/configuration/settings.rb +++ b/lib/ddtrace/contrib/roda/configuration/settings.rb @@ -7,13 +7,13 @@ module Roda module Configuration # Custom settings for the Roda integration class Settings < Contrib::Configuration::Settings - option :analytics_enabled, + option :analytics_enabled, default: -> { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, nil) }, lazy: true - + option :analytics_sample_rate, - default: -> { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }, - lazy: true + default: -> { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }, + lazy: true option :distributed_tracing, default: true diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 5f8f8d423e1..2718a974e9f 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -2,11 +2,10 @@ require 'ddtrace/contrib/analytics' module Datadog - module Contrib - module Roda - module Instrumentation - - def datadog_pin + module Contrib + module Roda + module Instrumentation + def datadog_pin @datadog_pin ||= begin service = Datadog.configuration[:roda][:service_name] tracer = Datadog.configuration[:roda][:tracer] @@ -14,17 +13,17 @@ def datadog_pin Datadog::Pin.new(service, app: Ext::APP, app_type: Datadog::Ext::AppTypes::WEB, tracer: tracer) end end - + def call(*args) pin = datadog_pin return super unless pin && pin.tracer - + set_distributed_tracing_context(env) pin.tracer.trace(Ext::SPAN_REQUEST) do |span| begin - req = ::Rack::Request.new(env) - request_method = req.request_method.to_s.upcase # + req = ::Rack::Request.new(env) + request_method = req.request_method.to_s.upcase path = req.path span.service = pin.service @@ -35,10 +34,9 @@ def call(*args) # a possibly infinite number of resources. span.set_tag(Datadog::Ext::HTTP::URL, path) span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) - - # Add analytics tag to the span - Contrib::Analytics.set_sample_rate(span, Datadog.configuration[:roda][:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) + # Add analytics tag to the span + Contrib::Analytics.set_sample_rate(span, Datadog.configuration[:roda][:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") ensure @@ -46,8 +44,8 @@ def call(*args) end # response comes back as [404, {"Content-Type"=>"text/html", "Content-Length"=>"0"}, []] - span.set_error(1) if response[0].to_s.start_with?("5") - response + span.set_error(1) if response[0].to_s.start_with?('5') + response end end @@ -55,11 +53,11 @@ def call(*args) def set_distributed_tracing_context(env) if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? - context = HTTPPropagator.extract(env) + context = HTTPPropagator.extract(env) Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id end end - end - end - end -end \ No newline at end of file + end + end + end +end diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index 9925feef7de..39f309078db 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -7,35 +7,32 @@ RSpec.describe Datadog::Contrib::Roda::Instrumentation do describe 'when implemented in Roda' do - let(:configuration_options) { { tracer: tracer } } let(:tracer) { get_test_tracer } let(:spans) { tracer.writer.spans } let(:span) { spans.first } let(:roda) { test_class.new } let(:test_class) do - Class.new do - prepend Datadog::Contrib::Roda::Instrumentation - end + Class.new do + prepend Datadog::Contrib::Roda::Instrumentation end + end before(:each) do Datadog.configure do |c| c.use :roda, configuration_options end end - + after(:each) do Datadog.registry[:roda].reset_configuration! end describe '#datadog_pin' do - let(:env) { {:REQUEST_METHOD =>'GET'} } + let(:env) { { REQUEST_METHOD: 'GET' } } subject(:datadog_pin) { roda.datadog_pin } context 'when roda is configured' do - context 'with default settings' do - it 'enables the tracer' do expect(datadog_pin.tracer).to be(Datadog.configuration[:roda][:tracer]) expect(datadog_pin.tracer.enabled).to eq(true) @@ -52,7 +49,7 @@ end context 'with a custom service name' do - let(:custom_service_name) {"custom service name"} + let(:custom_service_name) { 'custom service name' } let(:configuration_options) { { tracer: tracer, service_name: custom_service_name } } it 'sets a custom service name' do @@ -78,18 +75,18 @@ ::Rack::Request, request_method: response_method, path: path - ) + ) end before do e = env - test_class.send(:define_method, :env) do |*args| - e + test_class.send(:define_method, :env) do + e end expect(::Rack::Request).to receive(:new) - .with(env) - .and_return(request) + .with(env) + .and_return(request) end end @@ -101,14 +98,13 @@ before do s = spy - test_class.send(:define_method, :call) do |*args| - s.call + test_class.send(:define_method, :call) do + s.call end expect(spy).to receive(:call) - .and_return(response) + .and_return(response) end end - context 'when the response code is' do include_context 'stubbed request' @@ -116,15 +112,15 @@ context '200' do let(:response_code) { 200 } - + it do call expect(spans).to have(1).items expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') end @@ -133,20 +129,20 @@ context '404' do let(:response_code) { 404 } let(:path) { '/unsuccessful_endpoint' } - + it do call expect(spans).to have(1).items expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") + expect(span.resource).to eq('GET') + expect(span.name).to eq('roda.request') expect(span.status).to eq(0) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') end end - + context '500' do let(:response_code) { 500 } @@ -155,8 +151,8 @@ expect(spans).to have(1).items expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq("GET") - expect(span.name).to eq("roda.request") + expect(span.resource).to eq('GET') + expect(span.name).to eq('roda.request') expect(span.status).to eq(1) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') @@ -175,11 +171,11 @@ expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end + end end context 'PUT' do @@ -191,13 +187,12 @@ expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("PUT") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('PUT') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') end end - end context 'when the path is' do @@ -206,20 +201,20 @@ context '/worlds' do let(:path) { 'worlds' } - + it do call expect(spans).to have(1).items expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end + end end - + context '/worlds/:id' do let(:path) { 'worlds/1' } it do @@ -228,11 +223,11 @@ expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end + end end context 'articles?id=1' do @@ -243,19 +238,19 @@ expect(span.parent).to be nil expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) expect(span.status).to eq(0) - expect(span.name).to eq("roda.request") - expect(span.resource).to eq("GET") + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end + end end end context 'when distributed tracing' do include_context 'stubbed request' - - let(:sampling_priority) {Datadog::Ext::Priority::USER_KEEP.to_s} - + + let(:sampling_priority) { Datadog::Ext::Priority::USER_KEEP.to_s } + context 'is enabled' do context 'without origin' do include_context 'stubbed response' do @@ -263,7 +258,7 @@ { 'HTTP_X_DATADOG_TRACE_ID' => '40000', 'HTTP_X_DATADOG_PARENT_ID' => '50000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority } end end @@ -282,12 +277,12 @@ context 'with origin' do include_context 'stubbed response' do let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '10000', - 'HTTP_X_DATADOG_PARENT_ID' => '20000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, - 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' - } + { + 'HTTP_X_DATADOG_TRACE_ID' => '10000', + 'HTTP_X_DATADOG_PARENT_ID' => '20000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' + } end end @@ -307,14 +302,14 @@ let(:configuration_options) { { tracer: tracer, distributed_tracing: false } } include_context 'stubbed response' do let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '40000', - 'HTTP_X_DATADOG_PARENT_ID' => '50000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, - } + { + 'HTTP_X_DATADOG_TRACE_ID' => '40000', + 'HTTP_X_DATADOG_PARENT_ID' => '50000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority + } end end - + it 'does not take on the passed in trace context' do call expect(Datadog.configuration[:roda][:distributed_tracing]).to be(false) @@ -325,17 +320,15 @@ end end - context 'when analytics' do include_context 'stubbed request' include_context 'stubbed response' it_behaves_like 'analytics for integration', ignore_global_flag: false do - before { call } - let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } - let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } + before { call } + let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } end end - end end -end \ No newline at end of file +end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index 8bb145bb426..a8140487415 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -5,146 +5,140 @@ require 'roda' RSpec.describe 'Roda instrumentation' do - include Rack::Test::Methods - - let(:tracer) { get_test_tracer } - let(:configuration_options) { { tracer: tracer } } - let(:spans) { tracer.writer.spans } - let(:span) { spans.first } - - before(:each) do - Datadog.configure do |c| - c.use :roda, configuration_options - end - end - - around do |example| - Datadog.registry[:roda].reset_configuration! - example.run - Datadog.registry[:roda].reset_configuration! - end - - shared_context 'basic roda app' do - let(:app) do - Class.new(Roda) do - plugin :all_verbs - route do |r| - r.root do - r.get do - 'Hello World!' - end - end - r.is 'articles' do - r.get do - 'Articles' - end - end - r.is 'worlds', Integer do |world| - r.put do - 'UPDATE' - end - r.get do - "Hello, world #{r.params['world']}" - end - end - end - end - end - end - - shared_context 'Roda app with server error' do - let(:app) do - Class.new(Roda) do - route do |r| - r.root do - r.get do - r.halt([500, {'Content-Type'=>'text/html'}, ['test']]) - end - end - end - end - end - end - - context 'when configured' do - context 'with default settings' do - context 'and a successful request is made' do - - include_context 'basic roda app' - subject(:response) { get '/' } - - context 'for a basic GET endpoint' do - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items - expect(span.name).to eq("roda.request") - end - end - - context 'for a GET endpoint with an id' do - - subject(:params_response) { get 'worlds/1' } - - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"12"}) - expect(spans).to have(1).items - expect(span.name).to eq("roda.request") - end - end - - - context 'for a GET endpoint with params' do - - let(:response) { get 'articles?id=1' } - - it do - expect(response.status).to eq(200) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"8"}) - expect(spans).to have(1).items - expect(span.name).to eq("roda.request") - end - end - - end - - context 'and an unsuccessful response occurs' do - context 'with a 404' do - include_context 'basic roda app' - subject(:response) { get '/unsuccessful_endpoint' } - it do - expect(response.status).to eq(404) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"0"}) - expect(spans).to have(1).items - expect(span.name).to eq("roda.request") - end - end - - context 'with a 500' do - include_context 'Roda app with server error' - subject(:response) {get '/'} - it do - expect(response.status).to eq(500) - expect(response.header).to eq({"Content-Type"=>"text/html", "Content-Length"=>"4"}) - expect(spans).to have(1).items - expect(span.name).to eq("roda.request") - end - end - end - - context 'and the tracer is disabled' do - include_context 'basic roda app' - subject(:response) {get '/'} - - let(:tracer) { get_test_tracer(enabled: false) } - - it do - is_expected.to be_ok - expect(spans).to be_empty - end - end - - end - end -end \ No newline at end of file + include Rack::Test::Methods + + let(:tracer) { get_test_tracer } + let(:configuration_options) { { tracer: tracer } } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + + around do |example| + Datadog.registry[:roda].reset_configuration! + example.run + Datadog.registry[:roda].reset_configuration! + end + + shared_context 'basic roda app' do + let(:app) do + Class.new(Roda) do + plugin :all_verbs + route do |r| + r.root do + r.get do + 'Hello World!' + end + end + r.is 'articles' do + r.get do + 'Articles' + end + end + r.is 'worlds', Integer do + r.put do + 'UPDATE' + end + r.get do + "Hello, world #{r.params['world']}" + end + end + end + end + end + end + + shared_context 'Roda app with server error' do + let(:app) do + Class.new(Roda) do + route do |r| + r.root do + r.get do + r.halt([500, { 'Content-Type' => 'text/html' }, ['test']]) + end + end + end + end + end + end + + context 'when configured' do + context 'with default settings' do + context 'and a successful request is made' do + include_context 'basic roda app' + subject(:response) { get '/' } + + context 'for a basic GET endpoint' do + it do + expect(response.status).to eq(200) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '12') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end + + context 'for a GET endpoint with an id' do + subject(:params_response) { get 'worlds/1' } + + it do + expect(response.status).to eq(200) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '12') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end + + context 'for a GET endpoint with params' do + let(:response) { get 'articles?id=1' } + + it do + expect(response.status).to eq(200) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '8') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end + end + + context 'and an unsuccessful response occurs' do + context 'with a 404' do + include_context 'basic roda app' + subject(:response) { get '/unsuccessful_endpoint' } + it do + expect(response.status).to eq(404) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '0') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end + + context 'with a 500' do + include_context 'Roda app with server error' + subject(:response) { get '/' } + it do + expect(response.status).to eq(500) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '4') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end + end + + context 'and the tracer is disabled' do + include_context 'basic roda app' + subject(:response) { get '/' } + + let(:tracer) { get_test_tracer(enabled: false) } + + it do + is_expected.to be_ok + expect(spans).to be_empty + end + end + end + end +end From 586fd57a9150fc4556138212c306e343482472e9 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Fri, 19 Jul 2019 15:11:12 -0400 Subject: [PATCH 0014/2133] Update instrumentation to handle new dispatch api. Refactor unit tests accordingly. --- lib/ddtrace/contrib/roda/instrumentation.rb | 31 +- .../contrib/roda/instrumentation_spec.rb | 272 +--------------- spec/ddtrace/contrib/roda/patcher_spec.rb | 11 + spec/ddtrace/contrib/roda/shared_examples.rb | 292 ++++++++++++++++++ 4 files changed, 327 insertions(+), 279 deletions(-) create mode 100644 spec/ddtrace/contrib/roda/shared_examples.rb diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 2718a974e9f..732b49969bd 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -14,17 +14,25 @@ def datadog_pin end end - def call(*args) + def _roda_handle_main_route + instrument(Ext::SPAN_REQUEST) { super } + end + + def call + instrument(Ext::SPAN_REQUEST) { super } + end + + private + + def instrument(span_name, &block) pin = datadog_pin - return super unless pin && pin.tracer + return yield unless pin && pin.tracer - set_distributed_tracing_context(env) + set_distributed_tracing_context!(request.env) - pin.tracer.trace(Ext::SPAN_REQUEST) do |span| + pin.tracer.trace(span_name) do |span| begin - req = ::Rack::Request.new(env) - request_method = req.request_method.to_s.upcase - path = req.path + request_method = request.request_method.to_s.upcase span.service = pin.service span.span_type = Datadog::Ext::HTTP::TYPE_INBOUND @@ -32,7 +40,7 @@ def call(*args) span.resource = request_method # Using the method as a resource, as URL/path can trigger # a possibly infinite number of resources. - span.set_tag(Datadog::Ext::HTTP::URL, path) + span.set_tag(Datadog::Ext::HTTP::URL, request.path) span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) # Add analytics tag to the span @@ -40,18 +48,15 @@ def call(*args) rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") ensure - response = super + response = yield end - # response comes back as [404, {"Content-Type"=>"text/html", "Content-Length"=>"0"}, []] span.set_error(1) if response[0].to_s.start_with?('5') response end end - private - - def set_distributed_tracing_context(env) + def set_distributed_tracing_context!(env) if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? context = HTTPPropagator.extract(env) Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id diff --git a/spec/ddtrace/contrib/roda/instrumentation_spec.rb b/spec/ddtrace/contrib/roda/instrumentation_spec.rb index 39f309078db..ab34849746f 100644 --- a/spec/ddtrace/contrib/roda/instrumentation_spec.rb +++ b/spec/ddtrace/contrib/roda/instrumentation_spec.rb @@ -3,7 +3,7 @@ require 'ddtrace' require 'ddtrace/contrib/roda/instrumentation' require 'ddtrace/contrib/roda/ext' -require 'ddtrace/contrib/analytics_examples' +require 'ddtrace/contrib/roda/shared_examples' RSpec.describe Datadog::Contrib::Roda::Instrumentation do describe 'when implemented in Roda' do @@ -62,272 +62,12 @@ end end - describe '#call' do - subject(:call) { roda.call } - - shared_context 'stubbed request' do - let(:env) { {} } - let(:response_method) { :get } - let(:path) { '/' } - - let(:request) do - instance_double( - ::Rack::Request, - request_method: response_method, - path: path - ) - end - - before do - e = env - test_class.send(:define_method, :env) do - e - end - - expect(::Rack::Request).to receive(:new) - .with(env) - .and_return(request) - end - end - - shared_context 'stubbed response' do - let(:spy) { instance_double(Roda) } - let(:response) { [response_code, instance_double(Hash), double('body')] } - let(:response_code) { 200 } - let(:response_headers) { double('body') } - - before do - s = spy - test_class.send(:define_method, :call) do - s.call - end - expect(spy).to receive(:call) - .and_return(response) - end - end - - context 'when the response code is' do - include_context 'stubbed request' - include_context 'stubbed response' - - context '200' do - let(:response_code) { 200 } - - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end - end - - context '404' do - let(:response_code) { 404 } - let(:path) { '/unsuccessful_endpoint' } - - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq('GET') - expect(span.name).to eq('roda.request') - expect(span.status).to eq(0) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') - end - end - - context '500' do - let(:response_code) { 500 } - - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.resource).to eq('GET') - expect(span.name).to eq('roda.request') - expect(span.status).to eq(1) - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end - end - end - - context 'when the verb is' do - include_context 'stubbed request' - include_context 'stubbed response' - - context 'GET' do - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end - end - - context 'PUT' do - let(:response_method) { :put } - - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('PUT') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') - end - end + describe 'when application calls on the instrumented method' do + context '#call' do + it_behaves_like 'shared examples for roda', :call end - - context 'when the path is' do - include_context 'stubbed request' - include_context 'stubbed response' - - context '/worlds' do - let(:path) { 'worlds' } - - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end - end - - context '/worlds/:id' do - let(:path) { 'worlds/1' } - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end - end - - context 'articles?id=1' do - let(:path) { 'articles?id=1' } - it do - call - expect(spans).to have(1).items - expect(span.parent).to be nil - expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) - expect(span.status).to eq(0) - expect(span.name).to eq('roda.request') - expect(span.resource).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') - expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) - end - end - end - - context 'when distributed tracing' do - include_context 'stubbed request' - - let(:sampling_priority) { Datadog::Ext::Priority::USER_KEEP.to_s } - - context 'is enabled' do - context 'without origin' do - include_context 'stubbed response' do - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '40000', - 'HTTP_X_DATADOG_PARENT_ID' => '50000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority - } - end - end - - it do - call - expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) - expect(spans).to have(1).items - expect(span.trace_id).to eq(40000) - expect(span.parent_id).to eq(50000) - expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) - expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil - end - end - - context 'with origin' do - include_context 'stubbed response' do - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '10000', - 'HTTP_X_DATADOG_PARENT_ID' => '20000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, - 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' - } - end - end - - it do - call - expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) - expect(spans).to have(1).items - expect(span.trace_id).to eq(10000) - expect(span.parent_id).to eq(20000) - expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) - expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') - end - end - end - - context 'is disabled' do - let(:configuration_options) { { tracer: tracer, distributed_tracing: false } } - include_context 'stubbed response' do - let(:env) do - { - 'HTTP_X_DATADOG_TRACE_ID' => '40000', - 'HTTP_X_DATADOG_PARENT_ID' => '50000', - 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority - } - end - end - - it 'does not take on the passed in trace context' do - call - expect(Datadog.configuration[:roda][:distributed_tracing]).to be(false) - expect(spans).to have(1).items - expect(span.trace_id).to_not eq(40000) - expect(span.parent_id).to_not eq(50000) - end - end - end - - context 'when analytics' do - include_context 'stubbed request' - include_context 'stubbed response' - it_behaves_like 'analytics for integration', ignore_global_flag: false do - before { call } - let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } - let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } - end + context '#_roda_handle_main_route' do + it_behaves_like 'shared examples for roda', :_roda_handle_main_route end end end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index a8140487415..ac1db853290 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -126,6 +126,17 @@ expect(span.name).to eq('roda.request') end end + + context 'with a 500' do + include_context 'Roda app with server error' + subject(:response) { get '/' } + it do + expect(response.status).to eq(500) + expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '4') + expect(spans).to have(1).items + expect(span.name).to eq('roda.request') + end + end end context 'and the tracer is disabled' do diff --git a/spec/ddtrace/contrib/roda/shared_examples.rb b/spec/ddtrace/contrib/roda/shared_examples.rb new file mode 100644 index 00000000000..8a0ab909cfd --- /dev/null +++ b/spec/ddtrace/contrib/roda/shared_examples.rb @@ -0,0 +1,292 @@ +require 'spec_helper' +require 'roda' +require 'ddtrace' +require 'ddtrace/contrib/roda/instrumentation' +require 'ddtrace/contrib/roda/ext' +require 'ddtrace/contrib/analytics_examples' + +RSpec.shared_examples_for 'shared examples for roda' do | test_method | + let(:configuration_options) { { tracer: tracer } } + let(:tracer) { get_test_tracer } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + let(:roda) { test_class.new } + let(:test_class) do + Class.new do + prepend Datadog::Contrib::Roda::Instrumentation + end + end + let(:instrumented_method) { roda.send(test_method) } + + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options + end + end + + after(:each) do + Datadog.registry[:roda].reset_configuration! + end + + shared_context 'stubbed request' do + let(:env) { {} } + let(:response_method) { :get } + let(:path) { '/' } + + let(:request) do + instance_double( + ::Rack::Request, + env: env, + request_method: response_method, + path: path + ) + end + + before do + r = request + test_class.send(:define_method, :request) do + r + end + end + end + + shared_context 'stubbed response' do + let(:spy) { instance_double(Roda) } + let(:response) { [response_code, instance_double(Hash), double('body')] } + let(:response_code) { 200 } + let(:response_headers) { double('body') } + + before do + s = spy + test_class.send(:define_method, test_method) do + s.send(test_method) + end + expect(spy).to receive(test_method) + .and_return(response) + end + end + + context 'when the response code is' do + include_context 'stubbed request' + include_context 'stubbed response' + + context '200' do + let(:response_code) { 200 } + + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + + context '404' do + let(:response_code) { 404 } + let(:path) { '/unsuccessful_endpoint' } + + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq('GET') + expect(span.name).to eq('roda.request') + expect(span.status).to eq(0) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') + end + end + + context '500' do + let(:response_code) { 500 } + + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.resource).to eq('GET') + expect(span.name).to eq('roda.request') + expect(span.status).to eq(1) + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + end + + context 'when the verb is' do + include_context 'stubbed request' + include_context 'stubbed response' + + context 'GET' do + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + + context 'PUT' do + let(:response_method) { :put } + + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('PUT') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + end + end + end + + context 'when the path is' do + include_context 'stubbed request' + include_context 'stubbed response' + + context '/worlds' do + let(:path) { 'worlds' } + + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + end + end + + context '/worlds/:id' do + let(:path) { 'worlds/1' } + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + end + end + + context 'articles?id=1' do + let(:path) { 'articles?id=1' } + it do + instrumented_method + expect(spans).to have(1).items + expect(span.parent).to be nil + expect(span.span_type).to eq(Datadog::Ext::HTTP::TYPE_INBOUND) + expect(span.status).to eq(0) + expect(span.name).to eq('roda.request') + expect(span.resource).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') + expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + end + end + end + + context 'when distributed tracing' do + include_context 'stubbed request' + + let(:sampling_priority) { Datadog::Ext::Priority::USER_KEEP.to_s } + + context 'is enabled' do + context 'without origin' do + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '40000', + 'HTTP_X_DATADOG_PARENT_ID' => '50000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority + } + end + end + + it do + instrumented_method + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) + expect(spans).to have(1).items + expect(span.trace_id).to eq(40000) + expect(span.parent_id).to eq(50000) + expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to be nil + end + end + + context 'with origin' do + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '10000', + 'HTTP_X_DATADOG_PARENT_ID' => '20000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority, + 'HTTP_X_DATADOG_ORIGIN' => 'synthetics' + } + end + end + + it do + instrumented_method + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(true) + expect(spans).to have(1).items + expect(span.trace_id).to eq(10000) + expect(span.parent_id).to eq(20000) + expect(span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)).to eq(sampling_priority.to_f) + expect(span.get_tag(Datadog::Ext::DistributedTracing::ORIGIN_KEY)).to eq('synthetics') + end + end + end + + context 'is disabled' do + let(:configuration_options) { { tracer: tracer, distributed_tracing: false } } + include_context 'stubbed response' do + let(:env) do + { + 'HTTP_X_DATADOG_TRACE_ID' => '40000', + 'HTTP_X_DATADOG_PARENT_ID' => '50000', + 'HTTP_X_DATADOG_SAMPLING_PRIORITY' => sampling_priority + } + end + end + + it 'does not take on the passed in trace context' do + instrumented_method + expect(Datadog.configuration[:roda][:distributed_tracing]).to be(false) + expect(spans).to have(1).items + expect(span.trace_id).to_not eq(40000) + expect(span.parent_id).to_not eq(50000) + end + end + end + + context 'when analytics' do + include_context 'stubbed request' + include_context 'stubbed response' + it_behaves_like 'analytics for integration', ignore_global_flag: false do + before { instrumented_method } + let(:analytics_enabled_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Contrib::Roda::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + end +end From 5016c7b58460354920c91d524b37fdc544082be5 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Fri, 19 Jul 2019 15:20:52 -0400 Subject: [PATCH 0015/2133] Refactor code for formatting. --- lib/ddtrace/contrib/roda/instrumentation.rb | 17 +++- spec/ddtrace/contrib/roda/shared_examples.rb | 96 ++++++++++---------- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 732b49969bd..364694babd6 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -4,11 +4,12 @@ module Datadog module Contrib module Roda + # Instrumentation for Roda module Instrumentation def datadog_pin @datadog_pin ||= begin - service = Datadog.configuration[:roda][:service_name] - tracer = Datadog.configuration[:roda][:tracer] + service = roda_configuration[:service_name] + tracer = roda_configuration[:tracer] Datadog::Pin.new(service, app: Ext::APP, app_type: Datadog::Ext::AppTypes::WEB, tracer: tracer) end @@ -44,7 +45,9 @@ def instrument(span_name, &block) span.set_tag(Datadog::Ext::HTTP::METHOD, request_method) # Add analytics tag to the span - Contrib::Analytics.set_sample_rate(span, Datadog.configuration[:roda][:analytics_sample_rate]) if Contrib::Analytics.enabled?(Datadog.configuration[:roda][:analytics_enabled]) + if Contrib::Analytics.enabled?(roda_configuration[:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, roda_configuration[:analytics_sample_rate]) + end rescue StandardError => e Datadog::Tracer.log.error("error preparing span for roda request: #{e}") ensure @@ -56,10 +59,14 @@ def instrument(span_name, &block) end end + def roda_configuration + Datadog.configuration[:roda] + end + def set_distributed_tracing_context!(env) - if Datadog.configuration[:roda][:distributed_tracing] && Datadog.configuration[:roda][:tracer].provider.context.trace_id.nil? + if roda_configuration[:distributed_tracing] && roda_configuration[:tracer].provider.context.trace_id.nil? context = HTTPPropagator.extract(env) - Datadog.configuration[:roda][:tracer].provider.context = context if context && context.trace_id + roda_configuration[:tracer].provider.context = context if context && context.trace_id end end end diff --git a/spec/ddtrace/contrib/roda/shared_examples.rb b/spec/ddtrace/contrib/roda/shared_examples.rb index 8a0ab909cfd..3ba8d1caeed 100644 --- a/spec/ddtrace/contrib/roda/shared_examples.rb +++ b/spec/ddtrace/contrib/roda/shared_examples.rb @@ -5,66 +5,66 @@ require 'ddtrace/contrib/roda/ext' require 'ddtrace/contrib/analytics_examples' -RSpec.shared_examples_for 'shared examples for roda' do | test_method | - let(:configuration_options) { { tracer: tracer } } - let(:tracer) { get_test_tracer } - let(:spans) { tracer.writer.spans } - let(:span) { spans.first } - let(:roda) { test_class.new } - let(:test_class) do - Class.new do - prepend Datadog::Contrib::Roda::Instrumentation - end +RSpec.shared_examples_for 'shared examples for roda' do |test_method| + let(:configuration_options) { { tracer: tracer } } + let(:tracer) { get_test_tracer } + let(:spans) { tracer.writer.spans } + let(:span) { spans.first } + let(:roda) { test_class.new } + let(:test_class) do + Class.new do + prepend Datadog::Contrib::Roda::Instrumentation end - let(:instrumented_method) { roda.send(test_method) } + end + let(:instrumented_method) { roda.send(test_method) } - before(:each) do - Datadog.configure do |c| - c.use :roda, configuration_options - end + before(:each) do + Datadog.configure do |c| + c.use :roda, configuration_options end + end - after(:each) do - Datadog.registry[:roda].reset_configuration! - end + after(:each) do + Datadog.registry[:roda].reset_configuration! + end - shared_context 'stubbed request' do - let(:env) { {} } - let(:response_method) { :get } - let(:path) { '/' } - - let(:request) do - instance_double( - ::Rack::Request, - env: env, - request_method: response_method, - path: path - ) - end + shared_context 'stubbed request' do + let(:env) { {} } + let(:response_method) { :get } + let(:path) { '/' } + + let(:request) do + instance_double( + ::Rack::Request, + env: env, + request_method: response_method, + path: path + ) + end - before do - r = request - test_class.send(:define_method, :request) do - r - end + before do + r = request + test_class.send(:define_method, :request) do + r end end + end - shared_context 'stubbed response' do - let(:spy) { instance_double(Roda) } - let(:response) { [response_code, instance_double(Hash), double('body')] } - let(:response_code) { 200 } - let(:response_headers) { double('body') } + shared_context 'stubbed response' do + let(:spy) { instance_double(Roda) } + let(:response) { [response_code, instance_double(Hash), double('body')] } + let(:response_code) { 200 } + let(:response_headers) { double('body') } - before do - s = spy - test_class.send(:define_method, test_method) do - s.send(test_method) - end - expect(spy).to receive(test_method) - .and_return(response) + before do + s = spy + test_class.send(:define_method, test_method) do + s.send(test_method) end + expect(spy).to receive(test_method) + .and_return(response) end + end context 'when the response code is' do include_context 'stubbed request' From 4c74c4b58f1029ae269910b35f5a8ea06f7e68d9 Mon Sep 17 00:00:00 2001 From: "wan.tsui" Date: Fri, 19 Jul 2019 17:31:22 -0400 Subject: [PATCH 0016/2133] Remove duplicated server error example and add http status code tag. --- lib/ddtrace/contrib/roda/instrumentation.rb | 2 +- spec/ddtrace/contrib/roda/patcher_spec.rb | 11 ----------- spec/ddtrace/contrib/roda/shared_examples.rb | 10 +++++++++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/ddtrace/contrib/roda/instrumentation.rb b/lib/ddtrace/contrib/roda/instrumentation.rb index 364694babd6..5118a01dca2 100644 --- a/lib/ddtrace/contrib/roda/instrumentation.rb +++ b/lib/ddtrace/contrib/roda/instrumentation.rb @@ -53,7 +53,7 @@ def instrument(span_name, &block) ensure response = yield end - + span.set_tag(Datadog::Ext::HTTP::STATUS_CODE, response[0]) span.set_error(1) if response[0].to_s.start_with?('5') response end diff --git a/spec/ddtrace/contrib/roda/patcher_spec.rb b/spec/ddtrace/contrib/roda/patcher_spec.rb index ac1db853290..a8140487415 100644 --- a/spec/ddtrace/contrib/roda/patcher_spec.rb +++ b/spec/ddtrace/contrib/roda/patcher_spec.rb @@ -126,17 +126,6 @@ expect(span.name).to eq('roda.request') end end - - context 'with a 500' do - include_context 'Roda app with server error' - subject(:response) { get '/' } - it do - expect(response.status).to eq(500) - expect(response.header).to eq('Content-Type' => 'text/html', 'Content-Length' => '4') - expect(spans).to have(1).items - expect(span.name).to eq('roda.request') - end - end end context 'and the tracer is disabled' do diff --git a/spec/ddtrace/contrib/roda/shared_examples.rb b/spec/ddtrace/contrib/roda/shared_examples.rb index 3ba8d1caeed..af9b716167f 100644 --- a/spec/ddtrace/contrib/roda/shared_examples.rb +++ b/spec/ddtrace/contrib/roda/shared_examples.rb @@ -83,6 +83,7 @@ expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end @@ -100,7 +101,8 @@ expect(span.status).to eq(0) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/unsuccessful_endpoint') - end + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) + end end context '500' do @@ -116,6 +118,7 @@ expect(span.status).to eq(1) expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end end @@ -135,6 +138,7 @@ expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end @@ -151,6 +155,7 @@ expect(span.resource).to eq('PUT') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('PUT') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq('/') + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end end @@ -172,6 +177,7 @@ expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end @@ -187,6 +193,7 @@ expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end @@ -202,6 +209,7 @@ expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::METHOD)).to eq('GET') expect(span.get_tag(Datadog::Ext::HTTP::URL)).to eq(path) + expect(span.get_tag(Datadog::Ext::HTTP::STATUS_CODE)).to eq(response_code.to_s) end end end From 787167b802879d7d4c8ee02fca1e5b467cc275e2 Mon Sep 17 00:00:00 2001 From: Andrew Horner Date: Tue, 17 May 2022 17:19:49 -0600 Subject: [PATCH 0017/2133] Prevent `action_controller` tracing when disabled In environments where tracing is disabled, Datadog spits out a lot of unnecessary error logs here, due to the instrumentation assuming that there's an active trace to maintain. This fix is in the same vein as #1943 and #1945. ``` E, [2022-05-17T22:15:02.337370 #2639] ERROR -- ddtrace: [ddtrace] (/home/circleci/tmp/vendor/bundle/ruby/3.1.0/gems/ddtrace-1.0.0/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb:43:in `rescue in start_processing') undefined method `resource=' for nil:NilClass trace.resource = span.resource ^^^^^^^^^^^ E, [2022-05-17T22:15:02.340414 #2639] ERROR -- ddtrace: [ddtrace] (/home/circleci/tmp/vendor/bundle/ruby/3.1.0/gems/ddtrace-1.0.0/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb:79:in `rescue in finish_processing') undefined method `resource=' for nil:NilClass trace.resource = span.resource ^^^^^^^^^^^ ``` --- .../action_controller/instrumentation.rb | 4 ++++ .../tracing/contrib/rails/action_controller_spec.rb | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb b/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb index 33b07a4b005..400c1fb0a5a 100644 --- a/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +++ b/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb @@ -18,6 +18,8 @@ module Instrumentation module_function def start_processing(payload) + return unless Tracing.enabled? + # trace the execution service = Datadog.configuration.tracing[:action_pack][:service_name] type = Tracing::Metadata::Ext::HTTP::TYPE_INBOUND @@ -44,6 +46,8 @@ def start_processing(payload) end def finish_processing(payload) + return unless Tracing.enabled? + # retrieve the tracing context and the latest active span tracing_context = payload.fetch(:tracing_context) trace = tracing_context[:dd_request_trace] diff --git a/spec/datadog/tracing/contrib/rails/action_controller_spec.rb b/spec/datadog/tracing/contrib/rails/action_controller_spec.rb index 25ace6226e2..6f05661e5ea 100644 --- a/spec/datadog/tracing/contrib/rails/action_controller_spec.rb +++ b/spec/datadog/tracing/contrib/rails/action_controller_spec.rb @@ -43,6 +43,19 @@ def index expect(spans.first.name).to eq('rails.action_controller') end + context 'with tracing disabled' do + before do + Datadog.configure { |c| c.tracing.enabled = false } + expect(Datadog.logger).to_not receive(:error) + expect(Datadog::Tracing).to_not receive(:trace) + end + + it 'runs the action without tracing' do + expect { result }.to_not raise_error + expect(spans).to have(0).items + end + end + context 'when response is overridden' do context 'with an Array' do let(:headers) { double('headers') } From 3da2aba0a51e7b89ae6af964dced07328a68c3c3 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 10:23:14 +0100 Subject: [PATCH 0018/2133] Minor cleanups --- ext/ddtrace_profiling_native_extension/collectors_stack.c | 8 ++++---- ext/ddtrace_profiling_native_extension/stack_recorder.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 088cc09be54..48918c9dbe7 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -25,8 +25,8 @@ typedef struct sampling_buffer { static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames); void sample(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); -void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size); -void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); +static void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size); +static void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); sampling_buffer *sampling_buffer_new(unsigned int max_frames); void sampling_buffer_free(sampling_buffer *buffer); @@ -186,7 +186,7 @@ void sample(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddpr ); } -void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size) { +static void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size) { ptrdiff_t frames_omitted = stack_depth_for(thread) - buffer->max_frames; if (frames_omitted == 0) return; // Perfect fit! @@ -228,7 +228,7 @@ void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, // // To give customers visibility into these threads, rather than reporting an empty stack, we replace the empty stack // with one containing a placeholder frame, so that these threads are properly represented in the UX. -void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels) { +static void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels) { ddprof_ffi_Line placeholder_stack_in_native_code_line = { .function = (ddprof_ffi_Function) { .name = DDPROF_FFI_CHARSLICE_C(""), diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 968b20546d9..c534ba88fd1 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -28,7 +28,7 @@ static void *call_serialize_without_gvl(void *call_args); void stack_recorder_init(VALUE profiling_module) { stack_recorder_class = rb_define_class_under(profiling_module, "StackRecorder", rb_cObject); - // Instances of the StackRecorder class are going to be "TypedData" objects. + // Instances of the StackRecorder class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. // In our case, we're going to keep a libddprof profile reference inside our object. // From f0b57845620bb57ac8285416269831cf509f57e1 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 10:24:29 +0100 Subject: [PATCH 0019/2133] Bootstrap for Datadog::Profiling::Collectors::CpuAndWallTime This new collector will replace the `OldStack` collector. It will be used to periodically sample threads, recording elapsed CPU-time and Wall-time between samples. Currently it only stores memory to keep a reference to a `Datadog::Profiling::StackRecorder` inside a struct. --- .../collectors_cpu_and_wall_time.c | 82 +++++++++++++++++++ .../profiling.c | 2 + .../profiling/collectors/cpu_and_wall_time.rb | 15 ++++ 3 files changed, 99 insertions(+) create mode 100644 ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c create mode 100644 lib/datadog/profiling/collectors/cpu_and_wall_time.rb diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c new file mode 100644 index 00000000000..05055ef829a --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -0,0 +1,82 @@ +#include + +// Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. +// This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class + +static VALUE collectors_cpu_and_wall_time_class = Qnil; + +struct cpu_and_wall_time_collector_state { + VALUE recorder_instance; +}; + +static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); +static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr); +static VALUE _native_new(VALUE klass); +static VALUE _native_initialize(VALUE self, VALUE recorder_instance); + +void collectors_cpu_and_wall_time_init(VALUE profiling_module) { + VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); + collectors_cpu_and_wall_time_class = rb_define_class_under(collectors_module, "CpuAndWallTime", rb_cObject); + + // Instances of the CpuAndWallTime class are "TypedData" objects. + // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. + // In this case, it wraps the cpu_and_wall_time_collector_state. + // + // Because Ruby doesn't know how to initialize native-level structs, we MUST override the allocation function for objects + // of this class so that we can manage this part. Not overriding or disabling the allocation function is a common + // gotcha for "TypedData" objects that can very easily lead to VM crashes, see for instance + // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. + rb_define_alloc_func(collectors_cpu_and_wall_time_class, _native_new); + + rb_define_method(collectors_cpu_and_wall_time_class, "initialize", _native_initialize, 1); +} + +// This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state +// See also https://github.com/ruby/ruby/blob/master/doc/extension.rdoc for how this works +static const rb_data_type_t cpu_and_wall_time_collector_typed_data = { + .wrap_struct_name = "Datadog::Profiling::Collectors::CpuAndWallTime", + .function = { + .dmark = cpu_and_wall_time_collector_typed_data_mark, + .dfree = cpu_and_wall_time_collector_typed_data_free, + .dsize = NULL, // We don't track profile memory usage (although it'd be cool if we did!) + .dcompact = NULL, // FIXME: Add support for compaction + }, + .flags = RUBY_TYPED_FREE_IMMEDIATELY +}; + +static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr) { + struct cpu_and_wall_time_collector_state *state = (struct cpu_and_wall_time_collector_state *) state_ptr; + + rb_gc_mark(state->recorder_instance); +} + +static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { + struct cpu_and_wall_time_collector_state *state = (struct cpu_and_wall_time_collector_state *) state_ptr; + + xfree(state); +} + +static VALUE _native_new(VALUE klass) { + struct cpu_and_wall_time_collector_state *state = xcalloc(1, sizeof(struct cpu_and_wall_time_collector_state)); + + if (state == NULL) { + rb_raise(rb_eNoMemError, "Failed to allocate memory for components of Datadog::Profiling::Collectors::CpuAndWallTime"); + } + + state->recorder_instance = Qnil; + + return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); +} + +static VALUE _native_initialize(VALUE self, VALUE recorder_instance) { + // Quick sanity check. If the object passed here is not actually a Datadog::Profiling::StackRecorder, then + // we will later flag that when trying to access its data using TypedData_Get_Struct. + Check_Type(recorder_instance, T_DATA); + + struct cpu_and_wall_time_collector_state *state; + TypedData_Get_Struct(self, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + + state->recorder_instance = recorder_instance; + + return self; +} diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index 04f3361d5cf..cb8e57b13fa 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -3,6 +3,7 @@ #include "clock_id.h" // Each class/module here is implemented in their separate file +void collectors_cpu_and_wall_time_init(VALUE profiling_module); void collectors_stack_init(VALUE profiling_module); void stack_recorder_init(VALUE profiling_module); @@ -20,6 +21,7 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { rb_define_singleton_method(native_extension_module, "clock_id_for", clock_id_for, 1); // from clock_id.h + collectors_cpu_and_wall_time_init(profiling_module); collectors_stack_init(profiling_module); stack_recorder_init(profiling_module); } diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb new file mode 100644 index 00000000000..9838d03fe81 --- /dev/null +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -0,0 +1,15 @@ +# typed: false + +module Datadog + module Profiling + module Collectors + # Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. + # The stack collection itself is handled using the Datadog::Profiling::Collectors::Stack. + # + # Methods prefixed with _native_ are implemented in `collectors_cpu_and_wall_time.c` + class CpuAndWallTime + + end + end + end +end From c55e26320f4843f2ff48ab5bc731074eab1c8245 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 10:39:49 +0100 Subject: [PATCH 0020/2133] Make _native_initialize a singleton method Thus far the pattern of having `_native_` methods all be class singleton method seems to be working well, and it allows us to have the instance methods all be Ruby code that also serves as documentation for what the native code needs and provides back. --- .../collectors_cpu_and_wall_time.c | 10 +++++----- lib/datadog/profiling/collectors/cpu_and_wall_time.rb | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 05055ef829a..eed47471741 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -12,7 +12,7 @@ struct cpu_and_wall_time_collector_state { static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr); static VALUE _native_new(VALUE klass); -static VALUE _native_initialize(VALUE self, VALUE recorder_instance); +static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -28,7 +28,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. rb_define_alloc_func(collectors_cpu_and_wall_time_class, _native_new); - rb_define_method(collectors_cpu_and_wall_time_class, "initialize", _native_initialize, 1); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 2); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -68,15 +68,15 @@ static VALUE _native_new(VALUE klass) { return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); } -static VALUE _native_initialize(VALUE self, VALUE recorder_instance) { +static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance) { // Quick sanity check. If the object passed here is not actually a Datadog::Profiling::StackRecorder, then // we will later flag that when trying to access its data using TypedData_Get_Struct. Check_Type(recorder_instance, T_DATA); struct cpu_and_wall_time_collector_state *state; - TypedData_Get_Struct(self, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); state->recorder_instance = recorder_instance; - return self; + return Qtrue; } diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index 9838d03fe81..f4634c61dcb 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -8,7 +8,9 @@ module Collectors # # Methods prefixed with _native_ are implemented in `collectors_cpu_and_wall_time.c` class CpuAndWallTime - + def initialize(recorder:, max_frames:) + self.class._native_initialize(self, recorder, max_frames) + end end end end From 01d61d9b40c508b8fccf5252cd415a186cf96897 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 11:13:31 +0100 Subject: [PATCH 0021/2133] CpuAndWallTime bootstrap cont'd: initialize sampling_buffer --- .../collectors_cpu_and_wall_time.c | 29 +++++++++++++++---- .../collectors_stack.c | 5 ++-- .../collectors_stack.h | 6 ++++ .../stack_recorder.c | 4 +++ .../stack_recorder.h | 1 + lib/datadog/profiling.rb | 1 + .../collectors/cpu_and_wall_time_spec.rb | 17 +++++++++++ 7 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/collectors_stack.h create mode 100644 spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index eed47471741..395879470db 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,4 +1,6 @@ #include +#include "collectors_stack.h" +#include "stack_recorder.h" // Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class @@ -6,13 +8,16 @@ static VALUE collectors_cpu_and_wall_time_class = Qnil; struct cpu_and_wall_time_collector_state { + // Note: Places in this file that usually need to be changed when this struct is changed are tagged with + // "Update this when modifying state struct" + sampling_buffer *sampling_buffer; VALUE recorder_instance; }; static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr); static VALUE _native_new(VALUE klass); -static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance); +static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -28,7 +33,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. rb_define_alloc_func(collectors_cpu_and_wall_time_class, _native_new); - rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 2); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 3); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -47,12 +52,19 @@ static const rb_data_type_t cpu_and_wall_time_collector_typed_data = { static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr) { struct cpu_and_wall_time_collector_state *state = (struct cpu_and_wall_time_collector_state *) state_ptr; + // Update this when modifying state struct rb_gc_mark(state->recorder_instance); } static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { struct cpu_and_wall_time_collector_state *state = (struct cpu_and_wall_time_collector_state *) state_ptr; + // Update this when modifying state struct + + // Important: Remember that we're only guaranteed to see here what's been set in _native_new, aka + // pointers that have been set NULL there may still be NULL here. + if (state->sampling_buffer != NULL) sampling_buffer_free(state->sampling_buffer); + xfree(state); } @@ -63,19 +75,24 @@ static VALUE _native_new(VALUE klass) { rb_raise(rb_eNoMemError, "Failed to allocate memory for components of Datadog::Profiling::Collectors::CpuAndWallTime"); } + // Update this when modifying state struct + state->sampling_buffer = NULL; state->recorder_instance = Qnil; return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); } -static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance) { - // Quick sanity check. If the object passed here is not actually a Datadog::Profiling::StackRecorder, then - // we will later flag that when trying to access its data using TypedData_Get_Struct. - Check_Type(recorder_instance, T_DATA); +static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames) { + enforce_recorder_instance(recorder_instance); struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + int max_frames_requested = NUM2INT(max_frames); + if (max_frames_requested < 0) rb_raise(rb_eArgError, "Invalid max_frames: value must not be negative"); + + // Update this when modifying state struct + state->sampling_buffer = sampling_buffer_new(max_frames_requested); state->recorder_instance = recorder_instance; return Qtrue; diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 48918c9dbe7..11e2e8fa910 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -4,6 +4,7 @@ #include "libddprof_helpers.h" #include "private_vm_api_access.h" #include "stack_recorder.h" +#include "collectors_stack.h" // Gathers stack traces from running threads, storing them in a StackRecorder instance // This file implements the native bits of the Datadog::Profiling::Collectors::Stack class @@ -27,8 +28,6 @@ static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, V void sample(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); static void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size); static void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); -sampling_buffer *sampling_buffer_new(unsigned int max_frames); -void sampling_buffer_free(sampling_buffer *buffer); void collectors_stack_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -268,6 +267,8 @@ sampling_buffer *sampling_buffer_new(unsigned int max_frames) { } void sampling_buffer_free(sampling_buffer *buffer) { + if (buffer == NULL) rb_raise(rb_eArgError, "sampling_buffer_free called with NULL buffer"); + ruby_xfree(buffer->stack_buffer); ruby_xfree(buffer->lines_buffer); ruby_xfree(buffer->is_ruby_frame); diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.h b/ext/ddtrace_profiling_native_extension/collectors_stack.h new file mode 100644 index 00000000000..8fe3b57c229 --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.h @@ -0,0 +1,6 @@ +#pragma once + +typedef struct sampling_buffer sampling_buffer; + +sampling_buffer *sampling_buffer_new(unsigned int max_frames); +void sampling_buffer_free(sampling_buffer *buffer); diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index c534ba88fd1..330e11a392e 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -137,3 +137,7 @@ static void *call_serialize_without_gvl(void *call_args) { return NULL; // Unused } + +void enforce_recorder_instance(VALUE object) { + Check_TypedStruct(object, &stack_recorder_typed_data); +} diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.h b/ext/ddtrace_profiling_native_extension/stack_recorder.h index 8072a0aa41e..a83005603a4 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.h +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.h @@ -26,3 +26,4 @@ static const ddprof_ffi_ValueType enabled_value_types[] = {CPU_TIME_VALUE, CPU_S #define ENABLED_VALUE_TYPES_COUNT (sizeof(enabled_value_types) / sizeof(ddprof_ffi_ValueType)) void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample); +void enforce_recorder_instance(VALUE object); diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index 4ffd9ab64de..eed4aef7889 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -147,6 +147,7 @@ def self.start_if_enabled require 'datadog/profiling/ext/forking' require 'datadog/profiling/collectors/code_provenance' + require 'datadog/profiling/collectors/cpu_and_wall_time' require 'datadog/profiling/collectors/old_stack' require 'datadog/profiling/collectors/stack' require 'datadog/profiling/stack_recorder' diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb new file mode 100644 index 00000000000..3a6f424940e --- /dev/null +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -0,0 +1,17 @@ +# typed: ignore + +require 'datadog/profiling/spec_helper' +require 'datadog/profiling/collectors/cpu_and_wall_time' + +RSpec.describe Datadog::Profiling::Collectors::CpuAndWallTime do + before { skip_if_profiling_not_supported(self) } + + let(:recorder) { Datadog::Profiling::StackRecorder.new } + let(:max_frames) { 123 } + + subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } + + it "doesn't do anything useful at the moment" do + cpu_and_wall_time_collector + end +end From 1a2b7d90e08b79a061c77cced5419eed5cc29e07 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 12:10:59 +0100 Subject: [PATCH 0022/2133] Move `sample` method to header, rename it `sample_thread` This exposes the method to be used by the `collectors_cpu_and_wall_time.c`. --- ext/ddtrace_profiling_native_extension/collectors_stack.c | 7 +++---- ext/ddtrace_profiling_native_extension/collectors_stack.h | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 11e2e8fa910..42d5a9e2ee8 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -25,7 +25,6 @@ typedef struct sampling_buffer { } sampling_buffer; static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames); -void sample(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); static void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size); static void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); @@ -39,7 +38,7 @@ void collectors_stack_init(VALUE profiling_module) { rb_global_variable(&missing_string); } -// This method exists only to enable testing Collectors::Stack behavior using RSpec. +// This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. // It SHOULD NOT be used for other purposes. static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames) { Check_Type(metric_values_hash, T_HASH); @@ -77,7 +76,7 @@ static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, V sampling_buffer *buffer = sampling_buffer_new(max_frames_requested); - sample( + sample_thread( thread, buffer, recorder_instance, @@ -90,7 +89,7 @@ static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, V return Qtrue; } -void sample(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels) { +void sample_thread(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels) { int captured_frames = ddtrace_rb_profile_frames( thread, 0 /* stack starting depth */, diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.h b/ext/ddtrace_profiling_native_extension/collectors_stack.h index 8fe3b57c229..3bd0f4ba4ce 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.h +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.h @@ -1,6 +1,9 @@ #pragma once +#include + typedef struct sampling_buffer sampling_buffer; +void sample_thread(VALUE thread, sampling_buffer* buffer, VALUE recorder_instance, ddprof_ffi_Slice_i64 metric_values, ddprof_ffi_Slice_label labels); sampling_buffer *sampling_buffer_new(unsigned int max_frames); void sampling_buffer_free(sampling_buffer *buffer); From 51d8baa660a87a6debcbef03717d724f1a4b9d4d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 12:11:49 +0100 Subject: [PATCH 0023/2133] Document in the Ruby side that Stack#sample should not be used There was already a comment in `collectors_stack.c` but having it on the Ruby side makes it a lot more visible. --- lib/datadog/profiling/collectors/stack.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/datadog/profiling/collectors/stack.rb b/lib/datadog/profiling/collectors/stack.rb index 48b2b621bff..7ab9e15013a 100644 --- a/lib/datadog/profiling/collectors/stack.rb +++ b/lib/datadog/profiling/collectors/stack.rb @@ -7,6 +7,9 @@ module Collectors # # Methods prefixed with _native_ are implemented in `collectors_stack.c` class Stack + + # This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. + # It SHOULD NOT be used for other purposes. def sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames: 400) self.class._native_sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames) end From dd1de216c5f0696da7348de14e053252a8859636 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 12:12:50 +0100 Subject: [PATCH 0024/2133] Add `#define`s for value type positions in metrics array --- .../stack_recorder.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.h b/ext/ddtrace_profiling_native_extension/stack_recorder.h index a83005603a4..2f538882846 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.h +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.h @@ -22,7 +22,15 @@ #define ALLOC_SPACE_VALUE {.type_ = VALUE_STRING("alloc-space"), .unit = VALUE_STRING("bytes")} #define HEAP_SPACE_VALUE {.type_ = VALUE_STRING("heap-space"), .unit = VALUE_STRING("bytes")} -static const ddprof_ffi_ValueType enabled_value_types[] = {CPU_TIME_VALUE, CPU_SAMPLES_VALUE, WALL_TIME_VALUE}; +static const ddprof_ffi_ValueType enabled_value_types[] = { + #define CPU_TIME_VALUE_POS 0 + CPU_TIME_VALUE, + #define CPU_SAMPLES_VALUE_POS 1 + CPU_SAMPLES_VALUE, + #define WALL_TIME_VALUE_POS 2 + WALL_TIME_VALUE +}; + #define ENABLED_VALUE_TYPES_COUNT (sizeof(enabled_value_types) / sizeof(ddprof_ffi_ValueType)) void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample); From f9e963d95afdbbd420af33707513a1b3eae54c8a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 10 May 2022 12:13:48 +0100 Subject: [PATCH 0025/2133] First stab at sampling all threads, not working Not yet working; in particular, I'm having trouble using `rb_thread_list()` since it's not exposed by the VM and I'm still thinking how to fix that. --- .../collectors_cpu_and_wall_time.c | 38 +++++++++++++++++++ .../profiling/collectors/cpu_and_wall_time.rb | 6 +++ .../collectors/cpu_and_wall_time_spec.rb | 20 +++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 395879470db..2c02b6b0690 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,6 +1,7 @@ #include #include "collectors_stack.h" #include "stack_recorder.h" +#include "private_vm_api_access.h" // Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class @@ -18,6 +19,8 @@ static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr); static VALUE _native_new(VALUE klass); static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames); +static VALUE _native_sample(VALUE self, VALUE collector_instance); +static void sample(VALUE collector_instance); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -34,6 +37,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { rb_define_alloc_func(collectors_cpu_and_wall_time_class, _native_new); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 3); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_sample", _native_sample, 1); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -97,3 +101,37 @@ static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE reco return Qtrue; } + +// This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. +// It SHOULD NOT be used for other purposes. +static VALUE _native_sample(VALUE self, VALUE collector_instance) { + sample(collector_instance); + return Qtrue; +} + +static void sample(VALUE collector_instance) { + struct cpu_and_wall_time_collector_state *state; + TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + + // FIXME: How to access thread list? + VALUE threads = rb_ary_new(); //rb_thread_list(); + + const int thread_count = RARRAY_LEN(threads); + for (int i = 0; i < thread_count; i++) { + VALUE thread = RARRAY_AREF(threads, i); + + int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; + + metric_values[CPU_TIME_VALUE_POS] = 12; + metric_values[CPU_SAMPLES_VALUE_POS] = 34; + metric_values[WALL_TIME_VALUE_POS] = 56; + + sample_thread( + thread, + state->sampling_buffer, + state->recorder_instance, + (ddprof_ffi_Slice_i64) {.ptr = metric_values, .len = ENABLED_VALUE_TYPES_COUNT}, + (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME + ); + } +} diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index f4634c61dcb..716d64414a0 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -11,6 +11,12 @@ class CpuAndWallTime def initialize(recorder:, max_frames:) self.class._native_initialize(self, recorder, max_frames) end + + # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def sample + self.class._native_sample(self) + end end end end diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 3a6f424940e..9c0331b7862 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -11,7 +11,23 @@ subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } - it "doesn't do anything useful at the moment" do - cpu_and_wall_time_collector + it 'samples all threads' do + all_threads = Thread.list + + decoded_profile = sample_and_decode + + #binding.pry + end + + def sample_and_decode + cpu_and_wall_time_collector.sample + + serialization_result = recorder.serialize + raise 'Unexpected: Serialization failed' unless serialization_result + + pprof_data = serialization_result.last + decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) + + decoded_profile end end From 3ce0b24a3ef71ea0daed76cefa86c69e479687eb Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 12 May 2022 12:18:23 +0100 Subject: [PATCH 0026/2133] Fix compiler warning --- .../collectors_cpu_and_wall_time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 2c02b6b0690..de9e0eb5a61 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -116,8 +116,8 @@ static void sample(VALUE collector_instance) { // FIXME: How to access thread list? VALUE threads = rb_ary_new(); //rb_thread_list(); - const int thread_count = RARRAY_LEN(threads); - for (int i = 0; i < thread_count; i++) { + const long thread_count = RARRAY_LEN(threads); + for (long i = 0; i < thread_count; i++) { VALUE thread = RARRAY_AREF(threads, i); int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; From a0ecda6114ee66bf36dc6c8e0967af3ea4ece9e7 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 12 May 2022 12:18:57 +0100 Subject: [PATCH 0027/2133] Comment out `.dcompact`, doesn't compile on legacy Rubies Once we implement it, we'll need to sprinkle some #ifdef magic. --- .../collectors_cpu_and_wall_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index de9e0eb5a61..a55b751e2b9 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -48,7 +48,7 @@ static const rb_data_type_t cpu_and_wall_time_collector_typed_data = { .dmark = cpu_and_wall_time_collector_typed_data_mark, .dfree = cpu_and_wall_time_collector_typed_data_free, .dsize = NULL, // We don't track profile memory usage (although it'd be cool if we did!) - .dcompact = NULL, // FIXME: Add support for compaction + //.dcompact = NULL, // FIXME: Add support for compaction }, .flags = RUBY_TYPED_FREE_IMMEDIATELY }; From dc2230deb710fa6ac2f9869985242e0fcc2cfa07 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 12 May 2022 12:21:14 +0100 Subject: [PATCH 0028/2133] Implement `ddtrace_thread_list` to replace the inaccessible `rb_thread_list` (incomplete) Since `rb_thread_list` is not exposed by Ruby, here's my first attempt at implementing one, inspired by both `rb_thread_list` (Ruby 2) and `rb_ractor_thread_list` (Ruby 3). Thus far it seems to work on all 3.x Rubies, as well as on 2.7, 2.6, 2.4, 2.3 and 2.2. Ruby 2.5 is getting into an infinite loop (??? -- to be investigated) and Ruby 2.1 of course is different from the later 2.x series and of course we'll need to do something special for it. Sigh. --- .../collectors_cpu_and_wall_time.c | 8 +++ .../private_vm_api_access.c | 40 +++++++++++++++ .../private_vm_api_access.h | 2 + .../profiling/collectors/cpu_and_wall_time.rb | 6 +++ .../collectors/cpu_and_wall_time_spec.rb | 49 ++++++++++++++----- 5 files changed, 93 insertions(+), 12 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index a55b751e2b9..66d58b73119 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -21,6 +21,7 @@ static VALUE _native_new(VALUE klass); static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames); static VALUE _native_sample(VALUE self, VALUE collector_instance); static void sample(VALUE collector_instance); +static VALUE _native_thread_list(VALUE self); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -38,6 +39,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 3); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_sample", _native_sample, 1); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_thread_list", _native_thread_list, 0); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -135,3 +137,9 @@ static void sample(VALUE collector_instance) { ); } } + +// This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. +// It SHOULD NOT be used for other purposes. +static VALUE _native_thread_list(VALUE self) { + return ddtrace_thread_list(); +} diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 88ecde574a3..9eca9bdaa66 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -58,6 +58,46 @@ ptrdiff_t stack_depth_for(VALUE thread) { return end_cfp <= cfp ? 0 : end_cfp - cfp - 1; } +// This was renamed in Ruby 3.2 +#if !defined(ccan_list_for_each) && defined(list_for_each) + #define ccan_list_for_each list_for_each +#endif + +// Tries to match rb_thread_list() but that method isn't accessible to extensions +VALUE ddtrace_thread_list() { + VALUE result = rb_ary_new(); + rb_thread_t *thread = NULL; + + // Ruby 3 Safety: Our implementation is inspired by `rb_ractor_thread_list` BUT that method wraps the operations below + // with `RACTOR_LOCK` and `RACTOR_UNLOCK`. + // + // This initially made me believe that one MUST grab the ractor lock (which is different from the ractor-scoped Global + // VM Lock) in able to iterate the `threads.set`. This turned out not to be the case: upon further study of the VM + // codebase in 3.2-master, 3.1 and 3.0, there's quite a few places where `threads.set` is accessed without grabbing + // the ractor lock: `ractor_mark` (ractor.c), `thgroup_list` (thread.c), `rb_check_deadlock` (thread.c), etc. + // + // I suspect the design in `rb_ractor_thread_list` may be done that way to perhaps in the future expose it to be + // called from a different Ractor, but I'm not sure... + #ifdef HAVE_RUBY_RACTOR_H + rb_ractor_t *current_ractor = GET_RACTOR(); + ccan_list_for_each(¤t_ractor->threads.set, thread, lt_node) { + #else + rb_vm_t *vm = thread_struct_from_object(rb_thread_current())->vm; + list_for_each(&vm->living_threads, thread, vmlt_node) { + #endif + switch (thread->status) { + case THREAD_RUNNABLE: + case THREAD_STOPPED: + case THREAD_STOPPED_FOREVER: + rb_ary_push(result, thread->self); + default: + break; + } + } + + return result; +} + // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. // Each function is annotated with its origin, why we imported it, and the changes made. diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index ce0f0758e9f..dde09461bbb 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -17,6 +17,8 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); +VALUE ddtrace_thread_list(); + int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); // Ruby 3.0 finally added support for showing CFUNC frames (frames for methods written using native code) diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index 716d64414a0..4bd8305634f 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -17,6 +17,12 @@ def initialize(recorder:, max_frames:) def sample self.class._native_sample(self) end + + # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def thread_list + self.class._native_thread_list + end end end end diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 9c0331b7862..9f7ca3b6b0e 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -11,23 +11,48 @@ subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } - it 'samples all threads' do - all_threads = Thread.list + describe '#sample' do + it 'samples all threads' do + all_threads = Thread.list - decoded_profile = sample_and_decode + decoded_profile = sample_and_decode - #binding.pry - end + #binding.pry + end + + def sample_and_decode + cpu_and_wall_time_collector.sample - def sample_and_decode - cpu_and_wall_time_collector.sample + serialization_result = recorder.serialize + raise 'Unexpected: Serialization failed' unless serialization_result - serialization_result = recorder.serialize - raise 'Unexpected: Serialization failed' unless serialization_result + pprof_data = serialization_result.last + decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) - pprof_data = serialization_result.last - decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) + decoded_profile + end + end - decoded_profile + describe '#thread_list', :focus do + let(:ready_queue) { Queue.new } + let!(:t1) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t2) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t3) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + + before do + 3.times { ready_queue.pop } + expect(Thread.list).to include(Thread.main, t1, t2, t3) + end + + after do + [t1, t2, t3].each do |thread| + thread.kill + thread.join + end + end + + it "returns the same as Ruby's Thread.list" do + expect(cpu_and_wall_time_collector.thread_list).to eq Thread.list + end end end From 03ef5d67ad41961c5f3f149906c8bb5d1ea2bfb8 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 12 May 2022 15:06:57 +0100 Subject: [PATCH 0029/2133] Add alternative `ddtrace_thread_list` implementation for Ruby 2.1 Argh 2.1, the bane of my existence. --- .../extconf.rb | 3 +++ .../private_vm_api_access.c | 26 +++++++++++++++++++ .../collectors/cpu_and_wall_time_spec.rb | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 808b249c3ab..99cd61bfd8c 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -114,6 +114,9 @@ def add_compiler_flag(flag) $defs << '-DUSE_LEGACY_RB_PROFILE_FRAMES' end +# In Ruby 2.1, living_threads were stored in a hashmap (st) +$defs << '-DUSE_LEGACY_LIVING_THREADS_ST' if RUBY_VERSION < '2.2' + # If we got here, libddprof is available and loaded ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libddprof.pkgconfig_folder}" unless pkg_config('ddprof_ffi_with_rpath') diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 9eca9bdaa66..1505fbc0cc2 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -63,6 +63,7 @@ ptrdiff_t stack_depth_for(VALUE thread) { #define ccan_list_for_each list_for_each #endif +#ifndef USE_LEGACY_LIVING_THREADS_ST // Ruby > 2.1 // Tries to match rb_thread_list() but that method isn't accessible to extensions VALUE ddtrace_thread_list() { VALUE result = rb_ary_new(); @@ -97,6 +98,31 @@ VALUE ddtrace_thread_list() { return result; } +#else // USE_LEGACY_LIVING_THREADS_ST +static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, void *result_object); + +// Alternative ddtrace_thread_list implementation for Ruby 2.1. In this Ruby version, living threads were stored in a +// hashmap (st) instead of a list. +VALUE ddtrace_thread_list() { + VALUE result = rb_ary_new(); + st_foreach(thread_struct_from_object(rb_thread_current())->vm->living_threads, ddtrace_thread_list_each, result); + return result; +} + +static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, void *result_object) { + VALUE result = (VALUE) result_object; + rb_thread_t *thread = thread_struct_from_object((VALUE) thread_object); + switch (thread->status) { + case THREAD_RUNNABLE: + case THREAD_STOPPED: + case THREAD_STOPPED_FOREVER: + rb_ary_push(result, thread->self); + default: + break; + } + return ST_CONTINUE; +} +#endif // USE_LEGACY_LIVING_THREADS_ST // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 9f7ca3b6b0e..3c9c0961f5e 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -33,7 +33,7 @@ def sample_and_decode end end - describe '#thread_list', :focus do + describe '#thread_list' do let(:ready_queue) { Queue.new } let!(:t1) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } let!(:t2) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } From 04bfdf3f745d3087f8b635552ff86d21fdf71f0c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 13 May 2022 11:28:49 +0100 Subject: [PATCH 0030/2133] Add self-test for issue with Ruby 2.5 `ddtrace_thread_list` issue I'll submit a PR upstream to update `debase-ruby_core_source`, but I've added a self-check anyway to avoid running into issues with older gem versions. (I'm not sure how long it'll take for upstream to accept my PR, or if we'll need to fork...) --- .../private_vm_api_access.c | 30 +++++++++++++++++++ .../private_vm_api_access.h | 1 + .../profiling.c | 2 ++ 3 files changed, 33 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 1505fbc0cc2..b4b63dd43da 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -124,6 +124,36 @@ static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, v } #endif // USE_LEGACY_LIVING_THREADS_ST +// On Ruby versions where we don't use the MJIT header (< 2.6) we instead use the debase-ruby_core_source to access +// the VM headers and be able to get definitions for VM internal structs. +// +// Unfortunately, not every Ruby minor version is included in that gem, and in particular for Ruby 2.5.4 there was a +// change introduced in the `struct rb_vm_struct` (vm_core.h) that means that compiling it with headers for +// earlier 2.5.x releases results in the code being compiled incorrectly. +// +// The self test below is a sanity check for this case, so that we don't try to use profiler if we got compiled +// with the incorrect header. +void self_test_thread_list() { + #if !defined(RUBY_MJIT_HEADER) && !defined(USE_LEGACY_LIVING_THREADS_ST) + VALUE thread_list = rb_funcall(rb_cThread, rb_intern("list"), 0); + Check_Type(thread_list, T_ARRAY); + size_t thread_list_size = RARRAY_LEN(thread_list); + size_t living_thread_num = thread_struct_from_object(rb_thread_current())->vm->living_thread_num; + + // Other than the reason above, theoretically thread_list_size can be a bit smaller than living_thread_num if there's + // threads that have been just killed and not removed from the living_thread list. I'm not sure if we're ever going + // to run into it, but if you're investigating a suspicious failure below, that may be the reason. + if (thread_list_size != living_thread_num) { + rb_raise( + rb_eRuntimeError, + "ddtrace_thread_list() self-test failed (got %lu, expected %lu)", + living_thread_num, + thread_list_size + ); + } + #endif +} + // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. // Each function is annotated with its origin, why we imported it, and the changes made. diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index dde09461bbb..1df6d7e75de 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -18,6 +18,7 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); VALUE ddtrace_thread_list(); +void self_test_thread_list(); int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index cb8e57b13fa..e1eb7da566b 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -1,6 +1,7 @@ #include #include "clock_id.h" +#include "private_vm_api_access.h" // Each class/module here is implemented in their separate file void collectors_cpu_and_wall_time_init(VALUE profiling_module); @@ -28,6 +29,7 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { static VALUE native_working_p(VALUE self) { self_test_clock_id(); + self_test_thread_list(); return Qtrue; } From 669d55437aad4af9339a0ff6258e8617025116bf Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 13 May 2022 11:59:14 +0100 Subject: [PATCH 0031/2133] Fix profiling in Ruby 2.5.4 to 2.5.9 Hopefully https://github.com/ruby-debug/debase-ruby_core_source/pull/6 will be merged upstream soon. --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 83907e9860e..9dc01b9c0f1 100644 --- a/Gemfile +++ b/Gemfile @@ -91,3 +91,8 @@ if RUBY_VERSION >= '2.4.0' && (RUBY_PLATFORM =~ /^x86_64-(darwin|linux)/) gem 'sorbet', '= 0.5.9672' gem 'spoom', '~> 1.1' end + +# This is needed to enable profiling on Ruby 2.5.4 to 2.5.9. Without it, the profiler will not turn on because +# the `self_test_thread_list` (private_vm_api_access.c) will not pass. +# Hopefully upstream will accept this PR, otherwise we may need to fork, which I really would like to avoid. +gem 'debase-ruby_core_source', git: 'https://github.com/Datadog/debase-ruby_core_source.git', branch: 'datadog/add-ruby-2.5.4-headers' From eb94cd0780e13c73d98775394a1533e46a1c0eae Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 13 May 2022 14:48:58 +0100 Subject: [PATCH 0032/2133] Use new `ddtrace_thread_list` while sampling There's still a lot of missing features, but at least we can now take samples of all running threads. --- .../collectors_cpu_and_wall_time.c | 6 +++--- .../collectors/cpu_and_wall_time_spec.rb | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 66d58b73119..d07f08ce9c2 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -115,8 +115,7 @@ static void sample(VALUE collector_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); - // FIXME: How to access thread list? - VALUE threads = rb_ary_new(); //rb_thread_list(); + VALUE threads = ddtrace_thread_list(); const long thread_count = RARRAY_LEN(threads); for (long i = 0; i < thread_count; i++) { @@ -124,6 +123,7 @@ static void sample(VALUE collector_instance) { int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; + // FIXME: TODO metric_values[CPU_TIME_VALUE_POS] = 12; metric_values[CPU_SAMPLES_VALUE_POS] = 34; metric_values[WALL_TIME_VALUE_POS] = 56; @@ -133,7 +133,7 @@ static void sample(VALUE collector_instance) { state->sampling_buffer, state->recorder_instance, (ddprof_ffi_Slice_i64) {.ptr = metric_values, .len = ENABLED_VALUE_TYPES_COUNT}, - (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME + (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME: TODO ); } } diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 3c9c0961f5e..dd496b357bb 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -12,12 +12,29 @@ subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } describe '#sample' do + let(:ready_queue) { Queue.new } + let!(:t1) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t2) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t3) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + + before do + 3.times { ready_queue.pop } + expect(Thread.list).to include(Thread.main, t1, t2, t3) + end + + after do + [t1, t2, t3].each do |thread| + thread.kill + thread.join + end + end + it 'samples all threads' do all_threads = Thread.list decoded_profile = sample_and_decode - #binding.pry + expect(decoded_profile.sample.size).to be all_threads.size end def sample_and_decode From 512429072d58143fcc4e2ce46a727ac58e493319 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 17 May 2022 11:29:04 +0100 Subject: [PATCH 0033/2133] Use `debase-ruby_core_source` from upstream git, instead of our own fork My PR got accepted but has not yet been released! --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 9dc01b9c0f1..80e81835c48 100644 --- a/Gemfile +++ b/Gemfile @@ -94,5 +94,5 @@ end # This is needed to enable profiling on Ruby 2.5.4 to 2.5.9. Without it, the profiler will not turn on because # the `self_test_thread_list` (private_vm_api_access.c) will not pass. -# Hopefully upstream will accept this PR, otherwise we may need to fork, which I really would like to avoid. -gem 'debase-ruby_core_source', git: 'https://github.com/Datadog/debase-ruby_core_source.git', branch: 'datadog/add-ruby-2.5.4-headers' +# Hopefully this fix will be released soon, so we can start depending on it +gem 'debase-ruby_core_source', git: 'https://github.com/ruby-debug/debase-ruby_core_source.git', ref: '97650d6f70d823e12efd4f0eac51cb81ea59a1f2' From 6979597784bc9a78fe0fa77cb1de84a57af9bff8 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 17 May 2022 11:32:11 +0100 Subject: [PATCH 0034/2133] Use `rb_memerror()` when handing out of memory issues As pointed out by Marco in it's possible that when memory allocation fails, we can be in such a state that casually raising an exception may not work at all. Instead, let's use a function that Ruby exposes for this exact situation -- `rb_memerror()` -- which is built to withstand such memory issues. --- .../collectors_cpu_and_wall_time.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index d07f08ce9c2..5ca1ae5b04d 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -77,9 +77,7 @@ static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { static VALUE _native_new(VALUE klass) { struct cpu_and_wall_time_collector_state *state = xcalloc(1, sizeof(struct cpu_and_wall_time_collector_state)); - if (state == NULL) { - rb_raise(rb_eNoMemError, "Failed to allocate memory for components of Datadog::Profiling::Collectors::CpuAndWallTime"); - } + if (state == NULL) rb_memerror(); // Update this when modifying state struct state->sampling_buffer = NULL; From 8d2a9bc8c988f3986b36ecd99e0e03a6e31fdc64 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 17 May 2022 11:35:43 +0100 Subject: [PATCH 0035/2133] Clarify FIXME notes left --- .../collectors_cpu_and_wall_time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 5ca1ae5b04d..21b2066768e 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -121,7 +121,7 @@ static void sample(VALUE collector_instance) { int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; - // FIXME: TODO + // FIXME: TODO These are just dummy values for now metric_values[CPU_TIME_VALUE_POS] = 12; metric_values[CPU_SAMPLES_VALUE_POS] = 34; metric_values[WALL_TIME_VALUE_POS] = 56; @@ -131,7 +131,7 @@ static void sample(VALUE collector_instance) { state->sampling_buffer, state->recorder_instance, (ddprof_ffi_Slice_i64) {.ptr = metric_values, .len = ENABLED_VALUE_TYPES_COUNT}, - (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME: TODO + (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME: TODO we need to gather the expected labels ); } } From 21205de960449319ee95377f24a303d78b3655d0 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 11:29:51 +0100 Subject: [PATCH 0036/2133] Disallow older versions of debase-ruby_core_source from being used This ensures that customers on 2.5.4 to 2.5.9 don't accidentally use an older version. Revert "Add self-test for issue with Ruby 2.5 `ddtrace_thread_list` issue" This reverts commit 04bfdf3f745d3087f8b635552ff86d21fdf71f0c. --- Gemfile | 5 ---- ddtrace.gemspec | 7 +++-- .../private_vm_api_access.c | 30 ------------------- .../private_vm_api_access.h | 1 - .../profiling.c | 2 -- 5 files changed, 5 insertions(+), 40 deletions(-) diff --git a/Gemfile b/Gemfile index 80e81835c48..83907e9860e 100644 --- a/Gemfile +++ b/Gemfile @@ -91,8 +91,3 @@ if RUBY_VERSION >= '2.4.0' && (RUBY_PLATFORM =~ /^x86_64-(darwin|linux)/) gem 'sorbet', '= 0.5.9672' gem 'spoom', '~> 1.1' end - -# This is needed to enable profiling on Ruby 2.5.4 to 2.5.9. Without it, the profiler will not turn on because -# the `self_test_thread_list` (private_vm_api_access.c) will not pass. -# Hopefully this fix will be released soon, so we can start depending on it -gem 'debase-ruby_core_source', git: 'https://github.com/ruby-debug/debase-ruby_core_source.git', ref: '97650d6f70d823e12efd4f0eac51cb81ea59a1f2' diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 48c0faebe64..8ea49b1d47d 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -54,9 +54,12 @@ Gem::Specification.new do |spec| # Used by the profiler native extension to support older Rubies (see NativeExtensionDesign.md for notes) # - # Because we only use this for older Rubies, and we consider it "feature-complete" for those older Rubies, + # Most versions of this gem work for us, but 0.10.16 includes an important fix for Ruby 2.5.4 to 2.5.9 + # (https://github.com/ruby-debug/debase-ruby_core_source/pull/6) so we should keep that as a lower bound going + # forward. + # # we're pinning it at the latest available version and will manually bump the dependency as needed. - spec.add_dependency 'debase-ruby_core_source', '<= 0.10.16' + spec.add_dependency 'debase-ruby_core_source', '= 0.10.16' # Used by appsec spec.add_dependency 'libddwaf', '~> 1.3.0.2.0' diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index b4b63dd43da..1505fbc0cc2 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -124,36 +124,6 @@ static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, v } #endif // USE_LEGACY_LIVING_THREADS_ST -// On Ruby versions where we don't use the MJIT header (< 2.6) we instead use the debase-ruby_core_source to access -// the VM headers and be able to get definitions for VM internal structs. -// -// Unfortunately, not every Ruby minor version is included in that gem, and in particular for Ruby 2.5.4 there was a -// change introduced in the `struct rb_vm_struct` (vm_core.h) that means that compiling it with headers for -// earlier 2.5.x releases results in the code being compiled incorrectly. -// -// The self test below is a sanity check for this case, so that we don't try to use profiler if we got compiled -// with the incorrect header. -void self_test_thread_list() { - #if !defined(RUBY_MJIT_HEADER) && !defined(USE_LEGACY_LIVING_THREADS_ST) - VALUE thread_list = rb_funcall(rb_cThread, rb_intern("list"), 0); - Check_Type(thread_list, T_ARRAY); - size_t thread_list_size = RARRAY_LEN(thread_list); - size_t living_thread_num = thread_struct_from_object(rb_thread_current())->vm->living_thread_num; - - // Other than the reason above, theoretically thread_list_size can be a bit smaller than living_thread_num if there's - // threads that have been just killed and not removed from the living_thread list. I'm not sure if we're ever going - // to run into it, but if you're investigating a suspicious failure below, that may be the reason. - if (thread_list_size != living_thread_num) { - rb_raise( - rb_eRuntimeError, - "ddtrace_thread_list() self-test failed (got %lu, expected %lu)", - living_thread_num, - thread_list_size - ); - } - #endif -} - // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. // Each function is annotated with its origin, why we imported it, and the changes made. diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index 1df6d7e75de..dde09461bbb 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -18,7 +18,6 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); VALUE ddtrace_thread_list(); -void self_test_thread_list(); int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index e1eb7da566b..cb8e57b13fa 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -1,7 +1,6 @@ #include #include "clock_id.h" -#include "private_vm_api_access.h" // Each class/module here is implemented in their separate file void collectors_cpu_and_wall_time_init(VALUE profiling_module); @@ -29,7 +28,6 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { static VALUE native_working_p(VALUE self) { self_test_clock_id(); - self_test_thread_list(); return Qtrue; } From c6da78be049dfae0ad2d9b919891914b7b943160 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 11:49:44 +0100 Subject: [PATCH 0037/2133] Remove unneeded NULL check As pointed out by Marco during review () the `xcalloc` function already tests for `NULL` and thus we don't need to repeat the test. To make it even more obvious that we're using the Ruby-provided functions for managing memory, I've decided to directly call `ruby_xcalloc` and `ruby_xfree` instead of their shorted aliases. --- .../collectors_cpu_and_wall_time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 21b2066768e..4b5d6b1b872 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -71,13 +71,11 @@ static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { // pointers that have been set NULL there may still be NULL here. if (state->sampling_buffer != NULL) sampling_buffer_free(state->sampling_buffer); - xfree(state); + ruby_xfree(state); } static VALUE _native_new(VALUE klass) { - struct cpu_and_wall_time_collector_state *state = xcalloc(1, sizeof(struct cpu_and_wall_time_collector_state)); - - if (state == NULL) rb_memerror(); + struct cpu_and_wall_time_collector_state *state = ruby_xcalloc(1, sizeof(struct cpu_and_wall_time_collector_state)); // Update this when modifying state struct state->sampling_buffer = NULL; From b3b3efa25917fbd25c9db0d81decaabcf8c745c5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 11:58:31 +0100 Subject: [PATCH 0038/2133] Bump gemfile.lock files to use latest debase-ruby_core_source --- gemfiles/jruby_9.2.18.0_contrib.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_core_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock | 4 ++-- ..._9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock | 4 ++-- ..._9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_contrib.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_core_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock | 4 ++-- ...y_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock | 4 ++-- ...y_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_contrib.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_core_old.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock | 4 ++-- ...y_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock | 4 ++-- ...y_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock | 4 ++-- ...by_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock | 4 ++-- ...by_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock | 4 ++-- ...uby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_contrib.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_contrib_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_core_old.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_cucumber3.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_cucumber4.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_cucumber5.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock | 4 ++-- gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock | 4 ++-- 251 files changed, 502 insertions(+), 502 deletions(-) diff --git a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock index 2eb21a21b80..865e44cc296 100644 --- a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1335,7 +1335,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) delayed_job_active_record (4.1.7) diff --git a/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock index 8b23ecedb3c..174080dcc37 100644 --- a/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,7 +37,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock b/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock index 0a81cd02c9f..14da7ba2b57 100644 --- a/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (4.8.3) diff --git a/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock index dfd13ce7ad6..60498ab4dbe 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock index 714cd0ab708..2066faa8e67 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.3) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock index 099941f99e7..c146b60edb3 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock index e019aadadb1..642d5328ca4 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock index b8dfda28378..f211cd73efc 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock index f26c1c1a03a..02ee61d2a46 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock index 9b5942c8efe..9b97ef05b4d 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock index f95f5afc61f..74bff2f98e1 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock index 390f1c4d0da..6691ffb9c17 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock index 1b7bab8a135..45eeec78c93 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock index c4fd0c0c8a8..cf3b7ff4723 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock index 985d6abb5e3..2d2733f8b0a 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock index 17b670fa75e..2930d320db9 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -102,7 +102,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock index 78e3e2410ef..7bb6104b016 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock index 33bb1c55265..a241e338948 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock index 2854b7b155e..01beae16965 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock index bd5fd51e9fa..595530ac3a1 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock index 87e09c991d1..879cf26a016 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock index 02b00356b7a..ac405814b97 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock index 4541d74c7c6..28a4076a2f0 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock index a6b9ea660d5..8562913d238 100644 --- a/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock index d76b5c05015..d5ca49dc00e 100644 --- a/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock index 4d3092c1cf7..730939ec4cf 100644 --- a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1335,7 +1335,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) delayed_job_active_record (4.1.7) diff --git a/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock index 90a675e7dc3..f1dd4f60983 100644 --- a/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,7 +37,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock b/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock index 9697d2f3eab..9e5f9a74e83 100644 --- a/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (4.8.3) diff --git a/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock index d1c7b701817..555c8888583 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock index 052b8f36132..3a49e0230c8 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.3) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock index 61165578075..7fa7581db69 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock index e510e813024..dcb0d73b538 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock index db30737fe3e..a33b692d9b2 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock index 81b0733d84e..a97ca9306e2 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock index bc687197bba..1ae92ebcee4 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock index c255f158b76..47f626bd216 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock index c3aa33aabb6..074033a8e7e 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock index a6149b6754a..cf12703d89b 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock index 5d99001d7fc..3c9a752259b 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock index 4bf84c3a1d5..f7edb10a8ad 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock index cd3add2aa5b..1d37444c2f7 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -102,7 +102,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock index a54be9d15d1..288a6da4bfc 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock index 4caf4500ea8..cc7994b8176 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock index d8e0a69cfed..68b40e40d04 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock index c05c93d98a8..2db88ad498b 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock index ff70880a3d4..46bb5140e2f 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock index e0b48f6e3c5..f3e307a944e 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock index d4e5eec4212..f483dc14847 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock index 0ddbcd55ca0..e36e73998b6 100644 --- a/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock index 58c52415722..516122914d0 100644 --- a/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock index 6610d2ef761..acf7b6612b4 100644 --- a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1335,7 +1335,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) delayed_job_active_record (4.1.7) diff --git a/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock index e7f8c3963f6..81846cd7d89 100644 --- a/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,7 +37,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock b/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock index 3f2a507e235..2e9fce89a0d 100644 --- a/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (4.8.3) diff --git a/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock index 74c3c03483d..a44cfc58995 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock index ed05617ab60..b3a9fd2ca66 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.3) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock index e32979a21bf..0c3f38002d6 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -73,7 +73,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock index 5b909b35f36..4730d72cde8 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock index 6cb65f40520..66df9291eb2 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock index 124391e7035..3dff1554ec2 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock index 9a815956e4f..0499a71f1f8 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock index 2348dcae5c6..165fdb5c307 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock index 071c480262e..550b650bfed 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -84,7 +84,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock index ac3de09aac6..6c7e2acdec5 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock index d516db9a0a6..0df3bae2791 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock index 4df79370752..06aee3fada7 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock index 135b60ec5a9..2b01e9efaa3 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -102,7 +102,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock index 3cbaff1574c..4521aea0b89 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -101,7 +101,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock index 92ed774910b..524a3861b59 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock index 2d06fa195ab..0146d9e65dd 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock index 3c571680b0c..89354dc82ec 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock index 6736d5b03f3..7c3b24e38e7 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock index f198d199da5..8ad8d2d9bfb 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock index 385537b220c..d0ebbcb64d4 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock index 5d38ab1ae66..4bee1a3880a 100644 --- a/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock index 537bb73a016..90f3e5ef09b 100644 --- a/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -36,7 +36,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) diff-lcs (1.5.0) docile (1.4.0) dogstatsd-ruby (5.4.0) diff --git a/gemfiles/ruby_2.1.10_contrib.gemfile.lock b/gemfiles/ruby_2.1.10_contrib.gemfile.lock index 653977494aa..a2573be1881 100644 --- a/gemfiles/ruby_2.1.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.1.10_contrib.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -74,7 +74,7 @@ GEM crack (0.4.5) rexml dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.9) activesupport (>= 3.0, < 6.2) diff --git a/gemfiles/ruby_2.1.10_core_old.gemfile.lock b/gemfiles/ruby_2.1.10_core_old.gemfile.lock index 01a4d4a96de..da4f1e37276 100644 --- a/gemfiles/ruby_2.1.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.1.10_core_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.9) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock index 07a8bcdfd83..ef88ab67b39 100644 --- a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -57,7 +57,7 @@ GEM concurrent-ruby (1.1.9) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock index 4ab81fe8d7d..8b880bdccda 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.9) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock index 2ab0f9cc518..75429c873b3 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.9) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock index bc5e90be83f..4f98466cd8a 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -54,7 +54,7 @@ GEM connection_pool (2.2.3) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock index b4b417099bf..e0331311f06 100644 --- a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock index a243538785c..28919ee5667 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock index d55b0220abb..1bb88142467 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock index 9a277d8404c..def06ae4499 100644 --- a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack (< 1.4) @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_contrib.gemfile.lock b/gemfiles/ruby_2.2.10_contrib.gemfile.lock index 8100c44d263..c47c82e482a 100644 --- a/gemfiles/ruby_2.2.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.2.10_contrib.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1196,7 +1196,7 @@ GEM crass (1.0.6) daemons (1.4.1) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.2.10_core_old.gemfile.lock b/gemfiles/ruby_2.2.10_core_old.gemfile.lock index 0a33971351b..7a87d4135d1 100644 --- a/gemfiles/ruby_2.2.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.2.10_core_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock index c43faffb0d7..f4df4f0c34e 100644 --- a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -57,7 +57,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock index 5f81d5ec508..b6083b0ffd4 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock index 693dab10dd7..338b3810349 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock index ee476abceaa..df929fcd028 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -54,7 +54,7 @@ GEM connection_pool (2.2.5) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock index 0ff3878ddbb..a368a0d4e84 100644 --- a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock index e48da40640b..469c1c3f886 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock index 5316a66441d..fbeb5f8253e 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock index 4d61b9f4017..d38aff63e31 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -62,7 +62,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock index 805467f7e27..3a9ce5b246d 100644 --- a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock index 3ce76a448d4..5e5f49d05e6 100644 --- a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock index ba0bf1c546a..e162df9534e 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock index ae42f4a1874..1e300c44c46 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock index 978d8445eaa..172578602fd 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock index a6e269b9363..059f54dbef5 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -69,7 +69,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock index b94e71f3c60..00c03827c92 100644 --- a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_contrib.gemfile.lock b/gemfiles/ruby_2.3.8_contrib.gemfile.lock index eb77a807c06..07c0af045a5 100644 --- a/gemfiles/ruby_2.3.8_contrib.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1297,7 +1297,7 @@ GEM crass (1.0.6) daemons (1.4.1) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock index 597505f2399..3a02844e438 100644 --- a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_core_old.gemfile.lock b/gemfiles/ruby_2.3.8_core_old.gemfile.lock index 0c9e5d360bc..e969ff5d761 100644 --- a/gemfiles/ruby_2.3.8_core_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_core_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock index 92130f064b3..e780d920099 100644 --- a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -42,7 +42,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock index 98ea1c49549..3a1fd04f541 100644 --- a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock index 79d1225c20d..d847887cae9 100644 --- a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -57,7 +57,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock index 0f750d8628c..24b5cfab595 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock index 1933532dac8..76705e405a7 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -53,7 +53,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock index 7090bba64d8..4710db9fba6 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -54,7 +54,7 @@ GEM connection_pool (2.2.5) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock index bfc9f59d6ef..8b9ef4460a5 100644 --- a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock index ee6fa8fbf1d..d7b85f59a96 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock index d90a6d9f68a..4e7a2277cee 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock index 9d4851cd310..decdb4b123d 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -62,7 +62,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock index fd0fe8f7d9a..3826dee1b1d 100644 --- a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -61,7 +61,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock index 33ebd7df547..b8a07123ccd 100644 --- a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock index 8f84eb67df8..29e6844d466 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock index 942dd091478..10b7fe590e6 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock index ab6307b2173..eb2965f9b75 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock index 813505f73b6..9bcbba2cd3b 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -69,7 +69,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock index 7a284b69ab9..87fbcd2a6a4 100644 --- a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,7 +68,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock index 0c40cf09cf4..955f7b5b57e 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock index 5b255c6cee5..efb3a3b039b 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -25,7 +25,7 @@ GEM concurrent-ruby (1.1.10) crack (0.4.5) rexml - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_contrib.gemfile.lock b/gemfiles/ruby_2.4.10_contrib.gemfile.lock index d7a2c30ae82..b48bb2e953a 100644 --- a/gemfiles/ruby_2.4.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1325,7 +1325,7 @@ GEM cucumber-messages (~> 12.2, >= 12.2.0) daemons (1.4.1) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock index 57e9624ec9a..1df82fac17e 100644 --- a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -28,7 +28,7 @@ GEM crack (0.4.5) rexml cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_core_old.gemfile.lock b/gemfiles/ruby_2.4.10_core_old.gemfile.lock index 2467cbabd63..0bd400c6192 100644 --- a/gemfiles/ruby_2.4.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_core_old.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -28,7 +28,7 @@ GEM crack (0.4.5) rexml cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock index 41d487c78ac..fa519f817e3 100644 --- a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -45,7 +45,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock index 2e73ad3c8e9..c413402843c 100644 --- a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -64,7 +64,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock index b43bde3321f..58980ac26f1 100644 --- a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,7 +71,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock index 04779145305..d7748582672 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,7 +71,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock index a05758cbe87..16371b0b33c 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,7 +71,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock index 97c52276b68..c0959be4b66 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,7 +71,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock index 4838d98a6f6..53b011f326b 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -72,7 +72,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock index 7a84d5156e3..6e34429ce32 100644 --- a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,7 +71,7 @@ GEM rexml crass (1.0.6) cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock index 6e28cfc9184..20180ca3110 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -28,7 +28,7 @@ GEM crack (0.4.5) rexml cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock index 1c57099f9c4..e90f18caaf4 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -28,7 +28,7 @@ GEM crack (0.4.5) rexml cri (2.15.10) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.3.5) diff --git a/gemfiles/ruby_2.5.9_contrib.gemfile.lock b/gemfiles/ruby_2.5.9_contrib.gemfile.lock index 61e87bd4136..13d12c606bb 100644 --- a/gemfiles/ruby_2.5.9_contrib.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1329,7 +1329,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock index e862fc49d38..e4466f15f07 100644 --- a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_core_old.gemfile.lock b/gemfiles/ruby_2.5.9_core_old.gemfile.lock index b31ef5a532c..0d133d15f41 100644 --- a/gemfiles/ruby_2.5.9_core_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock index a3e64904b17..01a9f9d56e0 100644 --- a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -55,7 +55,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock index b4c008d7ed6..c71d65d1428 100644 --- a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock index 7485715e8bf..33c3e6b8070 100644 --- a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock index dbd1ff563fc..6ca0a0d0e74 100644 --- a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -81,7 +81,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock index 11c6726df5c..f4f34612fc3 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -81,7 +81,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock index 5dda434f302..fc3bb8e74ec 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -81,7 +81,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock index fd3a083a34b..48a7d08ce3b 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -81,7 +81,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock index d3bf61d9f62..cb970448525 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock index fa40f398c1e..41b622bfece 100644 --- a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -81,7 +81,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock index 59a87198267..1e10bcf4f25 100644 --- a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock index a40a97bad84..a118ab1fd8f 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock index cb073e019ca..0233ec3f742 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock index b48ceec5fca..e2edad61524 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock index 527d505b299..4080d0f83f0 100644 --- a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock index 181fcf0ca88..9936f130494 100644 --- a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -94,7 +94,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock index ac266421882..69ef7c77eba 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -94,7 +94,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock index f9696cf14cb..20578b962b0 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -94,7 +94,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock index 418b8c4ddf9..197a13ab50f 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -94,7 +94,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock index 8a0b28d8533..c936b590b2e 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock index d63b1a1c114..72cf8fe78a3 100644 --- a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -94,7 +94,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock index c0cb4db9651..0ccd2d48694 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock index ad686364ac6..647e30029c1 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_contrib.gemfile.lock b/gemfiles/ruby_2.6.7_contrib.gemfile.lock index 05ff59b2ed9..222f77a4be3 100644 --- a/gemfiles/ruby_2.6.7_contrib.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1330,7 +1330,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock index 89511b64fc6..adddf5839f0 100644 --- a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -40,7 +40,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_core_old.gemfile.lock b/gemfiles/ruby_2.6.7_core_old.gemfile.lock index 0b80c58720b..26844de1d8f 100644 --- a/gemfiles/ruby_2.6.7_core_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock index d01d6e7534b..e5ed4923c88 100644 --- a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -56,7 +56,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock index fd56a522b88..d86dad2477c 100644 --- a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -76,7 +76,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock index dd69e2c975f..44f6ba18366 100644 --- a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -76,7 +76,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock index 833bf277e8b..e61d12697af 100644 --- a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock index 2b0f2863eb8..0aad475a51d 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock index 223275b0462..fe09270ee08 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock index a48722aeb01..1d7cd4f2d20 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock index 6cf676b9d40..b6d31d2c4c3 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -83,7 +83,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock index 7adf0e8ebef..9ef15c1779f 100644 --- a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock index dc641ffc9b8..852e89a0853 100644 --- a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock index 9fe42ac450b..5df2d9f7c17 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock index 766836c2636..242b7233288 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock index 7b7e03f713c..be0c888e78e 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -100,7 +100,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock index 6a41bc1b5ac..a0dda2c32cc 100644 --- a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock index 034b1a2c69e..7815599dd2d 100644 --- a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock index 46789645186..4fc9ca72794 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock index d04c2604f4d..67243fe94c1 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock index 88a78f93679..36a585d2150 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock index 33e5d75922d..4651a44a5a4 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -96,7 +96,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock index f9ac5ae3100..bedfbe06905 100644 --- a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock index 0b3d73c1c57..acc632fc148 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock index dcf1f277e92..19874a8d08c 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_contrib.gemfile.lock b/gemfiles/ruby_2.7.3_contrib.gemfile.lock index 68fb3dcf4d3..cb5e22b98cb 100644 --- a/gemfiles/ruby_2.7.3_contrib.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1329,7 +1329,7 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock index 003fdd96c76..d59bdf3f97a 100644 --- a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -40,7 +40,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_core_old.gemfile.lock b/gemfiles/ruby_2.7.3_core_old.gemfile.lock index ac262f2ba89..88c80f47d85 100644 --- a/gemfiles/ruby_2.7.3_core_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock index f0c467fa626..de7dc374abc 100644 --- a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -56,7 +56,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock index 79d1fb942eb..999b1006e9b 100644 --- a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock index caf5e8c73e6..b19e1053445 100644 --- a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock index 79bad52f755..988f522ed46 100644 --- a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock index 4e1455c0d7b..f728f4dbc5e 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock index c4ecd711782..08ce082f488 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock index 5c9539c1d6e..0c6013ef28c 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock index 160094c6025..23df4df4da2 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -83,7 +83,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock index 506be233ab4..6a495de168e 100644 --- a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,7 +82,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock index dd828157fa3..28458c0a4fb 100644 --- a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock index 295cf029322..2664cf266b1 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock index 2bb65f6d57a..51448f73d5c 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock index e0d30f83772..b2d80d3d635 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -100,7 +100,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock index 8691fffa422..ae7b5b0c9b7 100644 --- a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock index e5ba6479bff..e418067f0ec 100644 --- a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock index 46258f156d8..d5f7a341cbe 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock index d9eca128699..9d8c35a7424 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock index b0faf78d4f7..580aded1d78 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock index 34f6650421e..6f05f004e6e 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -96,7 +96,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock index 0c42a5c0cea..8cd9ef14781 100644 --- a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -95,7 +95,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock index 5830d2b27e6..7ff9309ba75 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock index 35385f9ed0d..b18ce7f576c 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_contrib.gemfile.lock b/gemfiles/ruby_3.0.3_contrib.gemfile.lock index 4011b88ab37..63efb6b747a 100644 --- a/gemfiles/ruby_3.0.3_contrib.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1333,7 +1333,7 @@ GEM cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) daemons (1.4.1) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock index 88bdf52246c..13c1ccb2750 100644 --- a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -40,7 +40,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_core_old.gemfile.lock b/gemfiles/ruby_3.0.3_core_old.gemfile.lock index efcd371765f..150bc4c3d50 100644 --- a/gemfiles/ruby_3.0.3_core_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock index 94392da9184..275c0fc6cdc 100644 --- a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -56,7 +56,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock index d8e3fdf8cc8..e88db124bfe 100644 --- a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock index 82eb5e2be01..4f8153fed3c 100644 --- a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock index 732452d9cdf..5ef7cfd6e28 100644 --- a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock index a5a28f26a63..4d4e628b42e 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock index c66fdd19253..21d8c531de5 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock index 5324dfcb294..8240d285f06 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -100,7 +100,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock index ae24a7511c5..6a3f94a25b4 100644 --- a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock index 15aae622907..06f9e8f35af 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock index 9dbae0c66da..dccd0d623ca 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_contrib.gemfile.lock b/gemfiles/ruby_3.1.1_contrib.gemfile.lock index 7006d630ce0..ca0d115c861 100644 --- a/gemfiles/ruby_3.1.1_contrib.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1333,7 +1333,7 @@ GEM cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) daemons (1.4.1) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock index 55a2fdf1470..819cda37344 100644 --- a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -40,7 +40,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_core_old.gemfile.lock b/gemfiles/ruby_3.1.1_core_old.gemfile.lock index 2a2718720ec..bf537508a9b 100644 --- a/gemfiles/ruby_3.1.1_core_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock index f41093d8395..6b8727b3a71 100644 --- a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -56,7 +56,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock index 15c850f5bc3..6bda72370cd 100644 --- a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock index 541a30d7eb7..80b9af8a924 100644 --- a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,7 +75,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock index dd1415c333a..8bd01a94fde 100644 --- a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock index 8d45aa84fa9..286f9c382a3 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock index 46c20d2c0c6..6399e8afa9c 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock index 2bfe78d4be3..4a424010675 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -100,7 +100,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock index d4283ba1fe2..55df724281c 100644 --- a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock index 50483da0d70..b66fcf9dd44 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock index a53c6db9135..9b24eb14b28 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_contrib.gemfile.lock b/gemfiles/ruby_3.2.0_contrib.gemfile.lock index a9d481915fe..01f2d01362d 100644 --- a/gemfiles/ruby_3.2.0_contrib.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -1336,7 +1336,7 @@ GEM cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) daemons (1.4.1) dalli (3.2.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) delayed_job (4.1.10) activesupport (>= 3.0, < 8.0) diff --git a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock index 7496c9fecfb..2a4d313b57e 100644 --- a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,7 +39,7 @@ GEM rexml cri (2.15.11) dalli (2.7.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_core_old.gemfile.lock b/gemfiles/ruby_3.2.0_core_old.gemfile.lock index 7dee421c72f..a788caa908b 100644 --- a/gemfiles/ruby_3.2.0_core_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_core_old.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock index 9b6a94bd605..330c3f5be8b 100644 --- a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -55,7 +55,7 @@ GEM cucumber-expressions (6.0.1) cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock index 063e2eaebcf..91f9733565f 100644 --- a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -74,7 +74,7 @@ GEM cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) cucumber-messages (~> 12.2, >= 12.2.0) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.3) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock index ffe2790fd96..d040fcc79fa 100644 --- a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -74,7 +74,7 @@ GEM cucumber-core (~> 8.0, >= 8.0.1) cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) cucumber-messages (~> 13.0, >= 13.0.1) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock index 2446789d183..b25f4cad39c 100644 --- a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock index 1af6db4d556..5e2bf0eb5fa 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock index beb832de3d1..6a8f0493221 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock index a69d859c451..e387a56ec11 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock index 0135cae7b69..f5ae8b9867b 100644 --- a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM rexml crass (1.0.6) cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) digest (3.1.0) diff --git a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock index 57df3307488..e7b12f4b7b6 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) diff --git a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock index 159e52c7828..625a94c17ce 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock @@ -12,7 +12,7 @@ PATH remote: .. specs: ddtrace (1.0.0) - debase-ruby_core_source (<= 0.10.15) + debase-ruby_core_source (= 0.10.16) libddwaf (~> 1.3.0.2.0) msgpack @@ -38,7 +38,7 @@ GEM crack (0.4.5) rexml cri (2.15.11) - debase-ruby_core_source (0.10.15) + debase-ruby_core_source (0.10.16) debug_inspector (1.1.0) diff-lcs (1.5.0) docile (1.4.0) From aac13532a4a4163d8e0fc25ac207efc583f483fa Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 12:16:01 +0100 Subject: [PATCH 0039/2133] Rubocop fixes --- lib/datadog/profiling/collectors/stack.rb | 1 - .../collectors/cpu_and_wall_time_spec.rb | 46 +++++++++++++++---- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/lib/datadog/profiling/collectors/stack.rb b/lib/datadog/profiling/collectors/stack.rb index 7ab9e15013a..51e59293faf 100644 --- a/lib/datadog/profiling/collectors/stack.rb +++ b/lib/datadog/profiling/collectors/stack.rb @@ -7,7 +7,6 @@ module Collectors # # Methods prefixed with _native_ are implemented in `collectors_stack.c` class Stack - # This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. # It SHOULD NOT be used for other purposes. def sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames: 400) diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index dd496b357bb..656e871b90a 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -13,9 +13,24 @@ describe '#sample' do let(:ready_queue) { Queue.new } - let!(:t1) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } - let!(:t2) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } - let!(:t3) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t1) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end + let!(:t2) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end + let!(:t3) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end before do 3.times { ready_queue.pop } @@ -44,17 +59,30 @@ def sample_and_decode raise 'Unexpected: Serialization failed' unless serialization_result pprof_data = serialization_result.last - decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) - - decoded_profile + ::Perftools::Profiles::Profile.decode(pprof_data) end end describe '#thread_list' do let(:ready_queue) { Queue.new } - let!(:t1) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } - let!(:t2) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } - let!(:t3) { Thread.new(ready_queue) { |ready_queue| ready_queue << true; sleep } } + let!(:t1) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end + let!(:t2) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end + let!(:t3) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep + end + end before do 3.times { ready_queue.pop } From 1eec19e77376ec8f7bb17ac77db6c8860a51a8dc Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 18:27:32 +0100 Subject: [PATCH 0040/2133] Replace native extension checking/skip code with version from profiling spec_helper No need to repeat it, and the version being deleted caused the native extension to be loaded more than once in the process which could perhaps lead to issues in the future. --- .../profiling/native_extension_spec.rb | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/spec/datadog/profiling/native_extension_spec.rb b/spec/datadog/profiling/native_extension_spec.rb index cc15567e3a0..c0d74d9dcd5 100644 --- a/spec/datadog/profiling/native_extension_spec.rb +++ b/spec/datadog/profiling/native_extension_spec.rb @@ -1,26 +1,9 @@ # typed: false -require 'datadog/profiling/native_extension' +require 'datadog/profiling/spec_helper' RSpec.describe Datadog::Profiling::NativeExtension do - before do - skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? - skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? - - begin - require "ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}" - rescue LoadError - if PlatformHelpers.mac? - skip 'Skipping profiling native extension specs: extension does not seem' \ - 'to be available. (Note that on macOS the extension can only be built if ' \ - 'libddprof is also manually rebuilt from source, since there are no ' \ - 'precompiled macOS binaries for libddprof).' - else - raise 'Profiling native extension does not seem to be compiled. ' \ - 'Try running `bundle exec rake compile` before running this test.' - end - end - end + before { skip_if_profiling_not_supported(self) } describe '.working?' do subject(:working?) { described_class.send(:working?) } From 8543505094b963135f8908cf6a3a379a697e195a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 18:36:26 +0100 Subject: [PATCH 0041/2133] Silence startup log message during integration spec --- spec/datadog/profiling/integration_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index 275959a659a..64979ada43e 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -127,6 +127,8 @@ def stack_two context 'with tracing' do around do |example| + Datadog.configuration.diagnostics.startup_logs.enabled = false + Datadog::Tracing.trace('profiler.test') do |span, trace| @current_span = span @current_root_span = trace.send(:root_span) From 9660e93d813f8d16e9f368377ea2d83d14d10c30 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 24 May 2022 18:44:14 +0100 Subject: [PATCH 0042/2133] Silence profiling log message during spec --- spec/datadog/core/configuration_spec.rb | 1 + spec/datadog/core/diagnostics/environment_logger_spec.rb | 7 ++++++- spec/support/log_helpers.rb | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/datadog/core/configuration_spec.rb b/spec/datadog/core/configuration_spec.rb index 6c27086dd7d..6f37dcaf8ca 100644 --- a/spec/datadog/core/configuration_spec.rb +++ b/spec/datadog/core/configuration_spec.rb @@ -85,6 +85,7 @@ # Enable test_class.configure do |c| c.diagnostics.debug = true + c.logger.instance = Datadog::Core::Logger.new(StringIO.new) end # Assert state change diff --git a/spec/datadog/core/diagnostics/environment_logger_spec.rb b/spec/datadog/core/diagnostics/environment_logger_spec.rb index d1e104096de..d0035ea49aa 100644 --- a/spec/datadog/core/diagnostics/environment_logger_spec.rb +++ b/spec/datadog/core/diagnostics/environment_logger_spec.rb @@ -187,7 +187,12 @@ end context 'with debug enabled' do - before { Datadog.configure { |c| c.diagnostics.debug = true } } + before do + Datadog.configure do |c| + c.diagnostics.debug = true + c.logger.instance = Datadog::Core::Logger.new(StringIO.new) + end + end it { is_expected.to include debug: true } end diff --git a/spec/support/log_helpers.rb b/spec/support/log_helpers.rb index 0c8fd02b50e..ec16a862cc3 100644 --- a/spec/support/log_helpers.rb +++ b/spec/support/log_helpers.rb @@ -65,7 +65,10 @@ def without_errors end after do - Datadog.configure { |c| c.logger.instance = @default_logger } + Datadog.configure do |c| + c.logger.instance = @default_logger + c.diagnostics.debug = false + end end # Checks buffer to see if it contains lines that match all patterns. From aa589b16f1d3ee57b73f8fbd7bf27bcb2782b8db Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 7 Feb 2022 15:46:06 +0000 Subject: [PATCH 0043/2133] Introduce new Datadog::Profiling::Flush class --- lib/datadog/profiling/flush.rb | 27 +++++++++++++++++++++++ spec/datadog/profiling/flush_spec.rb | 33 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index 7ea80299d18..0836145bad5 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -65,5 +65,32 @@ def initialize( # Represents a collection of events of a specific type being flushed. EventGroup = Struct.new(:event_class, :events).freeze + + # Entity class used to represent metadata for a given profile + class Flush + attr_reader \ + :start, + :finish, + :pprof_file_name, + :pprof_data, # gzipped pprof bytes + :code_provenance_file_name, + :code_provenance_data # gzipped json bytes + + def initialize( + start:, + finish:, + pprof_file_name:, + pprof_data:, + code_provenance_file_name:, + code_provenance_data: + ) + @start = start + @finish = finish + @pprof_file_name = pprof_file_name + @pprof_data = pprof_data + @code_provenance_file_name = code_provenance_file_name + @code_provenance_data = code_provenance_data + end + end end end diff --git a/spec/datadog/profiling/flush_spec.rb b/spec/datadog/profiling/flush_spec.rb index 0ad6970beb0..69d62b822f0 100644 --- a/spec/datadog/profiling/flush_spec.rb +++ b/spec/datadog/profiling/flush_spec.rb @@ -98,3 +98,36 @@ end end end + +RSpec.describe Datadog::Profiling::Flush do + describe '.new' do + let(:start) { instance_double(Time, 'start time') } + let(:finish) { instance_double(Time, 'finish time') } + let(:pprof_file_name) { 'the_pprof_file_name.pprof' } + let(:pprof_data) { 'the_pprof_data' } + let(:code_provenance_file_name) { 'the_code_provenance_file_name.json' } + let(:code_provenance_data) { 'the_code_provenance_data' } + + subject(:flush) do + described_class.new( + start: start, + finish: finish, + pprof_file_name: pprof_file_name, + pprof_data: pprof_data, + code_provenance_file_name: code_provenance_file_name, + code_provenance_data: code_provenance_data, + ) + end + + it do + expect(flush).to have_attributes( + start: start, + finish: finish, + pprof_file_name: pprof_file_name, + pprof_data: pprof_data, + code_provenance_file_name: code_provenance_file_name, + code_provenance_data: code_provenance_data, + ) + end + end +end From 82e74e31c6dae14ee63483041854c001b44dc219 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 1 Mar 2022 11:07:49 +0000 Subject: [PATCH 0044/2133] [PROF-4780] Add `HttpTransport` class to report profiles through libddprof One of the features provided by `libddprof` is reporting profiles. The `HttpTransport` class exposes this functionality to Ruby code, and will in the future replace most of the code in `lib/datadog/profiling/transport/. This commit and PR only adds the `HttpTransport` without wiring it up; that will come in a separate PR. --- .../http_transport.c | 285 +++++++++++++ .../profiling.c | 2 + lib/datadog/profiling/http_transport.rb | 131 ++++++ spec/datadog/profiling/http_transport_spec.rb | 384 ++++++++++++++++++ 4 files changed, 802 insertions(+) create mode 100644 ext/ddtrace_profiling_native_extension/http_transport.c create mode 100644 lib/datadog/profiling/http_transport.rb create mode 100644 spec/datadog/profiling/http_transport_spec.rb diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c new file mode 100644 index 00000000000..e91a1c0ee18 --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -0,0 +1,285 @@ +#include +#include +#include + +// Used to report profiling data to Datadog. +// This file implements the native bits of the Datadog::Profiling::HttpTransport class + +// Datadog::Profiling::HttpTransport::Exporter +// This is used to wrap a native pointer to a libddprof exporter as a Ruby object of this class; +// see exporter_as_ruby_object below for more details +static VALUE exporter_class = Qnil; + +static VALUE ok_symbol = Qnil; // :ok in Ruby +static VALUE error_symbol = Qnil; // :error in Ruby + +#define byte_slice_from_literal(string) ((ddprof_ffi_ByteSlice) {.ptr = (uint8_t *) "" string, .len = sizeof("" string) - 1}) + +struct call_exporter_without_gvl_arguments { + ddprof_ffi_ProfileExporterV3 *exporter; + ddprof_ffi_Request *request; + ddprof_ffi_SendResult result; +}; + +inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string); +static VALUE _native_create_agentless_exporter(VALUE self, VALUE site, VALUE api_key, VALUE tags_as_array); +static VALUE _native_create_agent_exporter(VALUE self, VALUE base_url, VALUE tags_as_array); +static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_as_array); +static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array); +static void exporter_as_ruby_object_free(void *data); +static VALUE exporter_to_ruby_object(ddprof_ffi_ProfileExporterV3* exporter); +static VALUE _native_do_export( + VALUE self, + VALUE libddprof_exporter, + VALUE upload_timeout_milliseconds, + VALUE start_timespec_seconds, + VALUE start_timespec_nanoseconds, + VALUE finish_timespec_seconds, + VALUE finish_timespec_nanoseconds, + VALUE pprof_file_name, + VALUE pprof_data, + VALUE code_provenance_file_name, + VALUE code_provenance_data +); +static ddprof_ffi_Request *build_request( + ddprof_ffi_ProfileExporterV3 *exporter, + VALUE upload_timeout_milliseconds, + VALUE start_timespec_seconds, + VALUE start_timespec_nanoseconds, + VALUE finish_timespec_seconds, + VALUE finish_timespec_nanoseconds, + VALUE pprof_file_name, + VALUE pprof_data, + VALUE code_provenance_file_name, + VALUE code_provenance_data +); +static void *call_exporter_without_gvl(void *exporter_and_request); + +void http_transport_init(VALUE profiling_module) { + VALUE http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject); + + rb_define_singleton_method( + http_transport_class, "_native_create_agentless_exporter", _native_create_agentless_exporter, 3 + ); + rb_define_singleton_method( + http_transport_class, "_native_create_agent_exporter", _native_create_agent_exporter, 2 + ); + rb_define_singleton_method( + http_transport_class, "_native_do_export", _native_do_export, 10 + ); + + exporter_class = rb_define_class_under(http_transport_class, "Exporter", rb_cObject); + // This prevents creation of the exporter class outside of our extension, see https://bugs.ruby-lang.org/issues/18007 + rb_undef_alloc_func(exporter_class); + + ok_symbol = ID2SYM(rb_intern("ok")); + error_symbol = ID2SYM(rb_intern("error")); +} + +inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { + Check_Type(string, T_STRING); + ddprof_ffi_ByteSlice byte_slice = {.ptr = (uint8_t *) StringValuePtr(string), .len = RSTRING_LEN(string)}; + return byte_slice; +} + +static VALUE _native_create_agentless_exporter(VALUE self, VALUE site, VALUE api_key, VALUE tags_as_array) { + Check_Type(site, T_STRING); + Check_Type(api_key, T_STRING); + Check_Type(tags_as_array, T_ARRAY); + + return create_exporter( + ddprof_ffi_EndpointV3_agentless( + byte_slice_from_ruby_string(site), + byte_slice_from_ruby_string(api_key) + ), + tags_as_array + ); +} + +static VALUE _native_create_agent_exporter(VALUE self, VALUE base_url, VALUE tags_as_array) { + Check_Type(base_url, T_STRING); + Check_Type(tags_as_array, T_ARRAY); + + return create_exporter( + ddprof_ffi_EndpointV3_agent(byte_slice_from_ruby_string(base_url)), + tags_as_array + ); +} + +static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_as_array) { + long tags_count = rb_array_len(tags_as_array); + ddprof_ffi_Tag converted_tags[tags_count]; + + convert_tags(converted_tags, tags_count, tags_as_array); + + struct ddprof_ffi_NewProfileExporterV3Result exporter_result = + ddprof_ffi_ProfileExporterV3_new( + byte_slice_from_literal("ruby"), + (ddprof_ffi_Slice_tag) {.ptr = converted_tags, .len = tags_count}, + endpoint + ); + + if (exporter_result.tag != DDPROF_FFI_NEW_PROFILE_EXPORTER_V3_RESULT_OK) { + VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); + ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); // Clean up result + return rb_ary_new_from_args(2, error_symbol, failure_details); + } + + VALUE exporter = exporter_to_ruby_object(exporter_result.ok); + // No need to call the result dtor, since the only heap-allocated part is the exporter and we like that part + + return rb_ary_new_from_args(2, ok_symbol, exporter); +} + +static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array) { + Check_Type(tags_as_array, T_ARRAY); + + for (long i = 0; i < tags_count; i++) { + VALUE name_value_pair = rb_ary_entry(tags_as_array, i); + Check_Type(name_value_pair, T_ARRAY); + + // Note: We can index the array without checking its size first because rb_ary_entry returns Qnil if out of bounds + VALUE tag_name = rb_ary_entry(name_value_pair, 0); + VALUE tag_value = rb_ary_entry(name_value_pair, 1); + Check_Type(tag_name, T_STRING); + Check_Type(tag_value, T_STRING); + + converted_tags[i] = (ddprof_ffi_Tag) { + .name = byte_slice_from_ruby_string(tag_name), + .value = byte_slice_from_ruby_string(tag_value) + }; + } +} + +// This structure is used to define a Ruby object that stores a pointer to a ddprof_ffi_ProfileExporterV3 instance +// See also https://github.com/ruby/ruby/blob/master/doc/extension.rdoc for how this works +static const rb_data_type_t exporter_as_ruby_object = { + .wrap_struct_name = "Datadog::Profiling::HttpTransport::Exporter", + .function = { + .dfree = exporter_as_ruby_object_free, + .dsize = NULL, // We don't track exporter memory usage + // No need to provide dmark nor dcompact because we don't reference Ruby VALUEs from inside this object + }, + .flags = RUBY_TYPED_FREE_IMMEDIATELY +}; + +static void exporter_as_ruby_object_free(void *data) { + ddprof_ffi_ProfileExporterV3_delete((ddprof_ffi_ProfileExporterV3 *) data); +} + +static VALUE exporter_to_ruby_object(ddprof_ffi_ProfileExporterV3* exporter) { + return TypedData_Wrap_Struct(exporter_class, &exporter_as_ruby_object, exporter); +} + +static VALUE _native_do_export( + VALUE self, + VALUE libddprof_exporter, + VALUE upload_timeout_milliseconds, + VALUE start_timespec_seconds, + VALUE start_timespec_nanoseconds, + VALUE finish_timespec_seconds, + VALUE finish_timespec_nanoseconds, + VALUE pprof_file_name, + VALUE pprof_data, + VALUE code_provenance_file_name, + VALUE code_provenance_data +) { + Check_TypedStruct(libddprof_exporter, &exporter_as_ruby_object); + + ddprof_ffi_ProfileExporterV3 *exporter; + TypedData_Get_Struct(libddprof_exporter, ddprof_ffi_ProfileExporterV3, &exporter_as_ruby_object, exporter); + + ddprof_ffi_Request *request = + build_request( + exporter, + upload_timeout_milliseconds, + start_timespec_seconds, + start_timespec_nanoseconds, + finish_timespec_seconds, + finish_timespec_nanoseconds, + pprof_file_name, + pprof_data, + code_provenance_file_name, + code_provenance_data + ); + + // We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this + // is pending + struct call_exporter_without_gvl_arguments args = {.exporter = exporter, .request = request}; + // TODO: We don't provide a function to interrupt reporting, which means this thread will be blocked until + // call_exporter_without_gvl returns. + rb_thread_call_without_gvl(call_exporter_without_gvl, &args, NULL, NULL); + ddprof_ffi_SendResult result = args.result; + + // The request does not need to be freed as libddprof takes care of it. + + if (result.tag != DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { + VALUE failure_details = rb_str_new((char *) result.failure.ptr, result.failure.len); + ddprof_ffi_Buffer_reset(&result.failure); // Clean up result + return rb_ary_new_from_args(2, error_symbol, failure_details); + } + + return rb_ary_new_from_args(2, ok_symbol, UINT2NUM(result.http_response.code)); +} + +static ddprof_ffi_Request *build_request( + ddprof_ffi_ProfileExporterV3 *exporter, + VALUE upload_timeout_milliseconds, + VALUE start_timespec_seconds, + VALUE start_timespec_nanoseconds, + VALUE finish_timespec_seconds, + VALUE finish_timespec_nanoseconds, + VALUE pprof_file_name, + VALUE pprof_data, + VALUE code_provenance_file_name, + VALUE code_provenance_data +) { + Check_Type(upload_timeout_milliseconds, T_FIXNUM); + Check_Type(start_timespec_seconds, T_FIXNUM); + Check_Type(start_timespec_nanoseconds, T_FIXNUM); + Check_Type(finish_timespec_seconds, T_FIXNUM); + Check_Type(finish_timespec_nanoseconds, T_FIXNUM); + Check_Type(pprof_file_name, T_STRING); + Check_Type(pprof_data, T_STRING); + Check_Type(code_provenance_file_name, T_STRING); + Check_Type(code_provenance_data, T_STRING); + + uint64_t timeout_milliseconds = NUM2ULONG(upload_timeout_milliseconds); + + ddprof_ffi_Timespec start = + {.seconds = NUM2LONG(start_timespec_seconds), .nanoseconds = NUM2UINT(start_timespec_nanoseconds)}; + ddprof_ffi_Timespec finish = + {.seconds = NUM2LONG(finish_timespec_seconds), .nanoseconds = NUM2UINT(finish_timespec_nanoseconds)}; + + ddprof_ffi_Buffer *pprof_buffer = + ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { + .ptr = (uint8_t *) StringValuePtr(pprof_data), + .len = RSTRING_LEN(pprof_data) + }); + ddprof_ffi_Buffer *code_provenance_buffer = + ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { + .ptr = (uint8_t *) StringValuePtr(code_provenance_data), + .len = RSTRING_LEN(code_provenance_data) + }); + + const ddprof_ffi_File files[] = { + {.name = byte_slice_from_ruby_string(pprof_file_name), .file = pprof_buffer}, + {.name = byte_slice_from_ruby_string(code_provenance_file_name), .file = code_provenance_buffer} + }; + ddprof_ffi_Slice_file slice_files = {.ptr = files, .len = (sizeof(files) / sizeof(ddprof_ffi_File))}; + + ddprof_ffi_Request *request = + ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, timeout_milliseconds); + + // We don't need to free pprof_buffer nor code_provenance_buffer because libddprof takes care of it. + + return request; +} + +static void *call_exporter_without_gvl(void *exporter_and_request) { + struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) exporter_and_request; + + args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request); + + return NULL; // Unused +} diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index 04f3361d5cf..e0669157bda 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -4,6 +4,7 @@ // Each class/module here is implemented in their separate file void collectors_stack_init(VALUE profiling_module); +void http_transport_init(VALUE profiling_module); void stack_recorder_init(VALUE profiling_module); static VALUE native_working_p(VALUE self); @@ -21,6 +22,7 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { rb_define_singleton_method(native_extension_module, "clock_id_for", clock_id_for, 1); // from clock_id.h collectors_stack_init(profiling_module); + http_transport_init(profiling_module); stack_recorder_init(profiling_module); } diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb new file mode 100644 index 00000000000..68a18cb528c --- /dev/null +++ b/lib/datadog/profiling/http_transport.rb @@ -0,0 +1,131 @@ +# typed: false + +module Datadog + module Profiling + # Used to report profiling data to Datadog. + # Methods prefixed with _native_ are implemented in `http_transport.c` + class HttpTransport + def initialize(agent_settings:, site:, api_key:, tags:, upload_timeout_seconds:) + @upload_timeout_milliseconds = (upload_timeout_seconds * 1_000).to_i + + validate_agent_settings(agent_settings) + + tags_as_array = tags.to_a + + status, result = + if site && api_key && agentless_allowed? + create_agentless_exporter(site, api_key, tags_as_array) + else + create_agent_exporter(base_url_from(agent_settings), tags_as_array) + end + + if status == :ok + @libddprof_exporter = result + else # :error + raise(ArgumentError, "Failed to initialize transport: #{result}") + end + end + + def export(flush) + status, result = do_export( + libddprof_exporter: @libddprof_exporter, + upload_timeout_milliseconds: @upload_timeout_milliseconds, + + # why "timespec"? + # libddprof represents time using POSIX's struct timespec, see + # https://www.gnu.org/software/libc/manual/html_node/Time-Types.html + # aka it represents the seconds part separate from the nanoseconds part + start_timespec_seconds: flush.start.tv_sec, + start_timespec_nanoseconds: flush.start.tv_nsec, + finish_timespec_seconds: flush.finish.tv_sec, + finish_timespec_nanoseconds: flush.finish.tv_nsec, + + pprof_file_name: flush.pprof_file_name, + pprof_data: flush.pprof_data, + code_provenance_file_name: flush.code_provenance_file_name, + code_provenance_data: flush.code_provenance_data, + ) + + if status == :ok + if (200..299).cover?(result) + Datadog.logger.debug('Successfully reported profiling data') + true + else + Datadog.logger.error("Failed to report profiling data: server returned unexpected HTTP #{result} status code") + false + end + else + Datadog.logger.error("Failed to report profiling data: #{result}") + false + end + end + + private + + def base_url_from(agent_settings) + case agent_settings.adapter + when Datadog::Transport::Ext::HTTP::ADAPTER + "#{agent_settings.ssl ? 'https' : 'http'}://#{agent_settings.hostname}:#{agent_settings.port}/" + when Datadog::Transport::Ext::UnixSocket::ADAPTER + "unix://#{agent_settings.uds_path}" + else + raise ArgumentError, "Unexpected adapter: #{agent_settings.adapter}" + end + end + + def validate_agent_settings(agent_settings) + supported_adapters = [Datadog::Transport::Ext::HTTP::ADAPTER, Datadog::Transport::Ext::UnixSocket::ADAPTER] + unless supported_adapters.include?(agent_settings.adapter) + raise ArgumentError, "Unsupported transport configuration for profiling: Adapter #{agent_settings.adapter} " \ + ' is not supported' + end + + # FIXME: Currently the transport_configuration_proc is the only public API available for enable reporting + # via unix domain sockets. Not supporting it means not supporting Unix Domain Sockets in practice. + # This will need to be fixed before we make HttpTransport the default option for reporting profiles. + if agent_settings.deprecated_for_removal_transport_configuration_proc + raise ArgumentError, + 'Unsupported agent configuration for profiling: custom c.tracer.transport_options is currently unsupported.' + end + end + + def agentless_allowed? + Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false) + end + + def create_agentless_exporter(site, api_key, tags_as_array) + self.class._native_create_agentless_exporter(site, api_key, tags_as_array) + end + + def create_agent_exporter(base_url, tags_as_array) + self.class._native_create_agent_exporter(base_url, tags_as_array) + end + + def do_export( + libddprof_exporter:, + upload_timeout_milliseconds:, + start_timespec_seconds:, + start_timespec_nanoseconds:, + finish_timespec_seconds:, + finish_timespec_nanoseconds:, + pprof_file_name:, + pprof_data:, + code_provenance_file_name:, + code_provenance_data: + ) + self.class._native_do_export( + libddprof_exporter, + upload_timeout_milliseconds, + start_timespec_seconds, + start_timespec_nanoseconds, + finish_timespec_seconds, + finish_timespec_nanoseconds, + pprof_file_name, + pprof_data, + code_provenance_file_name, + code_provenance_data, + ) + end + end + end +end diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb new file mode 100644 index 00000000000..644c3028f5a --- /dev/null +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -0,0 +1,384 @@ +# typed: ignore + +require 'datadog/profiling/spec_helper' + +require 'datadog/profiling/http_transport' +require 'datadog/profiling' + +require 'webrick' +require 'socket' + +# Design note for this class's specs: from the Ruby code side, we're treating the `_native_` methods as an API +# between the Ruby code and the native methods, and thus in this class we have a bunch of tests to make sure the +# native methods are invoked correctly. +# +# We also have "integration" specs, where we exercise the Ruby code together with the C code and libddprof to ensure +# that things come out of libddprof as we expected. +RSpec.describe Datadog::Profiling::HttpTransport do + before { skip_if_profiling_not_supported(self) } + + subject(:http_transport) do + described_class.new( + agent_settings: agent_settings, + site: site, + api_key: api_key, + tags: tags, + upload_timeout_seconds: upload_timeout_seconds, + ) + end + + let(:agent_settings) do + Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings.new( + adapter: adapter, + uds_path: uds_path, + ssl: ssl, + hostname: hostname, + port: port, + deprecated_for_removal_transport_configuration_proc: deprecated_for_removal_transport_configuration_proc, + timeout_seconds: nil, + ) + end + let(:adapter) { Datadog::Transport::Ext::HTTP::ADAPTER } + let(:uds_path) { nil } + let(:ssl) { false } + let(:hostname) { '192.168.0.1' } + let(:port) { '12345' } + let(:deprecated_for_removal_transport_configuration_proc) { nil } + let(:site) { nil } + let(:api_key) { nil } + let(:tags) { { 'tag_a' => 'value_a', 'tag_b' => 'value_b' } } + let(:upload_timeout_seconds) { 123 } + + let(:flush) do + Datadog::Profiling::Flush.new( + start: start, + finish: finish, + pprof_file_name: pprof_file_name, + pprof_data: pprof_data, + code_provenance_file_name: code_provenance_file_name, + code_provenance_data: code_provenance_data, + ) + end + let(:start_timestamp) { '2022-02-07T15:59:53.987654321Z' } + let(:end_timestamp) { '2023-11-11T16:00:00.123456789Z' } + let(:start) { Time.iso8601(start_timestamp) } + let(:finish) { Time.iso8601(end_timestamp) } + let(:pprof_file_name) { 'the_pprof_file_name.pprof' } + let(:pprof_data) { 'the_pprof_data' } + let(:code_provenance_file_name) { 'the_code_provenance_file_name.json' } + let(:code_provenance_data) { 'the_code_provenance_data' } + + describe '#initialize' do + let(:tags_as_array) { [%w[tag_a value_a], %w[tag_b value_b]] } + + context 'when agent_settings are provided' do + it 'creates an agent exporter with the given settings' do + expect(described_class) + .to receive(:_native_create_agent_exporter) + .with('http://192.168.0.1:12345/', tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport + end + + context 'when ssl is enabled' do + let(:ssl) { true } + + it 'creates an agent exporter that reports over https' do + expect(described_class) + .to receive(:_native_create_agent_exporter) + .with('https://192.168.0.1:12345/', tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport + end + end + + context 'when agent_settings requests a unix domain socket' do + let(:adapter) { Datadog::Transport::Ext::UnixSocket::ADAPTER } + let(:uds_path) { '/var/run/datadog/apm.socket' } + + it 'creates an agent exporter that reports over a unix domain socket' do + expect(described_class) + .to receive(:_native_create_agent_exporter) + .with('unix:///var/run/datadog/apm.socket', tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport + end + end + + context 'when agent_settings includes a deprecated_for_removal_transport_configuration_proc' do + let(:deprecated_for_removal_transport_configuration_proc) { instance_double(Proc, 'Configuration proc') } + + it do + expect { http_transport }.to raise_error(ArgumentError, /c.tracer.transport_options is currently unsupported/) + end + end + + context 'when agent_settings requests an unsupported transport' do + let(:adapter) { :test } + + it do + expect { http_transport }.to raise_error(ArgumentError, /Unsupported transport/) + end + end + end + + context 'when additionally site and api_key are provided' do + let(:site) { 'test.datadoghq.com' } + let(:api_key) { SecureRandom.uuid } + + it 'ignores them and creates an agent exporter using the agent_settings' do + expect(described_class) + .to receive(:_native_create_agent_exporter) + .with('http://192.168.0.1:12345/', tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport + end + + context 'when agentless mode is allowed' do + around do |example| + ClimateControl.modify('DD_PROFILING_AGENTLESS' => 'true') do + example.run + end + end + + it 'creates an agentless exporter with the given site and api key' do + expect(described_class) + .to receive(:_native_create_agentless_exporter) + .with(site, api_key, tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport + end + end + end + + context 'when an invalid configuration is provided' do + let(:port) { 1_000_000_000.to_s } + + it do + expect { http_transport }.to raise_error(ArgumentError, /Failed to initialize transport/) + end + end + end + + describe '#export' do + subject(:export) { http_transport.export(flush) } + + it 'calls the native export method with the data from the flush' do + # Manually converted from the lets above :) + upload_timeout_milliseconds = 123_000 + start_timespec_seconds = 1644249593 + start_timespec_nanoseconds = 987654321 + finish_timespec_seconds = 1699718400 + finish_timespec_nanoseconds = 123456789 + + expect(described_class).to receive(:_native_do_export).with( + kind_of(Datadog::Profiling::HttpTransport::Exporter), + upload_timeout_milliseconds, + start_timespec_seconds, + start_timespec_nanoseconds, + finish_timespec_seconds, + finish_timespec_nanoseconds, + pprof_file_name, + pprof_data, + code_provenance_file_name, + code_provenance_data + ).and_return([:ok, 200]) + + export + end + + context 'when export was successful' do + before do + expect(described_class).to receive(:_native_do_export).and_return([:ok, 200]) + end + + it 'logs a debug message' do + expect(Datadog.logger).to receive(:debug).with('Successfully reported profiling data') + + export + end + + it { is_expected.to be true } + end + + context 'when failed' do + before do + expect(described_class).to receive(:_native_do_export).and_return([:ok, 500]) + allow(Datadog.logger).to receive(:error) + end + + it 'logs an error message' do + expect(Datadog.logger).to receive(:error) + + export + end + + it { is_expected.to be false } + end + end + + context 'integration testing' do + shared_context 'HTTP server' do + let(:server) do + WEBrick::HTTPServer.new( + Port: port, + Logger: log, + AccessLog: access_log, + StartCallback: -> { init_signal.push(1) } + ) + end + let(:hostname) { '127.0.0.1' } + let(:port) { 6006 } + let(:log) { WEBrick::Log.new(log_buffer) } + let(:log_buffer) { StringIO.new } + let(:access_log) { [[log_buffer, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] } + let(:server_proc) do + proc do |req, res| + messages << req.tap { req.body } # Read body, store message before socket closes. + res.body = '{}' + end + end + let(:init_signal) { Queue.new } + + let(:messages) { [] } + + before do + server.mount_proc('/', &server_proc) + @server_thread = Thread.new { server.start } + init_signal.pop + end + + after do + unless RSpec.current_example.skipped? + # When the test is skipped, server has not been initialized and @server_thread would be nil; thus we only + # want to touch them when the test actually run, otherwise we would cause the server to start (incorrectly) + # and join to be called on a nil @server_thread + server.shutdown + @server_thread.join + end + end + end + + include_context 'HTTP server' + + let(:request) { messages.first } + + let(:hostname) { '127.0.0.1' } + let(:port) { '6006' } + + shared_examples 'correctly reports profiling data' do + it 'correctly reports profiling data' do + success = http_transport.export(flush) + + expect(success).to be true + + expect(request.header).to include( + 'content-type' => [%r{^multipart/form-data; boundary=(.+)}], + ) + + # check body + boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] + body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) + + expect(body).to include( + 'version' => '3', + 'family' => 'ruby', + 'start' => start_timestamp, + 'end' => end_timestamp, + "data[#{pprof_file_name}]" => pprof_data, + "data[#{code_provenance_file_name}]" => code_provenance_data, + ) + + tags = body['tags[]'].list + expect(tags).to include('tag_a:value_a', 'tag_b:value_b') + end + end + + include_examples 'correctly reports profiling data' + + it 'exports data via http to the agent url' do + http_transport.export(flush) + + expect(request.request_uri.to_s).to eq 'http://127.0.0.1:6006/profiling/v1/input' + end + + context 'via unix domain socket' do + before { pending 'Support for reporting via unix domain socket in libddprof is still work in progress' } + + let(:temporary_directory) { Dir.mktmpdir } + let(:socket_path) { "#{temporary_directory}/rspec_unix_domain_socket" } + let(:unix_domain_socket) { UNIXServer.new(socket_path) } # Closing the socket is handled by webrick + let(:server) do + server = WEBrick::HTTPServer.new( + DoNotListen: true, + Logger: log, + AccessLog: access_log, + StartCallback: -> { init_signal.push(1) } + ) + server.listeners << unix_domain_socket + server + end + let(:adapter) { Datadog::Transport::Ext::UnixSocket::ADAPTER } + let(:uds_path) { socket_path } + + after do + begin + FileUtils.remove_entry(temporary_directory) + rescue Errno::ENOENT => _e + # Do nothing, it's ok + end + end + + include_examples 'correctly reports profiling data' + end + + context 'when agent is down' do + before do + server.shutdown + @server_thread.join + end + + it 'logs an error' do + expect(Datadog.logger).to receive(:error).with(/error trying to connect/) + + http_transport.export(flush) + end + end + + context 'when request times out' do + let(:upload_timeout_seconds) { 0.001 } + let(:server_proc) { proc { sleep 0.05 } } + + it 'logs an error' do + expect(Datadog.logger).to receive(:error).with(/timed out/) + + http_transport.export(flush) + end + end + + context 'when server returns a 4xx failure' do + let(:server_proc) { proc { |_req, res| res.status = 418 } } + + it 'logs an error' do + expect(Datadog.logger).to receive(:error).with(/unexpected HTTP 418/) + + http_transport.export(flush) + end + end + + context 'when server returns a 5xx failure' do + let(:server_proc) { proc { |_req, res| res.status = 503 } } + + it 'logs an error' do + expect(Datadog.logger).to receive(:error).with(/unexpected HTTP 503/) + + http_transport.export(flush) + end + end + end +end From 3dbf07e7516e4bcdcea7aa44f59b954f179a9338 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 2 Mar 2022 10:37:29 +0000 Subject: [PATCH 0045/2133] Allocate memory for tags array on the heap, instead of in the stack The number of tags is variable, and we expect not that big, but the failure sematics of stack allocation are completely bonkers so let's just switch this to a regular heap allocation. --- ext/ddtrace_profiling_native_extension/http_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index e91a1c0ee18..6270778a424 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -108,7 +108,9 @@ static VALUE _native_create_agent_exporter(VALUE self, VALUE base_url, VALUE tag static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_as_array) { long tags_count = rb_array_len(tags_as_array); - ddprof_ffi_Tag converted_tags[tags_count]; + + ddprof_ffi_Tag* converted_tags = xcalloc(tags_count, sizeof(ddprof_ffi_Tag)); + if (converted_tags == NULL) rb_raise(rb_eNoMemError, "Failed to allocate memory for storing tags"); convert_tags(converted_tags, tags_count, tags_as_array); @@ -119,6 +121,8 @@ static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_a endpoint ); + xfree(converted_tags); + if (exporter_result.tag != DDPROF_FFI_NEW_PROFILE_EXPORTER_V3_RESULT_OK) { VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); // Clean up result From f962071c3780c088beed78ffd3781d57c28bebee Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 7 Mar 2022 16:00:23 +0000 Subject: [PATCH 0046/2133] Print warning when transport_configuration_proc is used but do not raise error In https://github.com/DataDog/dd-trace-rb/pull/1932 we did the groundwork required to support parsing the unix domain socket configuration from a c.tracing.transport_options configuration. Thus, we can now support unix domain sockets configured by the user without any other change (assuming that PR is merged before this commit is). The `transport_configuration_proc` can still contain weird transport configurations, but if that's the case, we just ignore them and print a warning. This is because we don't support every setting a user may provide in that proc. Worst case, for customers with a really custom config, is that the profiler won't be able to report data, and the customer will need to reach out to support for help updating it. (But we won't raise an exception or stop the profiler from starting). --- lib/datadog/profiling/http_transport.rb | 8 +++----- spec/datadog/profiling/http_transport_spec.rb | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index 68a18cb528c..87bfa5076f9 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -80,12 +80,10 @@ def validate_agent_settings(agent_settings) ' is not supported' end - # FIXME: Currently the transport_configuration_proc is the only public API available for enable reporting - # via unix domain sockets. Not supporting it means not supporting Unix Domain Sockets in practice. - # This will need to be fixed before we make HttpTransport the default option for reporting profiles. if agent_settings.deprecated_for_removal_transport_configuration_proc - raise ArgumentError, - 'Unsupported agent configuration for profiling: custom c.tracer.transport_options is currently unsupported.' + Datadog.logger.warn( + 'Ignoring custom c.tracing.transport_options setting as the profiler does not support it.' + ) end end diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 644c3028f5a..7cae6c79da2 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -111,8 +111,21 @@ context 'when agent_settings includes a deprecated_for_removal_transport_configuration_proc' do let(:deprecated_for_removal_transport_configuration_proc) { instance_double(Proc, 'Configuration proc') } - it do - expect { http_transport }.to raise_error(ArgumentError, /c.tracer.transport_options is currently unsupported/) + it 'logs a warning message' do + expect(Datadog.logger).to receive(:warn) + + http_transport + end + + it 'creates an agent exporter with the rest of the settings in the agent_settings object' do + allow(Datadog.logger).to receive(:warn) + + expect(described_class) + .to receive(:_native_create_agent_exporter) + .with('http://192.168.0.1:12345/', tags_as_array) + .and_return([:ok, :dummy_exporter]) + + http_transport end end From fdb9e77dcba1ee1062cc6d914a55e442dbff46bc Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 3 Mar 2022 10:35:16 +0000 Subject: [PATCH 0047/2133] Support missing code provenance in `HttpTransport` Code provenance collection can be disabled, and in that case should not be reported. This was already a use case supported by the previous transport code, but it was missed when `HttpTransport` got created. --- .../http_transport.c | 30 ++++++++++++------- spec/datadog/profiling/http_transport_spec.rb | 24 +++++++++++++++ 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 6270778a424..384d094dd9e 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -246,7 +246,9 @@ static ddprof_ffi_Request *build_request( Check_Type(pprof_file_name, T_STRING); Check_Type(pprof_data, T_STRING); Check_Type(code_provenance_file_name, T_STRING); - Check_Type(code_provenance_data, T_STRING); + + // Code provenance can be disabled and in that case will be set to nil + if (!NIL_P(code_provenance_data)) Check_Type(code_provenance_data, T_STRING); uint64_t timeout_milliseconds = NUM2ULONG(upload_timeout_milliseconds); @@ -255,22 +257,28 @@ static ddprof_ffi_Request *build_request( ddprof_ffi_Timespec finish = {.seconds = NUM2LONG(finish_timespec_seconds), .nanoseconds = NUM2UINT(finish_timespec_nanoseconds)}; + int files_to_report = 1 + (NIL_P(code_provenance_data) ? 0 : 1); + + ddprof_ffi_File files[files_to_report]; + ddprof_ffi_Slice_file slice_files = {.ptr = files, .len = files_to_report}; + ddprof_ffi_Buffer *pprof_buffer = ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { .ptr = (uint8_t *) StringValuePtr(pprof_data), .len = RSTRING_LEN(pprof_data) }); - ddprof_ffi_Buffer *code_provenance_buffer = - ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { - .ptr = (uint8_t *) StringValuePtr(code_provenance_data), - .len = RSTRING_LEN(code_provenance_data) - }); - const ddprof_ffi_File files[] = { - {.name = byte_slice_from_ruby_string(pprof_file_name), .file = pprof_buffer}, - {.name = byte_slice_from_ruby_string(code_provenance_file_name), .file = code_provenance_buffer} - }; - ddprof_ffi_Slice_file slice_files = {.ptr = files, .len = (sizeof(files) / sizeof(ddprof_ffi_File))}; + files[0] = (ddprof_ffi_File) {.name = byte_slice_from_ruby_string(pprof_file_name), .file = pprof_buffer}; + + if (!NIL_P(code_provenance_data)) { + ddprof_ffi_Buffer *code_provenance_buffer = + ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { + .ptr = (uint8_t *) StringValuePtr(code_provenance_data), + .len = RSTRING_LEN(code_provenance_data) + }); + + files[1] = (ddprof_ffi_File) {.name = byte_slice_from_ruby_string(code_provenance_file_name), .file = code_provenance_buffer}; + } ddprof_ffi_Request *request = ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, timeout_milliseconds); diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 7cae6c79da2..01f35dc0cb0 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -320,6 +320,30 @@ expect(request.request_uri.to_s).to eq 'http://127.0.0.1:6006/profiling/v1/input' end + context 'when code provenance data is not available' do + let(:code_provenance_data) { nil } + + it 'correctly reports profiling data but does not include code provenance' do + success = http_transport.export(flush) + + expect(success).to be true + + # check body + boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] + body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) + + expect(body).to include( + 'version' => '3', + 'family' => 'ruby', + 'start' => start_timestamp, + 'end' => end_timestamp, + "data[#{pprof_file_name}]" => pprof_data, + ) + + expect(body["data[#{code_provenance_file_name}]"]).to be nil + end + end + context 'via unix domain socket' do before { pending 'Support for reporting via unix domain socket in libddprof is still work in progress' } From bb32d17e162ba5a1dd3ff6f0562320b5f9a23ede Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 9 Mar 2022 13:52:45 +0000 Subject: [PATCH 0048/2133] Update to use new ddprof `File` struct See https://github.com/DataDog/libddprof/pull/33 for details. --- .../http_transport.c | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 384d094dd9e..c44f26d00a7 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -248,7 +248,8 @@ static ddprof_ffi_Request *build_request( Check_Type(code_provenance_file_name, T_STRING); // Code provenance can be disabled and in that case will be set to nil - if (!NIL_P(code_provenance_data)) Check_Type(code_provenance_data, T_STRING); + bool have_code_provenance = !NIL_P(code_provenance_data); + if (have_code_provenance) Check_Type(code_provenance_data, T_STRING); uint64_t timeout_milliseconds = NUM2ULONG(upload_timeout_milliseconds); @@ -257,34 +258,24 @@ static ddprof_ffi_Request *build_request( ddprof_ffi_Timespec finish = {.seconds = NUM2LONG(finish_timespec_seconds), .nanoseconds = NUM2UINT(finish_timespec_nanoseconds)}; - int files_to_report = 1 + (NIL_P(code_provenance_data) ? 0 : 1); - + int files_to_report = 1 + (have_code_provenance ? 1 : 0); ddprof_ffi_File files[files_to_report]; ddprof_ffi_Slice_file slice_files = {.ptr = files, .len = files_to_report}; - ddprof_ffi_Buffer *pprof_buffer = - ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { - .ptr = (uint8_t *) StringValuePtr(pprof_data), - .len = RSTRING_LEN(pprof_data) - }); - - files[0] = (ddprof_ffi_File) {.name = byte_slice_from_ruby_string(pprof_file_name), .file = pprof_buffer}; - - if (!NIL_P(code_provenance_data)) { - ddprof_ffi_Buffer *code_provenance_buffer = - ddprof_ffi_Buffer_from_byte_slice((ddprof_ffi_ByteSlice) { - .ptr = (uint8_t *) StringValuePtr(code_provenance_data), - .len = RSTRING_LEN(code_provenance_data) - }); - - files[1] = (ddprof_ffi_File) {.name = byte_slice_from_ruby_string(code_provenance_file_name), .file = code_provenance_buffer}; + files[0] = (ddprof_ffi_File) { + .name = byte_slice_from_ruby_string(pprof_file_name), + .file = byte_slice_from_ruby_string(pprof_data) + }; + if (have_code_provenance) { + files[1] = (ddprof_ffi_File) { + .name = byte_slice_from_ruby_string(code_provenance_file_name), + .file = byte_slice_from_ruby_string(code_provenance_data) + }; } ddprof_ffi_Request *request = ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, timeout_milliseconds); - // We don't need to free pprof_buffer nor code_provenance_buffer because libddprof takes care of it. - return request; } From 97df5988abe600e6556cc8d46f52a13f4edd1a60 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 8 Mar 2022 09:22:55 +0000 Subject: [PATCH 0049/2133] Add benchmark for `HttpTransport` class This benchmark can be used to evaluate the performance and memory correctness of the `HttpTransport` class. In particular, it was used to fix a memory leak (and to validate that we don't have others), and was used to validate the change where `HttpTransport` creates a new exporter for every report, rather than reusing exporters. --- benchmarks/profiler_http_transport.rb | 116 ++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 benchmarks/profiler_http_transport.rb diff --git a/benchmarks/profiler_http_transport.rb b/benchmarks/profiler_http_transport.rb new file mode 100644 index 00000000000..15fbecca430 --- /dev/null +++ b/benchmarks/profiler_http_transport.rb @@ -0,0 +1,116 @@ +# typed: false + +# Used to quickly run benchmark under RSpec as part of the usual test suite, to validate it didn't bitrot +VALIDATE_BENCHMARK_MODE = ENV['VALIDATE_BENCHMARK'] == 'true' + +return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE + +require 'benchmark/ips' +require 'ddtrace' +require 'pry' +require 'securerandom' +require 'socket' +require_relative 'dogstatsd_reporter' + +# This benchmark measures the performance of the http_transport class used for reporting profiling data +# +# Note when running on macOS: If the benchmark starts failing with a timeout after around ~16k requests, try +# lowering the timeout for keeping ports in the TIME_WAIT state by using sudo sysctl -w net.inet.tcp.msl=1. +# +# The default on my machine is 15000 (15 seconds) which trips this bug quite easily. +# This doesn't seem to be clearly documented anywhere, you just see people rediscovering it on the web, for instance +# in https://gist.github.com/carlos8f/3473107 . If you're curious, the ports show up using the `netstat` tool. +# Behavior on Linux seems to be different (or at least the defaults are way higher). + +class ProfilerHttpTransportBenchmark + def initialize + raise(Datadog::Profiling.unsupported_reason) unless Datadog::Profiling.supported? + + @port = 6006 + start_fake_webserver + + @transport = Datadog::Profiling::HttpTransport.new( + agent_settings: Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings.new( + adapter: Datadog::Transport::Ext::HTTP::ADAPTER, + uds_path: nil, + ssl: false, + hostname: '127.0.0.1', + port: @port, + deprecated_for_removal_transport_configuration_proc: nil, + timeout_seconds: nil, + ), + site: nil, + api_key: nil, + tags: [], + upload_timeout_seconds: 10, + ) + flush_finish = Time.now.utc + @flush = Datadog::Profiling::Flush.new( + start: flush_finish - 60, + finish: flush_finish, + pprof_file_name: 'example_pprof_file_name.pprof', + pprof_data: '', # Random.new(0).bytes(32_000), + code_provenance_file_name: 'example_code_provenance_file_name.json', + code_provenance_data: '', # Random.new(1).bytes(4_000), + ) + end + + def start_fake_webserver + ready_queue = Queue.new + + Thread.new do + server = TCPServer.new(@port || raise('Missing port')) + + ready_queue << true + + loop do + client = server.accept + loop do + line = client.gets + break if line.end_with?("--\r\n") + end + client.write("HTTP/1.0 200 OK\nConnection: close\n\n") + client.close + end + end + + ready_queue.pop + end + + def run_benchmark + Benchmark.ips do |x| + benchmark_time = VALIDATE_BENCHMARK_MODE ? {time: 0.01, warmup: 0} : {time: 70, warmup: 2} + x.config(**benchmark_time, suite: report_to_dogstatsd_if_enabled_via_environment_variable(benchmark_name: 'profiler_http_transport')) + + x.report("http_transport #{ENV['CONFIG']}") do + run_once + end + + x.save! 'profiler-http-transport-results.json' unless VALIDATE_BENCHMARK_MODE + x.compare! + end + end + + def run_forever + while true + 100.times { run_once } + print '.' + end + end + + def run_once + success = @transport.export(@flush) + + raise('Unexpected: Export failed') unless success + end +end + +puts "Current pid is #{Process.pid}" + +ProfilerHttpTransportBenchmark.new.instance_exec do + if ARGV.include?('--forever') + run_forever + else + run_benchmark + end +end From 442421f9c92b414b932a8da1c07cc2939316202c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 10 Mar 2022 11:31:51 +0000 Subject: [PATCH 0050/2133] Refactor `HttpTransport` to not reuse libddprof exporters Reusing the libddprof exporter has a number of disadvantages: * We need to have quite a bit of boilerplate to be able to represent them as Ruby objects * Tags are set at exporter creation, so we would need to somehow tackle the issue of tags such as runtime-id and pid that can change during the lifetime of a process * There were some concerns around libddprof and Ruby apps that fork, although we didn't look into them in much detail After benchmarking both approaches using the `benchmarks/profiler_http_transport.rb` benchmark, the performance of an `HttpTransporter` that does not reuse the exporter is more than acceptable. I measured > 1000 reports per second on my laptop; and the expected usage for this class is one report per minute, so I think we're good. Thus, let's refactor `HttpTransport` to create a new exporter every time we report: * This allows the `tags` to change from report to report (and thus they move back to be part of the `Flush`, as they were in the pre-`HttpTransport` times) * We eliminate the need for the `HttpTransport::Exporter` class that wrapped the native libddprof pointer. * No need to care about potential issues with forks. --- benchmarks/profiler_http_transport.rb | 4 +- .../http_transport.c | 167 +++++++++--------- lib/datadog/profiling/flush.rb | 7 +- lib/datadog/profiling/http_transport.rb | 44 +++-- spec/datadog/profiling/flush_spec.rb | 3 + spec/datadog/profiling/http_transport_spec.rb | 59 +++---- .../profiling/validate_benchmarks_spec.rb | 4 + 7 files changed, 142 insertions(+), 146 deletions(-) diff --git a/benchmarks/profiler_http_transport.rb b/benchmarks/profiler_http_transport.rb index 15fbecca430..1cbd82fc33a 100644 --- a/benchmarks/profiler_http_transport.rb +++ b/benchmarks/profiler_http_transport.rb @@ -15,7 +15,7 @@ # This benchmark measures the performance of the http_transport class used for reporting profiling data # # Note when running on macOS: If the benchmark starts failing with a timeout after around ~16k requests, try -# lowering the timeout for keeping ports in the TIME_WAIT state by using sudo sysctl -w net.inet.tcp.msl=1. +# lowering the timeout for keeping ports in the TIME_WAIT state by using `sudo sysctl -w net.inet.tcp.msl=1`. # # The default on my machine is 15000 (15 seconds) which trips this bug quite easily. # This doesn't seem to be clearly documented anywhere, you just see people rediscovering it on the web, for instance @@ -41,7 +41,6 @@ def initialize ), site: nil, api_key: nil, - tags: [], upload_timeout_seconds: 10, ) flush_finish = Time.now.utc @@ -52,6 +51,7 @@ def initialize pprof_data: '', # Random.new(0).bytes(32_000), code_provenance_file_name: 'example_code_provenance_file_name.json', code_provenance_data: '', # Random.new(1).bytes(4_000), + tags_as_array: [], ) end diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index c44f26d00a7..c53f2098b04 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -5,14 +5,12 @@ // Used to report profiling data to Datadog. // This file implements the native bits of the Datadog::Profiling::HttpTransport class -// Datadog::Profiling::HttpTransport::Exporter -// This is used to wrap a native pointer to a libddprof exporter as a Ruby object of this class; -// see exporter_as_ruby_object below for more details -static VALUE exporter_class = Qnil; - static VALUE ok_symbol = Qnil; // :ok in Ruby static VALUE error_symbol = Qnil; // :error in Ruby +static ID agentless_id; // id of :agentless in Ruby +static ID agent_id; // id of :agent in Ruby + #define byte_slice_from_literal(string) ((ddprof_ffi_ByteSlice) {.ptr = (uint8_t *) "" string, .len = sizeof("" string) - 1}) struct call_exporter_without_gvl_arguments { @@ -22,15 +20,14 @@ struct call_exporter_without_gvl_arguments { }; inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string); -static VALUE _native_create_agentless_exporter(VALUE self, VALUE site, VALUE api_key, VALUE tags_as_array); -static VALUE _native_create_agent_exporter(VALUE self, VALUE base_url, VALUE tags_as_array); -static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_as_array); +static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration); +static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array); +static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result); +static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration); static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array); -static void exporter_as_ruby_object_free(void *data); -static VALUE exporter_to_ruby_object(ddprof_ffi_ProfileExporterV3* exporter); static VALUE _native_do_export( VALUE self, - VALUE libddprof_exporter, + VALUE exporter_configuration, VALUE upload_timeout_milliseconds, VALUE start_timespec_seconds, VALUE start_timespec_nanoseconds, @@ -39,7 +36,8 @@ static VALUE _native_do_export( VALUE pprof_file_name, VALUE pprof_data, VALUE code_provenance_file_name, - VALUE code_provenance_data + VALUE code_provenance_data, + VALUE tags_as_array ); static ddprof_ffi_Request *build_request( ddprof_ffi_ProfileExporterV3 *exporter, @@ -58,22 +56,13 @@ static void *call_exporter_without_gvl(void *exporter_and_request); void http_transport_init(VALUE profiling_module) { VALUE http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject); - rb_define_singleton_method( - http_transport_class, "_native_create_agentless_exporter", _native_create_agentless_exporter, 3 - ); - rb_define_singleton_method( - http_transport_class, "_native_create_agent_exporter", _native_create_agent_exporter, 2 - ); - rb_define_singleton_method( - http_transport_class, "_native_do_export", _native_do_export, 10 - ); - - exporter_class = rb_define_class_under(http_transport_class, "Exporter", rb_cObject); - // This prevents creation of the exporter class outside of our extension, see https://bugs.ruby-lang.org/issues/18007 - rb_undef_alloc_func(exporter_class); + rb_define_singleton_method(http_transport_class, "_native_validate_exporter", _native_validate_exporter, 1); + rb_define_singleton_method(http_transport_class, "_native_do_export", _native_do_export, 11); - ok_symbol = ID2SYM(rb_intern("ok")); - error_symbol = ID2SYM(rb_intern("error")); + ok_symbol = ID2SYM(rb_intern_const("ok")); + error_symbol = ID2SYM(rb_intern_const("error")); + agentless_id = rb_intern_const("agentless"); + agent_id = rb_intern_const("agent"); } inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { @@ -82,57 +71,72 @@ inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { return byte_slice; } -static VALUE _native_create_agentless_exporter(VALUE self, VALUE site, VALUE api_key, VALUE tags_as_array) { - Check_Type(site, T_STRING); - Check_Type(api_key, T_STRING); - Check_Type(tags_as_array, T_ARRAY); +static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) { + Check_Type(exporter_configuration, T_ARRAY); + ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, rb_ary_new()); - return create_exporter( - ddprof_ffi_EndpointV3_agentless( - byte_slice_from_ruby_string(site), - byte_slice_from_ruby_string(api_key) - ), - tags_as_array - ); -} + VALUE failure_tuple = handle_exporter_failure(exporter_result); + if (!NIL_P(failure_tuple)) return failure_tuple; -static VALUE _native_create_agent_exporter(VALUE self, VALUE base_url, VALUE tags_as_array) { - Check_Type(base_url, T_STRING); - Check_Type(tags_as_array, T_ARRAY); + // We don't actually need the exporter for now -- we just wanted to validate that we could create it with the + // settings we were given + ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); - return create_exporter( - ddprof_ffi_EndpointV3_agent(byte_slice_from_ruby_string(base_url)), - tags_as_array - ); + return rb_ary_new_from_args(2, ok_symbol, Qnil); } -static VALUE create_exporter(struct ddprof_ffi_EndpointV3 endpoint, VALUE tags_as_array) { - long tags_count = rb_array_len(tags_as_array); +static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array) { + Check_Type(exporter_configuration, T_ARRAY); + Check_Type(tags_as_array, T_ARRAY); + long tags_count = rb_array_len(tags_as_array); ddprof_ffi_Tag* converted_tags = xcalloc(tags_count, sizeof(ddprof_ffi_Tag)); if (converted_tags == NULL) rb_raise(rb_eNoMemError, "Failed to allocate memory for storing tags"); - convert_tags(converted_tags, tags_count, tags_as_array); - struct ddprof_ffi_NewProfileExporterV3Result exporter_result = - ddprof_ffi_ProfileExporterV3_new( - byte_slice_from_literal("ruby"), - (ddprof_ffi_Slice_tag) {.ptr = converted_tags, .len = tags_count}, - endpoint - ); + ddprof_ffi_NewProfileExporterV3Result exporter_result = ddprof_ffi_ProfileExporterV3_new( + byte_slice_from_literal("ruby"), + (ddprof_ffi_Slice_tag) {.ptr = converted_tags, .len = tags_count}, + endpoint_from(exporter_configuration) + ); xfree(converted_tags); - if (exporter_result.tag != DDPROF_FFI_NEW_PROFILE_EXPORTER_V3_RESULT_OK) { - VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); - ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); // Clean up result - return rb_ary_new_from_args(2, error_symbol, failure_details); + return exporter_result; +} + +static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result) { + if (exporter_result.tag == DDPROF_FFI_NEW_PROFILE_EXPORTER_V3_RESULT_OK) return Qnil; + + VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); + + ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); + + return rb_ary_new_from_args(2, error_symbol, failure_details); +} + +static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { + Check_Type(exporter_configuration, T_ARRAY); + + ID working_mode = SYM2ID(rb_ary_entry(exporter_configuration, 0)); // SYMID verifies its input so we can do this safely + + if (working_mode != agentless_id && working_mode != agent_id) { + rb_raise(rb_eArgError, "Failed to initialize transport: Unexpected working mode, expected :agentless or :agent"); } - VALUE exporter = exporter_to_ruby_object(exporter_result.ok); - // No need to call the result dtor, since the only heap-allocated part is the exporter and we like that part + if (working_mode == agentless_id) { + VALUE site = rb_ary_entry(exporter_configuration, 1); + VALUE api_key = rb_ary_entry(exporter_configuration, 2); + Check_Type(site, T_STRING); + Check_Type(api_key, T_STRING); - return rb_ary_new_from_args(2, ok_symbol, exporter); + return ddprof_ffi_EndpointV3_agentless(byte_slice_from_ruby_string(site), byte_slice_from_ruby_string(api_key)); + } else { // agent_id + VALUE base_url = rb_ary_entry(exporter_configuration, 1); + Check_Type(base_url, T_STRING); + + return ddprof_ffi_EndpointV3_agent(byte_slice_from_ruby_string(base_url)); + } } static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array) { @@ -155,29 +159,9 @@ static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE } } -// This structure is used to define a Ruby object that stores a pointer to a ddprof_ffi_ProfileExporterV3 instance -// See also https://github.com/ruby/ruby/blob/master/doc/extension.rdoc for how this works -static const rb_data_type_t exporter_as_ruby_object = { - .wrap_struct_name = "Datadog::Profiling::HttpTransport::Exporter", - .function = { - .dfree = exporter_as_ruby_object_free, - .dsize = NULL, // We don't track exporter memory usage - // No need to provide dmark nor dcompact because we don't reference Ruby VALUEs from inside this object - }, - .flags = RUBY_TYPED_FREE_IMMEDIATELY -}; - -static void exporter_as_ruby_object_free(void *data) { - ddprof_ffi_ProfileExporterV3_delete((ddprof_ffi_ProfileExporterV3 *) data); -} - -static VALUE exporter_to_ruby_object(ddprof_ffi_ProfileExporterV3* exporter) { - return TypedData_Wrap_Struct(exporter_class, &exporter_as_ruby_object, exporter); -} - static VALUE _native_do_export( VALUE self, - VALUE libddprof_exporter, + VALUE exporter_configuration, VALUE upload_timeout_milliseconds, VALUE start_timespec_seconds, VALUE start_timespec_nanoseconds, @@ -186,12 +170,15 @@ static VALUE _native_do_export( VALUE pprof_file_name, VALUE pprof_data, VALUE code_provenance_file_name, - VALUE code_provenance_data + VALUE code_provenance_data, + VALUE tags_as_array ) { - Check_TypedStruct(libddprof_exporter, &exporter_as_ruby_object); + ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, tags_as_array); - ddprof_ffi_ProfileExporterV3 *exporter; - TypedData_Get_Struct(libddprof_exporter, ddprof_ffi_ProfileExporterV3, &exporter_as_ruby_object, exporter); + VALUE failure_tuple = handle_exporter_failure(exporter_result); + if (!NIL_P(failure_tuple)) return failure_tuple; + + ddprof_ffi_ProfileExporterV3 *exporter = exporter_result.ok; ddprof_ffi_Request *request = build_request( @@ -215,10 +202,14 @@ static VALUE _native_do_export( rb_thread_call_without_gvl(call_exporter_without_gvl, &args, NULL, NULL); ddprof_ffi_SendResult result = args.result; - // The request does not need to be freed as libddprof takes care of it. + // Dispose of the exporter + ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); + + // The request itself does not need to be freed as libddprof takes care of it. if (result.tag != DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { VALUE failure_details = rb_str_new((char *) result.failure.ptr, result.failure.len); + // FIXME: Should this be a free? ddprof_ffi_Buffer_reset(&result.failure); // Clean up result return rb_ary_new_from_args(2, error_symbol, failure_details); } diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index 0836145bad5..b9cf4ac290d 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -74,7 +74,8 @@ class Flush :pprof_file_name, :pprof_data, # gzipped pprof bytes :code_provenance_file_name, - :code_provenance_data # gzipped json bytes + :code_provenance_data, # gzipped json bytes + :tags_as_array def initialize( start:, @@ -82,7 +83,8 @@ def initialize( pprof_file_name:, pprof_data:, code_provenance_file_name:, - code_provenance_data: + code_provenance_data:, + tags_as_array: ) @start = start @finish = finish @@ -90,6 +92,7 @@ def initialize( @pprof_data = pprof_data @code_provenance_file_name = code_provenance_file_name @code_provenance_data = code_provenance_data + @tags_as_array = tags_as_array end end end diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index 87bfa5076f9..02f40c771a3 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -5,30 +5,26 @@ module Profiling # Used to report profiling data to Datadog. # Methods prefixed with _native_ are implemented in `http_transport.c` class HttpTransport - def initialize(agent_settings:, site:, api_key:, tags:, upload_timeout_seconds:) + def initialize(agent_settings:, site:, api_key:, upload_timeout_seconds:) @upload_timeout_milliseconds = (upload_timeout_seconds * 1_000).to_i validate_agent_settings(agent_settings) - tags_as_array = tags.to_a - - status, result = - if site && api_key && agentless_allowed? - create_agentless_exporter(site, api_key, tags_as_array) + @exporter_configuration = + if agentless?(site, api_key) + [:agentless, site, api_key] else - create_agent_exporter(base_url_from(agent_settings), tags_as_array) + [:agent, base_url_from(agent_settings)] end - if status == :ok - @libddprof_exporter = result - else # :error - raise(ArgumentError, "Failed to initialize transport: #{result}") - end + status, result = validate_exporter(@exporter_configuration) + + raise(ArgumentError, "Failed to initialize transport: #{result}") if status == :error end def export(flush) status, result = do_export( - libddprof_exporter: @libddprof_exporter, + exporter_configuration: @exporter_configuration, upload_timeout_milliseconds: @upload_timeout_milliseconds, # why "timespec"? @@ -44,6 +40,8 @@ def export(flush) pprof_data: flush.pprof_data, code_provenance_file_name: flush.code_provenance_file_name, code_provenance_data: flush.code_provenance_data, + + tags_as_array: flush.tags_as_array, ) if status == :ok @@ -87,20 +85,16 @@ def validate_agent_settings(agent_settings) end end - def agentless_allowed? - Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false) - end - - def create_agentless_exporter(site, api_key, tags_as_array) - self.class._native_create_agentless_exporter(site, api_key, tags_as_array) + def agentless?(site, api_key) + site && api_key && Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false) end - def create_agent_exporter(base_url, tags_as_array) - self.class._native_create_agent_exporter(base_url, tags_as_array) + def validate_exporter(exporter_configuration) + self.class._native_validate_exporter(exporter_configuration) end def do_export( - libddprof_exporter:, + exporter_configuration:, upload_timeout_milliseconds:, start_timespec_seconds:, start_timespec_nanoseconds:, @@ -109,10 +103,11 @@ def do_export( pprof_file_name:, pprof_data:, code_provenance_file_name:, - code_provenance_data: + code_provenance_data:, + tags_as_array: ) self.class._native_do_export( - libddprof_exporter, + exporter_configuration, upload_timeout_milliseconds, start_timespec_seconds, start_timespec_nanoseconds, @@ -122,6 +117,7 @@ def do_export( pprof_data, code_provenance_file_name, code_provenance_data, + tags_as_array, ) end end diff --git a/spec/datadog/profiling/flush_spec.rb b/spec/datadog/profiling/flush_spec.rb index 69d62b822f0..73a1b00735e 100644 --- a/spec/datadog/profiling/flush_spec.rb +++ b/spec/datadog/profiling/flush_spec.rb @@ -107,6 +107,7 @@ let(:pprof_data) { 'the_pprof_data' } let(:code_provenance_file_name) { 'the_code_provenance_file_name.json' } let(:code_provenance_data) { 'the_code_provenance_data' } + let(:tags_as_array) { [%w[tag_a value_a], %w[tag_b value_b]] } subject(:flush) do described_class.new( @@ -116,6 +117,7 @@ pprof_data: pprof_data, code_provenance_file_name: code_provenance_file_name, code_provenance_data: code_provenance_data, + tags_as_array: tags_as_array, ) end @@ -127,6 +129,7 @@ pprof_data: pprof_data, code_provenance_file_name: code_provenance_file_name, code_provenance_data: code_provenance_data, + tags_as_array: tags_as_array, ) end end diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 01f35dc0cb0..702bc62291c 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -22,7 +22,6 @@ agent_settings: agent_settings, site: site, api_key: api_key, - tags: tags, upload_timeout_seconds: upload_timeout_seconds, ) end @@ -46,7 +45,6 @@ let(:deprecated_for_removal_transport_configuration_proc) { nil } let(:site) { nil } let(:api_key) { nil } - let(:tags) { { 'tag_a' => 'value_a', 'tag_b' => 'value_b' } } let(:upload_timeout_seconds) { 123 } let(:flush) do @@ -57,6 +55,7 @@ pprof_data: pprof_data, code_provenance_file_name: code_provenance_file_name, code_provenance_data: code_provenance_data, + tags_as_array: tags_as_array, ) end let(:start_timestamp) { '2022-02-07T15:59:53.987654321Z' } @@ -67,16 +66,15 @@ let(:pprof_data) { 'the_pprof_data' } let(:code_provenance_file_name) { 'the_code_provenance_file_name.json' } let(:code_provenance_data) { 'the_code_provenance_data' } + let(:tags_as_array) { [%w[tag_a value_a], %w[tag_b value_b]] } describe '#initialize' do - let(:tags_as_array) { [%w[tag_a value_a], %w[tag_b value_b]] } - context 'when agent_settings are provided' do - it 'creates an agent exporter with the given settings' do + it 'picks the :agent working mode for the exporter' do expect(described_class) - .to receive(:_native_create_agent_exporter) - .with('http://192.168.0.1:12345/', tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agent, 'http://192.168.0.1:12345/']) + .and_return([:ok, nil]) http_transport end @@ -84,11 +82,11 @@ context 'when ssl is enabled' do let(:ssl) { true } - it 'creates an agent exporter that reports over https' do + it 'picks the :agent working mode with https reporting' do expect(described_class) - .to receive(:_native_create_agent_exporter) - .with('https://192.168.0.1:12345/', tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agent, 'https://192.168.0.1:12345/']) + .and_return([:ok, nil]) http_transport end @@ -98,11 +96,11 @@ let(:adapter) { Datadog::Transport::Ext::UnixSocket::ADAPTER } let(:uds_path) { '/var/run/datadog/apm.socket' } - it 'creates an agent exporter that reports over a unix domain socket' do + it 'picks the :agent working mode with unix domain stocket reporting' do expect(described_class) - .to receive(:_native_create_agent_exporter) - .with('unix:///var/run/datadog/apm.socket', tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agent, 'unix:///var/run/datadog/apm.socket']) + .and_return([:ok, nil]) http_transport end @@ -117,13 +115,13 @@ http_transport end - it 'creates an agent exporter with the rest of the settings in the agent_settings object' do + it 'picks working mode from the agent_settings object' do allow(Datadog.logger).to receive(:warn) expect(described_class) - .to receive(:_native_create_agent_exporter) - .with('http://192.168.0.1:12345/', tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agent, 'http://192.168.0.1:12345/']) + .and_return([:ok, nil]) http_transport end @@ -142,11 +140,11 @@ let(:site) { 'test.datadoghq.com' } let(:api_key) { SecureRandom.uuid } - it 'ignores them and creates an agent exporter using the agent_settings' do + it 'ignores them and picks the :agent working mode using the agent_settings' do expect(described_class) - .to receive(:_native_create_agent_exporter) - .with('http://192.168.0.1:12345/', tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agent, 'http://192.168.0.1:12345/']) + .and_return([:ok, nil]) http_transport end @@ -158,11 +156,11 @@ end end - it 'creates an agentless exporter with the given site and api key' do + it 'picks the :agentless working mode with the given site and api key' do expect(described_class) - .to receive(:_native_create_agentless_exporter) - .with(site, api_key, tags_as_array) - .and_return([:ok, :dummy_exporter]) + .to receive(:_native_validate_exporter) + .with([:agentless, site, api_key]) + .and_return([:ok, nil]) http_transport end @@ -190,7 +188,7 @@ finish_timespec_nanoseconds = 123456789 expect(described_class).to receive(:_native_do_export).with( - kind_of(Datadog::Profiling::HttpTransport::Exporter), + kind_of(Array), # exporter_configuration upload_timeout_milliseconds, start_timespec_seconds, start_timespec_nanoseconds, @@ -199,7 +197,8 @@ pprof_file_name, pprof_data, code_provenance_file_name, - code_provenance_data + code_provenance_data, + tags_as_array ).and_return([:ok, 200]) export diff --git a/spec/datadog/profiling/validate_benchmarks_spec.rb b/spec/datadog/profiling/validate_benchmarks_spec.rb index c6015438575..61d6e87f9fe 100644 --- a/spec/datadog/profiling/validate_benchmarks_spec.rb +++ b/spec/datadog/profiling/validate_benchmarks_spec.rb @@ -17,4 +17,8 @@ describe 'profiler_sample_loop' do it('runs without raising errors') { expect_in_fork { load './benchmarks/profiler_sample_loop.rb' } } end + + describe 'profiler_http_transport' do + it('runs without raising errors') { expect_in_fork { load './benchmarks/profiler_http_transport.rb' } } + end end From 20e253e1ccd92b2ad944e2bcb8fe0ed2a468c42a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 11 Mar 2022 10:28:22 +0000 Subject: [PATCH 0051/2133] Replace FIXME with TODO after discussion with team (See comment for notes) --- ext/ddtrace_profiling_native_extension/http_transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index c53f2098b04..65b7dafa936 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -209,7 +209,9 @@ static VALUE _native_do_export( if (result.tag != DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { VALUE failure_details = rb_str_new((char *) result.failure.ptr, result.failure.len); - // FIXME: Should this be a free? + // TODO: This is needed until a proper dtor gets added in libddprof for SendResult; note that the Buffer + // itself is stack-allocated (so there's nothing to free/clean up there), so we only need to make sure its contents + // aren't leaked ddprof_ffi_Buffer_reset(&result.failure); // Clean up result return rb_ary_new_from_args(2, error_symbol, failure_details); } From 17effe14c13ccd4367d29549eafb6ec32c13fee6 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 7 Apr 2022 10:11:30 +0100 Subject: [PATCH 0052/2133] Compatibility fix for legacy rubies `rb_array_len` is not supported on older rubies, but `RARRAY_LEN` is supported by all of 'em. --- ext/ddtrace_profiling_native_extension/http_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 65b7dafa936..90001581111 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -89,7 +89,7 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf Check_Type(exporter_configuration, T_ARRAY); Check_Type(tags_as_array, T_ARRAY); - long tags_count = rb_array_len(tags_as_array); + long tags_count = RARRAY_LEN(tags_as_array); ddprof_ffi_Tag* converted_tags = xcalloc(tags_count, sizeof(ddprof_ffi_Tag)); if (converted_tags == NULL) rb_raise(rb_eNoMemError, "Failed to allocate memory for storing tags"); convert_tags(converted_tags, tags_count, tags_as_array); From c37dc618f9434bf46df52371f163df2c39b4dbfc Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 25 Mar 2022 12:49:16 +0000 Subject: [PATCH 0053/2133] Upgrade HttpTransport to libddprof 0.5.0.1.0 Changes included: * Use the new `DDPROF_FFI_CHARSLICE_C` to replace `byte_slice_from_literal` * Introduce `char_slice_from_ruby_string` and update APIs that now take a char slice in 0.5.0 * Remove pending from Unix Domain Socket tests: they work now (yay!!!) (Note that this commit was first coded against 0.5.0.1.0 and then later rebased on top of master which now has 0.6.0.1.0. I decided to keep it anyway after the rebase.) --- .../http_transport.c | 23 +++++++++++-------- spec/datadog/profiling/http_transport_spec.rb | 4 +--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 90001581111..7247d2976bc 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -11,8 +11,6 @@ static VALUE error_symbol = Qnil; // :error in Ruby static ID agentless_id; // id of :agentless in Ruby static ID agent_id; // id of :agent in Ruby -#define byte_slice_from_literal(string) ((ddprof_ffi_ByteSlice) {.ptr = (uint8_t *) "" string, .len = sizeof("" string) - 1}) - struct call_exporter_without_gvl_arguments { ddprof_ffi_ProfileExporterV3 *exporter; ddprof_ffi_Request *request; @@ -20,6 +18,7 @@ struct call_exporter_without_gvl_arguments { }; inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string); +inline static ddprof_ffi_CharSlice char_slice_from_ruby_string(VALUE string); static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration); static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array); static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result); @@ -71,6 +70,12 @@ inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { return byte_slice; } +inline static ddprof_ffi_CharSlice char_slice_from_ruby_string(VALUE string) { + Check_Type(string, T_STRING); + ddprof_ffi_CharSlice char_slice = {.ptr = StringValuePtr(string), .len = RSTRING_LEN(string)}; + return char_slice; +} + static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) { Check_Type(exporter_configuration, T_ARRAY); ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, rb_ary_new()); @@ -95,7 +100,7 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf convert_tags(converted_tags, tags_count, tags_as_array); ddprof_ffi_NewProfileExporterV3Result exporter_result = ddprof_ffi_ProfileExporterV3_new( - byte_slice_from_literal("ruby"), + DDPROF_FFI_CHARSLICE_C("ruby"), (ddprof_ffi_Slice_tag) {.ptr = converted_tags, .len = tags_count}, endpoint_from(exporter_configuration) ); @@ -130,12 +135,12 @@ static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { Check_Type(site, T_STRING); Check_Type(api_key, T_STRING); - return ddprof_ffi_EndpointV3_agentless(byte_slice_from_ruby_string(site), byte_slice_from_ruby_string(api_key)); + return ddprof_ffi_EndpointV3_agentless(char_slice_from_ruby_string(site), char_slice_from_ruby_string(api_key)); } else { // agent_id VALUE base_url = rb_ary_entry(exporter_configuration, 1); Check_Type(base_url, T_STRING); - return ddprof_ffi_EndpointV3_agent(byte_slice_from_ruby_string(base_url)); + return ddprof_ffi_EndpointV3_agent(char_slice_from_ruby_string(base_url)); } } @@ -153,8 +158,8 @@ static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE Check_Type(tag_value, T_STRING); converted_tags[i] = (ddprof_ffi_Tag) { - .name = byte_slice_from_ruby_string(tag_name), - .value = byte_slice_from_ruby_string(tag_value) + .name = char_slice_from_ruby_string(tag_name), + .value = char_slice_from_ruby_string(tag_value) }; } } @@ -256,12 +261,12 @@ static ddprof_ffi_Request *build_request( ddprof_ffi_Slice_file slice_files = {.ptr = files, .len = files_to_report}; files[0] = (ddprof_ffi_File) { - .name = byte_slice_from_ruby_string(pprof_file_name), + .name = char_slice_from_ruby_string(pprof_file_name), .file = byte_slice_from_ruby_string(pprof_data) }; if (have_code_provenance) { files[1] = (ddprof_ffi_File) { - .name = byte_slice_from_ruby_string(code_provenance_file_name), + .name = char_slice_from_ruby_string(code_provenance_file_name), .file = byte_slice_from_ruby_string(code_provenance_data) }; } diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 702bc62291c..7f4befd9da1 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -168,7 +168,7 @@ end context 'when an invalid configuration is provided' do - let(:port) { 1_000_000_000.to_s } + let(:hostname) { 'this:is:not:a:valid:hostname!!!!' } it do expect { http_transport }.to raise_error(ArgumentError, /Failed to initialize transport/) @@ -344,8 +344,6 @@ end context 'via unix domain socket' do - before { pending 'Support for reporting via unix domain socket in libddprof is still work in progress' } - let(:temporary_directory) { Dir.mktmpdir } let(:socket_path) { "#{temporary_directory}/rspec_unix_domain_socket" } let(:unix_domain_socket) { UNIXServer.new(socket_path) } # Closing the socket is handled by webrick From 74d4fa220433f75a267eaaa80e752f4c7d39d6e4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Apr 2022 11:11:14 +0100 Subject: [PATCH 0054/2133] Upgrade to libddprof 0.6.0.1.0 Changes included: * Use new tag handling API * Minor updates to match API changes (renames, added arguments, etc) --- .../http_transport.c | 62 +++++++++++-------- lib/datadog/profiling/http_transport.rb | 6 ++ spec/datadog/profiling/http_transport_spec.rb | 30 ++++++++- 3 files changed, 70 insertions(+), 28 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 7247d2976bc..7dcd8eab392 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -11,6 +11,10 @@ static VALUE error_symbol = Qnil; // :error in Ruby static ID agentless_id; // id of :agentless in Ruby static ID agent_id; // id of :agent in Ruby +static ID log_failure_to_process_tag_id; // id of :log_failure_to_process_tag in Ruby + +static VALUE http_transport_class = Qnil; + struct call_exporter_without_gvl_arguments { ddprof_ffi_ProfileExporterV3 *exporter; ddprof_ffi_Request *request; @@ -23,7 +27,7 @@ static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array); static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result); static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration); -static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array); +static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array); static VALUE _native_do_export( VALUE self, VALUE exporter_configuration, @@ -53,7 +57,7 @@ static ddprof_ffi_Request *build_request( static void *call_exporter_without_gvl(void *exporter_and_request); void http_transport_init(VALUE profiling_module) { - VALUE http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject); + http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject); rb_define_singleton_method(http_transport_class, "_native_validate_exporter", _native_validate_exporter, 1); rb_define_singleton_method(http_transport_class, "_native_do_export", _native_do_export, 11); @@ -62,6 +66,7 @@ void http_transport_init(VALUE profiling_module) { error_symbol = ID2SYM(rb_intern_const("error")); agentless_id = rb_intern_const("agentless"); agent_id = rb_intern_const("agent"); + log_failure_to_process_tag_id = rb_intern_const("log_failure_to_process_tag"); } inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { @@ -85,7 +90,7 @@ static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) // We don't actually need the exporter for now -- we just wanted to validate that we could create it with the // settings we were given - ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); + ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); return rb_ary_new_from_args(2, ok_symbol, Qnil); } @@ -94,18 +99,12 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf Check_Type(exporter_configuration, T_ARRAY); Check_Type(tags_as_array, T_ARRAY); - long tags_count = RARRAY_LEN(tags_as_array); - ddprof_ffi_Tag* converted_tags = xcalloc(tags_count, sizeof(ddprof_ffi_Tag)); - if (converted_tags == NULL) rb_raise(rb_eNoMemError, "Failed to allocate memory for storing tags"); - convert_tags(converted_tags, tags_count, tags_as_array); + ddprof_ffi_Vec_tag tags = convert_tags(tags_as_array); - ddprof_ffi_NewProfileExporterV3Result exporter_result = ddprof_ffi_ProfileExporterV3_new( - DDPROF_FFI_CHARSLICE_C("ruby"), - (ddprof_ffi_Slice_tag) {.ptr = converted_tags, .len = tags_count}, - endpoint_from(exporter_configuration) - ); + ddprof_ffi_NewProfileExporterV3Result exporter_result = + ddprof_ffi_ProfileExporterV3_new(DDPROF_FFI_CHARSLICE_C("ruby"), &tags, endpoint_from(exporter_configuration)); - xfree(converted_tags); + ddprof_ffi_Vec_tag_drop(tags); return exporter_result; } @@ -115,7 +114,7 @@ static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result expor VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); - ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); + ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); return rb_ary_new_from_args(2, error_symbol, failure_details); } @@ -144,9 +143,13 @@ static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { } } -static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE tags_as_array) { +__attribute__((warn_unused_result)) +static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { Check_Type(tags_as_array, T_ARRAY); + long tags_count = rb_array_len(tags_as_array); + ddprof_ffi_Vec_tag tags = ddprof_ffi_Vec_tag_new(); + for (long i = 0; i < tags_count; i++) { VALUE name_value_pair = rb_ary_entry(tags_as_array, i); Check_Type(name_value_pair, T_ARRAY); @@ -157,11 +160,20 @@ static void convert_tags(ddprof_ffi_Tag *converted_tags, long tags_count, VALUE Check_Type(tag_name, T_STRING); Check_Type(tag_value, T_STRING); - converted_tags[i] = (ddprof_ffi_Tag) { - .name = char_slice_from_ruby_string(tag_name), - .value = char_slice_from_ruby_string(tag_value) - }; + ddprof_ffi_PushTagResult push_result = + ddprof_ffi_Vec_tag_push(&tags, char_slice_from_ruby_string(tag_name), char_slice_from_ruby_string(tag_value)); + + if (push_result.tag == DDPROF_FFI_PUSH_TAG_RESULT_ERR) { + VALUE failure_details = rb_str_new((char *) push_result.err.ptr, push_result.err.len); + // libddprof validates tags and may catch invalid tags that ddtrace didn't actually catch. + // We warn users about such tags, and then just ignore them. + rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, failure_details); + } + + ddprof_ffi_PushTagResult_drop(push_result); } + + return tags; } static VALUE _native_do_export( @@ -208,16 +220,13 @@ static VALUE _native_do_export( ddprof_ffi_SendResult result = args.result; // Dispose of the exporter - ddprof_ffi_NewProfileExporterV3Result_dtor(exporter_result); + ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); // The request itself does not need to be freed as libddprof takes care of it. if (result.tag != DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { VALUE failure_details = rb_str_new((char *) result.failure.ptr, result.failure.len); - // TODO: This is needed until a proper dtor gets added in libddprof for SendResult; note that the Buffer - // itself is stack-allocated (so there's nothing to free/clean up there), so we only need to make sure its contents - // aren't leaked - ddprof_ffi_Buffer_reset(&result.failure); // Clean up result + ddprof_ffi_SendResult_drop(result); // Clean up result return rb_ary_new_from_args(2, error_symbol, failure_details); } @@ -271,8 +280,9 @@ static ddprof_ffi_Request *build_request( }; } + ddprof_ffi_Vec_tag *null_additional_tags = NULL; ddprof_ffi_Request *request = - ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, timeout_milliseconds); + ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, null_additional_tags, timeout_milliseconds); return request; } @@ -280,7 +290,7 @@ static ddprof_ffi_Request *build_request( static void *call_exporter_without_gvl(void *exporter_and_request) { struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) exporter_and_request; - args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request); + args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request, /* TODO: use cancel token */ NULL); return NULL; // Unused } diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index 02f40c771a3..bf1a75b3f88 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -120,6 +120,12 @@ def do_export( tags_as_array, ) end + + # Used to log soft failures in `ddprof_ffi_Vec_tag_push` (e.g. we still report the profile in these cases) + # Called from native code + def self.log_failure_to_process_tag(failure_details) + Datadog.logger.warn("Failed to add tag to profiling request: #{failure_details}") + end end end end diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 7f4befd9da1..57cf63511d4 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -204,7 +204,7 @@ export end - context 'when export was successful' do + context 'when successful' do before do expect(described_class).to receive(:_native_do_export).and_return([:ok, 200]) end @@ -307,7 +307,7 @@ ) tags = body['tags[]'].list - expect(tags).to include('tag_a:value_a', 'tag_b:value_b') + expect(tags).to contain_exactly('tag_a:value_a', 'tag_b:value_b') end end @@ -414,5 +414,31 @@ http_transport.export(flush) end end + + context 'when tags contains invalid tags' do + let(:tags_as_array) { [%w[:invalid invalid:], %w[valid1 valid1], %w[valid2 valid2]] } + + before do + allow(Datadog.logger).to receive(:warn) + end + + it 'reports using the valid tags and ignores the invalid tags' do + success = http_transport.export(flush) + + expect(success).to be true + + boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] + body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) + + tags = body['tags[]'].list + expect(tags).to contain_exactly('valid1:valid1', 'valid2:valid2') + end + + it 'logs a warning' do + expect(Datadog.logger).to receive(:warn).with(/Failed to add tag to profiling request/) + + http_transport.export(flush) + end + end end end From d880cde93e033bb9f683eda0320309dbfe6865ff Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Apr 2022 12:39:10 +0100 Subject: [PATCH 0055/2133] Allow `HttpTransport._native_do_export` to be cancelled/interrupted Up until now, `ddprof_ffi_ProfileExporterV3_send` was blocking and nothing on the Ruby side could interrupt it. This meant that if reporting a profile was slow/hung, then pressing ctrl+c or calling `Thread#kill` would do nothing -- send would only return after it hit the configured timeout (which by default is 30 seconds). This was very annoying if we're talking about an app that is trying to shut down and is being delayed by a report that is taking longer than expected. To fix this, we make use of the `CancellationToken` added in to enable the Ruby VM to signal to libddprof that it should cancel an in-progress `send`. Thus, as the added spec shows, we can make `send` return early by interrupting the thread, rather than needing to wait until the timeout was hit. --- .../http_transport.c | 50 ++++++++++++++----- spec/datadog/profiling/http_transport_spec.rb | 34 +++++++++++++ 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 7dcd8eab392..c06ea4302d2 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -18,6 +18,7 @@ static VALUE http_transport_class = Qnil; struct call_exporter_without_gvl_arguments { ddprof_ffi_ProfileExporterV3 *exporter; ddprof_ffi_Request *request; + ddprof_ffi_CancellationToken *cancel_token; ddprof_ffi_SendResult result; }; @@ -55,6 +56,7 @@ static ddprof_ffi_Request *build_request( VALUE code_provenance_data ); static void *call_exporter_without_gvl(void *exporter_and_request); +static void interrupt_exporter_call(void *cancel_token); void http_transport_init(VALUE profiling_module) { http_transport_class = rb_define_class_under(profiling_module, "HttpTransport", rb_cObject); @@ -196,6 +198,7 @@ static VALUE _native_do_export( if (!NIL_P(failure_tuple)) return failure_tuple; ddprof_ffi_ProfileExporterV3 *exporter = exporter_result.ok; + ddprof_ffi_CancellationToken *cancel_token = ddprof_ffi_CancellationToken_new(); ddprof_ffi_Request *request = build_request( @@ -213,24 +216,42 @@ static VALUE _native_do_export( // We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this // is pending - struct call_exporter_without_gvl_arguments args = {.exporter = exporter, .request = request}; - // TODO: We don't provide a function to interrupt reporting, which means this thread will be blocked until - // call_exporter_without_gvl returns. - rb_thread_call_without_gvl(call_exporter_without_gvl, &args, NULL, NULL); + struct call_exporter_without_gvl_arguments args = + {.exporter = exporter, .request = request, .cancel_token = cancel_token}; + + // We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the former does not process pending + // interrupts before returning. + // + // Aka with rb_thread_call_without_gvl if someone calls Thread#kill on the current thread, rb_thread_call_without_gvl + // will never return because Thread#kill causes an exception to be raised, and Ruby will longjmp to the exception + // handler which is outside of our code. + // This is problematic because we will leak the exporter, cancel_token, etc. + // + // Instead, with rb_thread_call_without_gvl2, if someone calls Thread#kill, rb_thread_call_without_gvl2 will still + // return as usual AND the exception will not be raised until we return from this function (as long as we don't + // call any Ruby API that triggers interrupt checking), which means we get to make an orderly exit. + rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); ddprof_ffi_SendResult result = args.result; - // Dispose of the exporter + ddprof_ffi_CancellationToken_drop(cancel_token); ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); - // The request itself does not need to be freed as libddprof takes care of it. - if (result.tag != DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { - VALUE failure_details = rb_str_new((char *) result.failure.ptr, result.failure.len); - ddprof_ffi_SendResult_drop(result); // Clean up result - return rb_ary_new_from_args(2, error_symbol, failure_details); + VALUE ruby_status; + VALUE ruby_result; + + if (result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { + ruby_status = ok_symbol; + ruby_result = UINT2NUM(result.http_response.code); + } else { + ruby_status = error_symbol; + VALUE err_details = rb_str_new((char *) result.failure.ptr, result.failure.len); + ruby_result = err_details; } - return rb_ary_new_from_args(2, ok_symbol, UINT2NUM(result.http_response.code)); + ddprof_ffi_SendResult_drop(result); + + return rb_ary_new_from_args(2, ruby_status, ruby_result); } static ddprof_ffi_Request *build_request( @@ -290,7 +311,12 @@ static ddprof_ffi_Request *build_request( static void *call_exporter_without_gvl(void *exporter_and_request) { struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) exporter_and_request; - args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request, /* TODO: use cancel token */ NULL); + args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request, args->cancel_token); return NULL; // Unused } + +// Called by Ruby when it wants to interrupt call_exporter_without_gvl above, e.g. when the app wants to exit cleanly +static void interrupt_exporter_call(void *cancel_token) { + ddprof_ffi_CancellationToken_cancel((ddprof_ffi_CancellationToken *) cancel_token); +} diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 57cf63511d4..e4777c89040 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -440,5 +440,39 @@ http_transport.export(flush) end end + + describe 'cancellation behavior' do + let!(:request_received_queue) { Queue.new } + let!(:request_finish_queue) { Queue.new } + + let(:upload_timeout_seconds) { 123_456_789 } # Set on purpose so this test will either pass or hang + let(:server_proc) do + proc do + request_received_queue << true + request_finish_queue.pop + end + end + + after do + request_finish_queue << true + end + + # As the describe above says, here we're testing the cancellation behavior. If cancellation is not correctly + # implemented, then `ddprof_ffi_ProfileExporterV3_send` will block until `upload_timeout_seconds` is hit and + # nothing we could do on the Ruby VM side will interrupt it. + # If it is correctly implemented, then the `exporter_thread.kill` will cause + # `ddprof_ffi_ProfileExporterV3_send` to return immediately and this test will quickly finish. + it 'can be interrupted' do + exporter_thread = Thread.new { http_transport.export(flush) } + request_received_queue.pop + + expect(exporter_thread.status).to eq 'sleep' + + exporter_thread.kill + exporter_thread.join + + expect(exporter_thread.status).to be false + end + end end end From 7174b8ca6651a8b4433cc48e13c2a5395ccca6ac Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Apr 2022 12:49:49 +0100 Subject: [PATCH 0056/2133] Fix potential memory leak by validating endpoint before allocating tags array --- ext/ddtrace_profiling_native_extension/http_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index c06ea4302d2..3af5ddd04af 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -101,10 +101,14 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf Check_Type(exporter_configuration, T_ARRAY); Check_Type(tags_as_array, T_ARRAY); + // This needs to be called BEFORE convert_tags since it can raise an exception and thus cause the ddprof_ffi_Vec_tag + // to be leaked. + ddprof_ffi_EndpointV3 endpoint = endpoint_from(exporter_configuration); + ddprof_ffi_Vec_tag tags = convert_tags(tags_as_array); ddprof_ffi_NewProfileExporterV3Result exporter_result = - ddprof_ffi_ProfileExporterV3_new(DDPROF_FFI_CHARSLICE_C("ruby"), &tags, endpoint_from(exporter_configuration)); + ddprof_ffi_ProfileExporterV3_new(DDPROF_FFI_CHARSLICE_C("ruby"), &tags, endpoint); ddprof_ffi_Vec_tag_drop(tags); From 5b5320b90bfd05120c72c680b5aafeff18d7295c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Apr 2022 14:39:34 +0100 Subject: [PATCH 0057/2133] Safely handle interruption of thread before send gets called Because we are using `rb_thread_call_without_gvl2`, we need to be careful not to assume that our code ran at all after it returns. --- .../http_transport.c | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 3af5ddd04af..c789b0694fc 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -20,6 +20,7 @@ struct call_exporter_without_gvl_arguments { ddprof_ffi_Request *request; ddprof_ffi_CancellationToken *cancel_token; ddprof_ffi_SendResult result; + bool send_ran; }; inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string); @@ -221,7 +222,7 @@ static VALUE _native_do_export( // We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this // is pending struct call_exporter_without_gvl_arguments args = - {.exporter = exporter, .request = request, .cancel_token = cancel_token}; + {.exporter = exporter, .request = request, .cancel_token = cancel_token, .send_ran = false}; // We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the former does not process pending // interrupts before returning. @@ -234,8 +235,8 @@ static VALUE _native_do_export( // Instead, with rb_thread_call_without_gvl2, if someone calls Thread#kill, rb_thread_call_without_gvl2 will still // return as usual AND the exception will not be raised until we return from this function (as long as we don't // call any Ruby API that triggers interrupt checking), which means we get to make an orderly exit. + // (Remember also that it can return BEFORE actually calling call_exporter_without_gvl, which we handle below.) rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); - ddprof_ffi_SendResult result = args.result; ddprof_ffi_CancellationToken_drop(cancel_token); ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); @@ -244,17 +245,27 @@ static VALUE _native_do_export( VALUE ruby_status; VALUE ruby_result; - if (result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { - ruby_status = ok_symbol; - ruby_result = UINT2NUM(result.http_response.code); + if (args.send_ran) { + ddprof_ffi_SendResult result = args.result; + + if (result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { + ruby_status = ok_symbol; + ruby_result = UINT2NUM(result.http_response.code); + } else { + ruby_status = error_symbol; + VALUE err_details = rb_str_new((char *) result.failure.ptr, result.failure.len); + ruby_result = err_details; + } + + ddprof_ffi_SendResult_drop(result); } else { + // According to the Ruby VM documentation, rb_thread_call_without_gvl2 checks for interrupts before doing anything + // else and thus it is possible -- yet extremely unlikely -- for it to return immediately without even calling + // call_exporter_without_gvl. Thus, here we handle that weird corner case. ruby_status = error_symbol; - VALUE err_details = rb_str_new((char *) result.failure.ptr, result.failure.len); - ruby_result = err_details; + ruby_result = rb_str_new_cstr("Interrupted before call_exporter_without_gvl ran"); } - ddprof_ffi_SendResult_drop(result); - return rb_ary_new_from_args(2, ruby_status, ruby_result); } @@ -316,6 +327,7 @@ static void *call_exporter_without_gvl(void *exporter_and_request) { struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) exporter_and_request; args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request, args->cancel_token); + args->send_ran = true; return NULL; // Unused } From 13de57e4e11b77f8dfe914abfc16643a1951bafe Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 16 May 2022 12:04:31 +0100 Subject: [PATCH 0058/2133] Fix compilation on older Rubies --- ext/ddtrace_profiling_native_extension/http_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index c789b0694fc..6f56e9f3530 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -154,7 +154,7 @@ __attribute__((warn_unused_result)) static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { Check_Type(tags_as_array, T_ARRAY); - long tags_count = rb_array_len(tags_as_array); + long tags_count = RARRAY_LEN(tags_as_array); ddprof_ffi_Vec_tag tags = ddprof_ffi_Vec_tag_new(); for (long i = 0; i < tags_count; i++) { From 8ae6eec7a2be2c32e759839434852f878b637188 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Apr 2022 13:49:28 +0100 Subject: [PATCH 0059/2133] Tweak webrick logging in tests to expose issues Previously we were sending all webrick logs to a `StringIO` that was never checked, which meant that if something was wrong inside webrick, we would not know about it (since webrick runs on a background thread). Instead, I've configured webrick to log to stderr, and raised the log level so only important issues get printed. --- spec/datadog/profiling/http_transport_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index e4777c89040..cd67cd985a0 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -246,9 +246,9 @@ end let(:hostname) { '127.0.0.1' } let(:port) { 6006 } - let(:log) { WEBrick::Log.new(log_buffer) } - let(:log_buffer) { StringIO.new } - let(:access_log) { [[log_buffer, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] } + let(:log) { WEBrick::Log.new($stderr, WEBrick::Log::WARN) } + let(:access_log_buffer) { StringIO.new } + let(:access_log) { [[access_log_buffer, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] } let(:server_proc) do proc do |req, res| messages << req.tap { req.body } # Read body, store message before socket closes. From d9b675c89ca4c4c8e959d2fb8d12ebf779eadc85 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Apr 2022 13:48:00 +0100 Subject: [PATCH 0060/2133] Reduce `upload_timeout_seconds` in spec The really long timeout may make a failing test hang, whereas with a shorter timeout libddprof will just fail the request and the test will finish with an error. --- spec/datadog/profiling/http_transport_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index cd67cd985a0..963c40154e5 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -45,7 +45,7 @@ let(:deprecated_for_removal_transport_configuration_proc) { nil } let(:site) { nil } let(:api_key) { nil } - let(:upload_timeout_seconds) { 123 } + let(:upload_timeout_seconds) { 10 } let(:flush) do Datadog::Profiling::Flush.new( @@ -181,7 +181,7 @@ it 'calls the native export method with the data from the flush' do # Manually converted from the lets above :) - upload_timeout_milliseconds = 123_000 + upload_timeout_milliseconds = 10_000 start_timespec_seconds = 1644249593 start_timespec_nanoseconds = 987654321 finish_timespec_seconds = 1699718400 From 6dc0a82570cc74874f323753279d65c4afcbc318 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Apr 2022 13:52:22 +0100 Subject: [PATCH 0061/2133] Fix broken test for unix socket reporting on Ruby 2.2 There is a bug in webrick in Ruby 2.2 when used with `DoNotListen: true` which broke in our tests. I've added a workaround for it. --- spec/datadog/profiling/http_transport_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index 963c40154e5..cbbb926da09 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -355,6 +355,16 @@ StartCallback: -> { init_signal.push(1) } ) server.listeners << unix_domain_socket + + if RUBY_VERSION.start_with?('2.2.') + # Workaround for webrick bug in Ruby 2.2. + # This `setup_shutdown_pipe` method was added in 2.2 (so 2.1 is not affected) but it had a bug when webrick + # was configured with `DoNotListen: true` and was never called, which led to failures as webrick requires and + # expects it to have been called. + # In Ruby 2.3 this was fixed and this method always gets called, even with `DoNotListen: true`. + server.send(:setup_shutdown_pipe) + end + server end let(:adapter) { Datadog::Transport::Ext::UnixSocket::ADAPTER } From a26d33ac427e35ddf34491796ab972a61e73359a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 17 May 2022 14:30:19 +0100 Subject: [PATCH 0062/2133] Rubocop fixes --- lib/datadog/profiling/http_transport.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index bf1a75b3f88..1a88ba8e53f 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -58,6 +58,12 @@ def export(flush) end end + # Used to log soft failures in `ddprof_ffi_Vec_tag_push` (e.g. we still report the profile in these cases) + # Called from native code + def self.log_failure_to_process_tag(failure_details) + Datadog.logger.warn("Failed to add tag to profiling request: #{failure_details}") + end + private def base_url_from(agent_settings) @@ -120,12 +126,6 @@ def do_export( tags_as_array, ) end - - # Used to log soft failures in `ddprof_ffi_Vec_tag_push` (e.g. we still report the profile in these cases) - # Called from native code - def self.log_failure_to_process_tag(failure_details) - Datadog.logger.warn("Failed to add tag to profiling request: #{failure_details}") - end end end end From c817038e987b192466d25bc9e15aa4e7b308d8f5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 4 Apr 2022 16:18:40 +0100 Subject: [PATCH 0063/2133] Use `char_slice_from_ruby_string` from helpers --- ext/ddtrace_profiling_native_extension/http_transport.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 6f56e9f3530..121698be0e4 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -1,6 +1,7 @@ #include #include #include +#include "libddprof_helpers.h" // Used to report profiling data to Datadog. // This file implements the native bits of the Datadog::Profiling::HttpTransport class @@ -24,7 +25,6 @@ struct call_exporter_without_gvl_arguments { }; inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string); -inline static ddprof_ffi_CharSlice char_slice_from_ruby_string(VALUE string); static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration); static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array); static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result); @@ -78,12 +78,6 @@ inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { return byte_slice; } -inline static ddprof_ffi_CharSlice char_slice_from_ruby_string(VALUE string) { - Check_Type(string, T_STRING); - ddprof_ffi_CharSlice char_slice = {.ptr = StringValuePtr(string), .len = RSTRING_LEN(string)}; - return char_slice; -} - static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) { Check_Type(exporter_configuration, T_ARRAY); ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, rb_ary_new()); From 85700f2dfcb7a159f3d8d91792dc525c0e3a1df7 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 28 Apr 2022 14:22:09 +0100 Subject: [PATCH 0064/2133] Fix potential memory leaks in error code paths for HttpTransport Whenever something is dynamically allocated, we must ensure that either no exceptions can be thrown or that we clean it up before throwing an exception. --- .../http_transport.c | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 121698be0e4..fd3ad099e93 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -123,7 +123,7 @@ static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result expor static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { Check_Type(exporter_configuration, T_ARRAY); - ID working_mode = SYM2ID(rb_ary_entry(exporter_configuration, 0)); // SYMID verifies its input so we can do this safely + ID working_mode = SYM2ID(rb_ary_entry(exporter_configuration, 0)); // SYM2ID verifies its input so we can do this safely if (working_mode != agentless_id && working_mode != agent_id) { rb_raise(rb_eArgError, "Failed to initialize transport: Unexpected working mode, expected :agentless or :agent"); @@ -153,13 +153,21 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { for (long i = 0; i < tags_count; i++) { VALUE name_value_pair = rb_ary_entry(tags_as_array, i); - Check_Type(name_value_pair, T_ARRAY); + + if (!RB_TYPE_P(name_value_pair, T_ARRAY)) { + ddprof_ffi_Vec_tag_drop(tags); + Check_Type(name_value_pair, T_ARRAY); + } // Note: We can index the array without checking its size first because rb_ary_entry returns Qnil if out of bounds VALUE tag_name = rb_ary_entry(name_value_pair, 0); VALUE tag_value = rb_ary_entry(name_value_pair, 1); - Check_Type(tag_name, T_STRING); - Check_Type(tag_value, T_STRING); + + if (!(RB_TYPE_P(tag_name, T_STRING) && RB_TYPE_P(tag_value, T_STRING))) { + ddprof_ffi_Vec_tag_drop(tags); + Check_Type(tag_name, T_STRING); + Check_Type(tag_value, T_STRING); + } ddprof_ffi_PushTagResult push_result = ddprof_ffi_Vec_tag_push(&tags, char_slice_from_ruby_string(tag_name), char_slice_from_ruby_string(tag_value)); @@ -232,10 +240,6 @@ static VALUE _native_do_export( // (Remember also that it can return BEFORE actually calling call_exporter_without_gvl, which we handle below.) rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); - ddprof_ffi_CancellationToken_drop(cancel_token); - ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); - // The request itself does not need to be freed as libddprof takes care of it. - VALUE ruby_status; VALUE ruby_result; @@ -250,16 +254,30 @@ static VALUE _native_do_export( VALUE err_details = rb_str_new((char *) result.failure.ptr, result.failure.len); ruby_result = err_details; } - - ddprof_ffi_SendResult_drop(result); } else { // According to the Ruby VM documentation, rb_thread_call_without_gvl2 checks for interrupts before doing anything // else and thus it is possible -- yet extremely unlikely -- for it to return immediately without even calling // call_exporter_without_gvl. Thus, here we handle that weird corner case. ruby_status = error_symbol; ruby_result = rb_str_new_cstr("Interrupted before call_exporter_without_gvl ran"); + + // We're in a weird situation that libddprof doesn't quite support. The ddprof_ffi_Request payload is dynamically + // allocated and needs to be freed, but libddprof doesn't have an API for dropping a request because it's kinda + // weird that a profiler builds a request and then says "oh, nevermind" and throws it away. + // We could add such an API, but I'm somewhat hesitant since this is a really bizarre corner case that looks quite + // Ruby-specific. + // + // Instead, let's get libddprof to clean up this value by asking for the send to be cancelled, and then calling + // it anyway. This will make libddprof free the request without needing changes to its API. + interrupt_exporter_call((void *) cancel_token); + call_exporter_without_gvl((void *) &args); } + ddprof_ffi_SendResult_drop(args.result); + ddprof_ffi_CancellationToken_drop(cancel_token); + ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); + // The request itself does not need to be freed as libddprof takes care of it. + return rb_ary_new_from_args(2, ruby_status, ruby_result); } From 02f104170b17643e2032ed745ea75c044965af2f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Apr 2022 14:17:56 +0100 Subject: [PATCH 0065/2133] Extract helper for creating Ruby string from libddprof Vec_u8 This is becoming a common-enough operation that it makes sense to have a nice wrapper for it. --- .../http_transport.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index fd3ad099e93..87f969f10ca 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -113,11 +113,11 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result) { if (exporter_result.tag == DDPROF_FFI_NEW_PROFILE_EXPORTER_V3_RESULT_OK) return Qnil; - VALUE failure_details = rb_str_new((char *) exporter_result.err.ptr, exporter_result.err.len); + VALUE err_details = ruby_string_from_vec_u8(exporter_result.err); ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); - return rb_ary_new_from_args(2, error_symbol, failure_details); + return rb_ary_new_from_args(2, error_symbol, err_details); } static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { @@ -173,10 +173,10 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { ddprof_ffi_Vec_tag_push(&tags, char_slice_from_ruby_string(tag_name), char_slice_from_ruby_string(tag_value)); if (push_result.tag == DDPROF_FFI_PUSH_TAG_RESULT_ERR) { - VALUE failure_details = rb_str_new((char *) push_result.err.ptr, push_result.err.len); + VALUE err_details = ruby_string_from_vec_u8(push_result.err); // libddprof validates tags and may catch invalid tags that ddtrace didn't actually catch. // We warn users about such tags, and then just ignore them. - rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, failure_details); + rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, err_details); } ddprof_ffi_PushTagResult_drop(push_result); @@ -251,8 +251,7 @@ static VALUE _native_do_export( ruby_result = UINT2NUM(result.http_response.code); } else { ruby_status = error_symbol; - VALUE err_details = rb_str_new((char *) result.failure.ptr, result.failure.len); - ruby_result = err_details; + ruby_result = ruby_string_from_vec_u8(result.failure); } } else { // According to the Ruby VM documentation, rb_thread_call_without_gvl2 checks for interrupts before doing anything From c23a004df407dbdbf56d3b69e123dc8d0b7d0f0e Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 28 Apr 2022 16:09:08 +0100 Subject: [PATCH 0066/2133] Refactor `build_request` and `_native_do_export` to avoid leaking libddprof objects The previous version of the code went: 1. Create libddprof exporter 2. Convert Ruby VALUE objects into libddprof equivalents 3. Fire off the request In the happy path, this worked fine. But if in step 2 any exception was raised (because some object was `nil` or of an unexpected type), then the exporter would be leaked. To fix this, I've flipped the code around so that the order now goes: 1. Convert Ruby VALUE objects into libddprof equivalents 2. Create libddprof exporter 3. Fire off the request Thus, we now do all of the work that may raise exceptions up front, and only then do we start calling libddprof APIs which allocate dynamic memory. (I did slightly move the code around to minimize the diff, and that's why `build_request` actually became `_native_do_export`, and the old code in `_native_do_export` became the new `perform_export`). --- .../http_transport.c | 86 ++++++------------- 1 file changed, 28 insertions(+), 58 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 87f969f10ca..e6bf013c0fa 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -44,18 +44,6 @@ static VALUE _native_do_export( VALUE code_provenance_data, VALUE tags_as_array ); -static ddprof_ffi_Request *build_request( - ddprof_ffi_ProfileExporterV3 *exporter, - VALUE upload_timeout_milliseconds, - VALUE start_timespec_seconds, - VALUE start_timespec_nanoseconds, - VALUE finish_timespec_seconds, - VALUE finish_timespec_nanoseconds, - VALUE pprof_file_name, - VALUE pprof_data, - VALUE code_provenance_file_name, - VALUE code_provenance_data -); static void *call_exporter_without_gvl(void *exporter_and_request); static void interrupt_exporter_call(void *cancel_token); @@ -185,41 +173,20 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { return tags; } -static VALUE _native_do_export( - VALUE self, - VALUE exporter_configuration, - VALUE upload_timeout_milliseconds, - VALUE start_timespec_seconds, - VALUE start_timespec_nanoseconds, - VALUE finish_timespec_seconds, - VALUE finish_timespec_nanoseconds, - VALUE pprof_file_name, - VALUE pprof_data, - VALUE code_provenance_file_name, - VALUE code_provenance_data, - VALUE tags_as_array +// Note: This function handles a bunch of libddprof dynamically-allocated objects, so it MUST not use any Ruby APIs +// which can raise exceptions, otherwise the objects will be leaked. +static VALUE perform_export( + ddprof_ffi_NewProfileExporterV3Result valid_exporter_result, // Must be called with a valid exporter result + ddprof_ffi_Timespec start, + ddprof_ffi_Timespec finish, + ddprof_ffi_Slice_file slice_files, + ddprof_ffi_Vec_tag *additional_tags, + uint64_t timeout_milliseconds ) { - ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, tags_as_array); - - VALUE failure_tuple = handle_exporter_failure(exporter_result); - if (!NIL_P(failure_tuple)) return failure_tuple; - - ddprof_ffi_ProfileExporterV3 *exporter = exporter_result.ok; + ddprof_ffi_ProfileExporterV3 *exporter = valid_exporter_result.ok; ddprof_ffi_CancellationToken *cancel_token = ddprof_ffi_CancellationToken_new(); - ddprof_ffi_Request *request = - build_request( - exporter, - upload_timeout_milliseconds, - start_timespec_seconds, - start_timespec_nanoseconds, - finish_timespec_seconds, - finish_timespec_nanoseconds, - pprof_file_name, - pprof_data, - code_provenance_file_name, - code_provenance_data - ); + ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, additional_tags, timeout_milliseconds); // We'll release the Global VM Lock while we're calling send, so that the Ruby VM can continue to work while this // is pending @@ -245,14 +212,10 @@ static VALUE _native_do_export( if (args.send_ran) { ddprof_ffi_SendResult result = args.result; + bool success = result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE; - if (result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE) { - ruby_status = ok_symbol; - ruby_result = UINT2NUM(result.http_response.code); - } else { - ruby_status = error_symbol; - ruby_result = ruby_string_from_vec_u8(result.failure); - } + ruby_status = success ? ok_symbol : error_symbol; + ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.failure); } else { // According to the Ruby VM documentation, rb_thread_call_without_gvl2 checks for interrupts before doing anything // else and thus it is possible -- yet extremely unlikely -- for it to return immediately without even calling @@ -272,16 +235,18 @@ static VALUE _native_do_export( call_exporter_without_gvl((void *) &args); } + // Clean up all dynamically-allocated things ddprof_ffi_SendResult_drop(args.result); ddprof_ffi_CancellationToken_drop(cancel_token); - ddprof_ffi_NewProfileExporterV3Result_drop(exporter_result); + ddprof_ffi_NewProfileExporterV3Result_drop(valid_exporter_result); // The request itself does not need to be freed as libddprof takes care of it. return rb_ary_new_from_args(2, ruby_status, ruby_result); } -static ddprof_ffi_Request *build_request( - ddprof_ffi_ProfileExporterV3 *exporter, +static VALUE _native_do_export( + VALUE self, + VALUE exporter_configuration, VALUE upload_timeout_milliseconds, VALUE start_timespec_seconds, VALUE start_timespec_nanoseconds, @@ -290,7 +255,8 @@ static ddprof_ffi_Request *build_request( VALUE pprof_file_name, VALUE pprof_data, VALUE code_provenance_file_name, - VALUE code_provenance_data + VALUE code_provenance_data, + VALUE tags_as_array ) { Check_Type(upload_timeout_milliseconds, T_FIXNUM); Check_Type(start_timespec_seconds, T_FIXNUM); @@ -328,10 +294,14 @@ static ddprof_ffi_Request *build_request( } ddprof_ffi_Vec_tag *null_additional_tags = NULL; - ddprof_ffi_Request *request = - ddprof_ffi_ProfileExporterV3_build(exporter, start, finish, slice_files, null_additional_tags, timeout_milliseconds); - return request; + ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, tags_as_array); + // Note: Do not add anything that can raise exceptions after this line, as otherwise the exporter memory will leak + + VALUE failure_tuple = handle_exporter_failure(exporter_result); + if (!NIL_P(failure_tuple)) return failure_tuple; + + return perform_export(exporter_result, start, finish, slice_files, null_additional_tags, timeout_milliseconds); } static void *call_exporter_without_gvl(void *exporter_and_request) { From cbb2a6942bd8093f52b249adc251b4de8f478984 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 28 Apr 2022 17:28:35 +0100 Subject: [PATCH 0067/2133] Fix potential tags memory leak in case of exception Make sure we clean up `tags` if logging failed with an exception. --- .../NativeExtensionDesign.md | 4 ++- .../http_transport.c | 25 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md index 7db0c2db9ee..85c05aa2c57 100644 --- a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md @@ -44,13 +44,15 @@ We avoid issues using a combination of: * Avoiding calling Ruby VM APIs after doing dynamic allocations * Wrapping dynamic allocations into Ruby GC-managed objects (using `TypedData_Wrap_Struct`), so that Ruby will manage their lifetime and call `free` when the GC-managed object is no longer being referenced +* Using [`rb_protect` and similar APIs](https://silverhammermba.github.io/emberb/c/?#rescue) to run cleanup code on + exception cases Non-exhaustive list of APIs that cause exceptions to be raised: * `Check_TypedStruct`, `Check_Type` * `rb_funcall` * `rb_thread_call_without_gvl`, `rb_thread_call_without_gvl2` -* [Numeric conversion APIs, e.g. `NUM2LONG`, `NUM2INT`, etc.](https://silverhammermba.github.io/emberb/c/?utm_source=pocket_mylist#translation) +* [Numeric conversion APIs, e.g. `NUM2LONG`, `NUM2INT`, etc.](https://silverhammermba.github.io/emberb/c/?#translation) * Our `char_slice_from_ruby_string` helper ## Usage of private VM headers diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index e6bf013c0fa..81028ea4637 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -30,6 +30,7 @@ static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_conf static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result exporter_result); static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration); static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array); +static void safely_log_failure_to_process_tag(ddprof_ffi_Vec_tag tags, VALUE err_details); static VALUE _native_do_export( VALUE self, VALUE exporter_configuration, @@ -162,17 +163,35 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { if (push_result.tag == DDPROF_FFI_PUSH_TAG_RESULT_ERR) { VALUE err_details = ruby_string_from_vec_u8(push_result.err); + ddprof_ffi_PushTagResult_drop(push_result); + // libddprof validates tags and may catch invalid tags that ddtrace didn't actually catch. // We warn users about such tags, and then just ignore them. - rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, err_details); + safely_log_failure_to_process_tag(tags, err_details); + } else { + ddprof_ffi_PushTagResult_drop(push_result); } - - ddprof_ffi_PushTagResult_drop(push_result); } return tags; } +static VALUE log_failure_to_process_tag(VALUE err_details) { + return rb_funcall(http_transport_class, log_failure_to_process_tag_id, 1, err_details); +} + +// Since we are calling into Ruby code, it may raise an exception. This method ensure that dynamically-allocated tags +// get cleaned before propagating the exception. +static void safely_log_failure_to_process_tag(ddprof_ffi_Vec_tag tags, VALUE err_details) { + int exception_state; + rb_protect(log_failure_to_process_tag, err_details, &exception_state); + + if (exception_state) { // An exception was raised + ddprof_ffi_Vec_tag_drop(tags); // clean up + rb_jump_tag(exception_state); // "Re-raise" exception + } +} + // Note: This function handles a bunch of libddprof dynamically-allocated objects, so it MUST not use any Ruby APIs // which can raise exceptions, otherwise the objects will be leaked. static VALUE perform_export( From 4cd898e829d34f994973452e4503a88d37b4f99c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 25 May 2022 11:56:27 +0100 Subject: [PATCH 0068/2133] Fix Ruby VM interruptions causing `HttpTransport#export` failures It took me a bit to wrap my head around this one, but `rb_thread_call_without_gvl2` can return with an "interrupt". This interrupt may mean that the VM has some work to do (and wants us to call something like `rb_thread_check_ints()`), BUT that SHOULD NOT be a reason for the export to fail, as this is expected to happen from time to time. I initially missed this subtlety, and it manifested itself as flaky tests in CI (this seems to happen more often in Ruby 2.3 and below). Tests would randomly fail with the `Interrupted before call_exporter_without_gvl ran` message we previously had. After some experimentation, I found I could reproduce on any Ruby version, if I just did enough calls to export: ```ruby context 'when server returns a 5xx failure' do let(:server_proc) { proc { |_req, res| res.status = 503 } } it 'logs an error' do expect(Datadog.logger).to receive(:error).with(/unexpected HTTP 503/) 10_000.times do |i| print '@' if i % 100 == 0 http_transport.export(flush) end end end ``` The fix here is to separate two different cases: * There's an interrupt and the VM wants to process it. This shouldn't fail the export -- we just let the VM do whatever and retry our call. * There's an exception to be raised. This will fail the export. --- .../http_transport.c | 61 ++++++++++--------- .../ruby_helpers.h | 33 ++++++++++ 2 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/ruby_helpers.h diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 81028ea4637..23ac5675825 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -2,6 +2,7 @@ #include #include #include "libddprof_helpers.h" +#include "ruby_helpers.h" // Used to report profiling data to Datadog. // This file implements the native bits of the Datadog::Profiling::HttpTransport class @@ -45,7 +46,7 @@ static VALUE _native_do_export( VALUE code_provenance_data, VALUE tags_as_array ); -static void *call_exporter_without_gvl(void *exporter_and_request); +static void *call_exporter_without_gvl(void *call_args); static void interrupt_exporter_call(void *cancel_token); void http_transport_init(VALUE profiling_module) { @@ -212,54 +213,56 @@ static VALUE perform_export( struct call_exporter_without_gvl_arguments args = {.exporter = exporter, .request = request, .cancel_token = cancel_token, .send_ran = false}; - // We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the former does not process pending - // interrupts before returning. + // We use rb_thread_call_without_gvl2 instead of rb_thread_call_without_gvl as the gvl2 variant never raises any + // exceptions. // - // Aka with rb_thread_call_without_gvl if someone calls Thread#kill on the current thread, rb_thread_call_without_gvl - // will never return because Thread#kill causes an exception to be raised, and Ruby will longjmp to the exception - // handler which is outside of our code. - // This is problematic because we will leak the exporter, cancel_token, etc. + // (With rb_thread_call_without_gvl, if someone calls Thread#kill or something like it on the current thread, + // the exception will be raised without us being able to clean up dynamically-allocated stuff, which would leak.) // - // Instead, with rb_thread_call_without_gvl2, if someone calls Thread#kill, rb_thread_call_without_gvl2 will still - // return as usual AND the exception will not be raised until we return from this function (as long as we don't - // call any Ruby API that triggers interrupt checking), which means we get to make an orderly exit. - // (Remember also that it can return BEFORE actually calling call_exporter_without_gvl, which we handle below.) - rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); + // Instead, we take care of our own exception checking, and delay the exception raising (`rb_jump_tag` call) until + // after we cleaned up any dynamically-allocated resources. + // + // We run rb_thread_call_without_gvl2 in a loop since an "interrupt" may cause it to return before even running + // our code. In such a case, we retry the call -- unless the interrupt was caused by an exception being pending, + // and in that case we also give up and break out of the loop. + int pending_exception = 0; + + while (!args.send_ran && !pending_exception) { + rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); + if (!args.send_ran) pending_exception = check_if_pending_exception(); + } VALUE ruby_status; VALUE ruby_result; - if (args.send_ran) { - ddprof_ffi_SendResult result = args.result; - bool success = result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE; - - ruby_status = success ? ok_symbol : error_symbol; - ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.failure); - } else { - // According to the Ruby VM documentation, rb_thread_call_without_gvl2 checks for interrupts before doing anything - // else and thus it is possible -- yet extremely unlikely -- for it to return immediately without even calling - // call_exporter_without_gvl. Thus, here we handle that weird corner case. - ruby_status = error_symbol; - ruby_result = rb_str_new_cstr("Interrupted before call_exporter_without_gvl ran"); - + if (pending_exception) { // We're in a weird situation that libddprof doesn't quite support. The ddprof_ffi_Request payload is dynamically // allocated and needs to be freed, but libddprof doesn't have an API for dropping a request because it's kinda // weird that a profiler builds a request and then says "oh, nevermind" and throws it away. // We could add such an API, but I'm somewhat hesitant since this is a really bizarre corner case that looks quite // Ruby-specific. // - // Instead, let's get libddprof to clean up this value by asking for the send to be cancelled, and then calling - // it anyway. This will make libddprof free the request without needing changes to its API. + // Instead, let's get libddprof to clean up the request by asking for the send to be cancelled, and then calling + // it anyway. This will make libddprof free the request and return immediately without needing changes to its API. interrupt_exporter_call((void *) cancel_token); call_exporter_without_gvl((void *) &args); } + ddprof_ffi_SendResult result = args.result; + bool success = result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE; + + ruby_status = success ? ok_symbol : error_symbol; + ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.failure); + // Clean up all dynamically-allocated things ddprof_ffi_SendResult_drop(args.result); ddprof_ffi_CancellationToken_drop(cancel_token); ddprof_ffi_NewProfileExporterV3Result_drop(valid_exporter_result); // The request itself does not need to be freed as libddprof takes care of it. + // We've cleaned up everything, so if there's an exception to be raised, let's have it + if (pending_exception) rb_jump_tag(pending_exception); + return rb_ary_new_from_args(2, ruby_status, ruby_result); } @@ -323,8 +326,8 @@ static VALUE _native_do_export( return perform_export(exporter_result, start, finish, slice_files, null_additional_tags, timeout_milliseconds); } -static void *call_exporter_without_gvl(void *exporter_and_request) { - struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) exporter_and_request; +static void *call_exporter_without_gvl(void *call_args) { + struct call_exporter_without_gvl_arguments *args = (struct call_exporter_without_gvl_arguments*) call_args; args->result = ddprof_ffi_ProfileExporterV3_send(args->exporter, args->request, args->cancel_token); args->send_ran = true; diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h new file mode 100644 index 00000000000..1ef3e01a8ce --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +// Processes any pending interruptions, including exceptions to be raised. +// If there's an exception to be raised, it raises it. +static inline VALUE process_pending_interruptions(VALUE _unused) { + rb_thread_check_ints(); + return Qnil; +} + +// Calls process_pending_interruptions BUT "rescues" any exceptions to be raised, returning them instead as +// a non-zero `pending_exception`. +// +// Thus, if there's a non-zero `pending_exception`, the caller MUST call `rb_jump_tag(pending_exception)` after any +// needed clean-ups. +// +// Usage example: +// +// ```c +// foo = ruby_xcalloc(...); +// pending_exception = check_if_pending_exception(); +// if (pending_exception) { +// ruby_xfree(foo); +// rb_jump_tag(pending_exception); // Re-raises exception +// } +// ``` +__attribute__((warn_unused_result)) +static inline int check_if_pending_exception() { + int pending_exception; + rb_protect(process_pending_interruptions, Qnil, &pending_exception); + return pending_exception; +} From 4795a8d983a553ab406d92b8f33fc5f2d1fb57c9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 2 Mar 2022 14:12:58 +0000 Subject: [PATCH 0069/2133] Wire up `HttpTransport` as default profiler transport This integration with `HttpTransport` replaces the old `Exporter`+`Transport` APIs and classes. In particular: * The `Scheduler` no longer supports multiple `Exporter`s. If needed, one can still provide a custom `profiling.exporter.transport` via the settings, and thus it's still possible to create a "transport" that multiplexes to multiple other transports. * `tags` provided for `HttpTransport` are installed at initialization time; to change `tags` a new `HttpTransport` instance must be created * The `Recorder` has been updated to provide an instance of the new `Flush` class as input. Because this class now includes the encoded pprof data inside it, the `Recorder` gained a few new responsibilities: 1. It calls the pprof encoder (`Datadog::Profiling::Encoding::Profile::Protobuf`) directly 2. It compresses the pprof data, as well as the code provenance data (this was previously done in the `Transport::HTTP::API::Endpoint`) 3. It skips encoding the data if there's less than 1s of data (this was previously done in the `Scheduler`) 4. It skips encoding the data if there's no events (this was previously done in the `Scheduler`) * The `Scheduler` was adjusted to match the new `Recorder` behavior * The `Datadog::Profiling::Encoding::Profile::Protobuf` was adjusted to no longer take a `Flush` as input. After this change, we'll be able to delete all the old `Exporter`+`Transport` APIs and classes. Note that I did as minimal changes to the `Recorder` and `Encoding::Profile::Protobuf` because both of them will still need further changes once we move to use libddprof for profile encoding, so please take that into account while reviewing. --- lib/datadog/core/configuration/components.rb | 18 ++- lib/datadog/profiling/encoding/profile.rb | 17 +-- lib/datadog/profiling/flush.rb | 2 +- lib/datadog/profiling/recorder.rb | 46 +++++- lib/datadog/profiling/scheduler.rb | 52 +++---- .../core/configuration/components_spec.rb | 65 ++++----- .../profiling/encoding/profile_spec.rb | 36 +++-- spec/datadog/profiling/recorder_spec.rb | 126 +++++++++++------ spec/datadog/profiling/scheduler_spec.rb | 132 ++++++------------ 9 files changed, 250 insertions(+), 244 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 1e967781259..ee96bf7dde1 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -249,8 +249,8 @@ def build_profiler(settings, agent_settings, tracer) recorder = build_profiler_recorder(settings, code_provenance_collector) collectors = build_profiler_collectors(settings, recorder, trace_identifiers_helper) - exporters = build_profiler_exporters(settings, agent_settings) - scheduler = build_profiler_scheduler(settings, recorder, exporters) + transport = build_profiler_transport(settings, agent_settings) + scheduler = build_profiler_scheduler(settings, recorder, transport) Profiling::Profiler.new(collectors, scheduler) end @@ -306,20 +306,18 @@ def build_profiler_collectors(settings, recorder, trace_identifiers_helper) ] end - def build_profiler_exporters(settings, agent_settings) - transport = - settings.profiling.exporter.transport || Profiling::Transport::HTTP.default( + def build_profiler_transport(settings, agent_settings) + settings.profiling.exporter.transport || + Profiling::HttpTransport.new( agent_settings: agent_settings, site: settings.site, api_key: settings.api_key, - profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds + upload_timeout_seconds: settings.profiling.upload.timeout_seconds, ) - - [Profiling::Exporter.new(transport)] end - def build_profiler_scheduler(settings, recorder, exporters) - Profiling::Scheduler.new(recorder, exporters) + def build_profiler_scheduler(_settings, recorder, transport) + Profiling::Scheduler.new(recorder: recorder, transport: transport) end end diff --git a/lib/datadog/profiling/encoding/profile.rb b/lib/datadog/profiling/encoding/profile.rb index 01d71266357..94872e05867 100644 --- a/lib/datadog/profiling/encoding/profile.rb +++ b/lib/datadog/profiling/encoding/profile.rb @@ -1,9 +1,7 @@ # typed: true -require 'set' require 'time' -require 'datadog/profiling/flush' require 'datadog/profiling/pprof/template' module Datadog @@ -14,31 +12,30 @@ module Profile module Protobuf module_function - def encode(flush) - return unless flush + def encode(event_count:, event_groups:, start:, finish:) # Create a pprof template from the list of event types - event_classes = flush.event_groups.collect(&:event_class).uniq + event_classes = event_groups.collect(&:event_class).uniq template = Pprof::Template.for_event_classes(event_classes) # Add all events to the pprof - flush.event_groups.each { |event_group| template.add_events!(event_group.event_class, event_group.events) } + event_groups.each { |event_group| template.add_events!(event_group.event_class, event_group.events) } Datadog.logger.debug do max_events = Datadog.configuration.profiling.advanced.max_events events_sampled = - if flush.event_count == max_events + if event_count == max_events 'max events limit hit, events were sampled [profile will be biased], ' else '' end - "Encoding profile covering #{flush.start.iso8601} to #{flush.finish.iso8601}, " \ - "events: #{flush.event_count} (#{events_sampled}#{template.debug_statistics})" + "Encoding profile covering #{start.iso8601} to #{finish.iso8601}, " \ + "events: #{event_count} (#{events_sampled}#{template.debug_statistics})" end # Build the profile and encode it - template.to_pprof(start: flush.start, finish: flush.finish) + template.to_pprof(start: start, finish: finish) end end end diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index b9cf4ac290d..22b25fb1742 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -64,7 +64,7 @@ def initialize( end # Represents a collection of events of a specific type being flushed. - EventGroup = Struct.new(:event_class, :events).freeze + EventGroup = Struct.new(:event_class, :events) # Entity class used to represent metadata for a given profile class Flush diff --git a/lib/datadog/profiling/recorder.rb b/lib/datadog/profiling/recorder.rb index 6d201faf4b9..99d197ee1aa 100644 --- a/lib/datadog/profiling/recorder.rb +++ b/lib/datadog/profiling/recorder.rb @@ -2,6 +2,9 @@ require 'datadog/profiling/buffer' require 'datadog/profiling/flush' +require 'datadog/profiling/encoding/profile' +require 'datadog/core/utils/compression' +require 'datadog/profiling/tag_builder' module Datadog module Profiling @@ -9,6 +12,9 @@ module Profiling class Recorder attr_reader :max_size + # Profiles with duration less than this will not be reported + PROFILE_DURATION_THRESHOLD_SECONDS = 1 + # TODO: Why does the Recorder directly reference the `code_provenance_collector`? # # For starters, this is weird/a problem because the relationship is supposed to go in the other direction: @@ -25,11 +31,18 @@ class Recorder # [libddprof](https://github.com/datadog/libddprof)-based implementation, and thus I don't think massive refactors # are worth it before moving to libddprof. - def initialize(event_classes, max_size, code_provenance_collector:, last_flush_time: Time.now.utc) + def initialize( + event_classes, + max_size, + code_provenance_collector:, + last_flush_time: Time.now.utc, + minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS + ) @buffers = {} @last_flush_time = last_flush_time @max_size = max_size @code_provenance_collector = code_provenance_collector + @minimum_duration = minimum_duration # Add a buffer for each class event_classes.each do |event_class| @@ -73,14 +86,33 @@ def flush end.compact end + return if event_count.zero? # We don't want to report empty profiles + + if duration_below_threshold?(start, finish) + Datadog.logger.debug do + "Skipped exporting profiling events as profile duration is below minimum (#{event_count} events skipped)" + end + + return + end + + encoded_pprof = Datadog::Profiling::Encoding::Profile::Protobuf.encode( + event_count: event_count, + event_groups: event_groups, + start: start, + finish: finish, + ) + code_provenance = @code_provenance_collector.refresh.generate_json if @code_provenance_collector - OldFlush.new( + Flush.new( start: start, finish: finish, - event_groups: event_groups, - event_count: event_count, - code_provenance: code_provenance, + pprof_file_name: Datadog::Profiling::Ext::Transport::HTTP::PPROF_DEFAULT_FILENAME, + pprof_data: Core::Utils::Compression.gzip(encoded_pprof), + code_provenance_file_name: Datadog::Profiling::Ext::Transport::HTTP::CODE_PROVENANCE_FILENAME, + code_provenance_data: (Core::Utils::Compression.gzip(code_provenance) if code_provenance), + tags_as_array: Datadog::Profiling::TagBuilder.call(settings: Datadog.configuration).to_a, ) end @@ -112,6 +144,10 @@ def update_time # Return event groups, start time, finish time [result, start, @last_flush_time] end + + def duration_below_threshold?(start, finish) + (finish - start) < @minimum_duration + end end end end diff --git a/lib/datadog/profiling/scheduler.rb b/lib/datadog/profiling/scheduler.rb index bc4af2c42c0..11fcb6390f4 100644 --- a/lib/datadog/profiling/scheduler.rb +++ b/lib/datadog/profiling/scheduler.rb @@ -7,36 +7,35 @@ module Datadog module Profiling - # Periodically (every DEFAULT_INTERVAL_SECONDS) takes data from the `Recorder` and pushes them to all configured - # `Exporter`s. Runs on its own background thread. + # Periodically (every DEFAULT_INTERVAL_SECONDS) takes data from the `Recorder` and reports them using the configured + # transport. Runs on its own background thread. class Scheduler < Core::Worker include Core::Workers::Polling DEFAULT_INTERVAL_SECONDS = 60 MINIMUM_INTERVAL_SECONDS = 0 - # Profiles with duration less than this will not be reported - PROFILE_DURATION_THRESHOLD_SECONDS = 1 - # We sleep for at most this duration seconds before reporting data to avoid multi-process applications all # reporting profiles at the exact same time DEFAULT_FLUSH_JITTER_MAXIMUM_SECONDS = 3 - private_constant :DEFAULT_INTERVAL_SECONDS, :MINIMUM_INTERVAL_SECONDS, :PROFILE_DURATION_THRESHOLD_SECONDS + private attr_reader \ - :exporters, - :recorder + :recorder, + :transport + + public def initialize( - recorder, - exporters, + recorder:, + transport:, fork_policy: Core::Workers::Async::Thread::FORK_POLICY_RESTART, # Restart in forks by default interval: DEFAULT_INTERVAL_SECONDS, enabled: true ) @recorder = recorder - @exporters = [exporters].flatten + @transport = transport # Workers::Async::Thread settings self.fork_policy = fork_policy @@ -100,16 +99,10 @@ def flush_and_wait end def flush_events - # Get events from recorder + # Collect data to be exported flush = recorder.flush - if duration_below_threshold?(flush) - Datadog.logger.debug do - "Skipped exporting profiling events as profile duration is below minimum (#{flush.event_count} events skipped)" - end - - return flush - end + return false unless flush # Sleep for a bit to cause misalignment between profilers in multi-process applications # @@ -127,24 +120,13 @@ def flush_events sleep(jitter_seconds) end - # Send events to each exporter - if flush.event_count > 0 - exporters.each do |exporter| - begin - exporter.export(flush) - rescue StandardError => e - Datadog.logger.error( - "Unable to export #{flush.event_count} profiling events. Cause: #{e} Location: #{Array(e.backtrace).first}" - ) - end - end + begin + transport.export(flush) + rescue StandardError => e + Datadog.logger.error("Unable to report profile. Cause: #{e} Location: #{Array(e.backtrace).first}") end - flush - end - - def duration_below_threshold?(flush) - (flush.finish - flush.start) < PROFILE_DURATION_THRESHOLD_SECONDS + true end end end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 9271ce3feb9..caaebf87bc2 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -939,43 +939,13 @@ end shared_examples_for 'profiler with default recorder' do - subject(:recorder) { profiler.scheduler.recorder } + subject(:recorder) { profiler.scheduler.send(:recorder) } it do is_expected.to have_attributes(max_size: settings.profiling.advanced.max_events) end end - shared_examples_for 'profiler with default exporters' do - subject(:http_exporter) { profiler.scheduler.exporters.first } - - before do - allow(File).to receive(:exist?).and_call_original - allow(File).to receive(:exist?).with('/var/run/datadog/apm.socket').and_return(false) - end - - it 'has an HTTP exporter' do - expect(profiler.scheduler.exporters).to have(1).item - expect(profiler.scheduler.exporters).to include(kind_of(Datadog::Profiling::Exporter)) - is_expected.to have_attributes( - transport: kind_of(Datadog::Profiling::Transport::HTTP::Client) - ) - - # Should be configured for agent transport - default_api = Datadog::Profiling::Transport::HTTP::API::V1 - expect(http_exporter.transport.api).to have_attributes( - adapter: kind_of(Datadog::Transport::HTTP::Adapters::Net), - spec: Datadog::Profiling::Transport::HTTP::API.agent_defaults[default_api] - ) - expect(http_exporter.transport.api.adapter).to have_attributes( - hostname: agent_settings.hostname, - port: agent_settings.port, - ssl: agent_settings.ssl, - timeout: settings.profiling.upload.timeout_seconds - ) - end - end - context 'by default' do it_behaves_like 'disabled profiler' end @@ -997,7 +967,6 @@ it_behaves_like 'profiler with default collectors' it_behaves_like 'profiler with default scheduler' it_behaves_like 'profiler with default recorder' - it_behaves_like 'profiler with default exporters' it 'runs the setup task to set up any needed extensions for profiling' do expect(profiler_setup_task).to receive(:run) @@ -1005,6 +974,27 @@ build_profiler end + it 'builds an HttpTransport with the current settings' do + expect(Datadog::Profiling::HttpTransport).to receive(:new).with( + agent_settings: agent_settings, + site: settings.site, + api_key: settings.api_key, + upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + ) + + build_profiler + end + + it 'creates a scheduler with an HttpTransport' do + http_transport = instance_double(Datadog::Profiling::HttpTransport) + + expect(Datadog::Profiling::HttpTransport).to receive(:new).and_return(http_transport) + + build_profiler + + expect(profiler.scheduler.send(:transport)).to be http_transport + end + [true, false].each do |value| context "when endpoint_collection_enabled is #{value}" do before { settings.profiling.advanced.endpoint.collection.enabled = value } @@ -1041,8 +1031,7 @@ context 'and :transport' do context 'is given' do - # Must be a kind of Datadog::Profiling::Transport::Client - let(:transport) { Class.new { include Datadog::Profiling::Transport::Client }.new } + let(:transport) { double('Custom transport') } before do allow(settings.profiling.exporter) @@ -1055,13 +1044,7 @@ it_behaves_like 'profiler with default recorder' it 'uses the custom transport' do - expect(profiler.scheduler.exporters).to have(1).item - expect(profiler.scheduler.exporters).to include(kind_of(Datadog::Profiling::Exporter)) - http_exporter = profiler.scheduler.exporters.first - - expect(http_exporter).to have_attributes( - transport: transport - ) + expect(profiler.scheduler.send(:transport)).to be transport end end end diff --git a/spec/datadog/profiling/encoding/profile_spec.rb b/spec/datadog/profiling/encoding/profile_spec.rb index f721b8f1f91..d11a09147c5 100644 --- a/spec/datadog/profiling/encoding/profile_spec.rb +++ b/spec/datadog/profiling/encoding/profile_spec.rb @@ -2,20 +2,26 @@ require 'spec_helper' +require 'datadog/profiling/flush' require 'datadog/profiling/encoding/profile' require 'datadog/profiling/events/stack' RSpec.describe Datadog::Profiling::Encoding::Profile::Protobuf do - describe '::encode' do - subject(:encode) { described_class.encode(flush) } - - let(:flush) do - instance_double(Datadog::Profiling::OldFlush, event_groups: event_groups, start: start_time, finish: finish_time) + describe '.encode' do + subject(:encode) do + described_class.encode( + event_count: event_count, + event_groups: event_groups, + start: start_time, + finish: finish_time + ) end + let(:event_groups) { [event_group] } let(:event_group) { instance_double(Datadog::Profiling::EventGroup, event_class: event_class, events: events) } let(:event_class) { double('event class') } let(:events) { double('events') } + let(:event_count) { nil } let(:template) { instance_double(Datadog::Profiling::Pprof::Template) } let(:profile) { instance_double(Perftools::Profiles::Profile) } @@ -41,20 +47,22 @@ .ordered end - it { is_expected.to be payload } + it 'returns a pprof-encoded profile' do + is_expected.to be payload + end - context 'debug logging' do - before do - allow(flush).to receive(:event_count).and_return(42) - end + describe 'debug logging' do + let(:event_count) { 42 } let(:template) { instance_double(Datadog::Profiling::Pprof::Template, debug_statistics: 'template_debug_statistics') } it 'debug logs profile information' do - expect(Datadog.logger).to receive(:debug) do |&message| - expect(message.call).to include '2020-01-01T00:00:00Z' - expect(message.call).to include '2021-01-01T00:00:00Z' - expect(message.call).to include 'template_debug_statistics' + expect(Datadog.logger).to receive(:debug) do |&message_block| + message = message_block.call + + expect(message).to include '2020-01-01T00:00:00Z' + expect(message).to include '2021-01-01T00:00:00Z' + expect(message).to include 'template_debug_statistics' end encode diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/recorder_spec.rb index 9d1a64be128..bf57d0a09df 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/recorder_spec.rb @@ -8,12 +8,13 @@ RSpec.describe Datadog::Profiling::Recorder do subject(:recorder) do - described_class.new(event_classes, max_size, code_provenance_collector: code_provenance_collector) + described_class.new(event_classes, max_size, code_provenance_collector: code_provenance_collector, **options) end let(:event_classes) { [] } let(:max_size) { 0 } let(:code_provenance_collector) { nil } + let(:options) { {} } shared_context 'test buffer' do let(:buffer) { instance_double(Datadog::Profiling::Buffer) } @@ -117,6 +118,7 @@ include_context 'test buffer' let(:events) { [] } + let(:options) { { minimum_duration: 0 } } # Override the minimum duration to avoid needing to mock Time subject(:flush) { recorder.flush } @@ -129,64 +131,108 @@ context 'whose buffer returns events' do let(:events) { [event_class.new, event_class.new] } - it { is_expected.to be_a_kind_of(Datadog::Profiling::OldFlush) } + before do + allow(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode) + end - it do + it 'returns a flush with the profiling data' do is_expected.to have_attributes( start: kind_of(Time), finish: kind_of(Time), - event_groups: array_including(Datadog::Profiling::EventGroup), - event_count: 2 + pprof_file_name: 'rubyprofile.pprof.gz', + code_provenance_file_name: 'code-provenance.json.gz', + tags_as_array: array_including(%w[language ruby], ['pid', Process.pid.to_s]), ) end - it { expect(flush.event_groups).to be_a_kind_of(Array) } - it { expect(flush.event_groups).to have(1).item } - it { expect(flush.start).to be < flush.finish } + it 'calls the protobuf encoder with the events' do + expected_event_group = instance_double(Datadog::Profiling::EventGroup) - it 'produces a flush with the events' do - expect(flush.event_groups.first).to have_attributes( - event_class: event_class, - events: events + expect(Datadog::Profiling::EventGroup) + .to receive(:new).with(event_class, events).and_return(expected_event_group) + expect(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).with( + start: kind_of(Time), + finish: kind_of(Time), + event_groups: [expected_event_group], + event_count: 2, ) + + flush end - end - context 'whose buffer returns no events' do - it { is_expected.to be_a_kind_of(Datadog::Profiling::OldFlush) } - it { expect(flush.event_groups).to be_empty } - end + it 'returns a flush with gzip-compressed pprof data' do + expect(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).and_return('dummy pprof data') - context 'called back to back' do - subject(:flush) { Array.new(3) { recorder.flush } } + flush - it 'has its start and end times line up' do - expect(flush[0].start).to be < flush[0].finish - expect(flush[0].finish).to eq(flush[1].start) - expect(flush[1].finish).to eq(flush[2].start) - expect(flush[2].start).to be < flush[2].finish + expect(Datadog::Core::Utils::Compression.gunzip(flush.pprof_data)).to eq 'dummy pprof data' end - end - end - context 'when code_provenance_collector is nil' do - let(:code_provenance_collector) { nil } + context 'called back to back' do + subject(:flush) { Array.new(3) { recorder.flush } } - it 'returns a flush without code_provenance' do - expect(flush.code_provenance).to be nil - end - end + it 'has its start and end times line up' do + expect(flush[0].start).to be < flush[0].finish + expect(flush[0].finish).to eq flush[1].start + expect(flush[1].finish).to eq flush[2].start + expect(flush[2].start).to be < flush[2].finish + end + end + + context 'when code_provenance_collector is nil' do + let(:code_provenance_collector) { nil } - context 'when code_provenance_collector is available' do - let(:code_provenance_collector) do - collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance) - allow(collector).to receive(:refresh).and_return(collector) - collector + it 'returns a flush without code provenance data' do + expect(flush.code_provenance_data).to be nil + end + end + + context 'when code_provenance_collector is available' do + let(:code_provenance_collector) do + collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance) + allow(collector).to receive(:refresh).and_return(collector) + collector + end + let(:code_provenance) { 'dummy code provenance data' } + + it 'returns a flush with gzip-compressed code provenance data' do + expect(Datadog::Core::Utils::Compression.gunzip(flush.code_provenance_data)).to eq code_provenance + end + end + + context 'when duration of profile is below 1s' do + let(:finish_time) { Time.utc(2021) } + let(:options) { { last_flush_time: finish_time - 0.9 } } + + before do + expect(Time).to receive(:now).and_return(finish_time) + end + + it { is_expected.to be nil } + + it 'logs a debug message' do + expect(Datadog.logger).to receive(:debug) do |&message| + expect(message.call).to include 'Skipped exporting' + end + + flush + end + end + + context 'when duration of profile is at least 1s' do + let(:finish_time) { Time.utc(2021) } + let(:options) { { last_flush_time: finish_time - 1 } } + + before do + expect(Time).to receive(:now).and_return(finish_time) + end + + it { is_expected.to_not be nil } + end end - let(:code_provenance) { double('code_provenance') } - it 'returns a flush with code_provenance' do - expect(flush.code_provenance).to be code_provenance + context 'whose buffer returns no events' do + it { is_expected.to be nil } end end end diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 9cef22c4f76..64e610e5e92 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -7,27 +7,21 @@ require 'datadog/profiling/scheduler' RSpec.describe Datadog::Profiling::Scheduler do - subject(:scheduler) { described_class.new(recorder, exporters, **options) } + subject(:scheduler) { described_class.new(recorder: recorder, transport: transport, **options) } let(:recorder) { instance_double(Datadog::Profiling::Recorder) } - let(:exporters) { [instance_double(Datadog::Profiling::Exporter)] } + let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } let(:options) { {} } - describe '::new' do - it 'with default settings' do - is_expected.to have_attributes( - enabled?: true, - exporters: exporters, - fork_policy: Datadog::Core::Workers::Async::Thread::FORK_POLICY_RESTART, - loop_base_interval: described_class.const_get(:DEFAULT_INTERVAL_SECONDS), - recorder: recorder - ) - end - - context 'given a single exporter' do - let(:exporters) { instance_double(Datadog::Profiling::Exporter) } - - it { is_expected.to have_attributes(exporters: [exporters]) } + describe '.new' do + describe 'default settings' do + it do + is_expected.to have_attributes( + enabled?: true, + fork_policy: Datadog::Core::Workers::Async::Thread::FORK_POLICY_RESTART, + loop_base_interval: 60, # seconds + ) + end end end @@ -137,99 +131,61 @@ describe '#flush_events' do subject(:flush_events) { scheduler.send(:flush_events) } - let(:flush_start) { Time.now } - let(:flush_finish) { flush_start + 1 } - let(:flush) do - instance_double(Datadog::Profiling::OldFlush, event_count: event_count, start: flush_start, finish: flush_finish) - end + let(:flush) { instance_double(Datadog::Profiling::Flush) } before { expect(recorder).to receive(:flush).and_return(flush) } - context 'when no events are available' do - let(:event_count) { 0 } - - it 'does not export' do - exporters.each do |exporter| - expect(exporter).to_not receive(:export) - end + it 'exports the profiling data' do + expect(transport).to receive(:export).with(flush) - is_expected.to be flush - end + flush_events end - context 'when events are available' do - let(:event_count) { 4 } - - context 'and all the exporters succeed' do - it 'returns the flush' do - expect(exporters).to all(receive(:export).with(flush)) - - is_expected.to be flush - end + context 'when transport fails' do + before do + expect(transport).to receive(:export) { raise 'Kaboom' } end - context 'and one of the exporters fail' do - before do - allow(exporters.first).to receive(:export) - .and_raise(StandardError) - - expect(Datadog.logger).to receive(:error) - .with(/Unable to export \d+ profiling events/) - .exactly(1).time - end + it 'gracefully handles the exception, logging it' do + expect(Datadog.logger).to receive(:error).with(/Kaboom/) - it 'returns the number of events flushed' do - is_expected.to be flush - - expect(exporters).to all(have_received(:export).with(flush)) - end + flush_events end + end - context 'when the flush contains less than 1s of profiling data' do - let(:flush_finish) { super() - 0.01 } - - it 'does not export' do - exporters.each do |exporter| - expect(exporter).to_not receive(:export) - end - - flush_events - end + context 'when the flush does not contain enough data' do + let(:flush) { nil } - it 'logs a debug message' do - expect(Datadog.logger).to receive(:debug) do |&message| - expect(message.call).to include 'Skipped exporting' - end + it 'does not try to export the profiling data' do + expect(transport).to_not receive(:export) - flush_events - end + flush_events end + end - context 'when being run in a loop' do - before { allow(scheduler).to receive(:run_loop?).and_return(true) } - - it 'sleeps for up to DEFAULT_FLUSH_JITTER_MAXIMUM_SECONDS seconds before reporting' do - expect(scheduler).to receive(:sleep) do |sleep_amount| - expect(sleep_amount).to be < described_class.const_get(:DEFAULT_FLUSH_JITTER_MAXIMUM_SECONDS) - expect(sleep_amount).to be_a_kind_of(Float) - end - - expect(exporters).to all(receive(:export).with(flush)) + context 'when being run in a loop' do + before { allow(scheduler).to receive(:run_loop?).and_return(true) } - flush_events + it 'sleeps for up to DEFAULT_FLUSH_JITTER_MAXIMUM_SECONDS seconds before reporting' do + expect(scheduler).to receive(:sleep) do |sleep_amount| + expect(sleep_amount).to be < described_class.const_get(:DEFAULT_FLUSH_JITTER_MAXIMUM_SECONDS) + expect(sleep_amount).to be_a_kind_of(Float) + expect(transport).to receive(:export) end + + flush_events end + end - context 'when being run as a one-off' do - before { allow(scheduler).to receive(:run_loop?).and_return(false) } + context 'when being run as a one-off' do + before { allow(scheduler).to receive(:run_loop?).and_return(false) } - it 'does not sleep before reporting' do - expect(scheduler).to_not receive(:sleep) + it 'does not sleep before reporting' do + expect(scheduler).to_not receive(:sleep) - expect(exporters).to all(receive(:export).with(flush)) + expect(transport).to receive(:export) - flush_events - end + flush_events end end end From 773b61a843230e931235d8782bb14a767c44b7b1 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 3 Mar 2022 13:43:13 +0000 Subject: [PATCH 0070/2133] Remove old profiling transport implementation This has been replaced with the new `HttpTransport` class. --- benchmarks/profiler_sample_loop.rb | 6 + lib/datadog/profiling.rb | 4 +- lib/datadog/profiling/encoding/profile.rb | 1 - lib/datadog/profiling/exporter.rb | 25 --- lib/datadog/profiling/ext.rb | 13 -- lib/datadog/profiling/flush.rb | 58 ----- lib/datadog/profiling/transport/client.rb | 16 -- lib/datadog/profiling/transport/http.rb | 112 ---------- lib/datadog/profiling/transport/http/api.rb | 45 ---- .../profiling/transport/http/api/endpoint.rb | 107 ---------- .../profiling/transport/http/api/instance.rb | 38 ---- .../profiling/transport/http/api/spec.rb | 42 ---- .../profiling/transport/http/builder.rb | 30 --- .../profiling/transport/http/client.rb | 35 --- .../profiling/transport/http/response.rb | 23 -- lib/datadog/profiling/transport/io.rb | 32 --- lib/datadog/profiling/transport/io/client.rb | 29 --- .../profiling/transport/io/response.rb | 18 -- lib/datadog/profiling/transport/parcel.rb | 19 -- lib/datadog/profiling/transport/request.rb | 17 -- lib/datadog/profiling/transport/response.rb | 10 - .../core/configuration/components_spec.rb | 4 - spec/datadog/profiling/exporter_spec.rb | 53 ----- spec/datadog/profiling/flush_spec.rb | 99 --------- spec/datadog/profiling/integration_spec.rb | 28 ++- .../profiling/native_extension_spec.rb | 19 +- spec/datadog/profiling/scheduler_spec.rb | 2 +- spec/datadog/profiling/spec_helper.rb | 35 --- .../profiling/transport/client_spec.rb | 22 -- .../http/adapters/net_integration_spec.rb | 202 ------------------ .../transport/http/api/endpoint_spec.rb | 182 ---------------- .../transport/http/api/instance_spec.rb | 38 ---- .../profiling/transport/http/api/spec_spec.rb | 57 ----- .../profiling/transport/http/api_spec.rb | 45 ---- .../profiling/transport/http/builder_spec.rb | 70 ------ .../profiling/transport/http/client_spec.rb | 84 -------- .../transport/http/integration_spec.rb | 75 ------- .../profiling/transport/http/response_spec.rb | 41 ---- spec/datadog/profiling/transport/http_spec.rb | 171 --------------- .../profiling/transport/io/client_spec.rb | 57 ----- .../profiling/transport/io/response_spec.rb | 14 -- spec/datadog/profiling/transport/io_spec.rb | 56 ----- .../profiling/transport/parcel_spec.rb | 32 --- .../profiling/transport/request_spec.rb | 19 -- 44 files changed, 21 insertions(+), 2064 deletions(-) delete mode 100644 lib/datadog/profiling/exporter.rb delete mode 100644 lib/datadog/profiling/transport/client.rb delete mode 100644 lib/datadog/profiling/transport/http.rb delete mode 100644 lib/datadog/profiling/transport/http/api.rb delete mode 100644 lib/datadog/profiling/transport/http/api/endpoint.rb delete mode 100644 lib/datadog/profiling/transport/http/api/instance.rb delete mode 100644 lib/datadog/profiling/transport/http/api/spec.rb delete mode 100644 lib/datadog/profiling/transport/http/builder.rb delete mode 100644 lib/datadog/profiling/transport/http/client.rb delete mode 100644 lib/datadog/profiling/transport/http/response.rb delete mode 100644 lib/datadog/profiling/transport/io.rb delete mode 100644 lib/datadog/profiling/transport/io/client.rb delete mode 100644 lib/datadog/profiling/transport/io/response.rb delete mode 100644 lib/datadog/profiling/transport/parcel.rb delete mode 100644 lib/datadog/profiling/transport/request.rb delete mode 100644 lib/datadog/profiling/transport/response.rb delete mode 100644 spec/datadog/profiling/exporter_spec.rb delete mode 100644 spec/datadog/profiling/transport/client_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/api/endpoint_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/api/instance_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/api/spec_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/api_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/builder_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/client_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/integration_spec.rb delete mode 100644 spec/datadog/profiling/transport/http/response_spec.rb delete mode 100644 spec/datadog/profiling/transport/http_spec.rb delete mode 100644 spec/datadog/profiling/transport/io/client_spec.rb delete mode 100644 spec/datadog/profiling/transport/io/response_spec.rb delete mode 100644 spec/datadog/profiling/transport/io_spec.rb delete mode 100644 spec/datadog/profiling/transport/parcel_spec.rb delete mode 100644 spec/datadog/profiling/transport/request_spec.rb diff --git a/benchmarks/profiler_sample_loop.rb b/benchmarks/profiler_sample_loop.rb index 86e07d1eff2..3c3f6028371 100644 --- a/benchmarks/profiler_sample_loop.rb +++ b/benchmarks/profiler_sample_loop.rb @@ -13,9 +13,15 @@ # This benchmark measures the performance of the main stack sampling loop of the profiler class ProfilerSampleLoopBenchmark + class MockProfilerTransport + def export(_flush) + end + end + def create_profiler Datadog.configure do |c| c.profiling.enabled = true + c.profiling.exporter.transport = MockProfilerTransport.new c.tracing.transport_options = proc { |t| t.adapter :test } end diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index 4ffd9ab64de..f3b6f0eecf2 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -150,17 +150,15 @@ def self.start_if_enabled require 'datadog/profiling/collectors/old_stack' require 'datadog/profiling/collectors/stack' require 'datadog/profiling/stack_recorder' - require 'datadog/profiling/exporter' require 'datadog/profiling/recorder' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' - require 'datadog/profiling/transport/io' - require 'datadog/profiling/transport/http' require 'datadog/profiling/profiler' require 'datadog/profiling/native_extension' require 'datadog/profiling/trace_identifiers/helper' require 'datadog/profiling/pprof/pprof_pb' require 'datadog/profiling/tag_builder' + require 'datadog/profiling/http_transport' true end diff --git a/lib/datadog/profiling/encoding/profile.rb b/lib/datadog/profiling/encoding/profile.rb index 94872e05867..80016ebfbc7 100644 --- a/lib/datadog/profiling/encoding/profile.rb +++ b/lib/datadog/profiling/encoding/profile.rb @@ -13,7 +13,6 @@ module Protobuf module_function def encode(event_count:, event_groups:, start:, finish:) - # Create a pprof template from the list of event types event_classes = event_groups.collect(&:event_class).uniq template = Pprof::Template.for_event_classes(event_classes) diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb deleted file mode 100644 index d64b6772c98..00000000000 --- a/lib/datadog/profiling/exporter.rb +++ /dev/null @@ -1,25 +0,0 @@ -# typed: true - -require 'datadog/profiling/transport/io/client' - -module Datadog - module Profiling - # Writes profiling data to a given transport - class Exporter - attr_reader \ - :transport - - def initialize(transport) - unless transport.is_a?(Profiling::Transport::Client) - raise ArgumentError, 'Unsupported transport for profiling exporter.' - end - - @transport = transport - end - - def export(flush) - transport.send_profiling_flush(flush) - end - end - end -end diff --git a/lib/datadog/profiling/ext.rb b/lib/datadog/profiling/ext.rb index 66d5c32e04c..b822ce5d136 100644 --- a/lib/datadog/profiling/ext.rb +++ b/lib/datadog/profiling/ext.rb @@ -22,11 +22,6 @@ module Pprof module Transport module HTTP - URI_TEMPLATE_DD_API = 'https://intake.profile.%s/'.freeze - - FORM_FIELD_RECORDING_START = 'start'.freeze - FORM_FIELD_RECORDING_END = 'end'.freeze - FORM_FIELD_FAMILY = 'family'.freeze FORM_FIELD_TAG_ENV = 'env'.freeze FORM_FIELD_TAG_HOST = 'host'.freeze FORM_FIELD_TAG_LANGUAGE = 'language'.freeze @@ -39,16 +34,8 @@ module HTTP FORM_FIELD_TAG_RUNTIME_VERSION = 'runtime_version'.freeze FORM_FIELD_TAG_SERVICE = 'service'.freeze FORM_FIELD_TAG_VERSION = 'version'.freeze - FORM_FIELD_TAGS = 'tags'.freeze - FORM_FIELD_INTAKE_VERSION = 'version'.freeze - - HEADER_CONTENT_TYPE = 'Content-Type'.freeze - HEADER_CONTENT_TYPE_OCTET_STREAM = 'application/octet-stream'.freeze - FORM_FIELD_PPROF_DATA = 'data[rubyprofile.pprof]'.freeze PPROF_DEFAULT_FILENAME = 'rubyprofile.pprof.gz'.freeze - - FORM_FIELD_CODE_PROVENANCE_DATA = 'data[code-provenance.json]'.freeze CODE_PROVENANCE_FILENAME = 'code-provenance.json.gz'.freeze end end diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index 22b25fb1742..2a1be5e9a84 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -5,64 +5,6 @@ module Datadog module Profiling - # Entity class used to represent metadata for a given profile - OldFlush = Struct.new( - :start, - :finish, - :event_groups, - :event_count, - :code_provenance, - :runtime_id, - :service, - :env, - :version, - :host, - :language, - :runtime_engine, - :runtime_platform, - :runtime_version, - :profiler_version, - :tags - ) do - def initialize( - start:, - finish:, - event_groups:, - event_count:, - code_provenance:, - runtime_id: Core::Environment::Identity.id, - service: Datadog.configuration.service, - env: Datadog.configuration.env, - version: Datadog.configuration.version, - host: Core::Environment::Socket.hostname, - language: Core::Environment::Identity.lang, - runtime_engine: Core::Environment::Identity.lang_engine, - runtime_platform: Core::Environment::Identity.lang_platform, - runtime_version: Core::Environment::Identity.lang_version, - profiler_version: Core::Environment::Identity.tracer_version, - tags: Datadog.configuration.tags - ) - super( - start, - finish, - event_groups, - event_count, - code_provenance, - runtime_id, - service, - env, - version, - host, - language, - runtime_engine, - runtime_platform, - runtime_version, - profiler_version, - tags, - ) - end - end - # Represents a collection of events of a specific type being flushed. EventGroup = Struct.new(:event_class, :events) diff --git a/lib/datadog/profiling/transport/client.rb b/lib/datadog/profiling/transport/client.rb deleted file mode 100644 index 3d967751394..00000000000 --- a/lib/datadog/profiling/transport/client.rb +++ /dev/null @@ -1,16 +0,0 @@ -# typed: true - -module Datadog - module Profiling - module Transport - # Generic interface for profiling transports - module Client - include Kernel # Ensure that kernel methods are always available (https://sorbet.org/docs/error-reference#7003) - - def send_profiling_flush(flush) - raise NotImplementedError - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http.rb b/lib/datadog/profiling/transport/http.rb deleted file mode 100644 index 63f15b96d47..00000000000 --- a/lib/datadog/profiling/transport/http.rb +++ /dev/null @@ -1,112 +0,0 @@ -# typed: true - -require 'datadog/core/environment/ext' -require 'ddtrace/transport/ext' - -require 'datadog/core/environment/container' -require 'datadog/core/environment/variable_helpers' - -require 'datadog/profiling/transport/http/builder' -require 'datadog/profiling/transport/http/api' - -require 'ddtrace/transport/http/adapters/net' -require 'ddtrace/transport/http/adapters/test' -require 'ddtrace/transport/http/adapters/unix_socket' - -module Datadog - module Profiling - module Transport - # Namespace for HTTP transport components - module HTTP - # Builds a new Transport::HTTP::Client - def self.new(&block) - Builder.new(&block).to_transport - end - - # Builds a new Transport::HTTP::Client with default settings - def self.default( - profiling_upload_timeout_seconds:, - agent_settings:, - site: nil, - api_key: nil, - agentless_allowed: agentless_allowed? - ) - new do |transport| - transport.headers default_headers - - # Configure adapter & API - if site && api_key && agentless_allowed - configure_for_agentless( - transport, - profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, - site: site, - api_key: api_key - ) - else - configure_for_agent( - transport, - profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, - agent_settings: agent_settings - ) - end - end - end - - def self.default_headers - { - Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Core::Environment::Ext::LANG, - Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Core::Environment::Ext::LANG_VERSION, - Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Core::Environment::Ext::LANG_INTERPRETER, - Datadog::Transport::Ext::HTTP::HEADER_META_TRACER_VERSION => Core::Environment::Ext::TRACER_VERSION - }.tap do |headers| - # Add container ID, if present. - container_id = Core::Environment::Container.container_id - headers[Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID] = container_id unless container_id.nil? - end - end - - private_class_method def self.configure_for_agent(transport, profiling_upload_timeout_seconds:, agent_settings:) - apis = API.agent_defaults - - transport.adapter(agent_settings.merge(timeout_seconds: profiling_upload_timeout_seconds)) - transport.api(API::V1, apis[API::V1], default: true) - - # NOTE: This proc, when it exists, usually overrides the transport specified above - if agent_settings.deprecated_for_removal_transport_configuration_proc - agent_settings.deprecated_for_removal_transport_configuration_proc.call(transport) - end - end - - private_class_method def self.configure_for_agentless(transport, profiling_upload_timeout_seconds:, site:, api_key:) - apis = API.api_defaults - - site_uri = URI(format(Profiling::Ext::Transport::HTTP::URI_TEMPLATE_DD_API, site)) - hostname = site_uri.host - port = site_uri.port - - transport.adapter( - Datadog::Transport::Ext::HTTP::ADAPTER, - hostname, - port, - timeout: profiling_upload_timeout_seconds, - ssl: site_uri.scheme == 'https' - ) - transport.api(API::V1, apis[API::V1], default: true) - transport.headers(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) - end - - private_class_method def self.agentless_allowed? - Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false) - end - - # Add adapters to registry - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Net, - Datadog::Transport::Ext::HTTP::ADAPTER) - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Test, - Datadog::Transport::Ext::Test::ADAPTER) - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::UnixSocket, - Datadog::Transport::Ext::UnixSocket::ADAPTER) - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/api.rb b/lib/datadog/profiling/transport/http/api.rb deleted file mode 100644 index b2ec92ddbff..00000000000 --- a/lib/datadog/profiling/transport/http/api.rb +++ /dev/null @@ -1,45 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/api/map' -require 'datadog/profiling/encoding/profile' -require 'datadog/profiling/transport/http/api/spec' -require 'datadog/profiling/transport/http/api/instance' -require 'datadog/profiling/transport/http/api/endpoint' - -module Datadog - module Profiling - module Transport - module HTTP - # Extensions for HTTP API Spec - module API - # Default API versions - V1 = 'v1'.freeze - - module_function - - def agent_defaults - @agent_defaults ||= Datadog::Transport::HTTP::API::Map[ - V1 => Spec.new do |s| - s.profiles = Endpoint.new( - '/profiling/v1/input'.freeze, - Profiling::Encoding::Profile::Protobuf - ) - end - ] - end - - def api_defaults - @api_defaults ||= Datadog::Transport::HTTP::API::Map[ - V1 => Spec.new do |s| - s.profiles = Endpoint.new( - '/v1/input'.freeze, - Profiling::Encoding::Profile::Protobuf - ) - end - ] - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/api/endpoint.rb b/lib/datadog/profiling/transport/http/api/endpoint.rb deleted file mode 100644 index 309344505dd..00000000000 --- a/lib/datadog/profiling/transport/http/api/endpoint.rb +++ /dev/null @@ -1,107 +0,0 @@ -# typed: true - -require 'datadog/core/utils/compression' -require 'datadog/core/vendor/multipart-post/multipart/post/composite_read_io' -require 'datadog/profiling/ext' -require 'datadog/profiling/transport/http/response' -require 'ddtrace/transport/http/api/endpoint' - -module Datadog - module Profiling - module Transport - module HTTP - module API - # Datadog API endpoint for profiling - class Endpoint < Datadog::Transport::HTTP::API::Endpoint - include Profiling::Ext::Transport::HTTP - - # These tags are read from the flush object (see below) directly and so we ignore any extra copies that - # may come in the tags hash to avoid duplicates. - TAGS_TO_IGNORE_IN_TAGS_HASH = %w[service env version].freeze - private_constant :TAGS_TO_IGNORE_IN_TAGS_HASH - - attr_reader \ - :encoder - - def initialize(path, encoder) - super(:post, path) - @encoder = encoder - end - - def call(env, &block) - # Build request - env.form = build_form(env) - - # Send request - http_response = super(env, &block) - - # Build response - Profiling::Transport::HTTP::Response.new(http_response) - end - - def build_form(env) - flush = env.request.parcel.data - pprof_file = build_pprof(flush) - - form = { - FORM_FIELD_INTAKE_VERSION => '3', # Aka 1.3 intake format - FORM_FIELD_RECORDING_START => flush.start.utc.iso8601, - FORM_FIELD_RECORDING_END => flush.finish.utc.iso8601, - FORM_FIELD_TAGS => [ - "#{FORM_FIELD_TAG_RUNTIME}:#{flush.language}", - "#{FORM_FIELD_TAG_RUNTIME_ID}:#{flush.runtime_id}", - "#{FORM_FIELD_TAG_RUNTIME_ENGINE}:#{flush.runtime_engine}", - "#{FORM_FIELD_TAG_RUNTIME_PLATFORM}:#{flush.runtime_platform}", - "#{FORM_FIELD_TAG_RUNTIME_VERSION}:#{flush.runtime_version}", - "#{FORM_FIELD_TAG_PID}:#{Process.pid}", - "#{FORM_FIELD_TAG_PROFILER_VERSION}:#{flush.profiler_version}", - # NOTE: Redundant w/ 'runtime'; may want to remove this later. - "#{FORM_FIELD_TAG_LANGUAGE}:#{flush.language}", - "#{FORM_FIELD_TAG_HOST}:#{flush.host}", - *flush - .tags - .reject { |tag_key| TAGS_TO_IGNORE_IN_TAGS_HASH.include?(tag_key) } - .map { |tag_key, tag_value| "#{tag_key}:#{tag_value}" } - ], - FORM_FIELD_PPROF_DATA => pprof_file, - FORM_FIELD_FAMILY => flush.language, - } - - # Optional fields - form[FORM_FIELD_TAGS] << "#{FORM_FIELD_TAG_SERVICE}:#{flush.service}" unless flush.service.nil? - form[FORM_FIELD_TAGS] << "#{FORM_FIELD_TAG_ENV}:#{flush.env}" unless flush.env.nil? - form[FORM_FIELD_TAGS] << "#{FORM_FIELD_TAG_VERSION}:#{flush.version}" unless flush.version.nil? - - # May not be available/enabled - form[FORM_FIELD_CODE_PROVENANCE_DATA] = build_code_provenance(flush) if flush.code_provenance - - form - end - - def build_pprof(flush) - pprof = encoder.encode(flush) - - gzipped_pprof_data = Core::Utils::Compression.gzip(pprof.data) - - Core::Vendor::Multipart::Post::UploadIO.new( - StringIO.new(gzipped_pprof_data), - HEADER_CONTENT_TYPE_OCTET_STREAM, - PPROF_DEFAULT_FILENAME - ) - end - - def build_code_provenance(flush) - gzipped_code_provenance = Core::Utils::Compression.gzip(flush.code_provenance) - - Core::Vendor::Multipart::Post::UploadIO.new( - StringIO.new(gzipped_code_provenance), - HEADER_CONTENT_TYPE_OCTET_STREAM, - CODE_PROVENANCE_FILENAME, - ) - end - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/api/instance.rb b/lib/datadog/profiling/transport/http/api/instance.rb deleted file mode 100644 index fc05ee13486..00000000000 --- a/lib/datadog/profiling/transport/http/api/instance.rb +++ /dev/null @@ -1,38 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/api/instance' -require 'datadog/profiling/transport/http/api/spec' - -module Datadog - module Profiling - module Transport - module HTTP - module API - # API instance for profiling - class Instance < Datadog::Transport::HTTP::API::Instance - def send_profiling_flush(env) - raise ProfilesNotSupportedError, spec unless spec.is_a?(Spec) - - spec.send_profiling_flush(env) do |request_env| - call(request_env) - end - end - - # Raised when profiles sent to API that does not support profiles - class ProfilesNotSupportedError < StandardError - attr_reader :spec - - def initialize(spec) - @spec = spec - end - - def message - 'Profiles not supported for this API!' - end - end - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/api/spec.rb b/lib/datadog/profiling/transport/http/api/spec.rb deleted file mode 100644 index a16206e81ff..00000000000 --- a/lib/datadog/profiling/transport/http/api/spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/api/spec' - -module Datadog - module Profiling - module Transport - module HTTP - module API - # API specification for profiling - class Spec < Datadog::Transport::HTTP::API::Spec - attr_accessor \ - :profiles - - def send_profiling_flush(env, &block) - raise NoProfilesEndpointDefinedError, self if profiles.nil? - - profiles.call(env, &block) - end - - def encoder - profiles.encoder - end - - # Raised when profiles sent but no profiles endpoint is defined - class NoProfilesEndpointDefinedError < StandardError - attr_reader :spec - - def initialize(spec) - @spec = spec - end - - def message - 'No profiles endpoint is defined for API specification!' - end - end - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/builder.rb b/lib/datadog/profiling/transport/http/builder.rb deleted file mode 100644 index f36fce658f1..00000000000 --- a/lib/datadog/profiling/transport/http/builder.rb +++ /dev/null @@ -1,30 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/builder' - -require 'datadog/profiling/transport/http/api' -require 'datadog/profiling/transport/http/client' - -module Datadog - module Profiling - module Transport - module HTTP - # Builds new instances of Transport::HTTP::Client - class Builder < Datadog::Transport::HTTP::Builder - def api_instance_class - API::Instance - end - - def to_transport - raise Datadog::Transport::HTTP::Builder::NoDefaultApiError if @default_api.nil? - - # TODO: Profiling doesn't have multiple APIs yet. - # When it does, we should build it out with these APIs. - # Just use :default_api for now. - Client.new(to_api_instances[@default_api]) - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/client.rb b/lib/datadog/profiling/transport/http/client.rb deleted file mode 100644 index d182682509e..00000000000 --- a/lib/datadog/profiling/transport/http/client.rb +++ /dev/null @@ -1,35 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/client' -require 'datadog/profiling/transport/client' - -module Datadog - module Profiling - module Transport - module HTTP - # Routes, encodes, and sends tracer data to the trace agent via HTTP. - class Client < Datadog::Transport::HTTP::Client - include Transport::Client - - def send_profiling_flush(flush) - # Build a request - request = Profiling::Transport::Request.new(flush) - send_payload(request).tap do |response| - if response.ok? - Datadog.logger.debug('Successfully reported profiling data') - else - Datadog.logger.debug { "Failed to report profiling data -- #{response.inspect}" } - end - end - end - - def send_payload(request) - send_request(request) do |api, env| - api.send_profiling_flush(env) - end - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/http/response.rb b/lib/datadog/profiling/transport/http/response.rb deleted file mode 100644 index 5291d7e66d9..00000000000 --- a/lib/datadog/profiling/transport/http/response.rb +++ /dev/null @@ -1,23 +0,0 @@ -# typed: true - -require 'ddtrace/transport/http/response' -require 'datadog/profiling/transport/response' - -module Datadog - module Profiling - module Transport - # HTTP transport behavior for profiling - module HTTP - # Response from HTTP transport for profiling - class Response - include Datadog::Transport::HTTP::Response - include Profiling::Transport::Response - - def initialize(http_response, options = {}) - super(http_response) - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/io.rb b/lib/datadog/profiling/transport/io.rb deleted file mode 100644 index a0a61f95ded..00000000000 --- a/lib/datadog/profiling/transport/io.rb +++ /dev/null @@ -1,32 +0,0 @@ -# typed: true - -require 'datadog/profiling/transport/io/client' -require 'datadog/profiling/encoding/profile' - -module Datadog - module Profiling - module Transport - # Namespace for profiling IO transport components - module IO - module_function - - # Builds a new Profiling::Transport::IO::Client - def new(out, encoder, options = {}) - Client.new(out, encoder, options) - end - - # Builds a new Profiling::Transport::IO::Client with default settings - # Pass options to override any settings. - def default(options = {}) - options = options.dup - - new( - options.delete(:out) || $stdout, - options.delete(:encoder) || Profiling::Encoding::Profile::Protobuf, - options - ) - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/io/client.rb b/lib/datadog/profiling/transport/io/client.rb deleted file mode 100644 index 08403818277..00000000000 --- a/lib/datadog/profiling/transport/io/client.rb +++ /dev/null @@ -1,29 +0,0 @@ -# typed: true - -require 'ddtrace/transport/io/client' -require 'datadog/profiling/transport/client' -require 'datadog/profiling/transport/request' -require 'datadog/profiling/transport/io/response' - -module Datadog - module Profiling - module Transport - module IO - # IO transport for profiling - class Client < Datadog::Transport::IO::Client - include Transport::Client - - def send_profiling_flush(flush) - # Build a request - request = Profiling::Transport::Request.new(flush) - send_request(request) - end - - def build_response(_request, _data, result) - Profiling::Transport::IO::Response.new(result) - end - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/io/response.rb b/lib/datadog/profiling/transport/io/response.rb deleted file mode 100644 index 7716b364024..00000000000 --- a/lib/datadog/profiling/transport/io/response.rb +++ /dev/null @@ -1,18 +0,0 @@ -# typed: strict - -require 'ddtrace/transport/io/response' -require 'datadog/profiling/transport/response' - -module Datadog - module Profiling - module Transport - # IO transport behavior for profiling - module IO - # Response from IO transport for profiling - class Response < Datadog::Transport::IO::Response - include Profiling::Transport::Response - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/parcel.rb b/lib/datadog/profiling/transport/parcel.rb deleted file mode 100644 index 6d024a53ac5..00000000000 --- a/lib/datadog/profiling/transport/parcel.rb +++ /dev/null @@ -1,19 +0,0 @@ -# typed: true - -require 'ddtrace/transport/parcel' - -module Datadog - module Profiling - module Transport - # Data transfer object for profiling data - class Parcel - include Datadog::Transport::Parcel - - def encode_with(encoder) - # TODO: Determine encoding behavior - encoder.encode(data) - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/request.rb b/lib/datadog/profiling/transport/request.rb deleted file mode 100644 index 3b35b3ae111..00000000000 --- a/lib/datadog/profiling/transport/request.rb +++ /dev/null @@ -1,17 +0,0 @@ -# typed: true - -require 'ddtrace/transport/request' -require 'datadog/profiling/transport/parcel' - -module Datadog - module Profiling - module Transport - # Profiling request - class Request < Datadog::Transport::Request - def initialize(flush) - super(Parcel.new(flush)) - end - end - end - end -end diff --git a/lib/datadog/profiling/transport/response.rb b/lib/datadog/profiling/transport/response.rb deleted file mode 100644 index f9c72df005d..00000000000 --- a/lib/datadog/profiling/transport/response.rb +++ /dev/null @@ -1,10 +0,0 @@ -# typed: strict - -module Datadog - module Profiling - module Transport - # Profiling response - module Response; end - end - end -end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index caaebf87bc2..dc742468a11 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -15,15 +15,11 @@ require 'datadog/profiling' require 'datadog/profiling/collectors/code_provenance' require 'datadog/profiling/collectors/old_stack' -require 'datadog/profiling/exporter' require 'datadog/profiling/profiler' require 'datadog/profiling/recorder' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' require 'datadog/profiling/trace_identifiers/helper' -require 'datadog/profiling/transport/client' -require 'datadog/profiling/transport/http/api' -require 'datadog/profiling/transport/http/client' require 'datadog/statsd' require 'datadog/tracing/flush' require 'datadog/tracing/sampling/all_sampler' diff --git a/spec/datadog/profiling/exporter_spec.rb b/spec/datadog/profiling/exporter_spec.rb deleted file mode 100644 index 5e7bc62b5f0..00000000000 --- a/spec/datadog/profiling/exporter_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/exporter' -require 'datadog/profiling/flush' -require 'datadog/profiling/transport/io' - -RSpec.describe Datadog::Profiling::Exporter do - subject(:exporter) { described_class.new(transport) } - - let(:transport) { Datadog::Profiling::Transport::IO.default } - - describe '::new' do - context 'given an IO transport' do - it 'uses the transport' do - is_expected.to have_attributes( - transport: transport - ) - end - end - - context 'given an HTTP transport' do - let(:transport) { instance_double(Datadog::Transport::HTTP::Client) } - - # TODO: Should not raise an error when implemented. - it 'raises an error' do - expect { exporter }.to raise_error(ArgumentError) - end - end - end - - describe '#export' do - subject(:export) { exporter.export(flush) } - - let(:flush) { instance_double(Datadog::Profiling::OldFlush) } - let(:result) { double('result') } - - before do - allow(transport) - .to receive(:send_profiling_flush) - .and_return(result) - end - - it do - is_expected.to be result - - expect(transport) - .to have_received(:send_profiling_flush) - .with(flush) - end - end -end diff --git a/spec/datadog/profiling/flush_spec.rb b/spec/datadog/profiling/flush_spec.rb index 73a1b00735e..33357b6650f 100644 --- a/spec/datadog/profiling/flush_spec.rb +++ b/spec/datadog/profiling/flush_spec.rb @@ -1,104 +1,5 @@ # typed: false -RSpec.describe Datadog::Profiling::OldFlush do - describe '#new' do - let(:start) { double('start') } - let(:finish) { double('finish') } - let(:event_groups) { double('event_groups') } - let(:event_count) { double('event_count') } - let(:code_provenance) { double('code_provenance') } - - context 'given only required arguments' do - subject(:identifier) do - described_class.new( - start: start, - finish: finish, - event_groups: event_groups, - event_count: event_count, - code_provenance: code_provenance, - ) - end - - it do - is_expected.to have_attributes( - start: start, - finish: finish, - event_groups: event_groups, - event_count: event_count, - code_provenance: code_provenance, - runtime_id: Datadog::Core::Environment::Identity.id, - service: Datadog.configuration.service, - env: Datadog.configuration.env, - version: Datadog.configuration.version, - host: Datadog::Core::Environment::Socket.hostname, - language: Datadog::Core::Environment::Identity.lang, - runtime_engine: Datadog::Core::Environment::Identity.lang_engine, - runtime_platform: Datadog::Core::Environment::Identity.lang_platform, - runtime_version: Datadog::Core::Environment::Identity.lang_version, - profiler_version: Datadog::Core::Environment::Identity.tracer_version, - tags: Datadog.configuration.tags - ) - end - end - - context 'given full arguments' do - subject(:identifier) do - described_class.new( - start: start, - finish: finish, - event_groups: event_groups, - event_count: event_count, - code_provenance: code_provenance, - runtime_id: runtime_id, - service: service, - env: env, - version: version, - host: host, - language: language, - runtime_engine: runtime_engine, - runtime_platform: runtime_platform, - runtime_version: runtime_version, - profiler_version: profiler_version, - tags: tags, - ) - end - - let(:runtime_id) { double('runtime_id') } - let(:service) { double('service') } - let(:env) { double('env') } - let(:version) { double('version') } - let(:host) { double('host') } - let(:language) { double('language') } - let(:runtime_engine) { double('runtime_engine') } - let(:runtime_platform) { double('runtime_platform') } - let(:runtime_version) { double('runtime_version') } - let(:profiler_version) { double('profiler_version') } - let(:tags) { double('tags') } - - it do - is_expected.to have_attributes( - start: start, - finish: finish, - event_groups: event_groups, - event_count: event_count, - code_provenance: code_provenance, - runtime_id: runtime_id, - service: service, - env: env, - version: version, - host: host, - language: language, - runtime_engine: runtime_engine, - runtime_platform: runtime_platform, - runtime_version: runtime_version, - profiler_version: profiler_version, - tags: tags, - ) - end - end - end -end - RSpec.describe Datadog::Profiling::Flush do describe '.new' do let(:start) { instance_double(Time, 'start time') } diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index 275959a659a..3056a714cdf 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -109,17 +109,11 @@ def stack_two ) ) end - let(:out) { instance_double(IO) } - let(:scheduler) do - Datadog::Profiling::Scheduler.new( - recorder, - exporter, - enabled: true - ) - end + let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } + let(:scheduler) { Datadog::Profiling::Scheduler.new(recorder: recorder, transport: transport) } it 'produces a profile' do - expect(out).to receive(:puts) + expect(transport).to receive(:export) collector.collect_events scheduler.send(:flush_events) @@ -138,13 +132,15 @@ def stack_two let(:tracer) { Datadog::Tracing.send(:tracer) } before do - expect(recorder) - .to receive(:flush) - .and_wrap_original do |m, *args| - flush = m.call(*args) + expect(Datadog::Profiling::Encoding::Profile::Protobuf) + .to receive(:encode) + .and_wrap_original do |m, **args| + encoded_pprof = m.call(**args) + + event_groups = args.fetch(:event_groups) # Verify that all the stack samples for this test received the same non-zero trace and span ID - stack_sample_group = flush.event_groups.find { |g| g.event_class == Datadog::Profiling::Events::StackSample } + stack_sample_group = event_groups.find { |g| g.event_class == Datadog::Profiling::Events::StackSample } stack_samples = stack_sample_group.events.select { |e| e.thread_id == Thread.current.object_id } raise 'No stack samples matching current thread!' if stack_samples.empty? @@ -154,12 +150,12 @@ def stack_two expect(stack_sample.span_id).to eq(@current_span.span_id) end - flush + encoded_pprof end end it 'produces a profile including tracing data' do - expect(out).to receive(:puts) + expect(transport).to receive(:export) collector.collect_events scheduler.send(:flush_events) diff --git a/spec/datadog/profiling/native_extension_spec.rb b/spec/datadog/profiling/native_extension_spec.rb index cc15567e3a0..7cc968831d5 100644 --- a/spec/datadog/profiling/native_extension_spec.rb +++ b/spec/datadog/profiling/native_extension_spec.rb @@ -3,24 +3,7 @@ require 'datadog/profiling/native_extension' RSpec.describe Datadog::Profiling::NativeExtension do - before do - skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? - skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? - - begin - require "ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}" - rescue LoadError - if PlatformHelpers.mac? - skip 'Skipping profiling native extension specs: extension does not seem' \ - 'to be available. (Note that on macOS the extension can only be built if ' \ - 'libddprof is also manually rebuilt from source, since there are no ' \ - 'precompiled macOS binaries for libddprof).' - else - raise 'Profiling native extension does not seem to be compiled. ' \ - 'Try running `bundle exec rake compile` before running this test.' - end - end - end + before { skip_if_profiling_not_supported(self) } describe '.working?' do subject(:working?) { described_class.send(:working?) } diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 64e610e5e92..672dfb80daa 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -require 'datadog/profiling/exporter' +require 'datadog/profiling/http_transport' require 'datadog/profiling/recorder' require 'datadog/profiling/scheduler' diff --git a/spec/datadog/profiling/spec_helper.rb b/spec/datadog/profiling/spec_helper.rb index c0e75d56d59..a70f0fc25f3 100644 --- a/spec/datadog/profiling/spec_helper.rb +++ b/spec/datadog/profiling/spec_helper.rb @@ -5,41 +5,6 @@ module ProfileHelpers include Kernel - def get_test_profiling_flush(code_provenance: nil) - stack_one = Array(Thread.current.backtrace_locations).first(3) - stack_two = Array(Thread.current.backtrace_locations).first(3) - - stack_samples = [ - build_stack_sample( - locations: stack_one, thread_id: 100, root_span_id: 0, span_id: 0, cpu_time_ns: 100, wall_time_ns: 100 - ), - build_stack_sample( - locations: stack_two, thread_id: 100, root_span_id: 0, span_id: 0, cpu_time_ns: 200, wall_time_ns: 200 - ), - build_stack_sample( - locations: stack_one, thread_id: 101, root_span_id: 0, span_id: 0, cpu_time_ns: 400, wall_time_ns: 400 - ), - build_stack_sample( - locations: stack_two, thread_id: 101, root_span_id: 0, span_id: 0, cpu_time_ns: 800, wall_time_ns: 800 - ), - build_stack_sample( - locations: stack_two, thread_id: 101, root_span_id: 0, span_id: 0, cpu_time_ns: 1600, wall_time_ns: 1600 - ) - ] - - start = Time.now.utc - finish = start + 10 - event_groups = [Datadog::Profiling::EventGroup.new(Datadog::Profiling::Events::StackSample, stack_samples)] - - Datadog::Profiling::OldFlush.new( - start: start, - finish: finish, - event_groups: event_groups, - event_count: stack_samples.length, - code_provenance: code_provenance, - ) - end - def build_stack_sample( locations: nil, thread_id: nil, diff --git a/spec/datadog/profiling/transport/client_spec.rb b/spec/datadog/profiling/transport/client_spec.rb deleted file mode 100644 index eb63f79b961..00000000000 --- a/spec/datadog/profiling/transport/client_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/flush' -require 'datadog/profiling/transport/client' - -RSpec.describe Datadog::Profiling::Transport::Client do - context 'when implemented in a Class' do - subject(:client) { client_class.new } - - let(:client_class) { Class.new { include Datadog::Profiling::Transport::Client } } - - describe '#send_profiling_flush' do - subject(:send_profiling_flush) { client.send_profiling_flush(flush) } - - let(:flush) { instance_double(Datadog::Profiling::OldFlush) } - - it { expect { send_profiling_flush }.to raise_error(NotImplementedError) } - end - end -end diff --git a/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb b/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb deleted file mode 100644 index c5b5ab93682..00000000000 --- a/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb +++ /dev/null @@ -1,202 +0,0 @@ -# typed: false - -require 'spec_helper' -require 'datadog/profiling/spec_helper' - -require 'stringio' -require 'securerandom' -require 'webrick' - -require 'ddtrace/transport/http' -require 'datadog/profiling' -require 'datadog/profiling/transport/http' -require 'ddtrace/transport/http/adapters/net' - -RSpec.describe 'Adapters::Net profiling integration tests' do - before { skip_if_profiling_not_supported(self) } - - let(:settings) { Datadog::Core::Configuration::Settings.new } - - shared_context 'HTTP server' do - # HTTP - let(:server) do - WEBrick::HTTPServer.new( - Port: port, - Logger: log, - AccessLog: access_log, - StartCallback: -> { init_signal.push(1) } - ) - end - let(:hostname) { '127.0.0.1' } - let(:port) { 6218 } - let(:log) { WEBrick::Log.new(log_buffer) } - let(:log_buffer) { StringIO.new } - let(:access_log) { [[log_buffer, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] } - let(:server_proc) do - proc do |req, res| - messages << req.tap { req.body } # Read body, store message before socket closes. - res.body = '{}' - end - end - let(:init_signal) { Queue.new } - - let(:messages) { [] } - - before do - server.mount_proc('/', &server_proc) - @server_thread = Thread.new { server.start } - init_signal.pop - end - - after do - unless RSpec.current_example.skipped? - # When the test is skipped, server has not been initialized and @server_thread would be nil; thus we only - # want to touch them when the test actually run, otherwise we would cause the server to start (incorrectly) - # and join to be called on a nil @server_thread - server.shutdown - @server_thread.join - end - end - end - - describe 'when sending profiles through Net::HTTP adapter' do - include_context 'HTTP server' - - let(:flush) { get_test_profiling_flush } - - shared_examples_for 'profile HTTP request' do - subject(:request) { messages.first } - - let(:tags) { { 'test_tag' => 'test_value' } } - - before do - allow(Datadog.configuration).to receive(:tags).and_return(tags) - end - - it 'sends profiles successfully' do - client.send_profiling_flush(flush) - - expect(request.header).to include( - 'datadog-meta-lang' => [Datadog::Core::Environment::Ext::LANG], - 'datadog-meta-lang-version' => [Datadog::Core::Environment::Ext::LANG_VERSION], - 'datadog-meta-lang-interpreter' => [Datadog::Core::Environment::Ext::LANG_INTERPRETER], - 'datadog-meta-tracer-version' => [Datadog::Core::Environment::Ext::TRACER_VERSION], - 'content-type' => [%r{^multipart/form-data; boundary=(.+)}] - ) - - unless Datadog::Core::Environment::Container.container_id.nil? - expect(request.header).to include( - 'datadog-container-id' => [Datadog::Core::Environment::Container.container_id] - ) - end - - expect(request.header['content-length'].first.to_i).to be > 0 - - # Check body - boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] - body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) - - expect(body).to include( - 'version' => '3', - 'start' => kind_of(String), - 'end' => kind_of(String), - 'data[rubyprofile.pprof]' => kind_of(String), - 'family' => 'ruby', - ) - - tags = body['tags[]'].list - expect(tags).to include( - /runtime:ruby/o, - /runtime-id:#{uuid_regex.source}/, - /runtime_engine:#{Datadog::Core::Environment::Ext::LANG_ENGINE}/o, - /runtime_platform:#{Datadog::Core::Environment::Ext::LANG_PLATFORM}/o, - /runtime_version:#{Datadog::Core::Environment::Ext::LANG_VERSION}/o, - /process_id:#{Process.pid}/o, - /profiler_version:#{Datadog::Core::Environment::Ext::TRACER_VERSION}/o, - /language:ruby/o, - 'test_tag:test_value' - ) - - if Datadog::Core::Environment::Container.container_id - container_id = Datadog::Core::Environment::Container.container_id[0..11] - expect(tags).to include(/host:#{container_id}/) - end - end - - context 'when code provenance data is available' do - let(:flush) do - get_test_profiling_flush( - code_provenance: Datadog::Profiling::Collectors::CodeProvenance.new.refresh.generate_json - ) - end - - it 'sends profiles with code provenance data successfully' do - client.send_profiling_flush(flush) - - boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] - body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) - - code_provenance_data = JSON.parse( - Datadog::Core::Utils::Compression.gunzip( - body.fetch('data[code-provenance.json]') - ) - ) - - expect(code_provenance_data) - .to include('v1' => array_including(hash_including('kind' => 'library', 'name' => 'ddtrace'))) - end - end - end - - context 'via agent' do - before do - settings.agent.host = hostname - settings.agent.port = port - end - - let(:client) do - Datadog::Profiling::Transport::HTTP.default( - profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, - agent_settings: agent_settings - ) - end - - let(:agent_settings) { Datadog::Core::Configuration::AgentSettingsResolver.call(settings) } - - it_behaves_like 'profile HTTP request' do - it 'is formatted for the agent' do - client.send_profiling_flush(flush) - expect(request.path).to eq('/profiling/v1/input') - expect(request.header).to_not include('dd-api-key') - end - end - end - - context 'via agentless' do - before do - stub_const('Datadog::Profiling::Ext::Transport::HTTP::URI_TEMPLATE_DD_API', "http://%s:#{port}/") - end - - let(:api_key) { SecureRandom.uuid } - let(:client) do - Datadog::Profiling::Transport::HTTP.default( - profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, - agent_settings: double('agent_settings which should not be used'), - api_key: api_key, - site: hostname, - agentless_allowed: true - ) - end - - it_behaves_like 'profile HTTP request' do - it 'is formatted for the API' do - client.send_profiling_flush(flush) - expect(request.path).to eq('/v1/input') - expect(request.header).to include( - 'dd-api-key' => [api_key] - ) - end - end - end - end -end diff --git a/spec/datadog/profiling/transport/http/api/endpoint_spec.rb b/spec/datadog/profiling/transport/http/api/endpoint_spec.rb deleted file mode 100644 index 61c6cdb3c2e..00000000000 --- a/spec/datadog/profiling/transport/http/api/endpoint_spec.rb +++ /dev/null @@ -1,182 +0,0 @@ -# typed: false - -require 'spec_helper' -require 'datadog/profiling/spec_helper' - -require 'datadog/profiling/encoding/profile' -require 'datadog/profiling/flush' -require 'datadog/profiling/transport/http/api/endpoint' -require 'datadog/profiling/transport/http/response' -require 'datadog/profiling/transport/request' -require 'ddtrace/transport/http/env' - -RSpec.describe Datadog::Profiling::Transport::HTTP::API::Endpoint do - subject(:endpoint) { described_class.new(path, encoder) } - - let(:path) { double('path') } - let(:encoder) { class_double(Datadog::Profiling::Encoding::Profile::Protobuf) } - - describe '#initialize' do - it do - is_expected.to have_attributes( - verb: :post, - path: path, - encoder: encoder - ) - end - end - - describe '#call' do - subject(:call) { endpoint.call(env, &block) } - - shared_examples_for 'profile request' do - let(:env) { Datadog::Transport::HTTP::Env.new(request) } - let(:request) { Datadog::Profiling::Transport::Request.new(flush) } - let(:flush) { get_test_profiling_flush } - - let(:pprof) { instance_double(Datadog::Profiling::Pprof::Payload, data: data) } - let(:data) { 'pprof_string_data' } - let(:http_response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } - - let(:block) do - proc do - http_response - end - end - - before do - allow(encoder).to receive(:encode) - .with(flush) - .and_return(pprof) - end - - it 'fills the env with data' do - is_expected.to be_a(Datadog::Profiling::Transport::HTTP::Response) - expect(env.verb).to be(:post) - expect(env.path).to be(path) - expect(env.body).to be nil - expect(env.headers).to eq({}) - - expect(env.form).to include( - 'version' => '3', - 'data[rubyprofile.pprof]' => kind_of(Datadog::Core::Vendor::Multipart::Post::UploadIO), - 'start' => flush.start.utc.iso8601, - 'end' => flush.finish.utc.iso8601, - 'family' => flush.language, - 'tags' => array_including( - "runtime:#{flush.language}", - "runtime-id:#{flush.runtime_id}", - "runtime_engine:#{flush.runtime_engine}", - "runtime_platform:#{flush.runtime_platform}", - "runtime_version:#{flush.runtime_version}", - "process_id:#{Process.pid}", - "profiler_version:#{flush.profiler_version}", - "language:#{flush.language}", - "host:#{flush.host}" - ) - ) - end - end - - context 'by default' do - it_behaves_like 'profile request' - end - - context 'when code provenance data is available' do - it_behaves_like 'profile request' do - let(:code_provenance) { 'code_provenance_json' } - - let(:flush) { get_test_profiling_flush(code_provenance: code_provenance) } - - it 'includes code provenance data in the form' do - call - - expect(env.form) - .to include('data[code-provenance.json]' => kind_of(Datadog::Core::Vendor::Multipart::Post::UploadIO)) - end - end - end - - context 'when additional tags are provided' do - it_behaves_like 'profile request' do - let(:tags) { { 'test_tag_key' => 'test_tag_value', 'another_tag_key' => :another_tag_value } } - - before do - flush.tags = tags - end - - it 'reports the additional tags as part of the tags field' do - call - - expect(env.form).to include('tags' => array_including( - 'test_tag_key:test_tag_value', 'another_tag_key:another_tag_value' - )) - end - end - end - - context 'when service/env/version are available' do - let(:service) { 'test-service' } - let(:env_name) { 'test-env' } - let(:version) { '1.2.3' } - - it_behaves_like 'profile request' do - before do - flush.service = service - flush.env = env_name - flush.version = version - end - - it 'includes service/env/version as tags' do - call - expect(env.form).to include( - 'tags' => array_including( - "service:#{flush.service}", - "env:#{flush.env}", - "version:#{flush.version}" - ) - ) - end - - context 'when service/env/version were configured via tags' do - # NOTE: In normal operation, flush.tags SHOULD never be different from flush.service/env/version because we set - # the service/env/version in the settings object from the tags if they are available (see settings.rb). - # But simulating them being different here makes it easier to test that no duplicates are added -- that - # effectively the tag versions are ignored and we only include the top-level flush versions. - let(:tags) do - { 'service' => 'service_tag', 'env' => 'env_tag', 'version' => 'version_tag', - 'some_other_tag' => 'some_other_value' } - end - - before do - flush.tags = tags - end - - it 'includes the flush.service / flush.env / flush.version values for these tags' do - call - - expect(env.form).to include( - 'tags' => array_including( - "service:#{flush.service}", - "env:#{flush.env}", - "version:#{flush.version}" - ) - ) - end - - it 'does not include the values for these tags from the flush.tags hash' do - call - - expect(env.form.fetch('tags')).to_not include('service:service_tag', 'env:env_tag', 'version:version_tag') - end - - it 'includes other defined tags' do - call - - expect(env.form.fetch('tags')).to include('some_other_tag:some_other_value') - end - end - end - end - end -end diff --git a/spec/datadog/profiling/transport/http/api/instance_spec.rb b/spec/datadog/profiling/transport/http/api/instance_spec.rb deleted file mode 100644 index 415d3526552..00000000000 --- a/spec/datadog/profiling/transport/http/api/instance_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'ddtrace/transport/http/env' -require 'datadog/profiling/transport/http/api/instance' -require 'datadog/profiling/transport/http/api/spec' -require 'datadog/profiling/transport/http/response' - -RSpec.describe Datadog::Profiling::Transport::HTTP::API::Instance do - subject(:instance) { described_class.new(spec, adapter) } - - let(:adapter) { double('adapter') } - - describe '#send_profiling_flush' do - subject(:send_profiling_flush) { instance.send_profiling_flush(env) } - - let(:env) { instance_double(Datadog::Transport::HTTP::Env) } - - context 'when specification does not support traces' do - let(:spec) { double('spec') } - - it do - expect { send_profiling_flush } - .to raise_error(Datadog::Profiling::Transport::HTTP::API::Instance::ProfilesNotSupportedError) - end - end - - context 'when specification supports traces' do - let(:spec) { Datadog::Profiling::Transport::HTTP::API::Spec.new } - let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } - - before { expect(spec).to receive(:send_profiling_flush).with(env).and_return(response) } - - it { is_expected.to be response } - end - end -end diff --git a/spec/datadog/profiling/transport/http/api/spec_spec.rb b/spec/datadog/profiling/transport/http/api/spec_spec.rb deleted file mode 100644 index 5b91579eaf1..00000000000 --- a/spec/datadog/profiling/transport/http/api/spec_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'ddtrace/transport/http/env' -require 'datadog/profiling/transport/http/api/endpoint' -require 'datadog/profiling/transport/http/api/spec' -require 'datadog/profiling/transport/http/response' - -RSpec.describe Datadog::Profiling::Transport::HTTP::API::Spec do - subject(:spec) { described_class.new } - - describe '#profiles=' do - subject(:profiles) { spec.profiles = endpoint } - - let(:endpoint) { instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint) } - - it { expect { profiles }.to change { spec.profiles }.from(nil).to(endpoint) } - end - - describe '#send_profiling_flush' do - subject(:send_profiling_flush) { spec.send_profiling_flush(env, &block) } - - let(:env) { instance_double(Datadog::Transport::HTTP::Env) } - let(:block) { proc {} } - - context 'when a trace endpoint has not been defined' do - it do - expect { send_profiling_flush } - .to raise_error(Datadog::Profiling::Transport::HTTP::API::Spec::NoProfilesEndpointDefinedError) - end - end - - context 'when a trace endpoint has been defined' do - let(:endpoint) { instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint) } - let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } - - before do - spec.profiles = endpoint - expect(endpoint).to receive(:call).with(env, &block).and_return(response) - end - - it { is_expected.to be response } - end - end - - describe '#encoder' do - subject { spec.encoder } - - let!(:endpoint) do - spec.profiles = instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint, encoder: encoder) - end - let(:encoder) { double } - - it { is_expected.to eq(encoder) } - end -end diff --git a/spec/datadog/profiling/transport/http/api_spec.rb b/spec/datadog/profiling/transport/http/api_spec.rb deleted file mode 100644 index f2c04266449..00000000000 --- a/spec/datadog/profiling/transport/http/api_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/http/api' - -RSpec.describe Datadog::Profiling::Transport::HTTP::API do - describe '::agent_defaults' do - subject(:agent_defaults) { described_class.agent_defaults } - - it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::API::Map) } - - it do - is_expected.to include( - described_class::V1 => kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) - ) - - agent_defaults[described_class::V1].tap do |v1| - expect(v1).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) - expect(v1.profiles).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Endpoint) - expect(v1.profiles.path).to eq('/profiling/v1/input') - expect(v1.profiles.encoder).to be Datadog::Profiling::Encoding::Profile::Protobuf - end - end - end - - describe '::api_defaults' do - subject(:api_defaults) { described_class.api_defaults } - - it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::API::Map) } - - it do - is_expected.to include( - described_class::V1 => kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) - ) - - api_defaults[described_class::V1].tap do |v1| - expect(v1).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) - expect(v1.profiles).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Endpoint) - expect(v1.profiles.path).to eq('/v1/input') - expect(v1.profiles.encoder).to be Datadog::Profiling::Encoding::Profile::Protobuf - end - end - end -end diff --git a/spec/datadog/profiling/transport/http/builder_spec.rb b/spec/datadog/profiling/transport/http/builder_spec.rb deleted file mode 100644 index 224a6a10e3d..00000000000 --- a/spec/datadog/profiling/transport/http/builder_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/http/builder' - -RSpec.describe Datadog::Profiling::Transport::HTTP::Builder do - subject(:builder) { described_class.new } - - it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Builder) } - - describe '#to_api_instances' do - subject(:api_instances) { builder.to_api_instances } - - shared_context 'default adapter' do - before { builder.adapter(adapter) } - - let(:adapter) { double('adapter') } - end - - context 'when an API is defined' do - before { builder.api(key, spec, options) } - - let(:key) { :v2 } - let(:spec) { instance_double(Datadog::Profiling::Transport::HTTP::API::Spec) } - let(:options) { {} } - - context 'but no adapter is defined anywhere' do - it { expect { api_instances }.to raise_error(described_class::NoAdapterForApiError) } - end - - context 'which inherits from the default adapter' do - include_context 'default adapter' - - it 'configures the API instance with the default adapter' do - expect(api_instances).to include(key => kind_of(builder.api_instance_class)) - expect(api_instances[key].adapter).to be adapter - end - end - end - end - - describe '#to_transport' do - subject(:transport) { builder.to_transport } - - context 'when no default API has been defined' do - it { expect { transport }.to raise_error(described_class::NoDefaultApiError) } - end - - context 'when APIs and an adapter are defined' do - let(:spec) { instance_double(Datadog::Transport::HTTP::API::Spec) } - - before do - builder.adapter(double('adapter')) - builder.api(:v2, spec) - end - - it 'returns an HTTP::Transport' do - expect(transport).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::Client) - expect(transport.api.spec).to eq(spec) - end - end - end - - describe '#api_instance_class' do - subject(:api_instance_class) { builder.api_instance_class } - - it { is_expected.to be(Datadog::Profiling::Transport::HTTP::API::Instance) } - end -end diff --git a/spec/datadog/profiling/transport/http/client_spec.rb b/spec/datadog/profiling/transport/http/client_spec.rb deleted file mode 100644 index 55be621bf94..00000000000 --- a/spec/datadog/profiling/transport/http/client_spec.rb +++ /dev/null @@ -1,84 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'ddtrace' -require 'ddtrace/transport/http/client' - -RSpec.describe Datadog::Profiling::Transport::HTTP::Client do - subject(:client) { described_class.new(api) } - - let(:api) { instance_double(Datadog::Profiling::Transport::HTTP::API::Instance) } - - describe '#initialize' do - it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Client) } - it { is_expected.to be_a_kind_of(Datadog::Profiling::Transport::Client) } - it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Statistics) } - it { is_expected.to have_attributes(api: api) } - end - - shared_context 'HTTP request' do - let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response, code: double('status code')) } - - before do - expect(api).to receive(:send_profiling_flush) - .with(kind_of(Datadog::Transport::HTTP::Env)) - .and_return(response) - - expect(client).to receive(:update_stats_from_response!) - .with(response) - end - end - - describe '#send_profiling_flush' do - include_context 'HTTP request' - - subject(:send_profiling_flush) { client.send_profiling_flush(flush) } - - let(:flush) { instance_double(Datadog::Profiling::OldFlush) } - - context 'when request was successful' do - before do - allow(response).to receive(:ok?).and_return(true) - end - - it 'returns the response object' do - is_expected.to be response - end - - it 'debug logs the successful report' do - expect(Datadog.logger).to receive(:debug).with(/Success/) - - send_profiling_flush - end - end - - context 'when request was not successful' do - before do - allow(response).to receive(:ok?).and_return(nil) - end - - it 'returns the response object' do - is_expected.to be response - end - - it 'debug logs the failed report' do - expect(Datadog.logger).to receive(:debug) { |&block| expect(block.call).to match(/Fail/) } - - send_profiling_flush - end - end - end - - describe '#send_payload' do - include_context 'HTTP request' - - subject(:send_payload) { client.send_payload(request) } - - let(:request) { instance_double(Datadog::Profiling::Transport::Request) } - - it 'returns the response object' do - is_expected.to be response - end - end -end diff --git a/spec/datadog/profiling/transport/http/integration_spec.rb b/spec/datadog/profiling/transport/http/integration_spec.rb deleted file mode 100644 index ffc39f595ba..00000000000 --- a/spec/datadog/profiling/transport/http/integration_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -# typed: ignore - -require 'spec_helper' -require 'datadog/profiling/spec_helper' - -require 'ddtrace' -require 'datadog/profiling/transport/http' - -RSpec.describe 'Datadog::Profiling::Transport::HTTP integration tests' do - before do - skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? - skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? - end - - describe 'HTTP#default' do - subject(:transport) do - Datadog::Profiling::Transport::HTTP.default( - profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, - **options - ) - end - - before do - # Make sure the transport is being built correctly, even if we then skip the tests - transport - end - - let(:settings) { Datadog::Core::Configuration::Settings.new } - - describe '#send_profiling_flush' do - subject(:response) { transport.send_profiling_flush(flush) } - - let(:flush) { get_test_profiling_flush } - - shared_examples_for 'a successful profile flush' do - it do - skip 'Only runs in fully integrated environment.' unless ENV['TEST_DATADOG_INTEGRATION'] - - is_expected.to be_a(Datadog::Profiling::Transport::HTTP::Response) - expect(response.code).to eq(200).or eq(403) - end - end - - context 'agent' do - let(:options) do - { - agent_settings: Datadog::Core::Configuration::AgentSettingsResolver.call( - Datadog::Core::Configuration::Settings.new, - logger: nil, - ) - } - end - - it_behaves_like 'a successful profile flush' - end - - context 'agentless' do - before do - skip 'Valid API key must be set.' unless ENV['DD_API_KEY'] && !ENV['DD_API_KEY'].empty? - end - - let(:options) do - { - agent_settings: double('agent_settings which should not be used'), - site: 'datadoghq.com', - api_key: ENV['DD_API_KEY'] || 'Invalid API key', - agentless_allowed: true - } - end - - it_behaves_like 'a successful profile flush' - end - end - end -end diff --git a/spec/datadog/profiling/transport/http/response_spec.rb b/spec/datadog/profiling/transport/http/response_spec.rb deleted file mode 100644 index f625d3554c9..00000000000 --- a/spec/datadog/profiling/transport/http/response_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/http/response' - -RSpec.describe Datadog::Profiling::Transport::HTTP::Response do - subject(:response) { described_class.new(http_response) } - - let(:http_response) { instance_double(Datadog::Transport::Response) } - - describe 'Datadog::Transport::Response methods' do - it 'are forwarded to the HTTP response' do - (Datadog::Transport::Response.instance_methods - [:inspect]).each do |method| - expect(http_response).to receive(method) - response.send(method) - end - end - end - - describe '#code' do - subject(:code) { response.code } - - let(:http_response) { double('http response') } - - context 'when HTTP response responds to #code' do - let(:status_code) { double('status code') } - - before { allow(http_response).to receive(:code).and_return(status_code) } - - it 'forwards to the HTTP response' do - is_expected.to be(status_code) - expect(http_response).to have_received(:code) - end - end - - context 'when HTTP response does not respond to #code' do - it { is_expected.to be nil } - end - end -end diff --git a/spec/datadog/profiling/transport/http_spec.rb b/spec/datadog/profiling/transport/http_spec.rb deleted file mode 100644 index 343ea891034..00000000000 --- a/spec/datadog/profiling/transport/http_spec.rb +++ /dev/null @@ -1,171 +0,0 @@ -# typed: false - -require 'spec_helper' -require 'securerandom' - -require 'datadog/core/configuration/agent_settings_resolver' -require 'datadog/profiling/transport/http' -require 'datadog/profiling/transport/http/builder' -require 'datadog/profiling/transport/http/client' -require 'ddtrace/transport/ext' -require 'ddtrace/transport/http/adapters/net' - -RSpec.describe Datadog::Profiling::Transport::HTTP do - describe '::new' do - context 'given a block' do - subject(:new_http) { described_class.new(&block) } - - let(:block) { proc {} } - - let(:builder) { instance_double(Datadog::Profiling::Transport::HTTP::Builder) } - let(:client) { instance_double(Datadog::Profiling::Transport::HTTP::Client) } - - before do - expect(Datadog::Transport::HTTP::Builder).to receive(:new) do |&blk| - expect(blk).to be block - builder - end - - expect(builder).to receive(:to_transport) - .and_return(client) - end - - it { is_expected.to be client } - end - end - - describe '::default' do - subject(:default) { described_class.default(profiling_upload_timeout_seconds: timeout_seconds, **options) } - - let(:timeout_seconds) { double('Timeout in seconds') } - let(:options) { { agent_settings: agent_settings } } - - let(:agent_settings) do - Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings.new( - adapter: adapter, - hostname: hostname, - port: port, - ssl: ssl, - uds_path: uds_path, - timeout_seconds: nil, - deprecated_for_removal_transport_configuration_proc: deprecated_for_removal_transport_configuration_proc, - ) - end - let(:adapter) { :net_http } - let(:hostname) { double('hostname') } - let(:port) { double('port') } - let(:profiling_upload_timeout_seconds) { double('timeout') } - let(:ssl) { true } - let(:uds_path) { double('uds_path') } - let(:deprecated_for_removal_transport_configuration_proc) { nil } - - it 'returns a transport with provided options configured for agent mode' do - expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) - expect(default.api.adapter.hostname).to eq(hostname) - expect(default.api.adapter.port).to eq(port) - expect(default.api.adapter.timeout).to be timeout_seconds - expect(default.api.adapter.ssl).to be true - expect(default.api.headers).to include(described_class.default_headers) - expect(default.api.headers).to_not include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY) - end - - context 'when agent_settings has a deprecated_for_removal_transport_configuration_proc' do - let(:deprecated_for_removal_transport_configuration_proc) { proc {} } - - it 'calls the deprecated_for_removal_transport_configuration_proc with the transport builder' do - expect(deprecated_for_removal_transport_configuration_proc).to \ - receive(:call).with(an_instance_of(Datadog::Profiling::Transport::HTTP::Builder)) - - default - end - end - - context 'when called with a site and api' do - let(:options) do - { agent_settings: double('agent_settings which should not be used'), site: site, api_key: api_key } - end - - let(:site) { 'test.datadoghq.com' } - let(:api_key) { SecureRandom.uuid } - - context 'when DD_PROFILING_AGENTLESS environment variable is set to "true"' do - around do |example| - ClimateControl.modify('DD_PROFILING_AGENTLESS' => 'true') do - example.run - end - end - - it 'returns a transport configured for agentless' do - expected_host = URI(format(Datadog::Profiling::Ext::Transport::HTTP::URI_TEMPLATE_DD_API, site)).host - expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) - expect(default.api.adapter.hostname).to eq(expected_host) - expect(default.api.adapter.port).to eq(443) - expect(default.api.adapter.timeout).to be timeout_seconds - expect(default.api.adapter.ssl).to be true - expect(default.api.headers).to include(described_class.default_headers) - expect(default.api.headers).to include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) - end - end - - context 'when agentless_allowed is true' do - let(:options) { { **super(), agentless_allowed: true } } - - it 'returns a transport configured for agentless' do - expected_host = URI(format(Datadog::Profiling::Ext::Transport::HTTP::URI_TEMPLATE_DD_API, site)).host - expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) - expect(default.api.adapter.hostname).to eq(expected_host) - expect(default.api.adapter.port).to eq(443) - expect(default.api.adapter.timeout).to be timeout_seconds - expect(default.api.adapter.ssl).to be true - expect(default.api.headers).to include(described_class.default_headers) - expect(default.api.headers).to include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) - end - end - - ['false', nil].each do |environment_value| - context "when DD_PROFILING_AGENTLESS environment variable is set to #{environment_value.inspect}" do - let(:options) { { **super(), agent_settings: agent_settings } } - - around do |example| - ClimateControl.modify('DD_PROFILING_AGENTLESS' => environment_value) do - example.run - end - end - - it 'returns a transport configured for agent mode' do - expect(default.api.adapter.hostname).to eq(hostname) - end - end - end - end - end - - describe '::default_headers' do - subject(:default_headers) { described_class.default_headers } - - it do - is_expected.to include( - Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, - Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, - Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, - Datadog::Transport::Ext::HTTP::HEADER_META_TRACER_VERSION => Datadog::Core::Environment::Ext::TRACER_VERSION - ) - end - - context 'when Core::Environment::Container.container_id' do - before { expect(Datadog::Core::Environment::Container).to receive(:container_id).and_return(container_id) } - - context 'is not nil' do - let(:container_id) { '3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860' } - - it { is_expected.to include(Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID => container_id) } - end - - context 'is nil' do - let(:container_id) { nil } - - it { is_expected.to_not include(Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID) } - end - end - end -end diff --git a/spec/datadog/profiling/transport/io/client_spec.rb b/spec/datadog/profiling/transport/io/client_spec.rb deleted file mode 100644 index 9ef6160cb8f..00000000000 --- a/spec/datadog/profiling/transport/io/client_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/flush' -require 'datadog/profiling/transport/io/client' - -RSpec.describe Datadog::Profiling::Transport::IO::Client do - subject(:client) { described_class.new(out, encoder) } - - let(:out) { instance_double(IO) } - let(:encoder) { instance_double(Datadog::Core::Encoding::Encoder) } - - describe '#send_profiling_flush' do - subject(:send_profiling_flush) { client.send_profiling_flush(flush) } - - let(:flush) { instance_double(Datadog::Profiling::OldFlush) } - let(:encoded_events) { double('encoded events') } - let(:result) { double('IO result') } - - before do - expect(client.encoder).to receive(:encode) - .with(flush) - .and_return(encoded_events) - - expect(client.out).to receive(:puts) - .with(encoded_events) - .and_return(result) - - expect(client).to receive(:update_stats_from_response!) - .with(kind_of(Datadog::Profiling::Transport::IO::Response)) - end - - it do - is_expected.to be_a_kind_of(Datadog::Profiling::Transport::IO::Response) - expect(send_profiling_flush.result).to eq(result) - end - end - - describe '#build_response' do - subject(:build_response) { client.build_response(request, data, result) } - - let(:request) { instance_double(Datadog::Profiling::Transport::Request) } - let(:data) { double('data') } - let(:result) { double('result') } - let(:response) { instance_double(Datadog::Profiling::Transport::IO::Response) } - - before do - expect(Datadog::Profiling::Transport::IO::Response) - .to receive(:new) - .with(result) - .and_return(response) - end - - it { is_expected.to be response } - end -end diff --git a/spec/datadog/profiling/transport/io/response_spec.rb b/spec/datadog/profiling/transport/io/response_spec.rb deleted file mode 100644 index d449d190cc0..00000000000 --- a/spec/datadog/profiling/transport/io/response_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/io/response' - -RSpec.describe Datadog::Profiling::Transport::IO::Response do - subject(:response) { described_class.new(result) } - - let(:result) { double('result') } - - it { is_expected.to be_a_kind_of(Datadog::Transport::IO::Response) } - it { is_expected.to be_a_kind_of(Datadog::Profiling::Transport::Response) } -end diff --git a/spec/datadog/profiling/transport/io_spec.rb b/spec/datadog/profiling/transport/io_spec.rb deleted file mode 100644 index fb03a610c80..00000000000 --- a/spec/datadog/profiling/transport/io_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/io' - -RSpec.describe Datadog::Profiling::Transport::IO do - describe '.new' do - subject(:new_io) { described_class.new(out, encoder, options) } - - let(:out) { instance_double(IO) } - let(:encoder) { double('encoder') } - let(:options) { {} } - let(:client) { instance_double(Datadog::Profiling::Transport::IO::Client) } - - before do - expect(Datadog::Profiling::Transport::IO::Client).to receive(:new) - .with(out, encoder, options) - .and_return(client) - end - - it { is_expected.to be client } - end - - describe '.default' do - let(:client) { instance_double(Datadog::Profiling::Transport::IO::Client) } - - context 'given no options' do - subject(:default) { described_class.default } - - before do - expect(Datadog::Profiling::Transport::IO::Client).to receive(:new) - .with($stdout, Datadog::Profiling::Encoding::Profile::Protobuf, {}) - .and_return(client) - end - - it { is_expected.to be client } - end - - context 'given overrides' do - subject(:default) { described_class.default(options) } - - let(:options) { { out: out, encoder: encoder, custom_option: 'custom_option' } } - let(:out) { instance_double(IO) } - let(:encoder) { double('encoder') } - - before do - expect(Datadog::Profiling::Transport::IO::Client).to receive(:new) - .with(out, encoder, custom_option: 'custom_option') - .and_return(client) - end - - it { is_expected.to be client } - end - end -end diff --git a/spec/datadog/profiling/transport/parcel_spec.rb b/spec/datadog/profiling/transport/parcel_spec.rb deleted file mode 100644 index 5ba8442f160..00000000000 --- a/spec/datadog/profiling/transport/parcel_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/transport/parcel' - -RSpec.describe Datadog::Profiling::Transport::Parcel do - subject(:parcel) { described_class.new(data) } - - let(:data) { instance_double(Array) } - - it { is_expected.to be_a_kind_of(Datadog::Transport::Parcel) } - - describe '#initialize' do - it { is_expected.to have_attributes(data: data) } - end - - describe '#encode_with' do - subject(:encode_with) { parcel.encode_with(encoder) } - - let(:encoder) { instance_double(Datadog::Core::Encoding::Encoder) } - let(:encoded_data) { double('encoded data') } - - before do - expect(encoder).to receive(:encode) - .with(data) - .and_return(encoded_data) - end - - it { is_expected.to be encoded_data } - end -end diff --git a/spec/datadog/profiling/transport/request_spec.rb b/spec/datadog/profiling/transport/request_spec.rb deleted file mode 100644 index 2d67021c6a5..00000000000 --- a/spec/datadog/profiling/transport/request_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# typed: false - -require 'spec_helper' - -require 'datadog/profiling/flush' -require 'datadog/profiling/transport/request' - -RSpec.describe Datadog::Profiling::Transport::Request do - subject(:request) { described_class.new(flush) } - - let(:flush) { instance_double(Datadog::Profiling::OldFlush) } - - it { is_expected.to be_a_kind_of(Datadog::Transport::Request) } - - describe '#initialize' do - it { is_expected.to have_attributes(parcel: kind_of(Datadog::Profiling::Transport::Parcel)) } - it { expect(request.parcel.data).to be(flush) } - end -end From f8d12c259f31defeb069cc749311b626f1e1eb99 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 3 Mar 2022 14:12:58 +0000 Subject: [PATCH 0071/2133] Update documentation --- docs/ProfilingDevelopment.md | 38 +++++++++---------- .../NativeExtensionDesign.md | 7 ++-- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index dba8ed02f94..60c58407b8c 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -11,23 +11,22 @@ Components below live inside <../lib/datadog/profiling>: * `Collectors::OldStack`: Collects stack trace samples from Ruby threads for both CPU-time (if available) and wall-clock. Runs on its own background thread. * `Collectors::CodeProvenance`: Collects library metadata to power grouping and categorization of stack traces (e.g. to help distinguish user code, from libraries, from the standard library, etc). -* `Encoding::Profile`: Encodes gathered data into the pprof format. +* `Encoding::Profile::Protobuf`: Encodes gathered data into the pprof format. * `Events::Stack`, `Events::StackSample`: Entity classes used to represent stacks. * `Ext::Forking`: Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore profiling abilities after the VM forks (such as re-instrumenting the main thread, and restarting profiler threads). -* `Pprof::*` (in <../lib/datadog/profiling/pprof>): Converts samples captured in the `Recorder` into the pprof format. -* `Tasks::Setup`: Takes care of loading our extensions/monkey patches to handle fork(). -* `Transport::*` (in <../lib/datadog/profiling/transport>): Implements transmission of profiling payloads to the Datadog agent - or backend. +* `Pprof::*` (in <../lib/datadog/profiling/pprof>): Used by `Encoding::Profile::Protobuf` to convert samples captured in + the `Recorder` into the pprof format. +* `Tasks::Setup`: Takes care of loading our extensions/monkey patches to handle `fork()`. +* `HttpTransport`: Implements transmission of profiling payloads to the Datadog agent or backend. * `TraceIdentifiers::*`: Used to retrieve trace id and span id from tracers, to be used to connect traces to profiles. * `BacktraceLocation`: Entity class used to represent an entry in a stack trace. * `Buffer`: Bounded buffer used to store profiling events. -* `Exporter`: Writes profiling data to a given transport. -* `Flush`: Entity class used to represent metadata for a given profile. +* `Flush`: Entity class used to represent the payload to be reported for a given profile. * `Profiler`: Profiling entry point, which coordinates collectors and a scheduler. * `Recorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) -* `Scheduler`: Periodically (every 1 minute) takes data from the `Recorder` and pushes them to all configured - `Exporter`s. Runs on its own background thread. +* `Scheduler`: Periodically (every 1 minute) takes data from the `Recorder` and pushes them to the configured transport. + Runs on its own background thread. ## Initialization @@ -35,11 +34,10 @@ When started via `ddtracerb exec` (together with `DD_PROFILING_ENABLED=true`), i flow: 1. <../lib/datadog/profiling/preload.rb> triggers the creation of the profiler instance by calling the method `Datadog::Profiling.start_if_enabled` -2. The profiler instance is handled by `Datadog::Configuration`, which triggers the configuration of `ddtrace` components - in `#build_components` -3. Inside `Datadog::Components`, the `build_profiler` method triggers the execution of the `Tasks::Setup` -4. The `Setup` task activates our extensions - * `Datadog::Profiling::Ext::Forking` +2. Creation of the profiler instance is handled by `Datadog::Configuration`, which triggers the configuration of all + `ddtrace` components in `#build_components` +3. Inside `Datadog::Components`, the `build_profiler` method triggers the execution of the `Tasks::Setup` task +4. The `Setup` task activates our extensions (`Datadog::Profiling::Ext::Forking`) 5. Still inside `Datadog::Components`, the `build_profiler` method then creates and wires up the Profiler as such: ```asciiflow +------------+ @@ -52,9 +50,9 @@ flow: +---------+--+ +-+-------+-+ | | | v | v - +--------+-+ | +----+------+ - | OldStack | | | Exporters | - +--------+-+ | +-----------+ + +--------+-+ | +----+----------+ + | OldStack | | | HttpTransport | + +--------+-+ | +---------------+ | | v v +-+-------+-+ @@ -75,9 +73,9 @@ During run-time, the `Scheduler` and the `Collectors::OldStack` each execute on The `Collectors::OldStack` samples stack traces of threads, capturing both CPU-time (if available) and wall-clock, storing them in the `Recorder`. -The `Scheduler` wakes up every 1 minute to flush the results of the `Recorder` into one or more `exporter`s. -Usually only one exporter is in use. By default, the `Exporter` delegates to the default `Transport::HTTP` transport, which -takes care of encoding the data and reporting it to the datadog agent (or to the API, when running without an agent). +The `Scheduler` wakes up every 1 minute to flush the results of the `Recorder` into the transport. +By default, the `Scheduler` gets created with the default `HttpTransport`, which +takes care of encoding the data and reporting it to the Datadog agent. ## How CPU-time profiling works diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md index 85c05aa2c57..ac5d812242d 100644 --- a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md @@ -10,13 +10,13 @@ JRuby or TruffleRuby. When below we say "Ruby", read it as "MRI Ruby". ## Disabling -The profiling native extension can be disabled by setting `DD_PROFILING_NO_EXTENSION=true` when installing or running +The profiling native extension can be disabled by setting `DD_PROFILING_NO_EXTENSION=true` when installing the gem. Setting `DD_PROFILING_NO_EXTENSION` at installation time skips compilation of the extension entirely. (If you're a customer and needed to use this, please tell us why on .) -Currently the profiler can still "limp along" when the native extension is disabled, but the plan is to require it -in future releases -- e.g. disabling the extension will disable profiling entirely. +In past releases, it was possible for the profiler to run without the native extension, but that's no longer the case, +and disabling the extension will disable profiling. ## Must not block or break users that cannot use it @@ -92,7 +92,6 @@ Thus, even though a regular Ruby installation does not include these files, we c ## Feature: Getting thread CPU-time clock_ids * **OS support**: Linux -* **Ruby support**: 2.6+ To enable CPU-time profiling, we use the `pthread_getcpuclockid(pthread_t thread, clockid_t *clockid)` C function to obtain a `clockid_t` that can then be used with the `Process.clock_gettime` method (or directly with the From 3e7388dc86d012416164c624e1b9d3752ce96c2c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 3 Mar 2022 14:32:27 +0000 Subject: [PATCH 0072/2133] Update profiler submission benchmark to work with new profiler structure --- benchmarks/profiler_submission.rb | 34 +++++++++---------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/benchmarks/profiler_submission.rb b/benchmarks/profiler_submission.rb index 64a1dfc9d61..aa9b3d1694b 100644 --- a/benchmarks/profiler_submission.rb +++ b/benchmarks/profiler_submission.rb @@ -1,4 +1,4 @@ -# typed: ignore +# typed: false # Used to quickly run benchmark under RSpec as part of the usual test suite, to validate it didn't bitrot VALIDATE_BENCHMARK_MODE = ENV['VALIDATE_BENCHMARK'] == 'true' @@ -45,37 +45,24 @@ class ProfilerSubmission :tags ) - def create_profiler - @adapter_buffer = [] - - Datadog.configure do |c| - c.profiling.enabled = true - c.tracing.transport_options = proc { |t| t.adapter :test, @adapter_buffer } - end - - # Stop background threads - Datadog.shutdown! - - # Call exporter directly - @exporter = Datadog.send(:components).profiler.scheduler.exporters.first - + def initialize # @ivoanjo: Hack to allow unmarshalling the old data; this will all need to be redesigned once we start using # libddprof for profile encoding, so I decided to take a shorter route for now. - original_flush_class = defined?(Datadog::Profiling::Flush) && Datadog::Profiling::Flush + original_flush_class = Datadog::Profiling::Flush Datadog::Profiling.const_set(:Flush, OldFlush) - @flush = Marshal.load( + flush = Marshal.load( Zlib::GzipReader.new(File.open(ENV['FLUSH_DUMP_FILE'] || 'benchmarks/data/profiler-submission-marshal.gz')) ) Datadog::Profiling.const_set(:Flush, original_flush_class) + + @profiling_data = {event_count: flush.event_count, event_groups: flush.event_groups, start: flush.start, finish: flush.finish} end def check_valid_pprof - output_pprof = @adapter_buffer.last[:form]["data[rubyprofile.pprof]"].io - expected_hashes = [ "395dd7e65b35be6eede78ac9be072df8d6d79653f8c248691ad9bdd1d8b507de", ] - current_hash = Digest::SHA256.hexdigest(Zlib::GzipReader.new(output_pprof).read) + current_hash = Digest::SHA256.hexdigest(Datadog::Core::Utils::Compression.gunzip(@output_pprof)) if expected_hashes.include?(current_hash) puts "Output hash #{current_hash} matches known signature" @@ -88,7 +75,7 @@ def check_valid_pprof def run_benchmark Benchmark.ips do |x| benchmark_time = VALIDATE_BENCHMARK_MODE ? {time: 0.01, warmup: 0} : {time: 70, warmup: 2} - x.config(**benchmark_time, suite: report_to_dogstatsd_if_enabled_via_environment_variable(benchmark_name: 'profiler_submission_v2')) + x.config(**benchmark_time, suite: report_to_dogstatsd_if_enabled_via_environment_variable(benchmark_name: 'profiler_submission_v3')) x.report("exporter #{ENV['CONFIG']}") do run_once @@ -107,15 +94,14 @@ def run_forever end def run_once - @adapter_buffer.clear - @exporter.export(@flush) + @output_pprof = + Datadog::Core::Utils::Compression.gzip(Datadog::Profiling::Encoding::Profile::Protobuf.encode(**@profiling_data)) end end puts "Current pid is #{Process.pid}" ProfilerSubmission.new.instance_exec do - create_profiler run_once check_valid_pprof From 8a2d1a83068068578e0c7b26131f24c2418a17e5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 17 Mar 2022 15:54:41 +0000 Subject: [PATCH 0073/2133] Fix file names sent to backend Pre-HttpTransport, we used to have two constants for each type of file, e.g.: ```ruby FORM_FIELD_PPROF_DATA = 'data[rubyprofile.pprof]'.freeze PPROF_DEFAULT_FILENAME = 'rubyprofile.pprof.gz'.freeze FORM_FIELD_CODE_PROVENANCE_DATA = 'data[code-provenance.json]'.freeze CODE_PROVENANCE_FILENAME = 'code-provenance.json.gz'.freeze ``` The form field variants did not have the .gz suffix, and the extra filename had (but afaik the backend ignored those names). When we moved to `HttpTransport`, we started using the `*_DEFAULT_FILENAME` constants to fill in the form field name, and dropped the extra filename. The problem is that the backend rejects form field names that end with .gz with an HTTP 400 error, and so we need to correct the names to match the previous behavior we had. Took me longer than I care to admit to hunt this one down ;_; --- lib/datadog/profiling/ext.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datadog/profiling/ext.rb b/lib/datadog/profiling/ext.rb index b822ce5d136..3c0f05feffc 100644 --- a/lib/datadog/profiling/ext.rb +++ b/lib/datadog/profiling/ext.rb @@ -35,8 +35,8 @@ module HTTP FORM_FIELD_TAG_SERVICE = 'service'.freeze FORM_FIELD_TAG_VERSION = 'version'.freeze - PPROF_DEFAULT_FILENAME = 'rubyprofile.pprof.gz'.freeze - CODE_PROVENANCE_FILENAME = 'code-provenance.json.gz'.freeze + PPROF_DEFAULT_FILENAME = 'rubyprofile.pprof'.freeze + CODE_PROVENANCE_FILENAME = 'code-provenance.json'.freeze end end end From 8b4539e31b805f067eea93f7bbd11f9f50ec83cf Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 11 May 2022 12:09:17 +0100 Subject: [PATCH 0074/2133] Rename profiling `pid` tag to `process_id` to align with other products Same as #2013, but for reporting via libddprof. --- spec/datadog/profiling/recorder_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/recorder_spec.rb index bf57d0a09df..ad9bdf131aa 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/recorder_spec.rb @@ -141,7 +141,7 @@ finish: kind_of(Time), pprof_file_name: 'rubyprofile.pprof.gz', code_provenance_file_name: 'code-provenance.json.gz', - tags_as_array: array_including(%w[language ruby], ['pid', Process.pid.to_s]), + tags_as_array: array_including(%w[language ruby], ['process_id', Process.pid.to_s]), ) end From 9c4960775d86c961a2f4a12d175f734ece325132 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Apr 2022 15:00:12 +0100 Subject: [PATCH 0075/2133] Update spec to match fix The file name was fixed in `Fix file names sent to backend` but I forgot to update the specs. --- spec/datadog/profiling/recorder_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/recorder_spec.rb index ad9bdf131aa..23acd92431e 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/recorder_spec.rb @@ -139,8 +139,8 @@ is_expected.to have_attributes( start: kind_of(Time), finish: kind_of(Time), - pprof_file_name: 'rubyprofile.pprof.gz', - code_provenance_file_name: 'code-provenance.json.gz', + pprof_file_name: 'rubyprofile.pprof', + code_provenance_file_name: 'code-provenance.json', tags_as_array: array_including(%w[language ruby], ['process_id', Process.pid.to_s]), ) end From 2ad8eb0e2235c1aea32e3076eedb5368ea274dff Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 4 Mar 2022 13:29:12 +0000 Subject: [PATCH 0076/2133] Rename `Recorder` class to `OldRecorder` This frees up the namespace for a new `Recorder` class which will contain some behavior extracted from `OldRecorder`. --- .rubocop_todo.yml | 2 +- lib/datadog/core/configuration/components.rb | 4 ++-- lib/datadog/profiling.rb | 2 +- .../profiling/{recorder.rb => old_recorder.rb} | 12 ++++++------ spec/datadog/core/configuration/components_spec.rb | 4 ++-- spec/datadog/profiling/collectors/old_stack_spec.rb | 4 ++-- spec/datadog/profiling/integration_spec.rb | 2 +- .../{recorder_spec.rb => old_recorder_spec.rb} | 6 +++--- spec/datadog/profiling/scheduler_spec.rb | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) rename lib/datadog/profiling/{recorder.rb => old_recorder.rb} (91%) rename spec/datadog/profiling/{recorder_spec.rb => old_recorder_spec.rb} (97%) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4759d491e13..ffc29d91639 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -63,7 +63,7 @@ Lint/MissingSuper: - 'lib/datadog/profiling/collectors/old_stack.rb' - 'lib/datadog/profiling/pprof/converter.rb' - 'lib/datadog/profiling/pprof/template.rb' - - 'lib/datadog/profiling/recorder.rb' + - 'lib/datadog/profiling/old_recorder.rb' - 'lib/datadog/profiling/scheduler.rb' - 'lib/datadog/profiling/transport/http/api/instance.rb' - 'lib/datadog/profiling/transport/http/api/spec.rb' diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index ee96bf7dde1..961c1e40707 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -241,7 +241,7 @@ def build_profiler(settings, agent_settings, tracer) ) # TODO: It's a bit weird to treat this collector differently from others. See the TODO on the - # Datadog::Profiling::Recorder class for a discussion of this choice. + # Datadog::Profiling::OldRecorder class for a discussion of this choice. if settings.profiling.advanced.code_provenance_enabled code_provenance_collector = Profiling::Collectors::CodeProvenance.new @@ -287,7 +287,7 @@ def build_test_mode_writer(settings, agent_settings) def build_profiler_recorder(settings, code_provenance_collector) event_classes = [Profiling::Events::StackSample] - Profiling::Recorder.new( + Profiling::OldRecorder.new( event_classes, settings.profiling.advanced.max_events, code_provenance_collector: code_provenance_collector diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index f3b6f0eecf2..61487131f8a 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -150,7 +150,7 @@ def self.start_if_enabled require 'datadog/profiling/collectors/old_stack' require 'datadog/profiling/collectors/stack' require 'datadog/profiling/stack_recorder' - require 'datadog/profiling/recorder' + require 'datadog/profiling/old_recorder' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' require 'datadog/profiling/profiler' diff --git a/lib/datadog/profiling/recorder.rb b/lib/datadog/profiling/old_recorder.rb similarity index 91% rename from lib/datadog/profiling/recorder.rb rename to lib/datadog/profiling/old_recorder.rb index 99d197ee1aa..245316196c4 100644 --- a/lib/datadog/profiling/recorder.rb +++ b/lib/datadog/profiling/old_recorder.rb @@ -9,25 +9,25 @@ module Datadog module Profiling # Stores profiling events gathered by `Collector`s - class Recorder + class OldRecorder attr_reader :max_size # Profiles with duration less than this will not be reported PROFILE_DURATION_THRESHOLD_SECONDS = 1 - # TODO: Why does the Recorder directly reference the `code_provenance_collector`? + # TODO: Why does the OldRecorder directly reference the `code_provenance_collector`? # # For starters, this is weird/a problem because the relationship is supposed to go in the other direction: - # collectors are supposed to record their results in the `Recorder`, rather than the `Recorder` having to know + # collectors are supposed to record their results in the `OldRecorder`, rather than the `OldRecorder` having to know # about individual collectors. # # But the `code_provenance_collector` is different from other existing and potential collectors because it is not # asynchronous. It does not gather data over time and record it as it goes. Instead, you call it once per profile, # synchronously, and just use what it spits out. # - # The current design of the `Recorder` is quite tied to the asynchronous model. Modifying our current design + # The current design of the `OldRecorder` is quite tied to the asynchronous model. Modifying our current design # to support synchronous collectors is non-trivial, and I decided not to go through with it because we're - # soon going to replace the `Recorder` and many other existing classes with a + # soon going to replace the `OldRecorder` and many other existing classes with a # [libddprof](https://github.com/datadog/libddprof)-based implementation, and thus I don't think massive refactors # are worth it before moving to libddprof. @@ -121,7 +121,7 @@ def empty? @buffers.values.all?(&:empty?) end - # Error when event of an unknown type is used with the Recorder + # Error when event of an unknown type is used with the OldRecorder class UnknownEventError < StandardError attr_reader :event_class diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index dc742468a11..961af8fe3f4 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -1005,7 +1005,7 @@ end it 'initializes the recorder with a code provenance collector' do - expect(Datadog::Profiling::Recorder).to receive(:new) do |*_args, code_provenance_collector:| + expect(Datadog::Profiling::OldRecorder).to receive(:new) do |*_args, code_provenance_collector:| expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) end.and_call_original @@ -1016,7 +1016,7 @@ before { settings.profiling.advanced.code_provenance_enabled = false } it 'initializes the recorder with a nil code provenance collector' do - expect(Datadog::Profiling::Recorder).to receive(:new) do |*_args, code_provenance_collector:| + expect(Datadog::Profiling::OldRecorder).to receive(:new) do |*_args, code_provenance_collector:| expect(code_provenance_collector).to be nil end.and_call_original diff --git a/spec/datadog/profiling/collectors/old_stack_spec.rb b/spec/datadog/profiling/collectors/old_stack_spec.rb index 011662b6ee2..61cb59a4132 100644 --- a/spec/datadog/profiling/collectors/old_stack_spec.rb +++ b/spec/datadog/profiling/collectors/old_stack_spec.rb @@ -5,14 +5,14 @@ require 'datadog/profiling/collectors/old_stack' require 'datadog/profiling/trace_identifiers/helper' -require 'datadog/profiling/recorder' +require 'datadog/profiling/old_recorder' require 'set' require 'timeout' RSpec.describe Datadog::Profiling::Collectors::OldStack do subject(:collector) { described_class.new(recorder, **options) } - let(:recorder) { instance_double(Datadog::Profiling::Recorder) } + let(:recorder) { instance_double(Datadog::Profiling::OldRecorder) } let(:options) { { max_frames: 50, trace_identifiers_helper: trace_identifiers_helper } } let(:buffer) { instance_double(Datadog::Profiling::Buffer) } diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index 3056a714cdf..4bc31f4a229 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -84,7 +84,7 @@ def stack_two describe 'profiling' do let(:recorder) do - Datadog::Profiling::Recorder.new( + Datadog::Profiling::OldRecorder.new( [Datadog::Profiling::Events::StackSample], 100000, code_provenance_collector: nil, diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/old_recorder_spec.rb similarity index 97% rename from spec/datadog/profiling/recorder_spec.rb rename to spec/datadog/profiling/old_recorder_spec.rb index 23acd92431e..44880145691 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/old_recorder_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' -require 'datadog/profiling/recorder' +require 'datadog/profiling/old_recorder' require 'datadog/profiling/event' require 'datadog/profiling/collectors/code_provenance' -RSpec.describe Datadog::Profiling::Recorder do +RSpec.describe Datadog::Profiling::OldRecorder do subject(:recorder) do described_class.new(event_classes, max_size, code_provenance_collector: code_provenance_collector, **options) end @@ -124,7 +124,7 @@ before { allow(buffer).to receive(:pop).and_return(events) } - context 'when the Recorder has a registered event class' do + context 'when the OldRecorder has a registered event class' do let(:event_classes) { [event_class] } let(:event_class) { Class.new(Datadog::Profiling::Event) } diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 672dfb80daa..20e3764daf3 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' require 'datadog/profiling/http_transport' -require 'datadog/profiling/recorder' +require 'datadog/profiling/old_recorder' require 'datadog/profiling/scheduler' RSpec.describe Datadog::Profiling::Scheduler do subject(:scheduler) { described_class.new(recorder: recorder, transport: transport, **options) } - let(:recorder) { instance_double(Datadog::Profiling::Recorder) } + let(:recorder) { instance_double(Datadog::Profiling::OldRecorder) } let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } let(:options) { {} } From f0f574f36ca36a02c5f0d011a5946615399d40cc Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 4 Mar 2022 14:57:14 +0000 Subject: [PATCH 0077/2133] Introduce new `Recorder` class, that records data from collectors This new class contains some of the behavior previously in the `OldRecorder` (which will be removed from there in a separate PR), and builds the `Flush` object. This class exists because with the upcoming move to a native implementation of profiler, the `OldRecorder` will cease to be needed. --- lib/datadog/profiling/recorder.rb | 77 ++++++++++++++++++++++ spec/datadog/profiling/recorder_spec.rb | 86 +++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 lib/datadog/profiling/recorder.rb create mode 100644 spec/datadog/profiling/recorder_spec.rb diff --git a/lib/datadog/profiling/recorder.rb b/lib/datadog/profiling/recorder.rb new file mode 100644 index 00000000000..d786667eab7 --- /dev/null +++ b/lib/datadog/profiling/recorder.rb @@ -0,0 +1,77 @@ +# typed: true + +require 'datadog/profiling/ext' +require 'datadog/core/utils/compression' +require 'datadog/profiling/tag_builder' + +module Datadog + module Profiling + # Records profiling data gathered by the multiple collectors in a `Flush`. + # + # @ivoanjo: Note that the collector that gathers pprof data is special, since we use its start/finish/empty? to + # decide if there's data to flush, as well as the timestamp for that data. + # I could've made the whole design more generic, but I'm unsure if we'll ever have more than a handful of + # collectors, so I've decided to make it specific until we actually need to support more collectors. + # + class Recorder + # Profiles with duration less than this will not be reported + PROFILE_DURATION_THRESHOLD_SECONDS = 1 + + private + + attr_reader \ + :pprof_collector, + :code_provenance_collector, + :minimum_duration, + :logger + + public + + def initialize( + pprof_collector:, + code_provenance_collector:, + minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS, + logger: Datadog.logger + ) + @pprof_collector = pprof_collector + @code_provenance_collector = code_provenance_collector + @minimum_duration = minimum_duration + @logger = logger + end + + def flush + start, finish, uncompressed_pprof = pprof_collector.serialize + + return if uncompressed_pprof.nil? # We don't want to report empty profiles + + if duration_below_threshold?(start, finish) + logger.debug('Skipped exporting profiling events as profile duration is below minimum') + return + end + + uncompressed_code_provenance = code_provenance_collector.refresh.generate_json if code_provenance_collector + + Flush.new( + start: start, + finish: finish, + pprof_file_name: Datadog::Profiling::Ext::Transport::HTTP::PPROF_DEFAULT_FILENAME, + pprof_data: Datadog::Core::Utils::Compression.gzip(uncompressed_pprof), + code_provenance_file_name: Datadog::Profiling::Ext::Transport::HTTP::CODE_PROVENANCE_FILENAME, + code_provenance_data: + (Datadog::Core::Utils::Compression.gzip(uncompressed_code_provenance) if uncompressed_code_provenance), + tags_as_array: Datadog::Profiling::TagBuilder.call(settings: Datadog.configuration).to_a, + ) + end + + def empty? + pprof_collector.empty? + end + + private + + def duration_below_threshold?(start, finish) + (finish - start) < @minimum_duration + end + end + end +end diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/recorder_spec.rb new file mode 100644 index 00000000000..5f3ca2258b6 --- /dev/null +++ b/spec/datadog/profiling/recorder_spec.rb @@ -0,0 +1,86 @@ +# typed: false + +require 'datadog/profiling/recorder' +require 'datadog/profiling/old_recorder' +require 'datadog/profiling/collectors/code_provenance' +require 'datadog/core/logger' + +RSpec.describe Datadog::Profiling::Recorder do + subject(:recorder) do + described_class.new( + pprof_collector: pprof_collector, + code_provenance_collector: code_provenance_collector, + logger: logger, + ) + end + + let(:start) { Time.now } + let(:finish) { start + 60 } + let(:pprof_data) { 'dummy pprof data' } + let(:code_provenance_data) { 'dummy code provenance data' } + let(:pprof_collector) { instance_double(Datadog::Profiling::OldRecorder, serialize: [start, finish, pprof_data]) } + let(:code_provenance_collector) do + collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance_data) + allow(collector).to receive(:refresh).and_return(collector) + collector + end + let(:logger) { instance_double(Datadog::Core::Logger) } + + describe '#flush' do + subject(:flush) { recorder.flush } + + it 'returns a flush containing the data from the collectors' do + expect(flush).to have_attributes( + start: start, + finish: finish, + pprof_file_name: 'rubyprofile.pprof.gz', + code_provenance_file_name: 'code-provenance.json.gz', + tags_as_array: array_including(%w[language ruby], ['pid', Process.pid.to_s]), + ) + expect(Datadog::Core::Utils::Compression.gunzip(flush.pprof_data)).to eq pprof_data + expect(Datadog::Core::Utils::Compression.gunzip(flush.code_provenance_data)).to eq code_provenance_data + end + + context 'when pprof collector has no data' do + let(:pprof_data) { nil } + + it { is_expected.to be nil } + end + + context 'when no code provenance collector was provided' do + let(:code_provenance_collector) { nil } + + it 'returns a flush with nil code_provenance_data' do + expect(flush.code_provenance_data).to be nil + end + end + + context 'when duration of profile is below 1s' do + let(:finish) { start + 0.99 } + + before { allow(logger).to receive(:debug) } + + it { is_expected.to be nil } + + it 'logs a debug message' do + expect(logger).to receive(:debug).with(/Skipped exporting/) + + flush + end + end + + context 'when duration of profile is 1s or above' do + let(:finish) { start + 1 } + + it { is_expected.to_not be nil } + end + end + + describe '#empty?' do + it 'delegates to the pprof_collector' do + expect(pprof_collector).to receive(:empty?).and_return(:empty_result) + + expect(recorder.empty?).to be :empty_result + end + end +end From 642d2a403e5bb98eb675c421e29e76c2e6bcf881 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 4 Mar 2022 15:30:51 +0000 Subject: [PATCH 0078/2133] Refactor `OldRecorder` to be called by `Recorder` This commit concludes the refactoring of the `OldRecorder`, removing many of its responsibilities, and having the `Recorder` handle them instead. The `OldRecorder` is almost entirely back to its shape from dd-trace-rb 0.54. --- benchmarks/profiler_sample_loop.rb | 4 +- docs/ProfilingDevelopment.md | 17 +- lib/datadog/core/configuration/components.rb | 27 ++-- lib/datadog/profiling.rb | 1 + lib/datadog/profiling/old_recorder.rb | 69 ++------- lib/datadog/profiling/recorder.rb | 9 +- .../core/configuration/components_spec.rb | 6 +- spec/datadog/profiling/integration_spec.rb | 6 +- spec/datadog/profiling/old_recorder_spec.rb | 145 +++++------------- spec/datadog/profiling/recorder_spec.rb | 13 +- spec/datadog/profiling/scheduler_spec.rb | 4 +- 11 files changed, 97 insertions(+), 204 deletions(-) diff --git a/benchmarks/profiler_sample_loop.rb b/benchmarks/profiler_sample_loop.rb index 3c3f6028371..32491cae5f0 100644 --- a/benchmarks/profiler_sample_loop.rb +++ b/benchmarks/profiler_sample_loop.rb @@ -58,13 +58,13 @@ def run_benchmark x.compare! end - @recorder.flush + @recorder.serialize end def run_forever while true 1000.times { @stack_collector.collect_and_wait } - @recorder.flush + @recorder.serialize print '.' end end diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index 60c58407b8c..12f3dd3264e 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -16,7 +16,7 @@ Components below live inside <../lib/datadog/profiling>: * `Ext::Forking`: Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore profiling abilities after the VM forks (such as re-instrumenting the main thread, and restarting profiler threads). * `Pprof::*` (in <../lib/datadog/profiling/pprof>): Used by `Encoding::Profile::Protobuf` to convert samples captured in - the `Recorder` into the pprof format. + the `OldRecorder` into the pprof format. * `Tasks::Setup`: Takes care of loading our extensions/monkey patches to handle `fork()`. * `HttpTransport`: Implements transmission of profiling payloads to the Datadog agent or backend. * `TraceIdentifiers::*`: Used to retrieve trace id and span id from tracers, to be used to connect traces to profiles. @@ -24,7 +24,8 @@ Components below live inside <../lib/datadog/profiling>: * `Buffer`: Bounded buffer used to store profiling events. * `Flush`: Entity class used to represent the payload to be reported for a given profile. * `Profiler`: Profiling entry point, which coordinates collectors and a scheduler. -* `Recorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) +* `OldRecorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) +* `Recorder`: Gathers data from `OldRecorder` and `Collector::CodeProvenance` to be reported as a profile. * `Scheduler`: Periodically (every 1 minute) takes data from the `Recorder` and pushes them to the configured transport. Runs on its own background thread. @@ -55,12 +56,12 @@ flow: +--------+-+ | +---------------+ | | v v - +-+-------+-+ - | Recorder | - +-----------+ - | - v - +-----------------+ + +---------+---+ ++----------+ + | OldRecorder |<-| Recorder | + +-------------+ +-+---------+ + | + v + +--------------+--+ | Code Provenance | +-----------------+ ``` diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 961c1e40707..d968f4c5fd9 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -240,15 +240,9 @@ def build_profiler(settings, agent_settings, tracer) endpoint_collection_enabled: settings.profiling.advanced.endpoint.collection.enabled ) - # TODO: It's a bit weird to treat this collector differently from others. See the TODO on the - # Datadog::Profiling::OldRecorder class for a discussion of this choice. - if settings.profiling.advanced.code_provenance_enabled - code_provenance_collector = - Profiling::Collectors::CodeProvenance.new - end - - recorder = build_profiler_recorder(settings, code_provenance_collector) - collectors = build_profiler_collectors(settings, recorder, trace_identifiers_helper) + old_recorder = build_profiler_old_recorder(settings) + recorder = build_profiler_recorder(settings, old_recorder) + collectors = build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) transport = build_profiler_transport(settings, agent_settings) scheduler = build_profiler_scheduler(settings, recorder, transport) @@ -284,13 +278,24 @@ def build_test_mode_writer(settings, agent_settings) Tracing::SyncWriter.new(agent_settings: agent_settings, **writer_options) end - def build_profiler_recorder(settings, code_provenance_collector) + def build_profiler_old_recorder(settings) event_classes = [Profiling::Events::StackSample] Profiling::OldRecorder.new( event_classes, settings.profiling.advanced.max_events, - code_provenance_collector: code_provenance_collector + ) + end + + def build_profiler_recorder(settings, old_recorder) + code_provenance_collector = + (Profiling::Collectors::CodeProvenance.new if settings.profiling.advanced.code_provenance_enabled) + + Profiling::Recorder.new( + # NOTE: Using the OldRecorder as a pprof_collector is temporary and will be removed once libpprof is + # being used for aggregation + pprof_collector: old_recorder, + code_provenance_collector: code_provenance_collector, ) end diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index 61487131f8a..c27a6268978 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -151,6 +151,7 @@ def self.start_if_enabled require 'datadog/profiling/collectors/stack' require 'datadog/profiling/stack_recorder' require 'datadog/profiling/old_recorder' + require 'datadog/profiling/recorder' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' require 'datadog/profiling/profiler' diff --git a/lib/datadog/profiling/old_recorder.rb b/lib/datadog/profiling/old_recorder.rb index 245316196c4..a5a4180f75c 100644 --- a/lib/datadog/profiling/old_recorder.rb +++ b/lib/datadog/profiling/old_recorder.rb @@ -1,48 +1,22 @@ # typed: true require 'datadog/profiling/buffer' -require 'datadog/profiling/flush' require 'datadog/profiling/encoding/profile' -require 'datadog/core/utils/compression' -require 'datadog/profiling/tag_builder' module Datadog module Profiling - # Stores profiling events gathered by `Collector`s + # Stores profiling events gathered by the `Stack` collector class OldRecorder attr_reader :max_size - # Profiles with duration less than this will not be reported - PROFILE_DURATION_THRESHOLD_SECONDS = 1 - - # TODO: Why does the OldRecorder directly reference the `code_provenance_collector`? - # - # For starters, this is weird/a problem because the relationship is supposed to go in the other direction: - # collectors are supposed to record their results in the `OldRecorder`, rather than the `OldRecorder` having to know - # about individual collectors. - # - # But the `code_provenance_collector` is different from other existing and potential collectors because it is not - # asynchronous. It does not gather data over time and record it as it goes. Instead, you call it once per profile, - # synchronously, and just use what it spits out. - # - # The current design of the `OldRecorder` is quite tied to the asynchronous model. Modifying our current design - # to support synchronous collectors is non-trivial, and I decided not to go through with it because we're - # soon going to replace the `OldRecorder` and many other existing classes with a - # [libddprof](https://github.com/datadog/libddprof)-based implementation, and thus I don't think massive refactors - # are worth it before moving to libddprof. - def initialize( event_classes, max_size, - code_provenance_collector:, - last_flush_time: Time.now.utc, - minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS + last_flush_time: Time.now.utc ) @buffers = {} @last_flush_time = last_flush_time @max_size = max_size - @code_provenance_collector = code_provenance_collector - @minimum_duration = minimum_duration # Add a buffer for each class event_classes.each do |event_class| @@ -73,7 +47,7 @@ def push(events) end end - def flush + def serialize event_count = 0 event_groups, start, finish = update_time do @@ -88,32 +62,15 @@ def flush return if event_count.zero? # We don't want to report empty profiles - if duration_below_threshold?(start, finish) - Datadog.logger.debug do - "Skipped exporting profiling events as profile duration is below minimum (#{event_count} events skipped)" - end - - return - end + encoded_pprof = + Datadog::Profiling::Encoding::Profile::Protobuf.encode( + event_count: event_count, + event_groups: event_groups, + start: start, + finish: finish, + ) - encoded_pprof = Datadog::Profiling::Encoding::Profile::Protobuf.encode( - event_count: event_count, - event_groups: event_groups, - start: start, - finish: finish, - ) - - code_provenance = @code_provenance_collector.refresh.generate_json if @code_provenance_collector - - Flush.new( - start: start, - finish: finish, - pprof_file_name: Datadog::Profiling::Ext::Transport::HTTP::PPROF_DEFAULT_FILENAME, - pprof_data: Core::Utils::Compression.gzip(encoded_pprof), - code_provenance_file_name: Datadog::Profiling::Ext::Transport::HTTP::CODE_PROVENANCE_FILENAME, - code_provenance_data: (Core::Utils::Compression.gzip(code_provenance) if code_provenance), - tags_as_array: Datadog::Profiling::TagBuilder.call(settings: Datadog.configuration).to_a, - ) + [start, finish, encoded_pprof] end # NOTE: Remember that if the recorder is being accessed by multiple threads, this is an inherently racy operation. @@ -144,10 +101,6 @@ def update_time # Return event groups, start time, finish time [result, start, @last_flush_time] end - - def duration_below_threshold?(start, finish) - (finish - start) < @minimum_duration - end end end end diff --git a/lib/datadog/profiling/recorder.rb b/lib/datadog/profiling/recorder.rb index d786667eab7..906444a0273 100644 --- a/lib/datadog/profiling/recorder.rb +++ b/lib/datadog/profiling/recorder.rb @@ -22,21 +22,18 @@ class Recorder attr_reader \ :pprof_collector, :code_provenance_collector, - :minimum_duration, - :logger + :minimum_duration public def initialize( pprof_collector:, code_provenance_collector:, - minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS, - logger: Datadog.logger + minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS ) @pprof_collector = pprof_collector @code_provenance_collector = code_provenance_collector @minimum_duration = minimum_duration - @logger = logger end def flush @@ -45,7 +42,7 @@ def flush return if uncompressed_pprof.nil? # We don't want to report empty profiles if duration_below_threshold?(start, finish) - logger.debug('Skipped exporting profiling events as profile duration is below minimum') + Datadog.logger.debug('Skipped exporting profiling events as profile duration is below minimum') return end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 961af8fe3f4..643f3ab8993 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -935,7 +935,7 @@ end shared_examples_for 'profiler with default recorder' do - subject(:recorder) { profiler.scheduler.send(:recorder) } + subject(:old_recorder) { profiler.scheduler.send(:recorder).send(:pprof_collector) } it do is_expected.to have_attributes(max_size: settings.profiling.advanced.max_events) @@ -1005,7 +1005,7 @@ end it 'initializes the recorder with a code provenance collector' do - expect(Datadog::Profiling::OldRecorder).to receive(:new) do |*_args, code_provenance_collector:| + expect(Datadog::Profiling::Recorder).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) end.and_call_original @@ -1016,7 +1016,7 @@ before { settings.profiling.advanced.code_provenance_enabled = false } it 'initializes the recorder with a nil code provenance collector' do - expect(Datadog::Profiling::OldRecorder).to receive(:new) do |*_args, code_provenance_collector:| + expect(Datadog::Profiling::Recorder).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be nil end.and_call_original diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index 4bc31f4a229..f00172efc45 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -83,17 +83,17 @@ def stack_two end describe 'profiling' do - let(:recorder) do + let(:old_recorder) do Datadog::Profiling::OldRecorder.new( [Datadog::Profiling::Events::StackSample], 100000, - code_provenance_collector: nil, last_flush_time: Time.now.utc - 5 ) end + let(:recorder) { Datadog::Profiling::Recorder.new(pprof_collector: old_recorder, code_provenance_collector: nil) } let(:collector) do Datadog::Profiling::Collectors::OldStack.new( - recorder, + old_recorder, trace_identifiers_helper: Datadog::Profiling::TraceIdentifiers::Helper.new( tracer: tracer, diff --git a/spec/datadog/profiling/old_recorder_spec.rb b/spec/datadog/profiling/old_recorder_spec.rb index 44880145691..ad1c6353c56 100644 --- a/spec/datadog/profiling/old_recorder_spec.rb +++ b/spec/datadog/profiling/old_recorder_spec.rb @@ -4,16 +4,14 @@ require 'datadog/profiling/old_recorder' require 'datadog/profiling/event' -require 'datadog/profiling/collectors/code_provenance' RSpec.describe Datadog::Profiling::OldRecorder do subject(:recorder) do - described_class.new(event_classes, max_size, code_provenance_collector: code_provenance_collector, **options) + described_class.new(event_classes, max_size, **options) end let(:event_classes) { [] } let(:max_size) { 0 } - let(:code_provenance_collector) { nil } let(:options) { {} } shared_context 'test buffer' do @@ -114,126 +112,67 @@ end end - describe '#flush' do + describe '#serialize' do include_context 'test buffer' let(:events) { [] } - let(:options) { { minimum_duration: 0 } } # Override the minimum duration to avoid needing to mock Time + let(:event_classes) { [event_class] } + let(:event_class) { Class.new(Datadog::Profiling::Event) } - subject(:flush) { recorder.flush } + subject(:serialize) { recorder.serialize } before { allow(buffer).to receive(:pop).and_return(events) } - context 'when the OldRecorder has a registered event class' do - let(:event_classes) { [event_class] } - let(:event_class) { Class.new(Datadog::Profiling::Event) } - - context 'whose buffer returns events' do - let(:events) { [event_class.new, event_class.new] } - - before do - allow(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode) - end - - it 'returns a flush with the profiling data' do - is_expected.to have_attributes( - start: kind_of(Time), - finish: kind_of(Time), - pprof_file_name: 'rubyprofile.pprof', - code_provenance_file_name: 'code-provenance.json', - tags_as_array: array_including(%w[language ruby], ['process_id', Process.pid.to_s]), - ) - end - - it 'calls the protobuf encoder with the events' do - expected_event_group = instance_double(Datadog::Profiling::EventGroup) - - expect(Datadog::Profiling::EventGroup) - .to receive(:new).with(event_class, events).and_return(expected_event_group) - expect(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).with( - start: kind_of(Time), - finish: kind_of(Time), - event_groups: [expected_event_group], - event_count: 2, - ) + context 'whose buffer returns events' do + let(:events) { [event_class.new, event_class.new] } + let(:pprof_data) { 'dummy encoded pprof data' } - flush - end - - it 'returns a flush with gzip-compressed pprof data' do - expect(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).and_return('dummy pprof data') - - flush - - expect(Datadog::Core::Utils::Compression.gunzip(flush.pprof_data)).to eq 'dummy pprof data' - end - - context 'called back to back' do - subject(:flush) { Array.new(3) { recorder.flush } } - - it 'has its start and end times line up' do - expect(flush[0].start).to be < flush[0].finish - expect(flush[0].finish).to eq flush[1].start - expect(flush[1].finish).to eq flush[2].start - expect(flush[2].start).to be < flush[2].finish - end - end - - context 'when code_provenance_collector is nil' do - let(:code_provenance_collector) { nil } - - it 'returns a flush without code provenance data' do - expect(flush.code_provenance_data).to be nil - end - end - - context 'when code_provenance_collector is available' do - let(:code_provenance_collector) do - collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance) - allow(collector).to receive(:refresh).and_return(collector) - collector - end - let(:code_provenance) { 'dummy code provenance data' } + before do + allow(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).and_return(pprof_data) + end - it 'returns a flush with gzip-compressed code provenance data' do - expect(Datadog::Core::Utils::Compression.gunzip(flush.code_provenance_data)).to eq code_provenance - end - end + it 'returns a tuple with the profiling data' do + start, finish, pprof_data = serialize - context 'when duration of profile is below 1s' do - let(:finish_time) { Time.utc(2021) } - let(:options) { { last_flush_time: finish_time - 0.9 } } + expect(start).to be_a_kind_of(Time) + expect(finish).to be_a_kind_of(Time) + expect(pprof_data).to be pprof_data + end - before do - expect(Time).to receive(:now).and_return(finish_time) - end + it 'calls the protobuf encoder with the events' do + expected_event_group = instance_double(Datadog::Profiling::EventGroup) - it { is_expected.to be nil } + expect(Datadog::Profiling::EventGroup) + .to receive(:new).with(event_class, events).and_return(expected_event_group) + expect(Datadog::Profiling::Encoding::Profile::Protobuf).to receive(:encode).with( + start: kind_of(Time), + finish: kind_of(Time), + event_groups: [expected_event_group], + event_count: 2, + ) - it 'logs a debug message' do - expect(Datadog.logger).to receive(:debug) do |&message| - expect(message.call).to include 'Skipped exporting' - end + serialize + end - flush + context 'called back to back' do + subject(:flush) do + Array.new(3) do + start, finish = recorder.serialize + OpenStruct.new(start: start, finish: finish) end end - context 'when duration of profile is at least 1s' do - let(:finish_time) { Time.utc(2021) } - let(:options) { { last_flush_time: finish_time - 1 } } - - before do - expect(Time).to receive(:now).and_return(finish_time) - end - - it { is_expected.to_not be nil } + it 'has its start and end times line up' do + expect(flush[0].start).to be < flush[0].finish + expect(flush[0].finish).to eq flush[1].start + expect(flush[1].finish).to eq flush[2].start + expect(flush[2].start).to be < flush[2].finish end end + end - context 'whose buffer returns no events' do - it { is_expected.to be nil } - end + context 'whose buffer returns no events' do + it { is_expected.to be nil } end end diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/recorder_spec.rb index 5f3ca2258b6..f6786eac5ce 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/recorder_spec.rb @@ -7,24 +7,21 @@ RSpec.describe Datadog::Profiling::Recorder do subject(:recorder) do - described_class.new( - pprof_collector: pprof_collector, - code_provenance_collector: code_provenance_collector, - logger: logger, - ) + described_class.new(pprof_collector: pprof_collector, code_provenance_collector: code_provenance_collector) end let(:start) { Time.now } let(:finish) { start + 60 } let(:pprof_data) { 'dummy pprof data' } let(:code_provenance_data) { 'dummy code provenance data' } - let(:pprof_collector) { instance_double(Datadog::Profiling::OldRecorder, serialize: [start, finish, pprof_data]) } + let(:pprof_collector_serialize) { [start, finish, pprof_data] } + let(:pprof_collector) { instance_double(Datadog::Profiling::OldRecorder, serialize: pprof_collector_serialize) } let(:code_provenance_collector) do collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance_data) allow(collector).to receive(:refresh).and_return(collector) collector end - let(:logger) { instance_double(Datadog::Core::Logger) } + let(:logger) { Datadog.logger } describe '#flush' do subject(:flush) { recorder.flush } @@ -42,7 +39,7 @@ end context 'when pprof collector has no data' do - let(:pprof_data) { nil } + let(:pprof_collector_serialize) { nil } it { is_expected.to be nil } end diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 20e3764daf3..672dfb80daa 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' require 'datadog/profiling/http_transport' -require 'datadog/profiling/old_recorder' +require 'datadog/profiling/recorder' require 'datadog/profiling/scheduler' RSpec.describe Datadog::Profiling::Scheduler do subject(:scheduler) { described_class.new(recorder: recorder, transport: transport, **options) } - let(:recorder) { instance_double(Datadog::Profiling::OldRecorder) } + let(:recorder) { instance_double(Datadog::Profiling::Recorder) } let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } let(:options) { {} } From 9eb5186ed2d60c0ca738c047972a637c949e2f2d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 1 Apr 2022 13:25:38 +0200 Subject: [PATCH 0079/2133] Rename `Recorder` to `Exporter` After sleeping on it for a few days, I decided that `Recorder` was not the best name for the component given what are its responsibilities. `Exporter` is a better name, so I've renamed it. --- .rubocop_todo.yml | 2 +- docs/ProfilingDevelopment.md | 14 +++++++------- lib/datadog/core/configuration/components.rb | 16 ++++++++-------- lib/datadog/profiling.rb | 2 +- .../profiling/{recorder.rb => exporter.rb} | 4 ++-- .../core/configuration/components_spec.rb | 8 ++++---- .../{recorder_spec.rb => exporter_spec.rb} | 10 +++++----- spec/datadog/profiling/integration_spec.rb | 11 ++--------- spec/datadog/profiling/scheduler_spec.rb | 18 +++++++++--------- 9 files changed, 39 insertions(+), 46 deletions(-) rename lib/datadog/profiling/{recorder.rb => exporter.rb} (96%) rename spec/datadog/profiling/{recorder_spec.rb => exporter_spec.rb} (92%) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ffc29d91639..f6671fc4c41 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -263,7 +263,7 @@ RSpec/VerifiedDoubles: - 'spec/datadog/profiling/collectors/old_stack_spec.rb' - 'spec/datadog/profiling/encoding/profile_spec.rb' - 'spec/datadog/profiling/events/stack_spec.rb' - - 'spec/datadog/profiling/exporter_spec.rb' + - 'spec/datadog/profiling/old_exporter_spec.rb' - 'spec/datadog/profiling/ext/cthread_spec.rb' - 'spec/datadog/profiling/ext/forking_spec.rb' - 'spec/datadog/profiling/flush_spec.rb' diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index 12f3dd3264e..59c764b3f9a 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -25,8 +25,8 @@ Components below live inside <../lib/datadog/profiling>: * `Flush`: Entity class used to represent the payload to be reported for a given profile. * `Profiler`: Profiling entry point, which coordinates collectors and a scheduler. * `OldRecorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) -* `Recorder`: Gathers data from `OldRecorder` and `Collector::CodeProvenance` to be reported as a profile. -* `Scheduler`: Periodically (every 1 minute) takes data from the `Recorder` and pushes them to the configured transport. +* `Exporter`: Gathers data from `OldRecorder` and `Collectors::CodeProvenance` to be reported as a profile. +* `Scheduler`: Periodically (every 1 minute) takes data from the `Exporter` and pushes them to the configured transport. Runs on its own background thread. ## Initialization @@ -56,9 +56,9 @@ flow: +--------+-+ | +---------------+ | | v v - +---------+---+ ++----------+ - | OldRecorder |<-| Recorder | - +-------------+ +-+---------+ + +---------+---+ ++---------+ + | OldRecorder |<-| Exporter | + +-------------+ +-+--------+ | v +--------------+--+ @@ -72,9 +72,9 @@ flow: During run-time, the `Scheduler` and the `Collectors::OldStack` each execute on their own background thread. The `Collectors::OldStack` samples stack traces of threads, capturing both CPU-time (if available) and wall-clock, storing -them in the `Recorder`. +them in the `OldRecorder`. -The `Scheduler` wakes up every 1 minute to flush the results of the `Recorder` into the transport. +The `Scheduler` wakes up every 1 minute to flush the results of the `Exporter` into the transport. By default, the `Scheduler` gets created with the default `HttpTransport`, which takes care of encoding the data and reporting it to the Datadog agent. diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index d968f4c5fd9..2aa9b18760a 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -241,10 +241,10 @@ def build_profiler(settings, agent_settings, tracer) ) old_recorder = build_profiler_old_recorder(settings) - recorder = build_profiler_recorder(settings, old_recorder) + exporter = build_profiler_exporter(settings, old_recorder) collectors = build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) transport = build_profiler_transport(settings, agent_settings) - scheduler = build_profiler_scheduler(settings, recorder, transport) + scheduler = build_profiler_scheduler(settings, exporter, transport) Profiling::Profiler.new(collectors, scheduler) end @@ -287,11 +287,11 @@ def build_profiler_old_recorder(settings) ) end - def build_profiler_recorder(settings, old_recorder) + def build_profiler_exporter(settings, old_recorder) code_provenance_collector = (Profiling::Collectors::CodeProvenance.new if settings.profiling.advanced.code_provenance_enabled) - Profiling::Recorder.new( + Profiling::Exporter.new( # NOTE: Using the OldRecorder as a pprof_collector is temporary and will be removed once libpprof is # being used for aggregation pprof_collector: old_recorder, @@ -299,10 +299,10 @@ def build_profiler_recorder(settings, old_recorder) ) end - def build_profiler_collectors(settings, recorder, trace_identifiers_helper) + def build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) [ Profiling::Collectors::OldStack.new( - recorder, + old_recorder, trace_identifiers_helper: trace_identifiers_helper, max_frames: settings.profiling.advanced.max_frames # TODO: Provide proc that identifies Datadog worker threads? @@ -321,8 +321,8 @@ def build_profiler_transport(settings, agent_settings) ) end - def build_profiler_scheduler(_settings, recorder, transport) - Profiling::Scheduler.new(recorder: recorder, transport: transport) + def build_profiler_scheduler(_settings, exporter, transport) + Profiling::Scheduler.new(recorder: exporter, transport: transport) end end diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index c27a6268978..31ed669beec 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -151,7 +151,7 @@ def self.start_if_enabled require 'datadog/profiling/collectors/stack' require 'datadog/profiling/stack_recorder' require 'datadog/profiling/old_recorder' - require 'datadog/profiling/recorder' + require 'datadog/profiling/exporter' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' require 'datadog/profiling/profiler' diff --git a/lib/datadog/profiling/recorder.rb b/lib/datadog/profiling/exporter.rb similarity index 96% rename from lib/datadog/profiling/recorder.rb rename to lib/datadog/profiling/exporter.rb index 906444a0273..7c0d3037434 100644 --- a/lib/datadog/profiling/recorder.rb +++ b/lib/datadog/profiling/exporter.rb @@ -6,14 +6,14 @@ module Datadog module Profiling - # Records profiling data gathered by the multiple collectors in a `Flush`. + # Exports profiling data gathered by the multiple collectors in a `Flush`. # # @ivoanjo: Note that the collector that gathers pprof data is special, since we use its start/finish/empty? to # decide if there's data to flush, as well as the timestamp for that data. # I could've made the whole design more generic, but I'm unsure if we'll ever have more than a handful of # collectors, so I've decided to make it specific until we actually need to support more collectors. # - class Recorder + class Exporter # Profiles with duration less than this will not be reported PROFILE_DURATION_THRESHOLD_SECONDS = 1 diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 643f3ab8993..1e0b45cbc08 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -1004,8 +1004,8 @@ end end - it 'initializes the recorder with a code provenance collector' do - expect(Datadog::Profiling::Recorder).to receive(:new) do |code_provenance_collector:, **_| + it 'initializes the exporter with a code provenance collector' do + expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) end.and_call_original @@ -1015,8 +1015,8 @@ context 'when code provenance is disabled' do before { settings.profiling.advanced.code_provenance_enabled = false } - it 'initializes the recorder with a nil code provenance collector' do - expect(Datadog::Profiling::Recorder).to receive(:new) do |code_provenance_collector:, **_| + it 'initializes the exporter with a nil code provenance collector' do + expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be nil end.and_call_original diff --git a/spec/datadog/profiling/recorder_spec.rb b/spec/datadog/profiling/exporter_spec.rb similarity index 92% rename from spec/datadog/profiling/recorder_spec.rb rename to spec/datadog/profiling/exporter_spec.rb index f6786eac5ce..2f5a36a53ce 100644 --- a/spec/datadog/profiling/recorder_spec.rb +++ b/spec/datadog/profiling/exporter_spec.rb @@ -1,12 +1,12 @@ # typed: false -require 'datadog/profiling/recorder' +require 'datadog/profiling/exporter' require 'datadog/profiling/old_recorder' require 'datadog/profiling/collectors/code_provenance' require 'datadog/core/logger' -RSpec.describe Datadog::Profiling::Recorder do - subject(:recorder) do +RSpec.describe Datadog::Profiling::Exporter do + subject(:exporter) do described_class.new(pprof_collector: pprof_collector, code_provenance_collector: code_provenance_collector) end @@ -24,7 +24,7 @@ let(:logger) { Datadog.logger } describe '#flush' do - subject(:flush) { recorder.flush } + subject(:flush) { exporter.flush } it 'returns a flush containing the data from the collectors' do expect(flush).to have_attributes( @@ -77,7 +77,7 @@ it 'delegates to the pprof_collector' do expect(pprof_collector).to receive(:empty?).and_return(:empty_result) - expect(recorder.empty?).to be :empty_result + expect(exporter.empty?).to be :empty_result end end end diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index f00172efc45..5d09021c63e 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -90,7 +90,7 @@ def stack_two last_flush_time: Time.now.utc - 5 ) end - let(:recorder) { Datadog::Profiling::Recorder.new(pprof_collector: old_recorder, code_provenance_collector: nil) } + let(:exporter) { Datadog::Profiling::Exporter.new(pprof_collector: old_recorder, code_provenance_collector: nil) } let(:collector) do Datadog::Profiling::Collectors::OldStack.new( old_recorder, @@ -102,15 +102,8 @@ def stack_two max_frames: 400 ) end - let(:exporter) do - Datadog::Profiling::Exporter.new( - Datadog::Profiling::Transport::IO.default( - out: out - ) - ) - end let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } - let(:scheduler) { Datadog::Profiling::Scheduler.new(recorder: recorder, transport: transport) } + let(:scheduler) { Datadog::Profiling::Scheduler.new(recorder: exporter, transport: transport) } it 'produces a profile' do expect(transport).to receive(:export) diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 672dfb80daa..8ba67b97956 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' require 'datadog/profiling/http_transport' -require 'datadog/profiling/recorder' +require 'datadog/profiling/exporter' require 'datadog/profiling/scheduler' RSpec.describe Datadog::Profiling::Scheduler do - subject(:scheduler) { described_class.new(recorder: recorder, transport: transport, **options) } + subject(:scheduler) { described_class.new(recorder: exporter, transport: transport, **options) } - let(:recorder) { instance_double(Datadog::Profiling::Recorder) } + let(:exporter) { instance_double(Datadog::Profiling::Exporter) } let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } let(:options) { {} } @@ -90,7 +90,7 @@ subject(:after_fork) { scheduler.after_fork } it 'clears the buffer' do - expect(recorder).to receive(:flush) + expect(exporter).to receive(:flush) after_fork end end @@ -133,7 +133,7 @@ let(:flush) { instance_double(Datadog::Profiling::Flush) } - before { expect(recorder).to receive(:flush).and_return(flush) } + before { expect(exporter).to receive(:flush).and_return(flush) } it 'exports the profiling data' do expect(transport).to receive(:export).with(flush) @@ -199,14 +199,14 @@ describe '#work_pending?' do subject(:work_pending?) { scheduler.work_pending? } - context 'when the recorder has no events' do - before { expect(recorder).to receive(:empty?).and_return(true) } + context 'when the exporter has no events' do + before { expect(exporter).to receive(:empty?).and_return(true) } it { is_expected.to be false } end - context 'when the recorder has events' do - before { expect(recorder).to receive(:empty?).and_return(false) } + context 'when the exporter has events' do + before { expect(exporter).to receive(:empty?).and_return(false) } it { is_expected.to be true } end From 876fe79a42378c979d1377c52ea8267b4b9dcf4a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 1 Apr 2022 13:54:39 +0200 Subject: [PATCH 0080/2133] Update `Scheduler` to have an `exporter` instead of a `recorder` This does not change any behavior, just makes sure we use naming consistently in the scheduler. --- lib/datadog/core/configuration/components.rb | 2 +- lib/datadog/profiling/scheduler.rb | 23 +++++++++---------- .../core/configuration/components_spec.rb | 2 +- spec/datadog/profiling/integration_spec.rb | 2 +- spec/datadog/profiling/scheduler_spec.rb | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 2aa9b18760a..39f8224a8a4 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -322,7 +322,7 @@ def build_profiler_transport(settings, agent_settings) end def build_profiler_scheduler(_settings, exporter, transport) - Profiling::Scheduler.new(recorder: exporter, transport: transport) + Profiling::Scheduler.new(exporter: exporter, transport: transport) end end diff --git a/lib/datadog/profiling/scheduler.rb b/lib/datadog/profiling/scheduler.rb index 11fcb6390f4..0ea2d7a5bb1 100644 --- a/lib/datadog/profiling/scheduler.rb +++ b/lib/datadog/profiling/scheduler.rb @@ -7,8 +7,8 @@ module Datadog module Profiling - # Periodically (every DEFAULT_INTERVAL_SECONDS) takes data from the `Recorder` and reports them using the configured - # transport. Runs on its own background thread. + # Periodically (every DEFAULT_INTERVAL_SECONDS) takes a profile from the `Exporter` and reports it using the + # configured transport. Runs on its own background thread. class Scheduler < Core::Worker include Core::Workers::Polling @@ -22,19 +22,19 @@ class Scheduler < Core::Worker private attr_reader \ - :recorder, + :exporter, :transport public def initialize( - recorder:, + exporter:, transport:, fork_policy: Core::Workers::Async::Thread::FORK_POLICY_RESTART, # Restart in forks by default interval: DEFAULT_INTERVAL_SECONDS, enabled: true ) - @recorder = recorder + @exporter = exporter @transport = transport # Workers::Async::Thread settings @@ -67,23 +67,22 @@ def perform end def after_fork - # Clear recorder's buffers by flushing events. - # Objects from parent process will copy-on-write, - # and we don't want to send events for the wrong process. - recorder.flush + # Clear any existing profiling state. + # We don't want the child process to report profiling data from its parent. + exporter.flush end # Configure Workers::IntervalLoop to not report immediately when scheduler starts # # When a scheduler gets created (or reset), we don't want it to immediately try to flush; we want it to wait for # the loop wait time first. This avoids an issue where the scheduler reported a mostly-empty profile if the - # application just started but this thread took a bit longer so there's already samples in the recorder. + # application just started but this thread took a bit longer so there's already profiling data in the exporter. def loop_wait_before_first_iteration? true end def work_pending? - !recorder.empty? + !exporter.empty? end private @@ -100,7 +99,7 @@ def flush_and_wait def flush_events # Collect data to be exported - flush = recorder.flush + flush = exporter.flush return false unless flush diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 1e0b45cbc08..cda8eefd5c5 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -935,7 +935,7 @@ end shared_examples_for 'profiler with default recorder' do - subject(:old_recorder) { profiler.scheduler.send(:recorder).send(:pprof_collector) } + subject(:old_recorder) { profiler.scheduler.send(:exporter).send(:pprof_collector) } it do is_expected.to have_attributes(max_size: settings.profiling.advanced.max_events) diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index 5d09021c63e..f9f8c6968ea 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -103,7 +103,7 @@ def stack_two ) end let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } - let(:scheduler) { Datadog::Profiling::Scheduler.new(recorder: exporter, transport: transport) } + let(:scheduler) { Datadog::Profiling::Scheduler.new(exporter: exporter, transport: transport) } it 'produces a profile' do expect(transport).to receive(:export) diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 8ba67b97956..549305d63d9 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -7,7 +7,7 @@ require 'datadog/profiling/scheduler' RSpec.describe Datadog::Profiling::Scheduler do - subject(:scheduler) { described_class.new(recorder: exporter, transport: transport, **options) } + subject(:scheduler) { described_class.new(exporter: exporter, transport: transport, **options) } let(:exporter) { instance_double(Datadog::Profiling::Exporter) } let(:transport) { instance_double(Datadog::Profiling::HttpTransport) } From aa3a9e2f27e34407c4b771002574ca2ae8cced88 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 1 Apr 2022 14:00:45 +0200 Subject: [PATCH 0081/2133] Rename `pprof_collector` argument in `Exporter` to `pprof_recorder` The recorder name is closer to what we want; the previous name resulted from me trying to distinguish the misnamed `Recorder` from other things, which made me not want to call them recorders. After I fixed the `Recorder` name, the actual recorders could start being called using that name again. --- lib/datadog/core/configuration/components.rb | 4 ++-- .../profiling/collectors/code_provenance.rb | 1 + lib/datadog/profiling/exporter.rb | 18 +++++++++--------- .../core/configuration/components_spec.rb | 2 +- spec/datadog/profiling/exporter_spec.rb | 16 ++++++++-------- spec/datadog/profiling/integration_spec.rb | 2 +- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 39f8224a8a4..9cb4a5e6fa3 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -292,9 +292,9 @@ def build_profiler_exporter(settings, old_recorder) (Profiling::Collectors::CodeProvenance.new if settings.profiling.advanced.code_provenance_enabled) Profiling::Exporter.new( - # NOTE: Using the OldRecorder as a pprof_collector is temporary and will be removed once libpprof is + # NOTE: Using the OldRecorder as a pprof_recorder is temporary and will be removed once libpprof is # being used for aggregation - pprof_collector: old_recorder, + pprof_recorder: old_recorder, code_provenance_collector: code_provenance_collector, ) end diff --git a/lib/datadog/profiling/collectors/code_provenance.rb b/lib/datadog/profiling/collectors/code_provenance.rb index 6bf2330cc82..1d5d367de2b 100644 --- a/lib/datadog/profiling/collectors/code_provenance.rb +++ b/lib/datadog/profiling/collectors/code_provenance.rb @@ -14,6 +14,7 @@ module Collectors # # This metadata powers grouping and categorization of stack trace data. # + # This class acts both as a collector (collecting data) as well as a recorder (records/serializes it) class CodeProvenance def initialize(standard_library_path: RbConfig::CONFIG.fetch('rubylibdir')) @libraries_by_name = {} diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb index 7c0d3037434..f166cdc3b45 100644 --- a/lib/datadog/profiling/exporter.rb +++ b/lib/datadog/profiling/exporter.rb @@ -6,12 +6,12 @@ module Datadog module Profiling - # Exports profiling data gathered by the multiple collectors in a `Flush`. + # Exports profiling data gathered by the multiple recorders in a `Flush`. # - # @ivoanjo: Note that the collector that gathers pprof data is special, since we use its start/finish/empty? to + # @ivoanjo: Note that the recorders that gathers pprof data is special, since we use its start/finish/empty? to # decide if there's data to flush, as well as the timestamp for that data. # I could've made the whole design more generic, but I'm unsure if we'll ever have more than a handful of - # collectors, so I've decided to make it specific until we actually need to support more collectors. + # recorders, so I've decided to make it specific until we actually need to support more recorders. # class Exporter # Profiles with duration less than this will not be reported @@ -20,24 +20,24 @@ class Exporter private attr_reader \ - :pprof_collector, - :code_provenance_collector, + :pprof_recorder, + :code_provenance_collector, # The code provenance collector acts both as collector and as a recorder :minimum_duration public def initialize( - pprof_collector:, + pprof_recorder:, code_provenance_collector:, minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS ) - @pprof_collector = pprof_collector + @pprof_recorder = pprof_recorder @code_provenance_collector = code_provenance_collector @minimum_duration = minimum_duration end def flush - start, finish, uncompressed_pprof = pprof_collector.serialize + start, finish, uncompressed_pprof = pprof_recorder.serialize return if uncompressed_pprof.nil? # We don't want to report empty profiles @@ -61,7 +61,7 @@ def flush end def empty? - pprof_collector.empty? + pprof_recorder.empty? end private diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index cda8eefd5c5..7070048cc77 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -935,7 +935,7 @@ end shared_examples_for 'profiler with default recorder' do - subject(:old_recorder) { profiler.scheduler.send(:exporter).send(:pprof_collector) } + subject(:old_recorder) { profiler.scheduler.send(:exporter).send(:pprof_recorder) } it do is_expected.to have_attributes(max_size: settings.profiling.advanced.max_events) diff --git a/spec/datadog/profiling/exporter_spec.rb b/spec/datadog/profiling/exporter_spec.rb index 2f5a36a53ce..f5076712859 100644 --- a/spec/datadog/profiling/exporter_spec.rb +++ b/spec/datadog/profiling/exporter_spec.rb @@ -7,15 +7,15 @@ RSpec.describe Datadog::Profiling::Exporter do subject(:exporter) do - described_class.new(pprof_collector: pprof_collector, code_provenance_collector: code_provenance_collector) + described_class.new(pprof_recorder: pprof_recorder, code_provenance_collector: code_provenance_collector) end let(:start) { Time.now } let(:finish) { start + 60 } let(:pprof_data) { 'dummy pprof data' } let(:code_provenance_data) { 'dummy code provenance data' } - let(:pprof_collector_serialize) { [start, finish, pprof_data] } - let(:pprof_collector) { instance_double(Datadog::Profiling::OldRecorder, serialize: pprof_collector_serialize) } + let(:pprof_recorder_serialize) { [start, finish, pprof_data] } + let(:pprof_recorder) { instance_double(Datadog::Profiling::OldRecorder, serialize: pprof_recorder_serialize) } let(:code_provenance_collector) do collector = instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance_data) allow(collector).to receive(:refresh).and_return(collector) @@ -26,7 +26,7 @@ describe '#flush' do subject(:flush) { exporter.flush } - it 'returns a flush containing the data from the collectors' do + it 'returns a flush containing the data from the recorders' do expect(flush).to have_attributes( start: start, finish: finish, @@ -38,8 +38,8 @@ expect(Datadog::Core::Utils::Compression.gunzip(flush.code_provenance_data)).to eq code_provenance_data end - context 'when pprof collector has no data' do - let(:pprof_collector_serialize) { nil } + context 'when pprof recorder has no data' do + let(:pprof_recorder_serialize) { nil } it { is_expected.to be nil } end @@ -74,8 +74,8 @@ end describe '#empty?' do - it 'delegates to the pprof_collector' do - expect(pprof_collector).to receive(:empty?).and_return(:empty_result) + it 'delegates to the pprof_recorder' do + expect(pprof_recorder).to receive(:empty?).and_return(:empty_result) expect(exporter.empty?).to be :empty_result end diff --git a/spec/datadog/profiling/integration_spec.rb b/spec/datadog/profiling/integration_spec.rb index f9f8c6968ea..8fbdf2b01fc 100644 --- a/spec/datadog/profiling/integration_spec.rb +++ b/spec/datadog/profiling/integration_spec.rb @@ -90,7 +90,7 @@ def stack_two last_flush_time: Time.now.utc - 5 ) end - let(:exporter) { Datadog::Profiling::Exporter.new(pprof_collector: old_recorder, code_provenance_collector: nil) } + let(:exporter) { Datadog::Profiling::Exporter.new(pprof_recorder: old_recorder, code_provenance_collector: nil) } let(:collector) do Datadog::Profiling::Collectors::OldStack.new( old_recorder, From a16670f6651c7a37352ae0cb0cb918619c1d760f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 1 Apr 2022 14:03:29 +0200 Subject: [PATCH 0082/2133] Remove reference to non-existing file --- .rubocop_todo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f6671fc4c41..7d5a9fd1c36 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -263,7 +263,6 @@ RSpec/VerifiedDoubles: - 'spec/datadog/profiling/collectors/old_stack_spec.rb' - 'spec/datadog/profiling/encoding/profile_spec.rb' - 'spec/datadog/profiling/events/stack_spec.rb' - - 'spec/datadog/profiling/old_exporter_spec.rb' - 'spec/datadog/profiling/ext/cthread_spec.rb' - 'spec/datadog/profiling/ext/forking_spec.rb' - 'spec/datadog/profiling/flush_spec.rb' From 399c5a74a3e5aa8c24142b42f1ae5b593b513d84 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 19 May 2022 10:53:42 +0100 Subject: [PATCH 0083/2133] Fix file names and pid tag after rebase --- spec/datadog/profiling/exporter_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/datadog/profiling/exporter_spec.rb b/spec/datadog/profiling/exporter_spec.rb index f5076712859..ffbdd0c2e9b 100644 --- a/spec/datadog/profiling/exporter_spec.rb +++ b/spec/datadog/profiling/exporter_spec.rb @@ -30,9 +30,9 @@ expect(flush).to have_attributes( start: start, finish: finish, - pprof_file_name: 'rubyprofile.pprof.gz', - code_provenance_file_name: 'code-provenance.json.gz', - tags_as_array: array_including(%w[language ruby], ['pid', Process.pid.to_s]), + pprof_file_name: 'rubyprofile.pprof', + code_provenance_file_name: 'code-provenance.json', + tags_as_array: array_including(%w[language ruby], ['process_id', Process.pid.to_s]), ) expect(Datadog::Core::Utils::Compression.gunzip(flush.pprof_data)).to eq pprof_data expect(Datadog::Core::Utils::Compression.gunzip(flush.code_provenance_data)).to eq code_provenance_data From 067e05ee33e2475062aa4dbe98231f4bbd36ae32 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 25 May 2022 15:26:54 +0100 Subject: [PATCH 0084/2133] Fix missing requires --- spec/datadog/core/configuration/components_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 7070048cc77..628d68e9e64 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -16,7 +16,8 @@ require 'datadog/profiling/collectors/code_provenance' require 'datadog/profiling/collectors/old_stack' require 'datadog/profiling/profiler' -require 'datadog/profiling/recorder' +require 'datadog/profiling/old_recorder' +require 'datadog/profiling/exporter' require 'datadog/profiling/scheduler' require 'datadog/profiling/tasks/setup' require 'datadog/profiling/trace_identifiers/helper' From 93d0c7472b125e29824115f0fea6ab49196047c5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 25 May 2022 17:17:06 +0100 Subject: [PATCH 0085/2133] Minor: Fix typo --- lib/datadog/profiling/exporter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb index f166cdc3b45..7f5549745b7 100644 --- a/lib/datadog/profiling/exporter.rb +++ b/lib/datadog/profiling/exporter.rb @@ -8,7 +8,7 @@ module Datadog module Profiling # Exports profiling data gathered by the multiple recorders in a `Flush`. # - # @ivoanjo: Note that the recorders that gathers pprof data is special, since we use its start/finish/empty? to + # @ivoanjo: Note that the recorder that gathers pprof data is special, since we use its start/finish/empty? to # decide if there's data to flush, as well as the timestamp for that data. # I could've made the whole design more generic, but I'm unsure if we'll ever have more than a handful of # recorders, so I've decided to make it specific until we actually need to support more recorders. From b1683fe05763d3fbf29b80cfda36abc74d80a81d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 26 May 2022 08:55:39 +0100 Subject: [PATCH 0086/2133] More rubocop nitpicks... --- ext/ddtrace_profiling_loader/extconf.rb | 1 + spec/datadog/profiling/validate_benchmarks_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/ext/ddtrace_profiling_loader/extconf.rb b/ext/ddtrace_profiling_loader/extconf.rb index 66c76a7e5de..c25cd742899 100644 --- a/ext/ddtrace_profiling_loader/extconf.rb +++ b/ext/ddtrace_profiling_loader/extconf.rb @@ -1,4 +1,5 @@ # typed: ignore + # rubocop:disable Style/StderrPuts # rubocop:disable Style/GlobalVars diff --git a/spec/datadog/profiling/validate_benchmarks_spec.rb b/spec/datadog/profiling/validate_benchmarks_spec.rb index c6015438575..c1ec23a57ee 100644 --- a/spec/datadog/profiling/validate_benchmarks_spec.rb +++ b/spec/datadog/profiling/validate_benchmarks_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'datadog/profiling/spec_helper' RSpec.describe 'Profiling benchmarks', if: (RUBY_VERSION >= '2.4.0') do From ca3c08ca5bcd835d2428bfcdf9f6d6d84096d512 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 26 May 2022 09:07:53 +0100 Subject: [PATCH 0087/2133] Update comment after PR discussion --- .../http_transport.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 23ac5675825..7f71750d45c 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -237,13 +237,13 @@ static VALUE perform_export( if (pending_exception) { // We're in a weird situation that libddprof doesn't quite support. The ddprof_ffi_Request payload is dynamically - // allocated and needs to be freed, but libddprof doesn't have an API for dropping a request because it's kinda - // weird that a profiler builds a request and then says "oh, nevermind" and throws it away. - // We could add such an API, but I'm somewhat hesitant since this is a really bizarre corner case that looks quite - // Ruby-specific. + // allocated and needs to be freed, but libddprof doesn't have an API for dropping a request. // - // Instead, let's get libddprof to clean up the request by asking for the send to be cancelled, and then calling - // it anyway. This will make libddprof free the request and return immediately without needing changes to its API. + // There's plans to add a `ddprof_ffi_Request_drop` + // (https://github.com/DataDog/dd-trace-rb/pull/1923#discussion_r882096221); once that happens, we can use it here. + // + // As a workaround, we get libddprof to clean up the request by asking for the send to be cancelled, and then calling + // it anyway. This will make libddprof free the request and return immediately which gets us the expected effect. interrupt_exporter_call((void *) cancel_token); call_exporter_without_gvl((void *) &args); } From 67ca35b3a89d7539db357c9c71a4cb4fb6193163 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 26 May 2022 09:21:08 +0100 Subject: [PATCH 0088/2133] Reduce parallelism used while building grpc to unbreak CI The latest version of grpc seems to need even more memory to build, so 8 processes is too much. 6 seems to work, for now... (See for a failing gem installation due to this). --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bebc2f3fac7..d89902921ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,10 @@ test_containers: - &container_base_environment BUNDLE_GEMFILE: /app/Gemfile JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag - GRPC_RUBY_BUILD_PROCS: 8 # Override number of concurrent compiles in grpc gem, see https://github.com/grpc/grpc/pull/28250 and https://github.com/DataDog/dd-trace-rb/issues/1791 + # Override number of concurrent compiles in grpc gem, see https://github.com/grpc/grpc/pull/28250 and https://github.com/DataDog/dd-trace-rb/issues/1791 + # If you see gem installation failing with "Killed" on CircleCI and `gem install --platform ruby grpc` reproduces the + # issue when you connect to the testing container via ssh, then try lowering this file a notch. + GRPC_RUBY_BUILD_PROCS: 6 - &container_parameters_environment - *container_base_environment - TEST_DATADOG_INTEGRATION: 1 From 7c6a2fa00cad7d45b0e7360bf51c20c07db39c18 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 26 May 2022 12:05:32 +0100 Subject: [PATCH 0089/2133] Minor: Fix compiler warning about typedef'ing struct twice --- ext/ddtrace_profiling_native_extension/collectors_stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 42d5a9e2ee8..0f9115cfd37 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -15,14 +15,14 @@ static VALUE missing_string = Qnil; // Used as scratch space during sampling -typedef struct sampling_buffer { +struct sampling_buffer { unsigned int max_frames; VALUE *stack_buffer; int *lines_buffer; bool *is_ruby_frame; ddprof_ffi_Location *locations; ddprof_ffi_Line *lines; -} sampling_buffer; +}; // Note: typedef'd in the header to sampling_buffer static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames); static void maybe_add_placeholder_frames_omitted(VALUE thread, sampling_buffer* buffer, char *frames_omitted_message, int frames_omitted_message_size); From 054917d1efc5a1965ebc540a0996e5955cbbf945 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 26 May 2022 12:14:26 +0100 Subject: [PATCH 0090/2133] Handle VM interruptions during `StackRecorder` serialization instead of failing After fixing the VM interruptions issue for `HttpTransport` in 4cd898e829d34f994973452e4503a88d37b4f99c (#1923), I suspected that the same issue could happen to the `StackRecorder`. It took a few attempts to reproduce this issue, but the easiest way seems to be to "send ctrl+c to itself" by adding ```c #include kill(getpid(), SIGINT); ``` before the call to `rb_thread_call_without_gvl2`. This made the VM flag an interrupt, which as long as no exception was raised (and RSpec has its own interrupt handler) simulated the issue. TL;DR `rb_thread_call_without_gvl2` can return BEFORE running our code when the VM has a pending interruption, so we need to let the VM do its work, but there's no reason to fail the action (in this case, fail to serialize) if all the VM wants is to run some callback and then we can get on with our work. So instead we retry running our code until it either runs or the VM actually raises an exception. The approach here is simpler than in `HttpTransport` because the heap allocations happen only inside `call_serialize_without_gvl`; in `HttpTransport` there are heap allocations done before calling `rb_thread_call_without_gvl2` and thus a more complex approach is needed. --- .../ruby_helpers.h | 2 +- .../stack_recorder.c | 22 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index 1ef3e01a8ce..a93b01064c7 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -3,7 +3,7 @@ #include // Processes any pending interruptions, including exceptions to be raised. -// If there's an exception to be raised, it raises it. +// If there's an exception to be raised, it raises it. In that case, this function does not return. static inline VALUE process_pending_interruptions(VALUE _unused) { rb_thread_check_ints(); return Qnil; diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 330e11a392e..cbc34495e8d 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -2,6 +2,7 @@ #include #include "stack_recorder.h" #include "libddprof_helpers.h" +#include "ruby_helpers.h" // Used to wrap a ddprof_ffi_Profile in a Ruby object and expose Ruby-level serialization APIs // This file implements the native bits of the Datadog::Profiling::StackRecorder class @@ -77,15 +78,18 @@ static VALUE _native_serialize(VALUE self, VALUE recorder_instance) { // is pending struct call_serialize_without_gvl_arguments args = {.profile = profile, .serialize_ran = false}; - // We use rb_thread_call_without_gvl2 for similar reasons as in http_transport.c: we don't want pending interrupts - // that cause exceptions to be raised to be processed as otherwise we can leak the serialized profile. - rb_thread_call_without_gvl2(call_serialize_without_gvl, &args, /* No interruption supported */ NULL, NULL); - - // This weird corner case can happen if rb_thread_call_without_gvl2 returns immediately due to an interrupt - // without ever calling call_serialize_without_gvl. In this situation, we don't have anything to clean up, we can - // just return. - if (!args.serialize_ran) { - return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Interrupted before call_serialize_without_gvl ran")); + while (!args.serialize_ran) { + // Give the Ruby VM an opportunity to process any pending interruptions (including raising exceptions). + // Note that it's OK to do this BEFORE call_serialize_without_gvl runs BUT NOT AFTER because afterwards + // there's heap-allocated memory that MUST be cleaned before raising any exception. + // + // Note that we run this in a loop because `rb_thread_call_without_gvl2` may return multiple times due to + // pending interrupts until it actually runs our code. + process_pending_interruptions(Qnil); + + // We use rb_thread_call_without_gvl2 here because unlike the regular _gvl variant, gvl2 does not process + // interruptions and thus does not raise exceptions after running our code. + rb_thread_call_without_gvl2(call_serialize_without_gvl, &args, /* No interruption function supported */ NULL, NULL); } ddprof_ffi_SerializeResult serialized_profile = args.result; From 4c5683dcf3aaf8c205b85720c21746c25d29d1dc Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 27 May 2022 15:47:37 +0200 Subject: [PATCH 0091/2133] Add fancy report, Add a scenario in test --- .github/workflows/system-tests.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index a44fdc95648..94872d2b645 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -65,14 +65,23 @@ jobs: - name: Build run: ./build.sh --library ${{ matrix.library }} --weblog-variant ${{ matrix.weblog-variant }} - - name: Run + - name: Run default scenario run: ./run.sh env: DD_API_KEY: ${{ secrets.DD_APPSEC_SYSTEM_TESTS_API_KEY }} + - name: Run APPSEC_CUSTOM_RULES scenario + run: ./run.sh APPSEC_CUSTOM_RULES + env: + DD_API_KEY: ${{ secrets.DD_APPSEC_SYSTEM_TESTS_API_KEY }} + - name: Archive logs uses: actions/upload-artifact@v2 if: ${{ always() }} with: name: system-tests-${{ matrix.library }}-${{ matrix.weblog-variant }}-logs-${{ github.run_id }}-${{ github.sha }} - path: logs + path: logs* + + - name: Print fancy log report + if: ${{ always() }} + run: python utils/scripts/markdown_logs.py >> $GITHUB_STEP_SUMMARY From 5bc7584037f2c37fa3b1f8b430bff1cec2eff039 Mon Sep 17 00:00:00 2001 From: ivanbrennan Date: Fri, 27 May 2022 12:39:58 -0400 Subject: [PATCH 0092/2133] fix old configuration example in upgrading guide --- docs/UpgradeGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UpgradeGuide.md b/docs/UpgradeGuide.md index 9d45bf3e218..3d305771b50 100644 --- a/docs/UpgradeGuide.md +++ b/docs/UpgradeGuide.md @@ -84,7 +84,7 @@ Datadog.configure do |c| # Global settings c.tracer.hostname = '127.0.0.1' c.tracer.port = 8126 - c.runtime_metrics.enabled = true + c.runtime_metrics_enabled = true c.service = 'billing-api' # Tracing settings From 8cf545166aee9b2072315d860d33f3a24350926e Mon Sep 17 00:00:00 2001 From: Travis Collins Date: Fri, 27 May 2022 10:56:26 -0600 Subject: [PATCH 0093/2133] fix malformed markdown --- docs/GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 46a5a8c5199..184546c695c 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1867,7 +1867,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | Key | Description | Default | | --- | ----------- | ------- | | `tag_args` | Enable tagging of job arguments. `true` for on, `false` for off. | `false` | -| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` | +| `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { \|span, error\| span.set_error(error) unless span.nil? }` | | `quantize` | Hash containing options for quantization of job arguments. | `{}` | ### Sinatra From d2b8e96953e55888ca29537d6124ee509686645c Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 30 May 2022 14:21:04 -0700 Subject: [PATCH 0094/2133] Actions: Create draft release on release branch push (#2050) --- .../draft-release-on-release-branch-push.yaml | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/draft-release-on-release-branch-push.yaml diff --git a/.github/workflows/draft-release-on-release-branch-push.yaml b/.github/workflows/draft-release-on-release-branch-push.yaml new file mode 100644 index 00000000000..94eb0b923fb --- /dev/null +++ b/.github/workflows/draft-release-on-release-branch-push.yaml @@ -0,0 +1,94 @@ +name: Draft release on release branch push +on: + create + +jobs: + draft_release_notes: + if: github.event.ref_type == 'branch' && startsWith('${{ github.event.ref }}', 'bump_to_version_') + runs-on: ubuntu-latest + steps: + - name: Get release version + id: releaseVersion + uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # 6.1.0 + with: + result-encoding: string + script: | + return '${{ github.event.ref }}'.substring('bump_to_version_'.length); + - name: Get milestone for version + id: milestone + uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # 6.1.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const milestones = await github.paginate(github.rest.issues.listMilestones, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'all' + }) + + const milestone = milestones.find(milestone => milestone.title == '${{steps.releaseVersion.outputs.result}}') + + if (milestone) { + return milestone.number + } else { + return null + } + - name: Generate release notes + if: fromJSON(steps.milestone.outputs.result) + id: generate + uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # 6.1.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + result-encoding: string + script: | + const pullRequests = await github.paginate(github.rest.pulls.list, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'closed', + base: 'master' + }) + + var draftText = "> Please categorize the following changes:\n\n" + for (let pull of pullRequests) { + if (pull.merged_at && pull.milestone && pull.milestone.number == ${{steps.milestone.outputs.result}}) { + // Skip PR with only `dev/*` labels, as these represent internal changes + if (pull.labels.length > 0 && pull.labels.every(label => label.name.startsWith("dev/"))) { + continue + } + + // Add labels to description, to ease categorization + var lineItem = "* " + for (let label of pull.labels) { + lineItem += label.name.charAt(0).toUpperCase() + label.name.slice(1) + ": " + } + + lineItem += pull.title + " (#" + pull.number + ")" + + // Add author if labeled as 'community' + if (pull.labels.some(label => label.name == "community")) { + lineItem += " (@" + pull.user.login + ")" + } + + draftText += lineItem + "\n" + } + } + draftText += "\n### Added\n\n### Changed\n\n### Fixed\n\n### Removed\n\n" + + // Escape backticks + draftText = draftText.replace(/`/g,"\\`") + + return draftText + - name: Create draft release + if: fromJSON(steps.milestone.outputs.result) + uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # 6.1.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: 'v${{ steps.releaseVersion.outputs.result }}', + name: '${{ steps.releaseVersion.outputs.result }}', + draft: true, + body: `${{ steps.generate.outputs.result }}` + }) From 7164edaac60af15fbf7873b81223a6178bf4d36e Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 30 May 2022 14:24:58 -0700 Subject: [PATCH 0095/2133] Link to DevelopmentGuide.md from CONTRIBUTING.md (#2049) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 995adc43d3b..f0ad26a34fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,7 +52,7 @@ We welcome code contributions to the library, which you can [submit as a pull re 1. **Fork the repository** from https://github.com/DataDog/dd-trace-rb 2. **Make any changes** for your patch. -3. **Write tests** that demonstrate how the feature works or how the bug is fixed. +3. **Write tests** that demonstrate how the feature works or how the bug is fixed. See the [DevelopmentGuide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md) for detailed test instructions. 4. **Update any documentation** such as `docs/GettingStarted.md`, especially for new features. 5. **Submit the pull request** from your fork back to the latest revision of the `master` branch on https://github.com/DataDog/dd-trace-rb. From 7bceeedc945c61ae7a626c1e61885d51a80f4924 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 30 May 2022 15:00:41 -0700 Subject: [PATCH 0096/2133] [Single Span Sampling] Add single span matcher (#2055) --- lib/datadog/tracing/sampling/rate_sampler.rb | 4 +- lib/datadog/tracing/sampling/span/matcher.rb | 80 ++++++++++++ .../tracing/sampling/span/matcher_spec.rb | 122 ++++++++++++++++++ 3 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 lib/datadog/tracing/sampling/span/matcher.rb create mode 100644 spec/datadog/tracing/sampling/span/matcher_spec.rb diff --git a/lib/datadog/tracing/sampling/rate_sampler.rb b/lib/datadog/tracing/sampling/rate_sampler.rb index 53a2ef89788..5d61e58b084 100644 --- a/lib/datadog/tracing/sampling/rate_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_sampler.rb @@ -37,11 +37,11 @@ def sample_rate(*_) def sample_rate=(sample_rate) @sample_rate = sample_rate - @sampling_id_threshold = sample_rate * Span::EXTERNAL_MAX_ID + @sampling_id_threshold = sample_rate * Tracing::Span::EXTERNAL_MAX_ID end def sample?(trace) - ((trace.id * KNUTH_FACTOR) % Span::EXTERNAL_MAX_ID) <= @sampling_id_threshold + ((trace.id * KNUTH_FACTOR) % Tracing::Span::EXTERNAL_MAX_ID) <= @sampling_id_threshold end def sample!(trace) diff --git a/lib/datadog/tracing/sampling/span/matcher.rb b/lib/datadog/tracing/sampling/span/matcher.rb new file mode 100644 index 00000000000..1d3d6d95bd9 --- /dev/null +++ b/lib/datadog/tracing/sampling/span/matcher.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Datadog + module Tracing + module Sampling + module Span + # Checks if a span conforms to a matching criteria. + class Matcher + # Pattern that matches any string + MATCH_ALL_PATTERN = '*' + + # Matches span name and service to their respective patterns provided. + # + # The patterns are {String}s with two special characters available: + # 1. `?`: matches exactly one of any character. + # 2. `*`: matches a substring of any size, including zero. + # These patterns can occur any point of the string, any number of times. + # + # Both {SpanOperation#name} and {SpanOperation#service} must match the provided patterns. + # + # The whole String has to match the provided patterns: providing a pattern that + # matches a portion of the provided String is not considered a match. + # + # @example web-* + # `'web-*'` will match any string starting with `web-`. + # @example cache-? + # `'cache-?'` will match any string starting with `database-` followed by exactly one character. + # + # @param name_pattern [String] a pattern to be matched against {SpanOperation#name} + # @param service_pattern [String] a pattern to be matched against {SpanOperation#service} + def initialize(name_pattern: MATCH_ALL_PATTERN, service_pattern: MATCH_ALL_PATTERN) + @name = pattern_to_regex(name_pattern) + @service = pattern_to_regex(service_pattern) + end + + # {Regexp#match?} was added in Ruby 2.4, and it's measurably + # the least costly way to get a boolean result for a Regexp match. + # @see https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/ + if Regexp.method_defined?(:match?) + # Returns `true` if the span conforms to the configured patterns, + # `false` otherwise + # + # @param [SpanOperation] span + # @return [Boolean] + def match?(span) + # Matching is performed at the end of the lifecycle of a Span, + # thus both `name` and `service` are guaranteed to be not `nil`. + @name.match?(span.name) && @service.match?(span.service) + end + else + # DEV: Remove when support for Ruby 2.3 and older is removed. + def match?(span) + @name === span.name && @service === span.service + end + end + + private + + # @param pattern [String] + # @return [Regexp] + def pattern_to_regex(pattern) + # Ensure no undesired characters are treated as regex. + # Our valid special characters, `?` and `*`, + # will be escaped so... + pattern = Regexp.quote(pattern) + + # ...we account for that here: + pattern.gsub!('\?', '.') # Any single character + pattern.gsub!('\*', '.*') # Any substring + + # Patterns have to match the whole input string + pattern = "\\A#{pattern}\\z" + + Regexp.new(pattern) + end + end + end + end + end +end diff --git a/spec/datadog/tracing/sampling/span/matcher_spec.rb b/spec/datadog/tracing/sampling/span/matcher_spec.rb new file mode 100644 index 00000000000..ee5c8a025d1 --- /dev/null +++ b/spec/datadog/tracing/sampling/span/matcher_spec.rb @@ -0,0 +1,122 @@ +require 'datadog/tracing/sampling/span/matcher' + +RSpec.describe Datadog::Tracing::Sampling::Span::Matcher do + let(:span_op) { Datadog::Tracing::SpanOperation.new(span_name, service: span_service) } + let(:span_name) { 'operation.name' } + let(:span_service) { '' } + + describe '#match?' do + subject(:match?) { matcher.match?(span_op) } + + { + 'plain string pattern' => [ + { pattern: 'web', input: 'web', expected: true }, + { pattern: 'web one', input: 'web one', expected: true }, + { pattern: 'web', input: 'my-web', expected: false }, + ], + '* pattern' => [ + { pattern: 'web*', input: 'web', expected: true }, + { pattern: 'web*', input: 'web-one', expected: true }, + { pattern: 'web*', input: 'pre-web', expected: false }, + { pattern: '*web', input: 'pre-web', expected: true }, + { pattern: '*web', input: 'web-post', expected: false }, + { pattern: 'web*one', input: 'web-site-one', expected: true }, + { pattern: 'web*one', input: 'webone', expected: true }, + { pattern: 'web*site*one', input: 'web--site one', expected: true }, + { pattern: 'web*site*one', input: 'web-nice-one', expected: false }, + ], + '? pattern' => [ + { pattern: 'web?', input: 'web', expected: false }, + { pattern: 'web?', input: 'web1', expected: true }, + { pattern: 'web?', input: '1web', expected: false }, + { pattern: '?web', input: '1web', expected: true }, + { pattern: '?web', input: 'web1', expected: false }, + { pattern: 'web?one', input: 'web-one', expected: true }, + { pattern: 'web?one', input: 'webone', expected: false }, + { pattern: 'web?one', input: 'web-site-one', expected: false }, + { pattern: 'web?site?one', input: 'web-site-one', expected: true }, + { pattern: 'web?site?one', input: 'web-nice-one', expected: false }, + ], + 'mixed * and ? pattern' => [ + { pattern: '*web?', input: 'pre-web1', expected: true }, + { pattern: '*web?', input: 'web', expected: false }, + { pattern: '?web*', input: '1web-post', expected: true }, + { pattern: '?web*', input: 'web', expected: false }, + { pattern: 'web?one*', input: 'web-one-post', expected: true }, + { pattern: 'web?one*', input: 'webone', expected: false }, + { pattern: 'web*one?', input: 'web-one1', expected: true }, + { pattern: 'web*one?', input: 'webne1', expected: false }, + { pattern: 'web*site?one', input: 'web--site one', expected: true }, + { pattern: 'web*site?one', input: 'web--siteone', expected: false }, + { pattern: 'web?site*one', input: 'web-site one', expected: true }, + { pattern: 'web?site*one', input: 'web-sitene', expected: false }, + ] + }.each do |scenario, fixtures| + context "for '#{scenario}'" do + fixtures.each do |fixture| + pattern = fixture[:pattern] + input = fixture[:input] + expected = fixture[:expected] + + context "with pattern '#{pattern}' and input '#{input}'" do + context 'matching on span name' do + let(:matcher) { described_class.new(name_pattern: pattern) } + let(:span_name) { input } + + it "does #{'not ' unless expected}match" do + is_expected.to eq(expected) + end + end + + context 'matching on span service' do + let(:matcher) { described_class.new(service_pattern: pattern) } + let(:span_service) { input } + + it "does #{'not ' unless expected}match" do + is_expected.to eq(expected) + end + end + + context 'matching on span name and service' do + context 'with the same matching scenario for both fields' do + let(:matcher) { described_class.new(name_pattern: pattern, service_pattern: pattern) } + let(:span_name) { input } + let(:span_service) { input } + + it "does #{'not ' unless expected}match" do + is_expected.to eq(expected) + end + end + end + end + end + end + end + + context 'matching on span name and service' do + let(:matcher) { described_class.new(name_pattern: name_pattern, service_pattern: service_pattern) } + + context 'when only name matches' do + let(:span_name) { 'web.get' } + let(:span_service) { 'server' } + let(:name_pattern) { 'web.*' } + let(:service_pattern) { 'server2' } + + context 'does not match' do + it { is_expected.to eq(false) } + end + end + + context 'when only service matches' do + let(:span_name) { 'web.get' } + let(:span_service) { 'server' } + let(:name_pattern) { 'web.post' } + let(:service_pattern) { 'server' } + + context 'does not match' do + it { is_expected.to eq(false) } + end + end + end + end +end From edca2062e5c0ba01b541f4c6909189e40802addf Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 10:20:09 +0100 Subject: [PATCH 0097/2133] Fix docs link not working The old `http://gems.datadoghq.com/trace/docs/` link does not seem to load for me on firefox nor chrome. I can see it with curl though... I suspect this may be related to modern browsers trying to get to an https version of the site, which doesn't work. Instead, I've replaced the link with one that works over https and seems to be working fine. In the future if/when we fix https support for `gems.datadoghq.com` directly we can go back to the old url :) Fixes #2057 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c653ec409ef..1875171a7d6 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ For contributing, checkout the [contribution guidelines][contribution docs] and [setup docs]: https://docs.datadoghq.com/tracing/setup/ruby/ [api docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md -[gem docs]: http://gems.datadoghq.com/trace/docs/ +[gem docs]: https://s3.amazonaws.com/gems.datadoghq.com/trace/docs/index.html [visualization docs]: https://docs.datadoghq.com/tracing/visualization/ [contribution docs]: https://github.com/DataDog/dd-trace-rb/blob/master/CONTRIBUTING.md [development docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md From 3b7126d170e487a749da49476493bda5426d76b9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 30 May 2022 13:38:26 +0100 Subject: [PATCH 0098/2133] Retrofit legacy profiling transport implementation as a backup to `HttpTransport` class Everything in `lib/datadog/profiling/transport/` already existed prior to the migration to the libddprof-based `HttpTransport` class (#1923). Temporarily, and just in case there are unknown-unknowns with `HttpTransport`, I've re-imported a few classes, and modified them so they will be able to be used **instead of** `Datadog::Profiling::HttpTransport`. This is only temporary, and will be deleted/reverted later. --- lib/datadog/profiling/old_ext.rb | 42 ++++ lib/datadog/profiling/transport/http.rb | 112 +++++++++ lib/datadog/profiling/transport/http/api.rb | 45 ++++ .../profiling/transport/http/api/endpoint.rb | 85 +++++++ .../profiling/transport/http/api/instance.rb | 38 +++ .../profiling/transport/http/api/spec.rb | 42 ++++ .../profiling/transport/http/builder.rb | 30 +++ .../profiling/transport/http/client.rb | 37 +++ .../profiling/transport/http/response.rb | 21 ++ .../http/adapters/net_integration_spec.rb | 224 ++++++++++++++++++ .../transport/http/api/endpoint_spec.rb | 136 +++++++++++ .../transport/http/api/instance_spec.rb | 38 +++ .../profiling/transport/http/api/spec_spec.rb | 57 +++++ .../profiling/transport/http/api_spec.rb | 45 ++++ .../profiling/transport/http/builder_spec.rb | 70 ++++++ .../profiling/transport/http/client_spec.rb | 85 +++++++ .../transport/http/integration_spec.rb | 97 ++++++++ spec/datadog/profiling/transport/http_spec.rb | 171 +++++++++++++ 18 files changed, 1375 insertions(+) create mode 100644 lib/datadog/profiling/old_ext.rb create mode 100644 lib/datadog/profiling/transport/http.rb create mode 100644 lib/datadog/profiling/transport/http/api.rb create mode 100644 lib/datadog/profiling/transport/http/api/endpoint.rb create mode 100644 lib/datadog/profiling/transport/http/api/instance.rb create mode 100644 lib/datadog/profiling/transport/http/api/spec.rb create mode 100644 lib/datadog/profiling/transport/http/builder.rb create mode 100644 lib/datadog/profiling/transport/http/client.rb create mode 100644 lib/datadog/profiling/transport/http/response.rb create mode 100644 spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb create mode 100644 spec/datadog/profiling/transport/http/api/endpoint_spec.rb create mode 100644 spec/datadog/profiling/transport/http/api/instance_spec.rb create mode 100644 spec/datadog/profiling/transport/http/api/spec_spec.rb create mode 100644 spec/datadog/profiling/transport/http/api_spec.rb create mode 100644 spec/datadog/profiling/transport/http/builder_spec.rb create mode 100644 spec/datadog/profiling/transport/http/client_spec.rb create mode 100644 spec/datadog/profiling/transport/http/integration_spec.rb create mode 100644 spec/datadog/profiling/transport/http_spec.rb diff --git a/lib/datadog/profiling/old_ext.rb b/lib/datadog/profiling/old_ext.rb new file mode 100644 index 00000000000..ebd4c96706a --- /dev/null +++ b/lib/datadog/profiling/old_ext.rb @@ -0,0 +1,42 @@ +# typed: true + +module Datadog + module Profiling + # NOTE: This OldExt file is temporary and expected to be removed once the migration to the new `HttpTransport` class + # is complete + module OldExt + module Transport + module HTTP + URI_TEMPLATE_DD_API = 'https://intake.profile.%s/'.freeze + + FORM_FIELD_RECORDING_START = 'start'.freeze + FORM_FIELD_RECORDING_END = 'end'.freeze + FORM_FIELD_FAMILY = 'family'.freeze + FORM_FIELD_TAG_ENV = 'env'.freeze + FORM_FIELD_TAG_HOST = 'host'.freeze + FORM_FIELD_TAG_LANGUAGE = 'language'.freeze + FORM_FIELD_TAG_PID = 'process_id'.freeze + FORM_FIELD_TAG_PROFILER_VERSION = 'profiler_version'.freeze + FORM_FIELD_TAG_RUNTIME = 'runtime'.freeze + FORM_FIELD_TAG_RUNTIME_ENGINE = 'runtime_engine'.freeze + FORM_FIELD_TAG_RUNTIME_ID = 'runtime-id'.freeze + FORM_FIELD_TAG_RUNTIME_PLATFORM = 'runtime_platform'.freeze + FORM_FIELD_TAG_RUNTIME_VERSION = 'runtime_version'.freeze + FORM_FIELD_TAG_SERVICE = 'service'.freeze + FORM_FIELD_TAG_VERSION = 'version'.freeze + FORM_FIELD_TAGS = 'tags'.freeze + FORM_FIELD_INTAKE_VERSION = 'version'.freeze + + HEADER_CONTENT_TYPE = 'Content-Type'.freeze + HEADER_CONTENT_TYPE_OCTET_STREAM = 'application/octet-stream'.freeze + + FORM_FIELD_PPROF_DATA = 'data[rubyprofile.pprof]'.freeze + PPROF_DEFAULT_FILENAME = 'rubyprofile.pprof.gz'.freeze + + FORM_FIELD_CODE_PROVENANCE_DATA = 'data[code-provenance.json]'.freeze + CODE_PROVENANCE_FILENAME = 'code-provenance.json.gz'.freeze + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http.rb b/lib/datadog/profiling/transport/http.rb new file mode 100644 index 00000000000..eadc36ad295 --- /dev/null +++ b/lib/datadog/profiling/transport/http.rb @@ -0,0 +1,112 @@ +# typed: true + +require 'datadog/core/environment/ext' +require 'ddtrace/transport/ext' + +require 'datadog/core/environment/container' +require 'datadog/core/environment/variable_helpers' + +require 'datadog/profiling/transport/http/builder' +require 'datadog/profiling/transport/http/api' + +require 'ddtrace/transport/http/adapters/net' +require 'ddtrace/transport/http/adapters/test' +require 'ddtrace/transport/http/adapters/unix_socket' + +module Datadog + module Profiling + module Transport + # Namespace for HTTP transport components + module HTTP + # Builds a new Transport::HTTP::Client + def self.new(&block) + Builder.new(&block).to_transport + end + + # Builds a new Transport::HTTP::Client with default settings + def self.default( + profiling_upload_timeout_seconds:, + agent_settings:, + site: nil, + api_key: nil, + agentless_allowed: agentless_allowed? + ) + new do |transport| + transport.headers default_headers + + # Configure adapter & API + if site && api_key && agentless_allowed + configure_for_agentless( + transport, + profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, + site: site, + api_key: api_key + ) + else + configure_for_agent( + transport, + profiling_upload_timeout_seconds: profiling_upload_timeout_seconds, + agent_settings: agent_settings + ) + end + end + end + + def self.default_headers + { + Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Core::Environment::Ext::LANG, + Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Core::Environment::Ext::LANG_VERSION, + Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Core::Environment::Ext::LANG_INTERPRETER, + Datadog::Transport::Ext::HTTP::HEADER_META_TRACER_VERSION => Core::Environment::Ext::TRACER_VERSION + }.tap do |headers| + # Add container ID, if present. + container_id = Core::Environment::Container.container_id + headers[Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID] = container_id unless container_id.nil? + end + end + + private_class_method def self.configure_for_agent(transport, profiling_upload_timeout_seconds:, agent_settings:) + apis = API.agent_defaults + + transport.adapter(agent_settings.merge(timeout_seconds: profiling_upload_timeout_seconds)) + transport.api(API::V1, apis[API::V1], default: true) + + # NOTE: This proc, when it exists, usually overrides the transport specified above + if agent_settings.deprecated_for_removal_transport_configuration_proc + agent_settings.deprecated_for_removal_transport_configuration_proc.call(transport) + end + end + + private_class_method def self.configure_for_agentless(transport, profiling_upload_timeout_seconds:, site:, api_key:) + apis = API.api_defaults + + site_uri = URI(format(Profiling::OldExt::Transport::HTTP::URI_TEMPLATE_DD_API, site)) + hostname = site_uri.host + port = site_uri.port + + transport.adapter( + Datadog::Transport::Ext::HTTP::ADAPTER, + hostname, + port, + timeout: profiling_upload_timeout_seconds, + ssl: site_uri.scheme == 'https' + ) + transport.api(API::V1, apis[API::V1], default: true) + transport.headers(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) + end + + private_class_method def self.agentless_allowed? + Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false) + end + + # Add adapters to registry + Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Net, + Datadog::Transport::Ext::HTTP::ADAPTER) + Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Test, + Datadog::Transport::Ext::Test::ADAPTER) + Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::UnixSocket, + Datadog::Transport::Ext::UnixSocket::ADAPTER) + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/api.rb b/lib/datadog/profiling/transport/http/api.rb new file mode 100644 index 00000000000..b2ec92ddbff --- /dev/null +++ b/lib/datadog/profiling/transport/http/api.rb @@ -0,0 +1,45 @@ +# typed: true + +require 'ddtrace/transport/http/api/map' +require 'datadog/profiling/encoding/profile' +require 'datadog/profiling/transport/http/api/spec' +require 'datadog/profiling/transport/http/api/instance' +require 'datadog/profiling/transport/http/api/endpoint' + +module Datadog + module Profiling + module Transport + module HTTP + # Extensions for HTTP API Spec + module API + # Default API versions + V1 = 'v1'.freeze + + module_function + + def agent_defaults + @agent_defaults ||= Datadog::Transport::HTTP::API::Map[ + V1 => Spec.new do |s| + s.profiles = Endpoint.new( + '/profiling/v1/input'.freeze, + Profiling::Encoding::Profile::Protobuf + ) + end + ] + end + + def api_defaults + @api_defaults ||= Datadog::Transport::HTTP::API::Map[ + V1 => Spec.new do |s| + s.profiles = Endpoint.new( + '/v1/input'.freeze, + Profiling::Encoding::Profile::Protobuf + ) + end + ] + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/api/endpoint.rb b/lib/datadog/profiling/transport/http/api/endpoint.rb new file mode 100644 index 00000000000..a318e61cc72 --- /dev/null +++ b/lib/datadog/profiling/transport/http/api/endpoint.rb @@ -0,0 +1,85 @@ +# typed: true + +require 'datadog/core/utils/compression' +require 'datadog/core/vendor/multipart-post/multipart/post/composite_read_io' +require 'datadog/profiling/old_ext' +require 'datadog/profiling/transport/http/response' +require 'ddtrace/transport/http/api/endpoint' + +module Datadog + module Profiling + module Transport + module HTTP + module API + # Datadog API endpoint for profiling + class Endpoint < Datadog::Transport::HTTP::API::Endpoint + include Profiling::OldExt::Transport::HTTP + + # These tags are read from the flush object (see below) directly and so we ignore any extra copies that + # may come in the tags hash to avoid duplicates. + TAGS_TO_IGNORE_IN_TAGS_HASH = %w[service env version].freeze + private_constant :TAGS_TO_IGNORE_IN_TAGS_HASH + + attr_reader \ + :encoder + + def initialize(path, encoder = nil) + super(:post, path) + @encoder = encoder + end + + def call(env, &block) + # Build request + env.form = build_form(env) + + # Send request + http_response = super(env, &block) + + # Build response + Profiling::Transport::HTTP::Response.new(http_response) + end + + def build_form(env) + flush = env.request + pprof_file = build_pprof(flush) + + form = { + FORM_FIELD_INTAKE_VERSION => '3', # Aka 1.3 intake format + FORM_FIELD_RECORDING_START => flush.start.utc.iso8601, + FORM_FIELD_RECORDING_END => flush.finish.utc.iso8601, + FORM_FIELD_TAGS => flush.tags_as_array.map { |key, value| "#{key}:#{value}" }, + FORM_FIELD_PPROF_DATA => pprof_file, + FORM_FIELD_FAMILY => 'ruby', + } + + # May not be available/enabled + form[FORM_FIELD_CODE_PROVENANCE_DATA] = build_code_provenance(flush) if flush.code_provenance_data + + form + end + + def build_pprof(flush) + gzipped_pprof_data = flush.pprof_data + + Core::Vendor::Multipart::Post::UploadIO.new( + StringIO.new(gzipped_pprof_data), + HEADER_CONTENT_TYPE_OCTET_STREAM, + PPROF_DEFAULT_FILENAME + ) + end + + def build_code_provenance(flush) + gzipped_code_provenance = flush.code_provenance_data + + Core::Vendor::Multipart::Post::UploadIO.new( + StringIO.new(gzipped_code_provenance), + HEADER_CONTENT_TYPE_OCTET_STREAM, + CODE_PROVENANCE_FILENAME, + ) + end + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/api/instance.rb b/lib/datadog/profiling/transport/http/api/instance.rb new file mode 100644 index 00000000000..fc05ee13486 --- /dev/null +++ b/lib/datadog/profiling/transport/http/api/instance.rb @@ -0,0 +1,38 @@ +# typed: true + +require 'ddtrace/transport/http/api/instance' +require 'datadog/profiling/transport/http/api/spec' + +module Datadog + module Profiling + module Transport + module HTTP + module API + # API instance for profiling + class Instance < Datadog::Transport::HTTP::API::Instance + def send_profiling_flush(env) + raise ProfilesNotSupportedError, spec unless spec.is_a?(Spec) + + spec.send_profiling_flush(env) do |request_env| + call(request_env) + end + end + + # Raised when profiles sent to API that does not support profiles + class ProfilesNotSupportedError < StandardError + attr_reader :spec + + def initialize(spec) + @spec = spec + end + + def message + 'Profiles not supported for this API!' + end + end + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/api/spec.rb b/lib/datadog/profiling/transport/http/api/spec.rb new file mode 100644 index 00000000000..a16206e81ff --- /dev/null +++ b/lib/datadog/profiling/transport/http/api/spec.rb @@ -0,0 +1,42 @@ +# typed: true + +require 'ddtrace/transport/http/api/spec' + +module Datadog + module Profiling + module Transport + module HTTP + module API + # API specification for profiling + class Spec < Datadog::Transport::HTTP::API::Spec + attr_accessor \ + :profiles + + def send_profiling_flush(env, &block) + raise NoProfilesEndpointDefinedError, self if profiles.nil? + + profiles.call(env, &block) + end + + def encoder + profiles.encoder + end + + # Raised when profiles sent but no profiles endpoint is defined + class NoProfilesEndpointDefinedError < StandardError + attr_reader :spec + + def initialize(spec) + @spec = spec + end + + def message + 'No profiles endpoint is defined for API specification!' + end + end + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/builder.rb b/lib/datadog/profiling/transport/http/builder.rb new file mode 100644 index 00000000000..f36fce658f1 --- /dev/null +++ b/lib/datadog/profiling/transport/http/builder.rb @@ -0,0 +1,30 @@ +# typed: true + +require 'ddtrace/transport/http/builder' + +require 'datadog/profiling/transport/http/api' +require 'datadog/profiling/transport/http/client' + +module Datadog + module Profiling + module Transport + module HTTP + # Builds new instances of Transport::HTTP::Client + class Builder < Datadog::Transport::HTTP::Builder + def api_instance_class + API::Instance + end + + def to_transport + raise Datadog::Transport::HTTP::Builder::NoDefaultApiError if @default_api.nil? + + # TODO: Profiling doesn't have multiple APIs yet. + # When it does, we should build it out with these APIs. + # Just use :default_api for now. + Client.new(to_api_instances[@default_api]) + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/client.rb b/lib/datadog/profiling/transport/http/client.rb new file mode 100644 index 00000000000..f3a68f97194 --- /dev/null +++ b/lib/datadog/profiling/transport/http/client.rb @@ -0,0 +1,37 @@ +# typed: true + +require 'ddtrace/transport/http/client' +require 'ddtrace/transport/request' + +module Datadog + module Profiling + module Transport + module HTTP + # Routes, encodes, and sends tracer data to the trace agent via HTTP. + class Client < Datadog::Transport::HTTP::Client + def export(flush) + send_profiling_flush(flush) + end + + def send_profiling_flush(flush) + # Build a request + request = flush + send_payload(request).tap do |response| + if response.ok? + Datadog.logger.debug('Successfully reported profiling data') + else + Datadog.logger.debug { "Failed to report profiling data -- #{response.inspect}" } + end + end + end + + def send_payload(request) + send_request(request) do |api, env| + api.send_profiling_flush(env) + end + end + end + end + end + end +end diff --git a/lib/datadog/profiling/transport/http/response.rb b/lib/datadog/profiling/transport/http/response.rb new file mode 100644 index 00000000000..0dd8ab686e9 --- /dev/null +++ b/lib/datadog/profiling/transport/http/response.rb @@ -0,0 +1,21 @@ +# typed: true + +require 'ddtrace/transport/http/response' + +module Datadog + module Profiling + module Transport + # HTTP transport behavior for profiling + module HTTP + # Response from HTTP transport for profiling + class Response + include Datadog::Transport::HTTP::Response + + def initialize(http_response, options = {}) + super(http_response) + end + end + end + end + end +end diff --git a/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb b/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb new file mode 100644 index 00000000000..1f965563aef --- /dev/null +++ b/spec/datadog/profiling/transport/http/adapters/net_integration_spec.rb @@ -0,0 +1,224 @@ +# typed: false + +require 'spec_helper' +require 'datadog/profiling/spec_helper' + +require 'stringio' +require 'securerandom' +require 'webrick' + +require 'ddtrace/transport/http' +require 'datadog/profiling' +require 'datadog/profiling/transport/http' +require 'ddtrace/transport/http/adapters/net' + +RSpec.describe 'Adapters::Net profiling integration tests' do + before { skip_if_profiling_not_supported(self) } + + let(:settings) { Datadog::Core::Configuration::Settings.new } + + shared_context 'HTTP server' do + # HTTP + let(:server) do + WEBrick::HTTPServer.new( + Port: port, + Logger: log, + AccessLog: access_log, + StartCallback: -> { init_signal.push(1) } + ) + end + let(:hostname) { '127.0.0.1' } + let(:port) { 6218 } + let(:log) { WEBrick::Log.new(log_buffer) } + let(:log_buffer) { StringIO.new } + let(:access_log) { [[log_buffer, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] } + let(:server_proc) do + proc do |req, res| + messages << req.tap { req.body } # Read body, store message before socket closes. + res.body = '{}' + end + end + let(:init_signal) { Queue.new } + + let(:messages) { [] } + + before do + server.mount_proc('/', &server_proc) + @server_thread = Thread.new { server.start } + init_signal.pop + end + + after do + unless RSpec.current_example.skipped? + # When the test is skipped, server has not been initialized and @server_thread would be nil; thus we only + # want to touch them when the test actually run, otherwise we would cause the server to start (incorrectly) + # and join to be called on a nil @server_thread + server.shutdown + @server_thread.join + end + end + end + + describe 'when sending profiles through Net::HTTP adapter' do + include_context 'HTTP server' + + let(:flush) { get_test_profiling_flush } + + shared_examples_for 'profile HTTP request' do + subject(:request) { messages.first } + + let(:tags) { { 'test_tag' => 'test_value' } } + + before do + allow(Datadog.configuration).to receive(:tags).and_return(tags) + end + + it 'sends profiles successfully' do + client.send_profiling_flush(flush) + + expect(request.header).to include( + 'datadog-meta-lang' => [Datadog::Core::Environment::Ext::LANG], + 'datadog-meta-lang-version' => [Datadog::Core::Environment::Ext::LANG_VERSION], + 'datadog-meta-lang-interpreter' => [Datadog::Core::Environment::Ext::LANG_INTERPRETER], + 'datadog-meta-tracer-version' => [Datadog::Core::Environment::Ext::TRACER_VERSION], + 'content-type' => [%r{^multipart/form-data; boundary=(.+)}] + ) + + unless Datadog::Core::Environment::Container.container_id.nil? + expect(request.header).to include( + 'datadog-container-id' => [Datadog::Core::Environment::Container.container_id] + ) + end + + expect(request.header['content-length'].first.to_i).to be > 0 + + # Check body + boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] + body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) + + expect(body).to include( + 'version' => '3', + 'start' => kind_of(String), + 'end' => kind_of(String), + 'data[rubyprofile.pprof]' => kind_of(String), + 'family' => 'ruby', + ) + + tags = body['tags[]'].list + expect(tags).to include( + /runtime:ruby/o, + /runtime-id:#{uuid_regex.source}/, + /runtime_engine:#{Datadog::Core::Environment::Ext::LANG_ENGINE}/o, + /runtime_platform:#{Datadog::Core::Environment::Ext::LANG_PLATFORM}/o, + /runtime_version:#{Datadog::Core::Environment::Ext::LANG_VERSION}/o, + /process_id:#{Process.pid}/o, + /profiler_version:#{Datadog::Core::Environment::Ext::TRACER_VERSION}/o, + /language:ruby/o, + 'test_tag:test_value' + ) + + if Datadog::Core::Environment::Container.container_id + container_id = Datadog::Core::Environment::Container.container_id[0..11] + expect(tags).to include(/host:#{container_id}/) + end + end + + context 'when code provenance data is available' do + let(:flush) do + get_test_profiling_flush( + code_provenance: Datadog::Profiling::Collectors::CodeProvenance.new.refresh.generate_json + ) + end + + it 'sends profiles with code provenance data successfully' do + client.send_profiling_flush(flush) + + boundary = request['content-type'][%r{^multipart/form-data; boundary=(.+)}, 1] + body = WEBrick::HTTPUtils.parse_form_data(StringIO.new(request.body), boundary) + + code_provenance_data = JSON.parse( + Datadog::Core::Utils::Compression.gunzip( + body.fetch('data[code-provenance.json]') + ) + ) + + expect(code_provenance_data) + .to include('v1' => array_including(hash_including('kind' => 'library', 'name' => 'ddtrace'))) + end + end + end + + context 'via agent' do + before do + settings.agent.host = hostname + settings.agent.port = port + end + + let(:client) do + Datadog::Profiling::Transport::HTTP.default( + profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + agent_settings: agent_settings + ) + end + + let(:agent_settings) { Datadog::Core::Configuration::AgentSettingsResolver.call(settings) } + + it_behaves_like 'profile HTTP request' do + it 'is formatted for the agent' do + client.send_profiling_flush(flush) + expect(request.path).to eq('/profiling/v1/input') + expect(request.header).to_not include('dd-api-key') + end + end + end + + context 'via agentless' do + before do + stub_const('Datadog::Profiling::OldExt::Transport::HTTP::URI_TEMPLATE_DD_API', "http://%s:#{port}/") + end + + let(:api_key) { SecureRandom.uuid } + let(:client) do + Datadog::Profiling::Transport::HTTP.default( + profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + agent_settings: double('agent_settings which should not be used'), + api_key: api_key, + site: hostname, + agentless_allowed: true + ) + end + + it_behaves_like 'profile HTTP request' do + it 'is formatted for the API' do + client.send_profiling_flush(flush) + expect(request.path).to eq('/v1/input') + expect(request.header).to include( + 'dd-api-key' => [api_key] + ) + end + end + end + end + + def get_test_profiling_flush(code_provenance: nil) + start = Time.now.utc + finish = start + 10 + + pprof_recorder = instance_double( + Datadog::Profiling::StackRecorder, + serialize: [start, finish, 'fake_compressed_encoded_pprof_data'], + ) + + code_provenance_collector = + if code_provenance + instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance).tap do |it| + allow(it).to receive(:refresh).and_return(it) + end + end + + Datadog::Profiling::Exporter.new( + pprof_recorder: pprof_recorder, + code_provenance_collector: code_provenance_collector, + ).flush + end +end diff --git a/spec/datadog/profiling/transport/http/api/endpoint_spec.rb b/spec/datadog/profiling/transport/http/api/endpoint_spec.rb new file mode 100644 index 00000000000..12090a5743d --- /dev/null +++ b/spec/datadog/profiling/transport/http/api/endpoint_spec.rb @@ -0,0 +1,136 @@ +# typed: false + +require 'spec_helper' +require 'datadog/profiling/spec_helper' + +require 'datadog/profiling/stack_recorder' +require 'datadog/profiling/exporter' +require 'datadog/profiling/collectors/code_provenance' + +require 'datadog/profiling/encoding/profile' +require 'datadog/profiling/flush' +require 'datadog/profiling/transport/http/api/endpoint' +require 'datadog/profiling/transport/http/response' +require 'ddtrace/transport/http/env' + +RSpec.describe Datadog::Profiling::Transport::HTTP::API::Endpoint do + subject(:endpoint) { described_class.new(path) } + + let(:path) { double('path') } + + describe '#initialize' do + it do + is_expected.to have_attributes( + verb: :post, + path: path, + ) + end + end + + describe '#call' do + subject(:call) { endpoint.call(env, &block) } + + shared_examples_for 'profile request' do + let(:env) { Datadog::Transport::HTTP::Env.new(flush) } + let(:flush) { get_test_profiling_flush } + + let(:http_response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } + + let(:block) do + proc do + http_response + end + end + + it 'fills the env with data' do + is_expected.to be_a(Datadog::Profiling::Transport::HTTP::Response) + expect(env.verb).to be(:post) + expect(env.path).to be(path) + expect(env.body).to be nil + expect(env.headers).to eq({}) + + expect(env.form).to include( + 'version' => '3', + 'data[rubyprofile.pprof]' => kind_of(Datadog::Core::Vendor::Multipart::Post::UploadIO), + 'start' => flush.start.utc.iso8601, + 'end' => flush.finish.utc.iso8601, + 'family' => get_flush_tag('language'), + 'tags' => array_including( + "runtime:#{get_flush_tag('language')}", + "runtime-id:#{get_flush_tag('runtime-id')}", + "runtime_engine:#{get_flush_tag('runtime_engine')}", + "runtime_platform:#{get_flush_tag('runtime_platform')}", + "runtime_version:#{get_flush_tag('runtime_version')}", + "process_id:#{Process.pid}", + "profiler_version:#{get_flush_tag('profiler_version')}", + "language:#{get_flush_tag('language')}", + "host:#{get_flush_tag('host')}" + ) + ) + end + + def get_flush_tag(tag) + flush.tags_as_array.find { |key, _| key == tag }.last + end + end + + context 'by default' do + it_behaves_like 'profile request' + end + + context 'when code provenance data is available' do + it_behaves_like 'profile request' do + let(:code_provenance) { 'code_provenance_json' } + + let(:flush) { get_test_profiling_flush(code_provenance: code_provenance) } + + it 'includes code provenance data in the form' do + call + + expect(env.form) + .to include('data[code-provenance.json]' => kind_of(Datadog::Core::Vendor::Multipart::Post::UploadIO)) + end + end + end + + context 'when additional tags are provided' do + it_behaves_like 'profile request' do + let(:tags) { { 'test_tag_key' => 'test_tag_value', 'another_tag_key' => :another_tag_value } } + + before do + flush.tags_as_array.push(*tags.to_a) + end + + it 'reports the additional tags as part of the tags field' do + call + + expect(env.form).to include('tags' => array_including( + 'test_tag_key:test_tag_value', 'another_tag_key:another_tag_value' + )) + end + end + end + end + + def get_test_profiling_flush(code_provenance: nil) + start = Time.now.utc + finish = start + 10 + + pprof_recorder = instance_double( + Datadog::Profiling::StackRecorder, + serialize: [start, finish, 'fake_compressed_encoded_pprof_data'], + ) + + code_provenance_collector = + if code_provenance + instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance).tap do |it| + allow(it).to receive(:refresh).and_return(it) + end + end + + Datadog::Profiling::Exporter.new( + pprof_recorder: pprof_recorder, + code_provenance_collector: code_provenance_collector, + ).flush + end +end diff --git a/spec/datadog/profiling/transport/http/api/instance_spec.rb b/spec/datadog/profiling/transport/http/api/instance_spec.rb new file mode 100644 index 00000000000..415d3526552 --- /dev/null +++ b/spec/datadog/profiling/transport/http/api/instance_spec.rb @@ -0,0 +1,38 @@ +# typed: false + +require 'spec_helper' + +require 'ddtrace/transport/http/env' +require 'datadog/profiling/transport/http/api/instance' +require 'datadog/profiling/transport/http/api/spec' +require 'datadog/profiling/transport/http/response' + +RSpec.describe Datadog::Profiling::Transport::HTTP::API::Instance do + subject(:instance) { described_class.new(spec, adapter) } + + let(:adapter) { double('adapter') } + + describe '#send_profiling_flush' do + subject(:send_profiling_flush) { instance.send_profiling_flush(env) } + + let(:env) { instance_double(Datadog::Transport::HTTP::Env) } + + context 'when specification does not support traces' do + let(:spec) { double('spec') } + + it do + expect { send_profiling_flush } + .to raise_error(Datadog::Profiling::Transport::HTTP::API::Instance::ProfilesNotSupportedError) + end + end + + context 'when specification supports traces' do + let(:spec) { Datadog::Profiling::Transport::HTTP::API::Spec.new } + let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } + + before { expect(spec).to receive(:send_profiling_flush).with(env).and_return(response) } + + it { is_expected.to be response } + end + end +end diff --git a/spec/datadog/profiling/transport/http/api/spec_spec.rb b/spec/datadog/profiling/transport/http/api/spec_spec.rb new file mode 100644 index 00000000000..5b91579eaf1 --- /dev/null +++ b/spec/datadog/profiling/transport/http/api/spec_spec.rb @@ -0,0 +1,57 @@ +# typed: false + +require 'spec_helper' + +require 'ddtrace/transport/http/env' +require 'datadog/profiling/transport/http/api/endpoint' +require 'datadog/profiling/transport/http/api/spec' +require 'datadog/profiling/transport/http/response' + +RSpec.describe Datadog::Profiling::Transport::HTTP::API::Spec do + subject(:spec) { described_class.new } + + describe '#profiles=' do + subject(:profiles) { spec.profiles = endpoint } + + let(:endpoint) { instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint) } + + it { expect { profiles }.to change { spec.profiles }.from(nil).to(endpoint) } + end + + describe '#send_profiling_flush' do + subject(:send_profiling_flush) { spec.send_profiling_flush(env, &block) } + + let(:env) { instance_double(Datadog::Transport::HTTP::Env) } + let(:block) { proc {} } + + context 'when a trace endpoint has not been defined' do + it do + expect { send_profiling_flush } + .to raise_error(Datadog::Profiling::Transport::HTTP::API::Spec::NoProfilesEndpointDefinedError) + end + end + + context 'when a trace endpoint has been defined' do + let(:endpoint) { instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint) } + let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response) } + + before do + spec.profiles = endpoint + expect(endpoint).to receive(:call).with(env, &block).and_return(response) + end + + it { is_expected.to be response } + end + end + + describe '#encoder' do + subject { spec.encoder } + + let!(:endpoint) do + spec.profiles = instance_double(Datadog::Profiling::Transport::HTTP::API::Endpoint, encoder: encoder) + end + let(:encoder) { double } + + it { is_expected.to eq(encoder) } + end +end diff --git a/spec/datadog/profiling/transport/http/api_spec.rb b/spec/datadog/profiling/transport/http/api_spec.rb new file mode 100644 index 00000000000..f2c04266449 --- /dev/null +++ b/spec/datadog/profiling/transport/http/api_spec.rb @@ -0,0 +1,45 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/profiling/transport/http/api' + +RSpec.describe Datadog::Profiling::Transport::HTTP::API do + describe '::agent_defaults' do + subject(:agent_defaults) { described_class.agent_defaults } + + it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::API::Map) } + + it do + is_expected.to include( + described_class::V1 => kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) + ) + + agent_defaults[described_class::V1].tap do |v1| + expect(v1).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) + expect(v1.profiles).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Endpoint) + expect(v1.profiles.path).to eq('/profiling/v1/input') + expect(v1.profiles.encoder).to be Datadog::Profiling::Encoding::Profile::Protobuf + end + end + end + + describe '::api_defaults' do + subject(:api_defaults) { described_class.api_defaults } + + it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::API::Map) } + + it do + is_expected.to include( + described_class::V1 => kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) + ) + + api_defaults[described_class::V1].tap do |v1| + expect(v1).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Spec) + expect(v1.profiles).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::API::Endpoint) + expect(v1.profiles.path).to eq('/v1/input') + expect(v1.profiles.encoder).to be Datadog::Profiling::Encoding::Profile::Protobuf + end + end + end +end diff --git a/spec/datadog/profiling/transport/http/builder_spec.rb b/spec/datadog/profiling/transport/http/builder_spec.rb new file mode 100644 index 00000000000..224a6a10e3d --- /dev/null +++ b/spec/datadog/profiling/transport/http/builder_spec.rb @@ -0,0 +1,70 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/profiling/transport/http/builder' + +RSpec.describe Datadog::Profiling::Transport::HTTP::Builder do + subject(:builder) { described_class.new } + + it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Builder) } + + describe '#to_api_instances' do + subject(:api_instances) { builder.to_api_instances } + + shared_context 'default adapter' do + before { builder.adapter(adapter) } + + let(:adapter) { double('adapter') } + end + + context 'when an API is defined' do + before { builder.api(key, spec, options) } + + let(:key) { :v2 } + let(:spec) { instance_double(Datadog::Profiling::Transport::HTTP::API::Spec) } + let(:options) { {} } + + context 'but no adapter is defined anywhere' do + it { expect { api_instances }.to raise_error(described_class::NoAdapterForApiError) } + end + + context 'which inherits from the default adapter' do + include_context 'default adapter' + + it 'configures the API instance with the default adapter' do + expect(api_instances).to include(key => kind_of(builder.api_instance_class)) + expect(api_instances[key].adapter).to be adapter + end + end + end + end + + describe '#to_transport' do + subject(:transport) { builder.to_transport } + + context 'when no default API has been defined' do + it { expect { transport }.to raise_error(described_class::NoDefaultApiError) } + end + + context 'when APIs and an adapter are defined' do + let(:spec) { instance_double(Datadog::Transport::HTTP::API::Spec) } + + before do + builder.adapter(double('adapter')) + builder.api(:v2, spec) + end + + it 'returns an HTTP::Transport' do + expect(transport).to be_a_kind_of(Datadog::Profiling::Transport::HTTP::Client) + expect(transport.api.spec).to eq(spec) + end + end + end + + describe '#api_instance_class' do + subject(:api_instance_class) { builder.api_instance_class } + + it { is_expected.to be(Datadog::Profiling::Transport::HTTP::API::Instance) } + end +end diff --git a/spec/datadog/profiling/transport/http/client_spec.rb b/spec/datadog/profiling/transport/http/client_spec.rb new file mode 100644 index 00000000000..a3af8f9fe9c --- /dev/null +++ b/spec/datadog/profiling/transport/http/client_spec.rb @@ -0,0 +1,85 @@ +# typed: false + +require 'spec_helper' + +require 'ddtrace' +require 'ddtrace/transport/http/client' +require 'datadog/profiling/transport/http/client' +require 'datadog/profiling/transport/http/api' + +RSpec.describe Datadog::Profiling::Transport::HTTP::Client do + subject(:client) { described_class.new(api) } + + let(:api) { instance_double(Datadog::Profiling::Transport::HTTP::API::Instance) } + + describe '#initialize' do + it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Client) } + it { is_expected.to be_a_kind_of(Datadog::Transport::HTTP::Statistics) } + it { is_expected.to have_attributes(api: api) } + end + + shared_context 'HTTP request' do + let(:response) { instance_double(Datadog::Profiling::Transport::HTTP::Response, code: double('status code')) } + + before do + expect(api).to receive(:send_profiling_flush) + .with(kind_of(Datadog::Transport::HTTP::Env)) + .and_return(response) + + expect(client).to receive(:update_stats_from_response!) + .with(response) + end + end + + describe '#send_profiling_flush' do + include_context 'HTTP request' + + subject(:send_profiling_flush) { client.send_profiling_flush(flush) } + + let(:flush) { instance_double(Datadog::Profiling::Flush) } + + context 'when request was successful' do + before do + allow(response).to receive(:ok?).and_return(true) + end + + it 'returns the response object' do + is_expected.to be response + end + + it 'debug logs the successful report' do + expect(Datadog.logger).to receive(:debug).with(/Success/) + + send_profiling_flush + end + end + + context 'when request was not successful' do + before do + allow(response).to receive(:ok?).and_return(nil) + end + + it 'returns the response object' do + is_expected.to be response + end + + it 'debug logs the failed report' do + expect(Datadog.logger).to receive(:debug) { |&block| expect(block.call).to match(/Fail/) } + + send_profiling_flush + end + end + end + + describe '#send_payload' do + include_context 'HTTP request' + + subject(:send_payload) { client.send_payload(request) } + + let(:request) { instance_double(Datadog::Transport::Request) } + + it 'returns the response object' do + is_expected.to be response + end + end +end diff --git a/spec/datadog/profiling/transport/http/integration_spec.rb b/spec/datadog/profiling/transport/http/integration_spec.rb new file mode 100644 index 00000000000..564b7545304 --- /dev/null +++ b/spec/datadog/profiling/transport/http/integration_spec.rb @@ -0,0 +1,97 @@ +# typed: ignore + +require 'spec_helper' +require 'datadog/profiling/spec_helper' + +require 'ddtrace' +require 'datadog/profiling/transport/http' + +RSpec.describe 'Datadog::Profiling::Transport::HTTP integration tests' do + before do + skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? + skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? + end + + describe 'HTTP#default' do + subject(:transport) do + Datadog::Profiling::Transport::HTTP.default( + profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + **options + ) + end + + before do + # Make sure the transport is being built correctly, even if we then skip the tests + transport + end + + let(:settings) { Datadog::Core::Configuration::Settings.new } + + describe '#send_profiling_flush' do + subject(:response) { transport.send_profiling_flush(flush) } + + let(:flush) { get_test_profiling_flush } + + shared_examples_for 'a successful profile flush' do + it do + skip 'Only runs in fully integrated environment.' unless ENV['TEST_DATADOG_INTEGRATION'] + + is_expected.to be_a(Datadog::Profiling::Transport::HTTP::Response) + expect(response.code).to eq(200).or eq(403) + end + end + + context 'agent' do + let(:options) do + { + agent_settings: Datadog::Core::Configuration::AgentSettingsResolver.call( + Datadog::Core::Configuration::Settings.new, + logger: nil, + ) + } + end + + it_behaves_like 'a successful profile flush' + end + + context 'agentless' do + before do + skip 'Valid API key must be set.' unless ENV['DD_API_KEY'] && !ENV['DD_API_KEY'].empty? + end + + let(:options) do + { + agent_settings: double('agent_settings which should not be used'), + site: 'datadoghq.com', + api_key: ENV['DD_API_KEY'] || 'Invalid API key', + agentless_allowed: true + } + end + + it_behaves_like 'a successful profile flush' + end + end + end + + def get_test_profiling_flush(code_provenance: nil) + start = Time.now.utc + finish = start + 10 + + pprof_recorder = instance_double( + Datadog::Profiling::StackRecorder, + serialize: [start, finish, 'fake_compressed_encoded_pprof_data'], + ) + + code_provenance_collector = + if code_provenance + instance_double(Datadog::Profiling::Collectors::CodeProvenance, generate_json: code_provenance).tap do |it| + allow(it).to receive(:refresh).and_return(it) + end + end + + Datadog::Profiling::Exporter.new( + pprof_recorder: pprof_recorder, + code_provenance_collector: code_provenance_collector, + ).flush + end +end diff --git a/spec/datadog/profiling/transport/http_spec.rb b/spec/datadog/profiling/transport/http_spec.rb new file mode 100644 index 00000000000..0c2eca0877e --- /dev/null +++ b/spec/datadog/profiling/transport/http_spec.rb @@ -0,0 +1,171 @@ +# typed: false + +require 'spec_helper' +require 'securerandom' + +require 'datadog/core/configuration/agent_settings_resolver' +require 'datadog/profiling/transport/http' +require 'datadog/profiling/transport/http/builder' +require 'datadog/profiling/transport/http/client' +require 'ddtrace/transport/ext' +require 'ddtrace/transport/http/adapters/net' + +RSpec.describe Datadog::Profiling::Transport::HTTP do + describe '::new' do + context 'given a block' do + subject(:new_http) { described_class.new(&block) } + + let(:block) { proc {} } + + let(:builder) { instance_double(Datadog::Profiling::Transport::HTTP::Builder) } + let(:client) { instance_double(Datadog::Profiling::Transport::HTTP::Client) } + + before do + expect(Datadog::Transport::HTTP::Builder).to receive(:new) do |&blk| + expect(blk).to be block + builder + end + + expect(builder).to receive(:to_transport) + .and_return(client) + end + + it { is_expected.to be client } + end + end + + describe '::default' do + subject(:default) { described_class.default(profiling_upload_timeout_seconds: timeout_seconds, **options) } + + let(:timeout_seconds) { double('Timeout in seconds') } + let(:options) { { agent_settings: agent_settings } } + + let(:agent_settings) do + Datadog::Core::Configuration::AgentSettingsResolver::AgentSettings.new( + adapter: adapter, + hostname: hostname, + port: port, + ssl: ssl, + uds_path: uds_path, + timeout_seconds: nil, + deprecated_for_removal_transport_configuration_proc: deprecated_for_removal_transport_configuration_proc, + ) + end + let(:adapter) { :net_http } + let(:hostname) { double('hostname') } + let(:port) { double('port') } + let(:profiling_upload_timeout_seconds) { double('timeout') } + let(:ssl) { true } + let(:uds_path) { double('uds_path') } + let(:deprecated_for_removal_transport_configuration_proc) { nil } + + it 'returns a transport with provided options configured for agent mode' do + expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) + expect(default.api.adapter.hostname).to eq(hostname) + expect(default.api.adapter.port).to eq(port) + expect(default.api.adapter.timeout).to be timeout_seconds + expect(default.api.adapter.ssl).to be true + expect(default.api.headers).to include(described_class.default_headers) + expect(default.api.headers).to_not include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY) + end + + context 'when agent_settings has a deprecated_for_removal_transport_configuration_proc' do + let(:deprecated_for_removal_transport_configuration_proc) { proc {} } + + it 'calls the deprecated_for_removal_transport_configuration_proc with the transport builder' do + expect(deprecated_for_removal_transport_configuration_proc).to \ + receive(:call).with(an_instance_of(Datadog::Profiling::Transport::HTTP::Builder)) + + default + end + end + + context 'when called with a site and api' do + let(:options) do + { agent_settings: double('agent_settings which should not be used'), site: site, api_key: api_key } + end + + let(:site) { 'test.datadoghq.com' } + let(:api_key) { SecureRandom.uuid } + + context 'when DD_PROFILING_AGENTLESS environment variable is set to "true"' do + around do |example| + ClimateControl.modify('DD_PROFILING_AGENTLESS' => 'true') do + example.run + end + end + + it 'returns a transport configured for agentless' do + expected_host = URI(format(Datadog::Profiling::OldExt::Transport::HTTP::URI_TEMPLATE_DD_API, site)).host + expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) + expect(default.api.adapter.hostname).to eq(expected_host) + expect(default.api.adapter.port).to eq(443) + expect(default.api.adapter.timeout).to be timeout_seconds + expect(default.api.adapter.ssl).to be true + expect(default.api.headers).to include(described_class.default_headers) + expect(default.api.headers).to include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) + end + end + + context 'when agentless_allowed is true' do + let(:options) { { **super(), agentless_allowed: true } } + + it 'returns a transport configured for agentless' do + expected_host = URI(format(Datadog::Profiling::OldExt::Transport::HTTP::URI_TEMPLATE_DD_API, site)).host + expect(default.api.adapter).to be_a_kind_of(Datadog::Transport::HTTP::Adapters::Net) + expect(default.api.adapter.hostname).to eq(expected_host) + expect(default.api.adapter.port).to eq(443) + expect(default.api.adapter.timeout).to be timeout_seconds + expect(default.api.adapter.ssl).to be true + expect(default.api.headers).to include(described_class.default_headers) + expect(default.api.headers).to include(Datadog::Transport::Ext::HTTP::HEADER_DD_API_KEY => api_key) + end + end + + ['false', nil].each do |environment_value| + context "when DD_PROFILING_AGENTLESS environment variable is set to #{environment_value.inspect}" do + let(:options) { { **super(), agent_settings: agent_settings } } + + around do |example| + ClimateControl.modify('DD_PROFILING_AGENTLESS' => environment_value) do + example.run + end + end + + it 'returns a transport configured for agent mode' do + expect(default.api.adapter.hostname).to eq(hostname) + end + end + end + end + end + + describe '::default_headers' do + subject(:default_headers) { described_class.default_headers } + + it do + is_expected.to include( + Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, + Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, + Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, + Datadog::Transport::Ext::HTTP::HEADER_META_TRACER_VERSION => Datadog::Core::Environment::Ext::TRACER_VERSION + ) + end + + context 'when Core::Environment::Container.container_id' do + before { expect(Datadog::Core::Environment::Container).to receive(:container_id).and_return(container_id) } + + context 'is not nil' do + let(:container_id) { '3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860' } + + it { is_expected.to include(Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID => container_id) } + end + + context 'is nil' do + let(:container_id) { nil } + + it { is_expected.to_not include(Datadog::Transport::Ext::HTTP::HEADER_CONTAINER_ID) } + end + end + end +end From 09d83b3f17930171812c814229aab3adc6446eeb Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 13:20:24 +0100 Subject: [PATCH 0099/2133] Allow enabling legacy profiling transport codepath via setting/env variable If needed, this will allow customers to toggle the legacy profiling transport codepath by setting the `DD_PROFILING_LEGACY_TRANSPORT_ENABLED` environment varaible to `true` or by using ```ruby Datadog.configure do |c| c.profiling.advanced.legacy_transport_enabled = true end ``` As described in the previous commit, this is temporary and only being added just in case we need to debug issues with the newly-added `HttpTransport` (or to confirm that an issue did not come from it). --- lib/datadog/core/configuration/components.rb | 12 ++++++++++++ lib/datadog/core/configuration/settings.rb | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 9cb4a5e6fa3..7fb23802548 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -313,6 +313,18 @@ def build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) def build_profiler_transport(settings, agent_settings) settings.profiling.exporter.transport || + if settings.profiling.advanced.legacy_transport_enabled + require 'datadog/profiling/transport/http' + + Datadog.logger.warn('Using legacy profiling transport. Do not use unless instructed to by support.') + + Profiling::Transport::HTTP.default( + agent_settings: agent_settings, + site: settings.site, + api_key: settings.api_key, + profiling_upload_timeout_seconds: settings.profiling.upload.timeout_seconds + ) + end || Profiling::HttpTransport.new( agent_settings: agent_settings, site: settings.site, diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 0f3612142e3..022adf52e9e 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -233,6 +233,13 @@ def initialize(*_) # Disable gathering of names and versions of gems in use by the service, used to power grouping and # categorization of stack traces. option :code_provenance_enabled, default: true + + # Use legacy transport code instead of HttpTransport. Temporarily added for migration to HttpTransport, + # and will be removed soon. Do not use unless instructed to by support. + option :legacy_transport_enabled do |o| + o.default { env_to_bool('DD_PROFILING_LEGACY_TRANSPORT_ENABLED', false) } + o.lazy + end end # @public_api From fa71f8b1f492c63646de3282daef52f010dfca12 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 13:58:56 +0100 Subject: [PATCH 0100/2133] Rubocop whitespace fixes --- ext/ddtrace_profiling_loader/extconf.rb | 1 + spec/datadog/profiling/validate_benchmarks_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/ext/ddtrace_profiling_loader/extconf.rb b/ext/ddtrace_profiling_loader/extconf.rb index 66c76a7e5de..c25cd742899 100644 --- a/ext/ddtrace_profiling_loader/extconf.rb +++ b/ext/ddtrace_profiling_loader/extconf.rb @@ -1,4 +1,5 @@ # typed: ignore + # rubocop:disable Style/StderrPuts # rubocop:disable Style/GlobalVars diff --git a/spec/datadog/profiling/validate_benchmarks_spec.rb b/spec/datadog/profiling/validate_benchmarks_spec.rb index 61d6e87f9fe..22dc55f88aa 100644 --- a/spec/datadog/profiling/validate_benchmarks_spec.rb +++ b/spec/datadog/profiling/validate_benchmarks_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'datadog/profiling/spec_helper' RSpec.describe 'Profiling benchmarks', if: (RUBY_VERSION >= '2.4.0') do From 625f11541d4051cc0082925d422f1fff4e788ae1 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Thu, 2 Jun 2022 18:09:43 -0400 Subject: [PATCH 0101/2133] Add Postgres Integration (#2054) * Instrument pg exec method * Add instrumentation for pg exec_params, async and sync methods * Add instrumentation for pg exec_prepared * fixup! Add instrumentation for pg exec_prepared * Remove db statement tag * Skip certain tests if pg version < 1.1.0 * fixup! Skip certain tests if pg version < 1.1.0 * Ignore lint and typecheck errors * Add benchmark test and refactor * fixup! Add benchmark test and refactor * Skip benchmark during CI + cleanup tests/appraisal * Update gemfiles * Update min pg version to 0.18.4 * Update gemfiles Co-authored-by: Marco Costa --- Appraisals | 16 +- Rakefile | 2 + docs/GettingStarted.md | 23 + gemfiles/jruby_9.2.18.0_contrib.gemfile.lock | 2 +- gemfiles/jruby_9.2.8.0_contrib.gemfile.lock | 2 +- gemfiles/jruby_9.3.4.0_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.1.10_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.2.10_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.3.8_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.4.10_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.5.9_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.6.7_contrib.gemfile.lock | 2 +- gemfiles/ruby_2.7.3_contrib.gemfile.lock | 2 +- lib/datadog/tracing/contrib.rb | 1 + .../contrib/pg/configuration/settings.rb | 35 + lib/datadog/tracing/contrib/pg/ext.rb | 31 + .../tracing/contrib/pg/instrumentation.rb | 129 +++ lib/datadog/tracing/contrib/pg/integration.rb | 43 + lib/datadog/tracing/contrib/pg/patcher.rb | 31 + lib/datadog/tracing/metadata/ext.rb | 22 + .../tracing/contrib/pg/integration_spec.rb | 80 ++ .../tracing/contrib/pg/patcher_spec.rb | 806 ++++++++++++++++++ spec/ddtrace/benchmark/pg_contrib_spec.rb | 265 ++++++ 23 files changed, 1486 insertions(+), 18 deletions(-) create mode 100644 lib/datadog/tracing/contrib/pg/configuration/settings.rb create mode 100644 lib/datadog/tracing/contrib/pg/ext.rb create mode 100644 lib/datadog/tracing/contrib/pg/instrumentation.rb create mode 100644 lib/datadog/tracing/contrib/pg/integration.rb create mode 100644 lib/datadog/tracing/contrib/pg/patcher.rb create mode 100644 spec/datadog/tracing/contrib/pg/integration_spec.rb create mode 100644 spec/datadog/tracing/contrib/pg/patcher_spec.rb create mode 100644 spec/ddtrace/benchmark/pg_contrib_spec.rb diff --git a/Appraisals b/Appraisals index b7f0f27a980..d5ea534c2fc 100644 --- a/Appraisals +++ b/Appraisals @@ -108,7 +108,7 @@ if ruby_version?('2.1') gem 'makara', '< 0.5.0' # >= 0.5.0 contain Ruby 2.3+ syntax gem 'mongo', '< 2.5' gem 'mysql2', '0.3.21' - gem 'pg', '< 1.0' + gem 'pg', '>= 0.18.4', '< 1.0' gem 'rack', '1.4.7' gem 'rack-cache', '1.7.1' gem 'rack-test', '0.7.0' @@ -270,8 +270,6 @@ elsif ruby_version?('2.2') gem 'delayed_job' gem 'delayed_job_active_record' gem 'elasticsearch' - gem 'pg' - gem 'presto-client', '>= 0.5.14' gem 'ethon' gem 'excon' gem 'faraday' @@ -285,6 +283,8 @@ elsif ruby_version?('2.2') gem 'makara', '< 0.5.0' # >= 0.5.0 contain Ruby 2.3+ syntax gem 'mongo', '>= 2.8.0' gem 'mysql2', '< 0.5' + gem 'pg', '>= 0.18.4' + gem 'presto-client', '>= 0.5.14' gem 'qless' gem 'racecar', '>= 0.3.5' gem 'rack', '< 2.1.0' # Locked due to grape incompatibility: https://github.com/ruby-grape/grape/issues/1980 @@ -468,7 +468,7 @@ elsif ruby_version?('2.3') gem 'makara' gem 'mongo', '>= 2.8.0', '< 2.15.0' # TODO: FIX TEST BREAKAGES ON >= 2.15 https://github.com/DataDog/dd-trace-rb/issues/1596 gem 'mysql2', '< 0.5' - gem 'pg' + gem 'pg', '>= 0.18.4' gem 'qless' gem 'racecar', '>= 0.3.5' gem 'rack', '< 2.1.0' # Locked due to grape incompatibility: https://github.com/ruby-grape/grape/issues/1980 @@ -586,7 +586,7 @@ elsif ruby_version?('2.4') gem 'makara' gem 'mongo', '>= 2.8.0', '< 2.15.0' # TODO: FIX TEST BREAKAGES ON >= 2.15 https://github.com/DataDog/dd-trace-rb/issues/1596 gem 'mysql2', '< 0.5' - gem 'pg' + gem 'pg', '>= 0.18.4' gem 'qless' gem 'racecar', '>= 0.3.5' gem 'rack' @@ -833,7 +833,7 @@ elsif ruby_version?('2.5') gem 'mongo', '>= 2.8.0', '< 2.15.0' # TODO: FIX TEST BREAKAGES ON >= 2.15 https://github.com/DataDog/dd-trace-rb/issues/1596 gem 'mysql2', '< 1', platform: :ruby gem 'activerecord-jdbcmysql-adapter', '>= 60.2', platform: :jruby - gem 'pg', platform: :ruby + gem 'pg', '>= 0.18.4', platform: :ruby gem 'activerecord-jdbcpostgresql-adapter', '>= 60.2', platform: :jruby gem 'qless', (RUBY_PLATFORM == 'java' ? '0.10.0' : '>= 0') # Newer releases require `rusage`, which is not available for JRuby gem 'racecar', '>= 0.3.5' @@ -1057,7 +1057,7 @@ elsif ruby_version?('2.6') gem 'mongo', '>= 2.8.0', '< 2.15.0' # TODO: FIX TEST BREAKAGES ON >= 2.15 https://github.com/DataDog/dd-trace-rb/issues/1596 gem 'mysql2', '< 1', platform: :ruby gem 'activerecord-jdbcmysql-adapter', platform: :jruby - gem 'pg', platform: :ruby + gem 'pg', '>= 0.18.4', platform: :ruby gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby gem 'qless', (RUBY_PLATFORM == 'java' ? '0.10.0' : '>= 0') # Newer releases require `rusage`, which is not available for JRuby gem 'racecar', '>= 0.3.5' @@ -1262,7 +1262,7 @@ elsif ruby_version?('2.7') gem 'makara' gem 'mongo', '>= 2.8.0', '< 2.15.0' # TODO: FIX TEST BREAKAGES ON >= 2.15 https://github.com/DataDog/dd-trace-rb/issues/1596 gem 'mysql2', '< 1', platform: :ruby - gem 'pg', platform: :ruby + gem 'pg', '>= 0.18.4', platform: :ruby gem 'qless' gem 'racecar', '>= 0.3.5' gem 'rack' diff --git a/Rakefile b/Rakefile index 6a7ea3418a4..27236a59a7d 100644 --- a/Rakefile +++ b/Rakefile @@ -131,6 +131,7 @@ namespace :spec do :lograge, :mongodb, :mysql2, + :pg, :presto, :qless, :que, @@ -273,6 +274,7 @@ task :ci do declare '❌ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:lograge' # disabled on 3.0 as lograge nested dependancy thor ~> 1.0 conflicts w/qless dependancy thor ~> 0.19.1 declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:mongodb' declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ❌ jruby' => 'bundle exec appraisal contrib rake spec:mysql2' # disabled on JRuby, built-in jdbc is used instead + declare '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ❌ jruby' => 'bundle exec appraisal contrib rake spec:pg' declare '✅ 2.1 / ✅ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ❌ jruby' => 'bundle exec appraisal contrib rake spec:presto' declare '❌ 2.1 / ✅ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:qless' declare '❌ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby' => 'bundle exec appraisal contrib rake spec:que' diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 184546c695c..b8b161b82dc 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -62,6 +62,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d - [MongoDB](#mongodb) - [MySQL2](#mysql2) - [Net/HTTP](#nethttp) + - [Postgres](#postgres) - [Presto](#presto) - [Qless](#qless) - [Que](#que) @@ -497,6 +498,7 @@ For a list of available integrations, and their configuration options, please re | MongoDB | `mongo` | `>= 2.1` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* | | MySQL2 | `mysql2` | `>= 0.3.21` | *gem not available* | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* | | Net/HTTP | `http` | *(Any supported Ruby)* | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* | +| Postgres | `pg` | `>= 0.18.4` | *gem not available* | *[Link](#postgres)* | *[Link](https://github.com/ged/ruby-pg)* | | Presto | `presto` | `>= 0.5.14` | `>= 0.5.14` | *[Link](#presto)* | *[Link](https://github.com/treasure-data/presto-client-ruby)* | | Qless | `qless` | `>= 0.10.0` | `>= 0.10.0` | *[Link](#qless)* | *[Link](https://github.com/seomoz/qless)* | | Que | `que` | `>= 1.0.0.beta2` | `>= 1.0.0.beta2` | *[Link](#que)* | *[Link](https://github.com/que-rb/que)* | @@ -1369,6 +1371,27 @@ If you wish to configure each connection object individually, you may use the `D client = Net::HTTP.new(host, port) Datadog.configure_onto(client, **options) ``` +### Postgres + +The PG integration traces SQL commands sent through the `pg` gem via: +* `exec`, `exec_params`, `exec_prepared`; +* `async_exec`, `async_exec_params`, `async_exec_prepared`; or, +* `sync_exec`, `sync_exec_params`, `sync_exec_prepared` + +```ruby +require 'pg' +require 'ddtrace' + +Datadog.configure do |c| + c.tracing.instrument :pg, options +end +``` + +Where `options` is an optional `Hash` that accepts the following parameters: + +| Key | Description | Default | +| --- | ----------- | ------- | +| `service_name` | Service name used for `pg` instrumentation | `'pg'` | ### Presto diff --git a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock index 39e21530630..85b2cceeaab 100644 --- a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock @@ -1673,7 +1673,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-debugger-jruby diff --git a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock index 5e50bbe6af5..474425e4ebe 100644 --- a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock @@ -1673,7 +1673,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-debugger-jruby diff --git a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock index 2062e0bfda0..bf5ec320596 100644 --- a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock @@ -1672,7 +1672,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-debugger-jruby diff --git a/gemfiles/ruby_2.1.10_contrib.gemfile.lock b/gemfiles/ruby_2.1.10_contrib.gemfile.lock index 806847d470d..4302019f637 100644 --- a/gemfiles/ruby_2.1.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.1.10_contrib.gemfile.lock @@ -283,7 +283,7 @@ DEPENDENCIES mysql2 (= 0.3.21) opentracing (>= 0.4.1) os (~> 1.1) - pg (< 1.0) + pg (>= 0.18.4, < 1.0) pimpmychangelog (>= 0.1.2) presto-client (>= 0.5.14) pry diff --git a/gemfiles/ruby_2.2.10_contrib.gemfile.lock b/gemfiles/ruby_2.2.10_contrib.gemfile.lock index 9963400e4ef..347c925892d 100644 --- a/gemfiles/ruby_2.2.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.2.10_contrib.gemfile.lock @@ -1499,7 +1499,7 @@ DEPENDENCIES mysql2 (< 0.5) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) presto-client (>= 0.5.14) pry diff --git a/gemfiles/ruby_2.3.8_contrib.gemfile.lock b/gemfiles/ruby_2.3.8_contrib.gemfile.lock index 375b9a8a0f3..949a67346ea 100644 --- a/gemfiles/ruby_2.3.8_contrib.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib.gemfile.lock @@ -1596,7 +1596,7 @@ DEPENDENCIES mysql2 (< 0.5) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-nav diff --git a/gemfiles/ruby_2.4.10_contrib.gemfile.lock b/gemfiles/ruby_2.4.10_contrib.gemfile.lock index 004d1cbba32..05f579a0b8a 100644 --- a/gemfiles/ruby_2.4.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib.gemfile.lock @@ -1707,7 +1707,7 @@ DEPENDENCIES mysql2 (< 0.5) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-nav diff --git a/gemfiles/ruby_2.5.9_contrib.gemfile.lock b/gemfiles/ruby_2.5.9_contrib.gemfile.lock index 94980a477b9..608d3b1bcc9 100644 --- a/gemfiles/ruby_2.5.9_contrib.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib.gemfile.lock @@ -1689,7 +1689,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-nav diff --git a/gemfiles/ruby_2.6.7_contrib.gemfile.lock b/gemfiles/ruby_2.6.7_contrib.gemfile.lock index 19a69174aaf..6f017626296 100644 --- a/gemfiles/ruby_2.6.7_contrib.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib.gemfile.lock @@ -1690,7 +1690,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-byebug diff --git a/gemfiles/ruby_2.7.3_contrib.gemfile.lock b/gemfiles/ruby_2.7.3_contrib.gemfile.lock index 5485cb9b48b..26b95f839d2 100644 --- a/gemfiles/ruby_2.7.3_contrib.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib.gemfile.lock @@ -1688,7 +1688,7 @@ DEPENDENCIES mysql2 (< 1) opentracing (>= 0.4.1) os (~> 1.1) - pg + pg (>= 0.18.4) pimpmychangelog (>= 0.1.2) pry pry-byebug diff --git a/lib/datadog/tracing/contrib.rb b/lib/datadog/tracing/contrib.rb index 2a15b9a6360..0402212848d 100644 --- a/lib/datadog/tracing/contrib.rb +++ b/lib/datadog/tracing/contrib.rb @@ -57,6 +57,7 @@ module Contrib require 'datadog/tracing/contrib/lograge/integration' require 'datadog/tracing/contrib/mongodb/integration' require 'datadog/tracing/contrib/mysql2/integration' +require 'datadog/tracing/contrib/pg/integration' require 'datadog/tracing/contrib/presto/integration' require 'datadog/tracing/contrib/qless/integration' require 'datadog/tracing/contrib/que/integration' diff --git a/lib/datadog/tracing/contrib/pg/configuration/settings.rb b/lib/datadog/tracing/contrib/pg/configuration/settings.rb new file mode 100644 index 00000000000..e53114a6d87 --- /dev/null +++ b/lib/datadog/tracing/contrib/pg/configuration/settings.rb @@ -0,0 +1,35 @@ +# typed: false + +require 'datadog/tracing/contrib/configuration/settings' +require 'datadog/tracing/contrib/pg/ext' + +module Datadog + module Tracing + module Contrib + module Pg + module Configuration + # Custom settings for the Pg integration + # @public_api + class Settings < Contrib::Configuration::Settings + option :enabled do |o| + o.default { env_to_bool(Ext::ENV_ENABLED, true) } + o.lazy + end + + option :analytics_enabled do |o| + o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) } + o.lazy + end + + option :analytics_sample_rate do |o| + o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) } + o.lazy + end + + option :service_name, default: Ext::DEFAULT_PEER_SERVICE_NAME + end + end + end + end + end +end diff --git a/lib/datadog/tracing/contrib/pg/ext.rb b/lib/datadog/tracing/contrib/pg/ext.rb new file mode 100644 index 00000000000..58d33b86d5d --- /dev/null +++ b/lib/datadog/tracing/contrib/pg/ext.rb @@ -0,0 +1,31 @@ +# typed: true + +module Datadog + module Tracing + module Contrib + module Pg + # pg integration constants + # @public_api Changing resource names, tag names, or environment variables creates breaking changes. + module Ext + ENV_ENABLED = 'DD_TRACE_PG_ENABLED'.freeze + ENV_ANALYTICS_ENABLED = 'DD_TRACE_PG_ANALYTICS_ENABLED'.freeze + ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_PG_ANALYTICS_SAMPLE_RATE'.freeze + DEFAULT_PEER_SERVICE_NAME = 'pg'.freeze + SPAN_SYSTEM = 'postgresql'.freeze + SPAN_EXEC = 'pg.exec'.freeze + SPAN_EXEC_PARAMS = 'pg.exec.params'.freeze + SPAN_EXEC_PREPARED = 'pg.exec.prepared'.freeze + SPAN_ASYNC_EXEC = 'pg.async.exec'.freeze + SPAN_ASYNC_EXEC_PARAMS = 'pg.async.exec.params'.freeze + SPAN_ASYNC_EXEC_PREPARED = 'pg.async.exec.prepared'.freeze + SPAN_SYNC_EXEC = 'pg.sync.exec'.freeze + SPAN_SYNC_EXEC_PARAMS = 'pg.sync.exec.params'.freeze + SPAN_SYNC_EXEC_PREPARED = 'pg.sync.exec.prepared'.freeze + TAG_DB_NAME = 'pg.db.name'.freeze + TAG_COMPONENT = 'pg'.freeze + TAG_OPERATION_QUERY = 'query'.freeze + end + end + end + end +end diff --git a/lib/datadog/tracing/contrib/pg/instrumentation.rb b/lib/datadog/tracing/contrib/pg/instrumentation.rb new file mode 100644 index 00000000000..c433d50089d --- /dev/null +++ b/lib/datadog/tracing/contrib/pg/instrumentation.rb @@ -0,0 +1,129 @@ +# typed: false + +require 'datadog/tracing' +require 'datadog/tracing/metadata/ext' +require 'datadog/tracing/contrib/analytics' +require 'datadog/tracing/contrib/pg/ext' + +module Datadog + module Tracing + module Contrib + module Pg + # PG::Connection patch module + module Instrumentation + def self.included(base) + base.prepend(InstanceMethods) + end + + # PG::Connection patch methods + module InstanceMethods + def exec(sql, *args) + trace(Ext::SPAN_EXEC, resource: sql) do + super(sql, *args) + end + end + + def exec_params(sql, params, *args) + trace(Ext::SPAN_EXEC_PARAMS, resource: sql) do + super(sql, params, *args) + end + end + + def exec_prepared(statement_name, params, *args) + trace(Ext::SPAN_EXEC_PREPARED, resource: statement_name) do + super(statement_name, params, *args) + end + end + + def async_exec(sql, *args) + trace(Ext::SPAN_ASYNC_EXEC, resource: sql) do + super(sql, *args) + end + end + + def async_exec_params(sql, params, *args) + trace(Ext::SPAN_ASYNC_EXEC_PARAMS, resource: sql) do + super(sql, params, *args) + end + end + + def async_exec_prepared(statement_name, params, *args) + trace(Ext::SPAN_ASYNC_EXEC_PREPARED, resource: statement_name) do + super(statement_name, params, *args) + end + end + + def sync_exec(sql, *args) + trace(Ext::SPAN_SYNC_EXEC, resource: sql) do + super(sql, *args) + end + end + + def sync_exec_params(sql, params, *args) + trace(Ext::SPAN_SYNC_EXEC_PARAMS, resource: sql) do + super(sql, params, *args) + end + end + + def sync_exec_prepared(statement_name, params, *args) + trace(Ext::SPAN_SYNC_EXEC_PREPARED, resource: statement_name) do + super(statement_name, params, *args) + end + end + + private + + def trace(name, resource:) + service = Datadog.configuration_for(self, :service_name) || datadog_configuration[:service_name] + Tracing.trace(name, service: service, resource: resource, type: Tracing::Metadata::Ext::SQL::TYPE) do |span| + annotate_span_with_query!(span, service) + # Set analytics sample rate + Contrib::Analytics.set_sample_rate(span, analytics_sample_rate) if analytics_enabled? + result = yield + annotate_span_with_result!(span, result) + result + end + end + + def annotate_span_with_query!(span, service) + span.set_tag(Ext::TAG_DB_NAME, db) + + span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) + span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY) + span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + + # Tag as an external peer service + span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, service) + span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, host) + + span.set_tag(Tracing::Metadata::Ext::DB::TAG_INSTANCE, db) + span.set_tag(Tracing::Metadata::Ext::DB::TAG_USER, user) + span.set_tag(Tracing::Metadata::Ext::DB::TAG_SYSTEM, Ext::SPAN_SYSTEM) + + span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_HOST, host) + span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_PORT, port) + span.set_tag(Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME, host) + span.set_tag(Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT, port) + end + + def annotate_span_with_result!(span, result) + span.set_tag(Tracing::Metadata::Ext::DB::TAG_ROW_COUNT, result.ntuples) + end + + def datadog_configuration + Datadog.configuration.tracing[:pg] + end + + def analytics_enabled? + datadog_configuration[:analytics_enabled] + end + + def analytics_sample_rate + datadog_configuration[:analytics_sample_rate] + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/contrib/pg/integration.rb b/lib/datadog/tracing/contrib/pg/integration.rb new file mode 100644 index 00000000000..acbbacc0af0 --- /dev/null +++ b/lib/datadog/tracing/contrib/pg/integration.rb @@ -0,0 +1,43 @@ +# typed: false + +require 'datadog/tracing/contrib/integration' +require 'datadog/tracing/contrib/pg/configuration/settings' +require 'datadog/tracing/contrib/pg/patcher' + +module Datadog + module Tracing + module Contrib + module Pg + # Description of pg integration + class Integration + include Contrib::Integration + + MINIMUM_VERSION = Gem::Version.new('0.18.4') + + # @public_api Changing the integration name or integration options can cause breaking changes + register_as :pg + + def self.version + Gem.loaded_specs['pg'] && Gem.loaded_specs['pg'].version + end + + def self.loaded? + !defined?(::PG).nil? + end + + def self.compatible? + super && version >= MINIMUM_VERSION + end + + def new_configuration + Configuration::Settings.new + end + + def patcher + Patcher + end + end + end + end + end +end diff --git a/lib/datadog/tracing/contrib/pg/patcher.rb b/lib/datadog/tracing/contrib/pg/patcher.rb new file mode 100644 index 00000000000..e72ac102853 --- /dev/null +++ b/lib/datadog/tracing/contrib/pg/patcher.rb @@ -0,0 +1,31 @@ +# typed: ignore + +require 'datadog/tracing/contrib/patcher' +require 'datadog/tracing/contrib/pg/instrumentation' + +module Datadog + module Tracing + module Contrib + module Pg + # Patcher enables patching of 'pg' module. + module Patcher + include Contrib::Patcher + + module_function + + def target_version + Integration.version + end + + def patch + patch_pg_connection + end + + def patch_pg_connection + ::PG::Connection.include(Instrumentation) + end + end + end + end + end +end diff --git a/lib/datadog/tracing/metadata/ext.rb b/lib/datadog/tracing/metadata/ext.rb index cff8b26b078..979c3f7ea67 100644 --- a/lib/datadog/tracing/metadata/ext.rb +++ b/lib/datadog/tracing/metadata/ext.rb @@ -20,6 +20,8 @@ module Ext # Name of external service that performed the work TAG_PEER_SERVICE = 'peer.service' + TAG_KIND = 'span.kind' + # Defines constants for trace analytics # @public_api module Analytics @@ -123,6 +125,8 @@ module NET TAG_HOSTNAME = '_dd.hostname' TAG_TARGET_HOST = 'out.host' TAG_TARGET_PORT = 'out.port' + TAG_DESTINATION_NAME = 'network.destination.name' + TAG_DESTINATION_PORT = 'network.destination.port' end # @public_api @@ -145,6 +149,24 @@ module SQL TYPE = 'sql' TAG_QUERY = 'sql.query' end + + # @public_api + module DB + TAG_INSTANCE = 'db.instance' + TAG_USER = 'db.user' + TAG_SYSTEM = 'db.system' + TAG_STATEMENT = 'db.statement' + TAG_ROW_COUNT = 'db.row_count' + end + + # @public_api + module SpanKind + TAG_SERVER = 'server' + TAG_CLIENT = 'client' + TAG_PRODUCER = 'producer' + TAG_CONSUMER = 'consumer' + TAG_INTERNAL = 'internal' + end end end end diff --git a/spec/datadog/tracing/contrib/pg/integration_spec.rb b/spec/datadog/tracing/contrib/pg/integration_spec.rb new file mode 100644 index 00000000000..fbd74d0d7f8 --- /dev/null +++ b/spec/datadog/tracing/contrib/pg/integration_spec.rb @@ -0,0 +1,80 @@ +# typed: ignore + +require 'datadog/tracing/contrib/support/spec_helper' + +require 'datadog/tracing/contrib/pg/integration' + +RSpec.describe Datadog::Tracing::Contrib::Pg::Integration do + extend ConfigurationHelpers + + let(:integration) { described_class.new(:pg) } + + describe '.version' do + subject(:version) { described_class.version } + + context 'when the "pg" gem is loaded' do + include_context 'loaded gems', pg: described_class::MINIMUM_VERSION + it { is_expected.to be_a_kind_of(Gem::Version) } + end + + context 'when "pg" gem is not loaded' do + include_context 'loaded gems', pg: nil + it { is_expected.to be nil } + end + end + + describe '.loaded?' do + subject(:loaded?) { described_class.loaded? } + + context 'when pg is defined' do + before { stub_const('PG', Class.new) } + + it { is_expected.to be true } + end + + context 'when pg is not defined' do + before { hide_const('PG') } + + it { is_expected.to be false } + end + end + + describe '.compatible?' do + subject(:compatible?) { described_class.compatible? } + + context 'when "pg" gem is loaded with a version' do + context 'that is less than the minimum' do + include_context 'loaded gems', pg: decrement_gem_version(described_class::MINIMUM_VERSION) + it { is_expected.to be false } + end + + context 'that meets the minimum version' do + include_context 'loaded gems', pg: described_class::MINIMUM_VERSION + it { is_expected.to be true } + end + end + + context 'when gem is not loaded' do + include_context 'loaded gems', pg: nil + it { is_expected.to be false } + end + end + + describe '#auto_instrument?' do + subject(:auto_instrument?) { integration.auto_instrument? } + + it { is_expected.to be(true) } + end + + describe '#default_configuration' do + subject(:default_configuration) { integration.default_configuration } + + it { is_expected.to be_a_kind_of(Datadog::Tracing::Contrib::Pg::Configuration::Settings) } + end + + describe '#patcher' do + subject(:patcher) { integration.patcher } + + it { is_expected.to be Datadog::Tracing::Contrib::Pg::Patcher } + end +end diff --git a/spec/datadog/tracing/contrib/pg/patcher_spec.rb b/spec/datadog/tracing/contrib/pg/patcher_spec.rb new file mode 100644 index 00000000000..3702e00d1df --- /dev/null +++ b/spec/datadog/tracing/contrib/pg/patcher_spec.rb @@ -0,0 +1,806 @@ +# typed: ignore + +require 'datadog/tracing/contrib/integration_examples' +require 'datadog/tracing/contrib/support/spec_helper' +require 'datadog/tracing/contrib/analytics_examples' + +require 'ddtrace' +require 'pg' + +RSpec.describe 'PG::Connection patcher' do + let(:service_name) { 'pg' } + let(:configuration_options) { { service_name: service_name } } + + let(:conn) do + PG::Connection.new( + host: host, + port: port, + dbname: dbname, + user: user, + password: password + ) + end + + let(:host) { ENV.fetch('TEST_POSTGRES_HOST') { '127.0.0.1' } } + let(:port) { ENV.fetch('TEST_POSTGRES_PORT') { '5432' } } + let(:dbname) { ENV.fetch('TEST_POSTGRES_DB') { 'postgres' } } + let(:user) { ENV.fetch('TEST_POSTGRES_USER') { 'postgres' } } + let(:password) { ENV.fetch('TEST_POSTGRES_PASSWORD') { 'postgres' } } + + before do + Datadog.configure do |c| + c.tracing.instrument :pg, configuration_options + end + end + + around do |example| + # Reset before and after each example; don't allow global state to linger. + Datadog.registry[:pg].reset_configuration! + example.run + Datadog.registry[:pg].reset_configuration! + end + + after do + conn.close + end + + describe 'tracing' do + describe '#exec' do + subject(:exec) { conn.exec('SELECT 1;') } + + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + exec + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + exec + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT 1;' + it 'produces a trace' do + exec + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_EXEC) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { exec } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { exec } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { exec } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.exec('SELECT INVALID') }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('column "invalid" does not exist')) + end + end + end + + describe '#exec_params' do + subject(:exec_params) { conn.exec_params('SELECT $1::int;', [1]) } + + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + exec_params + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + exec_params + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT $1::int;' + + it 'produces a trace' do + exec_params + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_EXEC_PARAMS) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { exec_params } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { exec_params } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { exec_params } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.exec_params('SELECT $1;', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('could not determine data type of parameter $1')) + end + end + end + + describe '#exec_prepared' do + before { conn.prepare('prepared select 1', 'SELECT $1::int') } + subject(:exec_prepared) { conn.exec_prepared('prepared select 1', [1]) } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + exec_prepared + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + exec_prepared + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + statement_name = 'prepared select 1' + + it 'produces a trace' do + exec_prepared + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_EXEC_PREPARED) + expect(span.resource).to eq(statement_name) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { exec_prepared } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { exec_prepared } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { exec_prepared } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.exec_prepared('invalid prepared select 1', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message( + include('ERROR') & include('prepared statement "invalid prepared select 1" does not exist') + ) + end + end + end + + describe '#async_exec' do + subject(:async_exec) { conn.async_exec('SELECT 1;') } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + async_exec + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + async_exec + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT 1;' + + it 'produces a trace' do + async_exec + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_ASYNC_EXEC) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { async_exec } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { async_exec } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { async_exec } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.async_exec('SELECT INVALID') }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('column "invalid" does not exist')) + end + end + end + + describe '#async_exec_params' do + before do + skip('pg < 1.1.0 does not support #async_exec_params') if Gem::Version.new(PG::VERSION) < Gem::Version.new('1.1.0') + end + subject(:async_exec_params) { conn.async_exec_params('SELECT $1::int;', [1]) } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + async_exec_params + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + async_exec_params + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT $1::int;' + + it 'produces a trace' do + async_exec_params + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_ASYNC_EXEC_PARAMS) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { async_exec_params } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { async_exec_params } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { async_exec_params } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.async_exec_params('SELECT $1;', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('could not determine data type of parameter $1')) + end + end + end + + describe '#async_exec_prepared' do + before do + if Gem::Version.new(PG::VERSION) < Gem::Version.new('1.1.0') + skip('pg < 1.1.0 does not support #async_exec_prepared') + end + conn.prepare('prepared select 1', 'SELECT $1::int') + end + subject(:async_exec_prepared) { conn.async_exec_prepared('prepared select 1', [1]) } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + async_exec_prepared + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + async_exec_prepared + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + statement_name = 'prepared select 1' + + it 'produces a trace' do + async_exec_prepared + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_ASYNC_EXEC_PREPARED) + expect(span.resource).to eq(statement_name) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { async_exec_prepared } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { async_exec_prepared } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { async_exec_prepared } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.async_exec_prepared('invalid prepared select 1', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message( + include('ERROR') & include('prepared statement "invalid prepared select 1" does not exist') + ) + end + end + end + + describe '#sync_exec' do + before do + if Gem::Version.new(PG::VERSION) < Gem::Version.new('1.1.0') + skip('pg < 1.1.0 does not support #async_exec_prepared') + end + end + subject(:sync_exec) { conn.sync_exec('SELECT 1;') } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + sync_exec + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + sync_exec + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT 1;' + + it 'produces a trace' do + sync_exec + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYNC_EXEC) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { sync_exec } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { sync_exec } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { sync_exec } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.sync_exec('SELECT INVALID') }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('column "invalid" does not exist')) + end + end + end + + describe '#sync_exec_params' do + before do + skip('pg < 1.1.0 does not support #sync_exec_params') if Gem::Version.new(PG::VERSION) < Gem::Version.new('1.1.0') + end + subject(:sync_exec_params) { conn.sync_exec_params('SELECT $1::int;', [1]) } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + sync_exec_params + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + sync_exec_params + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + query = 'SELECT $1::int;' + + it 'produces a trace' do + sync_exec_params + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYNC_EXEC_PARAMS) + expect(span.resource).to eq(query) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { sync_exec_params } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { sync_exec_params } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { sync_exec_params } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.sync_exec_params('SELECT $1;', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message(include('ERROR') & include('could not determine data type of parameter $1')) + end + end + end + + describe '#sync_exec_prepared' do + before do + skip('pg < 1.1.0 does not support #sync_exec_prepared') if Gem::Version.new(PG::VERSION) < Gem::Version.new('1.1.0') + conn.prepare('prepared select 1', 'SELECT $1::int') + end + subject(:sync_exec_prepared) { conn.sync_exec_prepared('prepared select 1', [1]) } + context 'when the tracer is disabled' do + before { tracer.enabled = false } + + it 'does not write spans' do + sync_exec_prepared + expect(spans).to be_empty + end + end + + context 'when the tracer is configured directly' do + let(:service_override) { 'pg-override' } + + before { Datadog.configure_onto(conn, service_name: service_override) } + + it 'produces a trace with service override' do + sync_exec_prepared + expect(spans.count).to eq(1) + expect(span.service).to eq(service_override) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq(service_override) + end + end + + context 'when a successful query is made' do + statement_name = 'prepared select 1' + + it 'produces a trace' do + sync_exec_prepared + expect(spans.count).to eq(1) + expect(span.name).to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYNC_EXEC_PREPARED) + expect(span.resource).to eq(statement_name) + expect(span.service).to eq('pg') + expect(span.type).to eq(Datadog::Tracing::Metadata::Ext::SQL::TYPE) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_KIND)) + .to eq(Datadog::Tracing::Metadata::Ext::SpanKind::TAG_CLIENT) + expect(span.get_tag(Datadog::Tracing::Contrib::Pg::Ext::TAG_DB_NAME)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_COMPONENT) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::TAG_OPERATION_QUERY) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::DEFAULT_PEER_SERVICE_NAME) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_HOSTNAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_INSTANCE)).to eq(dbname) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_USER)).to eq(user) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_SYSTEM)) + .to eq(Datadog::Tracing::Contrib::Pg::Ext::SPAN_SYSTEM) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_HOST)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_TARGET_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME)).to eq(host) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::NET::TAG_DESTINATION_PORT)).to eq(port.to_i) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::DB::TAG_ROW_COUNT)).to eq(1) + end + + it_behaves_like 'analytics for integration' do + before { sync_exec_prepared } + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::Pg::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'a peer service span' do + before { sync_exec_prepared } + let(:peer_hostname) { host } + end + + it_behaves_like 'measured span for integration', false do + before { sync_exec_prepared } + end + end + + context 'when a failed query is made' do + it 'traces failed queries' do + expect { conn.sync_exec_prepared('invalid prepared select 1', ['INVALID']) }.to raise_error(PG::Error) + expect(spans.count).to eq(1) + expect(span).to have_error + expect(span).to have_error_message( + include('ERROR') & include('prepared statement "invalid prepared select 1" does not exist') + ) + end + end + end + end +end diff --git a/spec/ddtrace/benchmark/pg_contrib_spec.rb b/spec/ddtrace/benchmark/pg_contrib_spec.rb new file mode 100644 index 00000000000..6ff86e34395 --- /dev/null +++ b/spec/ddtrace/benchmark/pg_contrib_spec.rb @@ -0,0 +1,265 @@ +# typed: ignore + +require 'spec_helper' + +require 'benchmark' +require 'ddtrace' +require 'pg' + +RSpec.describe 'Pg Tracing Integration', :order => :defined do + iterations = 1000 + + let(:conn) do + PG::Connection.new( + host: host, + port: port, + dbname: dbname, + user: user, + password: password + ) + end + + let(:host) { ENV.fetch('TEST_POSTGRES_HOST') { '127.0.0.1' } } + let(:port) { ENV.fetch('TEST_POSTGRES_PORT') { '5432' } } + let(:dbname) { ENV.fetch('TEST_POSTGRES_DB') { 'postgres' } } + let(:user) { ENV.fetch('TEST_POSTGRES_USER') { 'postgres' } } + let(:password) { ENV.fetch('TEST_POSTGRES_PASSWORD') { 'postgres' } } + + after do + conn.close + end + + context 'timing' do + before { skip('Benchmark results not currently captured in CI') if ENV.key?('CI') } + + include Benchmark + + context 'no tracing enabled' do + context 'SELECT 1' do + before { conn.prepare('SELECT 1', 'SELECT $1::int') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT 1;') } } + x.report('#exec_params') { iterations.times { conn.exec_params('SELECT $1::int;', [1]) } } + x.report('#exec_prepared') { iterations.times { conn.exec_prepared('SELECT 1', [1]) } } + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT 1;') } } + x.report('#async_exec_params') { iterations.times { conn.async_exec_params('SELECT $1::int;', [1]) } } + x.report('#async_exec_prepared') { iterations.times { conn.async_exec_prepared('SELECT 1', [1]) } } + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT 1;') } } + x.report('#sync_exec_params') { iterations.times { conn.sync_exec_params('SELECT $1::int;', [1]) } } + x.report('#sync_exec_prepared') { iterations.times { conn.sync_exec_prepared('SELECT 1', [1]) } } + end + } + end + + context 'SELECT * FROM 100 rows' do + before do + conn.exec('CREATE TABLE test_table (col1 text, col2 text, col3 text);') + 100.times { conn.exec("INSERT INTO test_table (col1,col2,col3) VALUES ('foo','bar','baz');") } + conn.prepare('SELECT test_table', 'SELECT $1::text, $2::text, $3::text FROM test_table') + end + after { conn.exec('DROP TABLE test_table;') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT * FROM test_table;') } } + x.report('#exec_params') do + iterations.times do + conn.exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#exec_prepared') do + iterations.times do + conn.exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT * FROM test_table;') } } + x.report('#async_exec_params') do + iterations.times do + conn.async_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#async_exec_prepared') do + iterations.times do + conn.async_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT * FROM test_table;') } } + x.report('#sync_exec_params') do + iterations.times do + conn.sync_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#sync_exec_prepared') do + iterations.times do + conn.sync_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + end + } + end + + context 'SELECT * FROM 1000 rows' do + before do + conn.exec('CREATE TABLE test_table (col1 text, col2 text, col3 text);') + 1000.times { conn.exec("INSERT INTO test_table (col1,col2,col3) VALUES ('foo','bar','baz');") } + conn.prepare('SELECT test_table', 'SELECT $1::text, $2::text, $3::text FROM test_table') + end + after { conn.exec('DROP TABLE test_table;') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT * FROM test_table;') } } + x.report('#exec_params') do + iterations.times do + conn.exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#exec_prepared') do + iterations.times do + conn.exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT * FROM test_table;') } } + x.report('#async_exec_params') do + iterations.times do + conn.async_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#async_exec_prepared') do + iterations.times do + conn.async_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT * FROM test_table;') } } + x.report('#sync_exec_params') do + iterations.times do + conn.sync_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#sync_exec_prepared') do + iterations.times do + conn.sync_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + end + } + end + end + + context 'tracing enabled' do + before do + Datadog.configure do |c| + c.tracing.instrument :pg + end + conn.exec('SELECT 1;') # to warm up the library + end + context 'SELECT 1' do + before { conn.prepare('SELECT 1', 'SELECT $1::int') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT 1;') } } + x.report('#exec_params') { iterations.times { conn.exec_params('SELECT $1::int;', [1]) } } + x.report('#exec_prepared') { iterations.times { conn.exec_prepared('SELECT 1', [1]) } } + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT 1;') } } + x.report('#async_exec_params') { iterations.times { conn.async_exec_params('SELECT $1::int;', [1]) } } + x.report('#async_exec_prepared') { iterations.times { conn.async_exec_prepared('SELECT 1', [1]) } } + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT 1;') } } + x.report('#sync_exec_params') { iterations.times { conn.sync_exec_params('SELECT $1::int;', [1]) } } + x.report('#sync_exec_prepared') { iterations.times { conn.sync_exec_prepared('SELECT 1', [1]) } } + end + } + end + + context 'SELECT * FROM 100 rows' do + before do + conn.exec('CREATE TABLE test_table (col1 text, col2 text, col3 text);') + 100.times { conn.exec("INSERT INTO test_table (col1,col2,col3) VALUES ('foo','bar','baz');") } + conn.prepare('SELECT test_table', 'SELECT $1::text, $2::text, $3::text FROM test_table') + end + after { conn.exec('DROP TABLE test_table;') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT * FROM test_table;') } } + x.report('#exec_params') do + iterations.times do + conn.exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#exec_prepared') do + iterations.times do + conn.exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT * FROM test_table;') } } + x.report('#async_exec_params') do + iterations.times do + conn.async_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#async_exec_prepared') do + iterations.times do + conn.async_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT * FROM test_table;') } } + x.report('#sync_exec_params') do + iterations.times do + conn.sync_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#sync_exec_prepared') do + iterations.times do + conn.sync_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + end + } + end + + context 'SELECT * FROM 1000 rows' do + before do + conn.exec('CREATE TABLE test_table (col1 text, col2 text, col3 text);') + 1000.times { conn.exec("INSERT INTO test_table (col1,col2,col3) VALUES ('foo','bar','baz');") } + conn.prepare('SELECT test_table', 'SELECT $1::text, $2::text, $3::text FROM test_table') + end + after { conn.exec('DROP TABLE test_table;') } + it { + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#exec') { iterations.times { conn.exec('SELECT * FROM test_table;') } } + x.report('#exec_params') do + iterations.times do + conn.exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#exec_prepared') do + iterations.times do + conn.exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#async_exec') { iterations.times { conn.async_exec('SELECT * FROM test_table;') } } + x.report('#async_exec_params') do + iterations.times do + conn.async_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#async_exec_prepared') do + iterations.times do + conn.async_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + x.report('#sync_exec') { iterations.times { conn.sync_exec('SELECT * FROM test_table;') } } + x.report('#sync_exec_params') do + iterations.times do + conn.sync_exec_params('SELECT $1::text, $2::text, $3::text FROM test_table;', %w[col1 col2 col3]) + end + end + x.report('#sync_exec_prepared') do + iterations.times do + conn.sync_exec_prepared('SELECT test_table', %w[col1 col2 col3]) + end + end + end + } + end + end + end +end From f545994581c8e7570628e27e3316048850bf09ab Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 6 Jun 2022 10:13:46 +0100 Subject: [PATCH 0102/2133] Fix support for Ruby 3.2 (> preview1) A new `struct rb_native_thread` was introduced to contain the `thread_id`. Fixes #2065 --- ext/ddtrace_profiling_native_extension/extconf.rb | 3 +++ .../private_vm_api_access.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 99cd61bfd8c..fa518642c09 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -92,6 +92,9 @@ def add_compiler_flag(flag) $defs << '-DHAVE_PTHREAD_GETCPUCLOCKID' end +# On older Rubies, there was no struct rb_native_thread. See private_vm_api_acccess.c for details. +$defs << '-DNO_RB_NATIVE_THREAD' if RUBY_VERSION < '3.2' + # On older Rubies, we need to use a backported version of this function. See private_vm_api_access.h for details. $defs << '-DUSE_BACKPORTED_RB_PROFILE_FRAME_METHOD_NAME' if RUBY_VERSION < '3' diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 1505fbc0cc2..5d7b80d0878 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -35,7 +35,12 @@ static inline rb_thread_t *thread_struct_from_object(VALUE thread) { } rb_nativethread_id_t pthread_id_for(VALUE thread) { - return thread_struct_from_object(thread)->thread_id; + // struct rb_native_thread was introduced in Ruby 3.2 (preview2): https://github.com/ruby/ruby/pull/5836 + #ifndef NO_RB_NATIVE_THREAD + return thread_struct_from_object(thread)->nt->thread_id; + #else + return thread_struct_from_object(thread)->thread_id; + #endif } // Returns the stack depth by using the same approach as rb_profile_frames and backtrace_each: get the positions From 61e69431f5d49ebf18e3abe91527feda78891f4b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 6 Jun 2022 10:15:09 +0100 Subject: [PATCH 0103/2133] Fix "warning: old-style function definition" The correct modern way to declare a function which takes no arguments is `void foo(void)` not `void foo()`. --- ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c | 2 +- ext/ddtrace_profiling_native_extension/clock_id.h | 2 +- ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c | 2 +- ext/ddtrace_profiling_native_extension/clock_id_noop.c | 2 +- ext/ddtrace_profiling_native_extension/private_vm_api_access.c | 2 +- ext/ddtrace_profiling_native_extension/private_vm_api_access.h | 2 +- ext/ddtrace_profiling_native_extension/ruby_helpers.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c b/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c index f60e24c42d4..462ee9b27d4 100644 --- a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c +++ b/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c @@ -41,7 +41,7 @@ static void unload_failed_library(void *handle); #define DDTRACE_EXPORT __attribute__ ((visibility ("default"))) -void DDTRACE_EXPORT Init_ddtrace_profiling_loader() { +void DDTRACE_EXPORT Init_ddtrace_profiling_loader(void) { VALUE datadog_module = rb_define_module("Datadog"); VALUE profiling_module = rb_define_module_under(datadog_module, "Profiling"); VALUE loader_module = rb_define_module_under(profiling_module, "Loader"); diff --git a/ext/ddtrace_profiling_native_extension/clock_id.h b/ext/ddtrace_profiling_native_extension/clock_id.h index 755ea210f4d..5b98a53bf79 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id.h +++ b/ext/ddtrace_profiling_native_extension/clock_id.h @@ -1,4 +1,4 @@ #pragma once -void self_test_clock_id(); +void self_test_clock_id(void); VALUE clock_id_for(VALUE self, VALUE thread); diff --git a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c index de70ecd9308..40839c1b571 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c @@ -13,7 +13,7 @@ #include "clock_id.h" // Validate that our home-cooked pthread_id_for() matches pthread_self() for the current thread -void self_test_clock_id() { +void self_test_clock_id(void) { rb_nativethread_id_t expected_pthread_id = pthread_self(); rb_nativethread_id_t actual_pthread_id = pthread_id_for(rb_thread_current()); diff --git a/ext/ddtrace_profiling_native_extension/clock_id_noop.c b/ext/ddtrace_profiling_native_extension/clock_id_noop.c index 986a0af31cc..043677ed054 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_noop.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_noop.c @@ -8,7 +8,7 @@ #include "clock_id.h" -void self_test_clock_id() { } // Nothing to check +void self_test_clock_id(void) { } // Nothing to check VALUE clock_id_for(VALUE self, VALUE thread) { return Qnil; } // Nothing to return #endif diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 5d7b80d0878..079b029dd10 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -70,7 +70,7 @@ ptrdiff_t stack_depth_for(VALUE thread) { #ifndef USE_LEGACY_LIVING_THREADS_ST // Ruby > 2.1 // Tries to match rb_thread_list() but that method isn't accessible to extensions -VALUE ddtrace_thread_list() { +VALUE ddtrace_thread_list(void) { VALUE result = rb_ary_new(); rb_thread_t *thread = NULL; diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index dde09461bbb..715a44fd241 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -17,7 +17,7 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); -VALUE ddtrace_thread_list(); +VALUE ddtrace_thread_list(void); int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index a93b01064c7..d70a76c37a5 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -26,7 +26,7 @@ static inline VALUE process_pending_interruptions(VALUE _unused) { // } // ``` __attribute__((warn_unused_result)) -static inline int check_if_pending_exception() { +static inline int check_if_pending_exception(void) { int pending_exception; rb_protect(process_pending_interruptions, Qnil, &pending_exception); return pending_exception; From 9e163c47c636a9cc9888ce416b9718b6a279d238 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 7 Jun 2022 12:12:42 +0100 Subject: [PATCH 0104/2133] Add env var for debugging profiling native extension compilation issues To avoid impacting customers, whenever we detect an issue which would've led to the profiling native extension compilation to fail, we instead skip the compilation. This ensures that customers (especially those *not* using profiling) don't get impacted at installation time. Instead, at execution time, if they do try to enable profiling, they'll get a message such as ``` WARN -- ddtrace: [ddtrace] Profiling was requested but is not supported, profiling disabled: Your ddtrace installation is missing support for the Continuous Profiler because there was a problem in setting up the libddprof dependency. For help solving this issue, please contact Datadog support at https://docs.datadoghq.com/help/. ``` But while investigating one such issue reported by a customer (), I found that it's helpful to have a way to break during installation, because that will make Ruby print extra debug information, including the location of the `mkmf.log` log file which can be useful when debugging issues. Thus, I've added a new `DD_PROFILING_FAIL_INSTALL_IF_MISSING_EXTENSION` environment variable that support can request customers set to `true` to force a failure at installation time. Here's how it looks when I simulate a broken `libddprof` setup by renaming a file: ``` # Installs successfully, but profiling will not work: $ gem install pkg/ddtrace-1.1.0.gem Building native extensions. This could take a while... Successfully installed ddtrace-1.1.0 Parsing documentation for ddtrace-1.1.0 Done installing documentation for ddtrace after 3 seconds 1 gem installed # Force failure to show up at gem installation time: $ DD_PROFILING_FAIL_INSTALL_IF_MISSING_EXTENSION=true gem install pkg/ddtrace-1.1.0.gem Building native extensions. This could take a while... ERROR: Error installing pkg/ddtrace-1.1.0.gem: ERROR: Failed to build gem native extension. current directory: ~/.rvm/gems/ruby-2.7.6/gems/ddtrace-1.1.0/ext/ddtrace_profiling_native_extension ~/.rvm/rubies/ruby-2.7.6/bin/ruby -I ~/.rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0 -r ./siteconf20220607-83731-8dqh3w.rb extconf.rb +------------------------------------------------------------------------------+ | ** Preparing to build the ddtrace profiling native extension... ** | | | | If you run into any failures during this step, you can set the | | `DD_PROFILING_NO_EXTENSION` environment variable to `true` e.g. | | `$ DD_PROFILING_NO_EXTENSION=true bundle install` to skip this step. | | | | If you disable this extension, the Datadog Continuous Profiler will | | not be available, but all other ddtrace features will work fine! | | | | If you needed to use this, please tell us why on | | so we can fix it :) | | | | Thanks for using ddtrace! You rock! | +------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ | Could not compile the Datadog Continuous Profiler because | | there was a problem in setting up the `libddprof` dependency. | | | | Failing installation immediately because the | | `DD_PROFILING_FAIL_INSTALL_IF_MISSING_EXTENSION` environment variable is set | | to `true`. | | When contacting support, please include the file that is shown | | below. | | | | For help solving this issue, please contact Datadog support at | | . | +------------------------------------------------------------------------------+ *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=~/.rvm/rubies/ruby-2.7.6/bin/$(RUBY_BASE_NAME) --with-ddprof_ffi_with_rpath_x-config --without-ddprof_ffi_with_rpath_x-config --with-pkg-config --without-pkg-config To see why this extension failed to compile, please check the mkmf.log which can be found here: ~/.rvm/gems/ruby-2.7.6/extensions/x86_64-darwin-20/2.7.0/ddtrace-1.1.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in ~/.rvm/gems/ruby-2.7.6/gems/ddtrace-1.1.0 for inspection. Results logged to ~/.rvm/gems/ruby-2.7.6/extensions/x86_64-darwin-20/2.7.0/ddtrace-1.1.0/gem_make.out ``` You'll notice that a bunch more useful information shows up, including the path to `mkmf.log`, which can provide extra information. --- .../extconf.rb | 21 +++++++++++-- .../native_extension_helpers.rb | 31 ++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index fa518642c09..41886bdb6c0 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -10,13 +10,30 @@ File.delete(SKIPPED_REASON_FILE) rescue nil def skip_building_extension!(reason) - $stderr.puts(Datadog::Profiling::NativeExtensionHelpers::Supported.failure_banner_for(**reason)) + fail_install_if_missing_extension = + Datadog::Profiling::NativeExtensionHelpers.fail_install_if_missing_extension? + + $stderr.puts( + Datadog::Profiling::NativeExtensionHelpers::Supported.failure_banner_for( + **reason, + fail_install: fail_install_if_missing_extension, + ) + ) + File.write( SKIPPED_REASON_FILE, Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason), ) - File.write('Makefile', 'all install clean: # dummy makefile that does nothing') + if fail_install_if_missing_extension + require 'mkmf' + Logging.message( + "\nFailure cause: #{Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason)}" + ) + else + File.write('Makefile', 'all install clean: # dummy makefile that does nothing') + end + exit end diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 838798eb0a4..a7961597d8f 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -6,12 +6,20 @@ module Datadog module Profiling + # Helpers for extconf.rb module NativeExtensionHelpers + # Can be set when customers want to skip compiling the native extension entirely ENV_NO_EXTENSION = 'DD_PROFILING_NO_EXTENSION' + # Can be set to force rubygems to fail gem installation when profiling extension could not be built + ENV_FAIL_INSTALL_IF_MISSING_EXTENSION = 'DD_PROFILING_FAIL_INSTALL_IF_MISSING_EXTENSION' # Older Rubies don't have the MJIT header, used by the JIT compiler, so we need to use a different approach CAN_USE_MJIT_HEADER = RUBY_VERSION >= '2.6' + def self.fail_install_if_missing_extension? + ENV[ENV_FAIL_INSTALL_IF_MISSING_EXTENSION].to_s.strip.downcase == 'true' + end + # Used to check if profiler is supported, including user-visible clear messages explaining why their # system may not be supported. # rubocop:disable Metrics/ModuleLength @@ -37,15 +45,30 @@ def self.unsupported_reason end # This banner will show up in the logs/terminal while compiling the native extension - def self.failure_banner_for(reason:, suggested:) - prettify_lines = proc { |lines| lines.map { |line| "| #{line.ljust(76)} |" }.join("\n") } + def self.failure_banner_for(reason:, suggested:, fail_install:) + prettify_lines = proc { |lines| Array(lines).map { |line| "| #{line.ljust(76)} |" }.join("\n") } + outcome = + if fail_install + [ + 'Failing installation immediately because the ', + "`#{ENV_FAIL_INSTALL_IF_MISSING_EXTENSION}` environment variable is set", + 'to `true`.', + 'When contacting support, please include the file that is shown ', + 'below.', + ] + else + [ + 'The Datadog Continuous Profiler will not be available,', + 'but all other ddtrace features will work fine!', + ] + end + %( +------------------------------------------------------------------------------+ | Could not compile the Datadog Continuous Profiler because | #{prettify_lines.call(reason)} | | -| The Datadog Continuous Profiler will not be available, | -| but all other ddtrace features will work fine! | +#{prettify_lines.call(outcome)} | | #{prettify_lines.call(suggested)} +------------------------------------------------------------------------------+ From ce7884d6be0ea87810434b6a0af523191ff8925d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 7 Jun 2022 13:23:58 +0100 Subject: [PATCH 0105/2133] Log `PKG_CONFIG_PATH` to mkmf.log This will help us investigate #2068 . --- ext/ddtrace_profiling_native_extension/extconf.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 41886bdb6c0..600a6a948a1 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -28,7 +28,8 @@ def skip_building_extension!(reason) if fail_install_if_missing_extension require 'mkmf' Logging.message( - "\nFailure cause: #{Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason)}" + ' [ddtrace] Failure cause: ' \ + "#{Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason)}\n" ) else File.write('Makefile', 'all install clean: # dummy makefile that does nothing') @@ -139,6 +140,7 @@ def add_compiler_flag(flag) # If we got here, libddprof is available and loaded ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libddprof.pkgconfig_folder}" +Logging.message(" [ddtrace] PKG_CONFIG_PATH set to '#{ENV['PKG_CONFIG_PATH']}'\n") unless pkg_config('ddprof_ffi_with_rpath') skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF) end From c5cdaa2afbb560ea759cc3b0f040cb32254c8eb1 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 9 May 2022 14:08:37 +0100 Subject: [PATCH 0106/2133] Rename `at_fork_blocks` to `ddtrace_at_fork_blocks` Since we're adding a method to `Kernel`, I've decided to namespace the method just in case we cause any collisions OR it's confusing to users where this method is coming from. --- lib/datadog/profiling/ext/forking.rb | 16 ++++++++-------- spec/datadog/profiling/ext/forking_spec.rb | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index 6eb3436d8da..402c3ccef5b 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -45,7 +45,7 @@ def fork child_block = if block_given? proc do # Trigger :child callback - at_fork_blocks[:child].each(&:call) if at_fork_blocks.key?(:child) + ddtrace_at_fork_blocks[:child].each(&:call) if ddtrace_at_fork_blocks.key?(:child) # Invoke original block yield @@ -53,7 +53,7 @@ def fork end # Trigger :prepare callback - at_fork_blocks[:prepare].each(&:call) if at_fork_blocks.key?(:prepare) + ddtrace_at_fork_blocks[:prepare].each(&:call) if ddtrace_at_fork_blocks.key?(:prepare) # Start fork # If a block is provided, use the wrapped version. @@ -65,10 +65,10 @@ def fork # rubocop:disable Style/IfInsideElse if result.nil? # Trigger :child callback - at_fork_blocks[:child].each(&:call) if at_fork_blocks.key?(:child) + ddtrace_at_fork_blocks[:child].each(&:call) if ddtrace_at_fork_blocks.key?(:child) else # Trigger :parent callback - at_fork_blocks[:parent].each(&:call) if at_fork_blocks.key?(:parent) + ddtrace_at_fork_blocks[:parent].each(&:call) if ddtrace_at_fork_blocks.key?(:parent) end # rubocop:enable Style/IfInsideElse @@ -79,17 +79,17 @@ def fork def at_fork(stage = :prepare, &block) raise ArgumentError, 'Bad \'stage\' for ::at_fork' unless FORK_STAGES.include?(stage) - at_fork_blocks[stage] = [] unless at_fork_blocks.key?(stage) - at_fork_blocks[stage] << block + ddtrace_at_fork_blocks[stage] = [] unless ddtrace_at_fork_blocks.key?(stage) + ddtrace_at_fork_blocks[stage] << block end module_function - def at_fork_blocks + def ddtrace_at_fork_blocks # Blocks should be shared across all users of this module, # e.g. Process#fork, Kernel#fork, etc. should all invoke the same callbacks. # rubocop:disable Style/ClassVars - @@at_fork_blocks ||= {} + @@ddtrace_at_fork_blocks ||= {} # rubocop:enable Style/ClassVars end end diff --git a/spec/datadog/profiling/ext/forking_spec.rb b/spec/datadog/profiling/ext/forking_spec.rb index 1a8081b3c4f..2e3c455abda 100644 --- a/spec/datadog/profiling/ext/forking_spec.rb +++ b/spec/datadog/profiling/ext/forking_spec.rb @@ -136,7 +136,7 @@ def fork(&block) end after do - described_class.at_fork_blocks.clear + described_class.ddtrace_at_fork_blocks.clear end end From 455a808eadf819f2d88e5eb656c0cde9e01546db Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 8 Jun 2022 11:27:11 +0100 Subject: [PATCH 0107/2133] Use inspect when logging PKG_CONFIG_PATH --- ext/ddtrace_profiling_native_extension/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 600a6a948a1..ef596abf4fa 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -140,7 +140,7 @@ def add_compiler_flag(flag) # If we got here, libddprof is available and loaded ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libddprof.pkgconfig_folder}" -Logging.message(" [ddtrace] PKG_CONFIG_PATH set to '#{ENV['PKG_CONFIG_PATH']}'\n") +Logging.message(" [ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") unless pkg_config('ddprof_ffi_with_rpath') skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF) end From 4a01ba08e57e16189c28a246af71957cbdf8fb18 Mon Sep 17 00:00:00 2001 From: David Elner Date: Thu, 9 Jun 2022 10:12:22 -0400 Subject: [PATCH 0108/2133] Fixed: rails-six integration app gems with Ruby 2.5 --- integration/apps/rails-six/Gemfile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/integration/apps/rails-six/Gemfile b/integration/apps/rails-six/Gemfile index d34ea333f4f..d983e1753b0 100644 --- a/integration/apps/rails-six/Gemfile +++ b/integration/apps/rails-six/Gemfile @@ -37,10 +37,15 @@ source 'https://rubygems.org' do gem 'multi_json' gem 'oj', platform: :ruby - # Need to add these because ActionMailer is broken in 6.1.5 + # Need to add these because ActionMailer is broken in 6.1.6 # https://github.com/rails/rails/pull/44697 - gem 'net-smtp' - gem 'net-imap' + if RUBY_VERSION < '2.6.0' + gem 'net-smtp', '0.3.0' + gem 'net-imap', '0.2.2' + else + gem 'net-smtp' + gem 'net-imap' + end gem 'net-pop' gem 'active_model_serializers' @@ -80,7 +85,13 @@ source 'https://rubygems.org' do gem 'rspec' gem 'rspec-collection_matchers' gem 'rspec-rails' - gem 'shoulda-matchers' + + if RUBY_VERSION < '2.6.0' + gem 'shoulda-matchers', '~> 4.5' + else + gem 'shoulda-matchers' + end + gem 'simplecov', require: false # Will install simplecov-html as a dependency gem 'timecop' gem 'webmock' From 9482f24893c39df80b4af3f79aee91e6aff5acd4 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Fri, 10 Jun 2022 15:26:55 +1200 Subject: [PATCH 0109/2133] Add convenient interface for getting and setting tags using `[]` and `[]=` respectively. Fixes https://github.com/DataDog/dd-trace-rb/issues/2075. --- lib/datadog/tracing/metadata/tagging.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 12a66555cef..6ce64e78dc3 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -70,6 +70,12 @@ def clear_tag(key) meta.delete(key) end + # Convenient interface for setting a single tag. + alias []= set_tag + + # Convenient interface for getting a single tag. + alias [] get_tag + # Return the metric with the given key, nil if it doesn't exist. def get_metric(key) metrics[key] || meta[key] From 399abeddd446d08c55fe47edf3098f912fc81f08 Mon Sep 17 00:00:00 2001 From: Alex Robbin Date: Fri, 10 Jun 2022 09:58:37 -0400 Subject: [PATCH 0110/2133] teach Rest Client integration the `:split_by_domain` option --- docs/GettingStarted.md | 1 + .../contrib/rest_client/configuration/settings.rb | 1 + .../tracing/contrib/rest_client/request_patch.rb | 2 +- .../contrib/rest_client/request_patch_spec.rb | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index b8b161b82dc..9087c2324e7 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1780,6 +1780,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | --- | ----------- | ------- | | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` | | `service_name` | Service name for `rest_client` instrumentation. | `'rest_client'` | +| `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` | ### RSpec diff --git a/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb b/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb index 4e8d2eb1fb2..d3e497f05ad 100644 --- a/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb @@ -28,6 +28,7 @@ class Settings < Contrib::Configuration::Settings option :distributed_tracing, default: true option :service_name, default: Ext::DEFAULT_PEER_SERVICE_NAME + option :split_by_domain, default: false end end end diff --git a/lib/datadog/tracing/contrib/rest_client/request_patch.rb b/lib/datadog/tracing/contrib/rest_client/request_patch.rb index 9f95a02d585..6878a339f05 100644 --- a/lib/datadog/tracing/contrib/rest_client/request_patch.rb +++ b/lib/datadog/tracing/contrib/rest_client/request_patch.rb @@ -54,7 +54,7 @@ def datadog_tag_request(uri, span) def datadog_trace_request(uri) span = Tracing.trace( Ext::SPAN_REQUEST, - service: datadog_configuration[:service_name], + service: datadog_configuration[:split_by_domain] ? uri.host : datadog_configuration[:service_name], span_type: Tracing::Metadata::Ext::HTTP::TYPE_OUTBOUND ) diff --git a/spec/datadog/tracing/contrib/rest_client/request_patch_spec.rb b/spec/datadog/tracing/contrib/rest_client/request_patch_spec.rb index cb9b75f1bd1..361f5244e81 100644 --- a/spec/datadog/tracing/contrib/rest_client/request_patch_spec.rb +++ b/spec/datadog/tracing/contrib/rest_client/request_patch_spec.rb @@ -306,5 +306,19 @@ end end end + + context 'when split by domain' do + let(:configuration_options) { super().merge(split_by_domain: true) } + + before { request } + + it 'has correct service name' do + expect(span.service).to eq('example.com') + end + + it_behaves_like 'a peer service span' do + let(:peer_hostname) { 'example.com' } + end + end end end From 398cdae7c0b8a894850dccbb745117eb140c0d02 Mon Sep 17 00:00:00 2001 From: Kieran Pilkington Date: Mon, 13 Jun 2022 10:19:12 +1200 Subject: [PATCH 0111/2133] Allow passing request_queuing option to Rack through Rails tracer --- docs/GettingStarted.md | 1 + lib/datadog/tracing/contrib/rails/configuration/settings.rb | 3 +++ lib/datadog/tracing/contrib/rails/framework.rb | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index b8b161b82dc..790d7bfa08d 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1579,6 +1579,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | `cache_service` | Cache service name used when tracing cache activity | `'-cache'` | | `database_service` | Database service name used when tracing database activity | `'-'` | | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` | +| `request_queuing` | Track HTTP request time spent in the queue of the frontend server. See [HTTP request queuing](#http-request-queuing) for setup details. Set to `true` to enable. | `false` | | `exception_controller` | Class or Module which identifies a custom exception controller class. Tracer provides improved error behavior when it can identify custom exception controllers. By default, without this option, it 'guesses' what a custom exception controller looks like. Providing this option aids this identification. | `nil` | | `middleware` | Add the trace middleware to the Rails application. Set to `false` if you don't want the middleware to load. | `true` | | `middleware_names` | Enables any short-circuited middleware requests to display the middleware name as a resource for the trace. | `false` | diff --git a/lib/datadog/tracing/contrib/rails/configuration/settings.rb b/lib/datadog/tracing/contrib/rails/configuration/settings.rb index ed674454261..7695ff49513 100644 --- a/lib/datadog/tracing/contrib/rails/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rails/configuration/settings.rb @@ -47,6 +47,9 @@ def initialize(options = {}) end option :distributed_tracing, default: true + + option :request_queuing, default: false + option :exception_controller do |o| o.on_set do |value| # Update ActionPack exception controller too diff --git a/lib/datadog/tracing/contrib/rails/framework.rb b/lib/datadog/tracing/contrib/rails/framework.rb index 06fa3237617..7ba2fbea921 100644 --- a/lib/datadog/tracing/contrib/rails/framework.rb +++ b/lib/datadog/tracing/contrib/rails/framework.rb @@ -68,7 +68,8 @@ def self.activate_rack!(datadog_config, rails_config) application: ::Rails.application, service_name: rails_config[:service_name], middleware_names: rails_config[:middleware_names], - distributed_tracing: rails_config[:distributed_tracing] + distributed_tracing: rails_config[:distributed_tracing], + request_queuing: rails_config[:request_queuing] ) end From cd8dc6d2ee88e5c8c737f6d1d8310e2de5f61d47 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 16 Jun 2022 17:08:59 -0400 Subject: [PATCH 0112/2133] Github: Add issue templates (#2090) --- .github/ISSUE_TEMPLATE/bug_report.md | 26 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 8 +++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..ecbf4b0982a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: File a bug report +title: '' +labels: community, bug +assignees: '' + +--- + +**Current behaviour** + + +**Expected behaviour** + + +**Steps to reproduce** + + +**Environment** + +* **ddtrace version:** +* **Configuration block (`Datadog.configure ...`):** +* **Ruby version:** +* **Operating system:** +* **Relevant library versions:** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..0004be6fa93 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,8 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: community, feature-request +assignees: '' + +--- From 615a2ce708cb56781718194b9cb2febd20a606f7 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 2 Jun 2022 18:00:32 -0700 Subject: [PATCH 0113/2133] [Single Span Sampling] Add single span sampling rule --- lib/datadog/tracing/sampling/span/ext.rb | 24 ++++++ lib/datadog/tracing/sampling/span/rule.rb | 63 +++++++++++++++ .../tracing/sampling/span/rule_spec.rb | 79 +++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 lib/datadog/tracing/sampling/span/ext.rb create mode 100644 lib/datadog/tracing/sampling/span/rule.rb create mode 100644 spec/datadog/tracing/sampling/span/rule_spec.rb diff --git a/lib/datadog/tracing/sampling/span/ext.rb b/lib/datadog/tracing/sampling/span/ext.rb new file mode 100644 index 00000000000..d6236d15587 --- /dev/null +++ b/lib/datadog/tracing/sampling/span/ext.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Datadog + module Tracing + module Sampling + module Span + # Checks if a span conforms to a matching criteria. + class Ext + # Sampling decision method used to come to the sampling decision for this span + TAG_MECHANISM = '_dd.span_sampling.mechanism' + # Sampling rate applied to this span + TAG_RULE_RATE = '_dd.span_sampling.rule_rate' + # Effective sampling ratio for the rate limiter configured for this span + # @see Datadog::Tracing::Sampling::TokenBucket#effective_rate + TAG_LIMIT_RATE = '_dd.span_sampling.limit_rate' + + # This span was sampled on account of a Span Sampling Rule + # @see Datadog::Tracing::Sampling::Span::Rule + MECHANISM_SPAN_SAMPLING_RATE = 8 + end + end + end + end +end diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb new file mode 100644 index 00000000000..549bcb139f6 --- /dev/null +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +require 'datadog/tracing/sampling/span/ext' + +module Datadog + module Tracing + module Sampling + module Span + # Span sampling rule that applies a sampling rate if the span + # matches the provided {Matcher}. + # Additionally, a rate limiter is also applied. + # + # If a span does not conform to the matcher, no changes are made. + class Rule + # Creates a new span sampling rule. + # + # @param [Sampling::Span::Matcher] matcher whether this rule applies to a specific span + # @param [Float] sampling_rate span sampling ratio, between 0.0 (0%) and 1.0 (100%). + # @param [Numeric] rate_limit maximum number of spans sampled per second. Negative numbers mean unlimited spans. + def initialize(matcher, sampling_rate, rate_limit) + @matcher = matcher + @sampling_rate = sampling_rate + @rate_limit = rate_limit + + @sampler = Sampling::RateSampler.new + @sampler.sample_rate = sampling_rate + @rate_limiter = Sampling::TokenBucket.new(rate_limit) + end + + # This method should only be invoked for spans that are part + # of a trace that has been dropped by trace-level sampling. + # Invoking it for other spans will cause incorrect sampling + # metrics to be reported by the Datadog App. + # + # Returns `true` if the provided span is sampled. + # If the span is dropped due to sampling rate or rate limiting, + # it returns `false`. + # + # Returns `nil` if the span did not meet the matching criteria by the + # provided matcher. + # + # This method modifies the `span` if it matches the provided matcher. + # + # @param [Datadog::Tracing::SpanOperation] span_op span to be sampled + # @return [Boolean] should this span be sampled? + # @return [nil] span did not satisfy the matcher, no changes are made to the span + def sample!(span_op) + return nil unless @matcher.match?(span_op) + + if @sampler.sample?(span_op) && @rate_limiter.allow?(1) + span_op.set_metric(Span::Ext::TAG_MECHANISM, Span::Ext::MECHANISM_SPAN_SAMPLING_RATE) + span_op.set_metric(Span::Ext::TAG_RULE_RATE, @sampling_rate) + span_op.set_metric(Span::Ext::TAG_LIMIT_RATE, @rate_limiter.effective_rate) + true + else + false + end + end + end + end + end + end +end diff --git a/spec/datadog/tracing/sampling/span/rule_spec.rb b/spec/datadog/tracing/sampling/span/rule_spec.rb new file mode 100644 index 00000000000..ce62f28d29b --- /dev/null +++ b/spec/datadog/tracing/sampling/span/rule_spec.rb @@ -0,0 +1,79 @@ +require 'datadog/tracing/sampling/span/matcher' +require 'datadog/tracing/sampling/span/rule' + +RSpec.describe Datadog::Tracing::Sampling::Span::Rule do + subject(:rule) { described_class.new(matcher, sampling_rate, rate_limit) } + let(:matcher) { instance_double(Datadog::Tracing::Sampling::Span::Matcher) } + let(:sampling_rate) { 0.0 } + let(:rate_limit) { 0 } + + let(:span_op) { Datadog::Tracing::SpanOperation.new(span_name, service: span_service) } + let(:span_name) { 'operation.name' } + let(:span_service) { '' } + + describe '#sample!' do + subject(:sample!) { rule.sample!(span_op) } + + shared_examples 'does not modify span' do + it { expect { sample! }.to_not(change { span_op.send(:build_span).to_hash }) } + end + + context 'when matching' do + before do + expect(matcher).to receive(:match?).with(span_op).and_return(true) + end + + context 'not sampled' do + let(:sampling_rate) { 0.0 } + + it 'returns false' do + is_expected.to eq(false) + end + + it_behaves_like 'does not modify span' + end + + context 'sampled' do + let(:sampling_rate) { 1.0 } + + context 'rate limited' do + let(:rate_limit) { 0 } + + it 'returns false' do + is_expected.to eq(false) + end + + it_behaves_like 'does not modify span' + end + + context 'not rate limited' do + let(:rate_limit) { 10 } + + it 'returns true' do + is_expected.to eq(true) + end + + it 'sets mechanism, rule rate and rate limit metrics' do + sample! + + expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) + expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) + expect(span_op.get_metric('_dd.span_sampling.limit_rate')).to eq(1.0) + end + end + end + end + + context 'when not matching' do + before do + expect(matcher).to receive(:match?).with(span_op).and_return(false) + end + + it 'returns nil' do + is_expected.to be_nil + end + + it_behaves_like 'does not modify span' + end + end +end From 61c7e022d95ec5700736f79c2228adfc7cd27aeb Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 09:29:18 -0700 Subject: [PATCH 0114/2133] Update max_per_second tag due to RFC change --- lib/datadog/tracing/sampling/span/ext.rb | 7 +++---- lib/datadog/tracing/sampling/span/rule.rb | 2 +- spec/datadog/tracing/sampling/span/rule_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/ext.rb b/lib/datadog/tracing/sampling/span/ext.rb index d6236d15587..a1814c1e08d 100644 --- a/lib/datadog/tracing/sampling/span/ext.rb +++ b/lib/datadog/tracing/sampling/span/ext.rb @@ -8,11 +8,10 @@ module Span class Ext # Sampling decision method used to come to the sampling decision for this span TAG_MECHANISM = '_dd.span_sampling.mechanism' - # Sampling rate applied to this span + # Sampling rate applied to this span, if a rule applies TAG_RULE_RATE = '_dd.span_sampling.rule_rate' - # Effective sampling ratio for the rate limiter configured for this span - # @see Datadog::Tracing::Sampling::TokenBucket#effective_rate - TAG_LIMIT_RATE = '_dd.span_sampling.limit_rate' + # Rate limit configured for this span, if a rule applies + TAG_MAX_PER_SECOND = '_dd.span_sampling.max_per_second' # This span was sampled on account of a Span Sampling Rule # @see Datadog::Tracing::Sampling::Span::Rule diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index 549bcb139f6..597d18bf6d0 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -50,7 +50,7 @@ def sample!(span_op) if @sampler.sample?(span_op) && @rate_limiter.allow?(1) span_op.set_metric(Span::Ext::TAG_MECHANISM, Span::Ext::MECHANISM_SPAN_SAMPLING_RATE) span_op.set_metric(Span::Ext::TAG_RULE_RATE, @sampling_rate) - span_op.set_metric(Span::Ext::TAG_LIMIT_RATE, @rate_limiter.effective_rate) + span_op.set_metric(Span::Ext::TAG_MAX_PER_SECOND, @rate_limit) true else false diff --git a/spec/datadog/tracing/sampling/span/rule_spec.rb b/spec/datadog/tracing/sampling/span/rule_spec.rb index ce62f28d29b..4d8441df0c3 100644 --- a/spec/datadog/tracing/sampling/span/rule_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_spec.rb @@ -47,7 +47,7 @@ end context 'not rate limited' do - let(:rate_limit) { 10 } + let(:rate_limit) { 3 } it 'returns true' do is_expected.to eq(true) @@ -58,7 +58,7 @@ expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) - expect(span_op.get_metric('_dd.span_sampling.limit_rate')).to eq(1.0) + expect(span_op.get_metric('_dd.span_sampling.max_per_second')).to eq(3) end end end From 82821e8c3c735b57a8840c81d0dfe98e3c3e7d54 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 13:11:25 -0700 Subject: [PATCH 0115/2133] Add default values --- lib/datadog/tracing/sampling/span/ext.rb | 6 ++++++ lib/datadog/tracing/sampling/span/rule.rb | 9 ++++++++- spec/datadog/tracing/sampling/span/rule_spec.rb | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/ext.rb b/lib/datadog/tracing/sampling/span/ext.rb index a1814c1e08d..c8b416e6232 100644 --- a/lib/datadog/tracing/sampling/span/ext.rb +++ b/lib/datadog/tracing/sampling/span/ext.rb @@ -6,6 +6,12 @@ module Sampling module Span # Checks if a span conforms to a matching criteria. class Ext + # Accept all spans (100% retention). + DEFAULT_SAMPLE_RATE = 1.0 + # Unlimited. + # @see Datadog::Tracing::Sampling::TokenBucket + DEFAULT_MAX_PER_SECOND = -1 + # Sampling decision method used to come to the sampling decision for this span TAG_MECHANISM = '_dd.span_sampling.mechanism' # Sampling rate applied to this span, if a rule applies diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index 597d18bf6d0..c3c024cdbc4 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -12,12 +12,19 @@ module Span # # If a span does not conform to the matcher, no changes are made. class Rule + attr_reader :matcher, :sampling_rate, :rate_limit + # Creates a new span sampling rule. # # @param [Sampling::Span::Matcher] matcher whether this rule applies to a specific span # @param [Float] sampling_rate span sampling ratio, between 0.0 (0%) and 1.0 (100%). # @param [Numeric] rate_limit maximum number of spans sampled per second. Negative numbers mean unlimited spans. - def initialize(matcher, sampling_rate, rate_limit) + def initialize( + matcher, + sampling_rate: Span::Ext::DEFAULT_SAMPLE_RATE, + rate_limit: Span::Ext::DEFAULT_MAX_PER_SECOND + ) + @matcher = matcher @sampling_rate = sampling_rate @rate_limit = rate_limit diff --git a/spec/datadog/tracing/sampling/span/rule_spec.rb b/spec/datadog/tracing/sampling/span/rule_spec.rb index 4d8441df0c3..a9138ceef5b 100644 --- a/spec/datadog/tracing/sampling/span/rule_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_spec.rb @@ -2,7 +2,7 @@ require 'datadog/tracing/sampling/span/rule' RSpec.describe Datadog::Tracing::Sampling::Span::Rule do - subject(:rule) { described_class.new(matcher, sampling_rate, rate_limit) } + subject(:rule) { described_class.new(matcher, sampling_rate: sampling_rate, rate_limit: rate_limit) } let(:matcher) { instance_double(Datadog::Tracing::Sampling::Span::Matcher) } let(:sampling_rate) { 0.0 } let(:rate_limit) { 0 } @@ -11,6 +11,19 @@ let(:span_name) { 'operation.name' } let(:span_service) { '' } + describe '#initialize' do + subject(:rule) { described_class.new(matcher) } + context 'default values' do + it 'sets sampling rate to 100%' do + expect(rule.sampling_rate).to eq(1.0) + end + + it 'sets rate limit unlimited' do + expect(rule.rate_limit).to eq(-1) + end + end + end + describe '#sample!' do subject(:sample!) { rule.sample!(span_op) } From 8cf2479d65fd6d1637c0ae48081834401c866edb Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 13:15:59 -0700 Subject: [PATCH 0116/2133] Sample is better than Sampling --- lib/datadog/tracing/sampling/span/rule.rb | 12 ++++++------ spec/datadog/tracing/sampling/span/rule_spec.rb | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index c3c024cdbc4..efc2b216a00 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -12,25 +12,25 @@ module Span # # If a span does not conform to the matcher, no changes are made. class Rule - attr_reader :matcher, :sampling_rate, :rate_limit + attr_reader :matcher, :sample_rate, :rate_limit # Creates a new span sampling rule. # # @param [Sampling::Span::Matcher] matcher whether this rule applies to a specific span - # @param [Float] sampling_rate span sampling ratio, between 0.0 (0%) and 1.0 (100%). + # @param [Float] sample_rate span sampling ratio, between 0.0 (0%) and 1.0 (100%). # @param [Numeric] rate_limit maximum number of spans sampled per second. Negative numbers mean unlimited spans. def initialize( matcher, - sampling_rate: Span::Ext::DEFAULT_SAMPLE_RATE, + sample_rate: Span::Ext::DEFAULT_SAMPLE_RATE, rate_limit: Span::Ext::DEFAULT_MAX_PER_SECOND ) @matcher = matcher - @sampling_rate = sampling_rate + @sample_rate = sample_rate @rate_limit = rate_limit @sampler = Sampling::RateSampler.new - @sampler.sample_rate = sampling_rate + @sampler.sample_rate = sample_rate @rate_limiter = Sampling::TokenBucket.new(rate_limit) end @@ -56,7 +56,7 @@ def sample!(span_op) if @sampler.sample?(span_op) && @rate_limiter.allow?(1) span_op.set_metric(Span::Ext::TAG_MECHANISM, Span::Ext::MECHANISM_SPAN_SAMPLING_RATE) - span_op.set_metric(Span::Ext::TAG_RULE_RATE, @sampling_rate) + span_op.set_metric(Span::Ext::TAG_RULE_RATE, @sample_rate) span_op.set_metric(Span::Ext::TAG_MAX_PER_SECOND, @rate_limit) true else diff --git a/spec/datadog/tracing/sampling/span/rule_spec.rb b/spec/datadog/tracing/sampling/span/rule_spec.rb index a9138ceef5b..fb3672b5125 100644 --- a/spec/datadog/tracing/sampling/span/rule_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_spec.rb @@ -2,9 +2,9 @@ require 'datadog/tracing/sampling/span/rule' RSpec.describe Datadog::Tracing::Sampling::Span::Rule do - subject(:rule) { described_class.new(matcher, sampling_rate: sampling_rate, rate_limit: rate_limit) } + subject(:rule) { described_class.new(matcher, sample_rate: sample_rate, rate_limit: rate_limit) } let(:matcher) { instance_double(Datadog::Tracing::Sampling::Span::Matcher) } - let(:sampling_rate) { 0.0 } + let(:sample_rate) { 0.0 } let(:rate_limit) { 0 } let(:span_op) { Datadog::Tracing::SpanOperation.new(span_name, service: span_service) } @@ -15,7 +15,7 @@ subject(:rule) { described_class.new(matcher) } context 'default values' do it 'sets sampling rate to 100%' do - expect(rule.sampling_rate).to eq(1.0) + expect(rule.sample_rate).to eq(1.0) end it 'sets rate limit unlimited' do @@ -37,7 +37,7 @@ end context 'not sampled' do - let(:sampling_rate) { 0.0 } + let(:sample_rate) { 0.0 } it 'returns false' do is_expected.to eq(false) @@ -47,7 +47,7 @@ end context 'sampled' do - let(:sampling_rate) { 1.0 } + let(:sample_rate) { 1.0 } context 'rate limited' do let(:rate_limit) { 0 } From bf7815507d0c5ccacb3fd2e1853750946e130446 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 15:07:08 -0700 Subject: [PATCH 0117/2133] Fix object_id usage as thread local key --- .../opentracer/thread_local_scope_manager.rb | 27 ++++++++++++++++--- lib/datadog/tracing/context_provider.rb | 15 ++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/lib/datadog/opentracer/thread_local_scope_manager.rb b/lib/datadog/opentracer/thread_local_scope_manager.rb index 4c57992004b..8beb71c5cb7 100644 --- a/lib/datadog/opentracer/thread_local_scope_manager.rb +++ b/lib/datadog/opentracer/thread_local_scope_manager.rb @@ -1,10 +1,19 @@ -# typed: true +# typed: false + +require 'datadog/core/utils/sequence' module Datadog module OpenTracer # OpenTracing adapter for thread local scope management # @public_api class ThreadLocalScopeManager < ScopeManager + def initialize(*args, &block) + super(*args, &block) + @thread_key = "dd_opentracer_context_#{ThreadLocalScopeManager.next_instance_id}".to_sym + end + + ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true) + # Make a span instance active. # # @param span [Span] the Span that should become active @@ -30,13 +39,25 @@ def activate(span, finish_on_close: true) # (as Reference#CHILD_OF) of any newly-created Span at Tracer#start_active_span # or Tracer#start_span time. def active - Thread.current[object_id.to_s] + Thread.current[@thread_key] + end + + # Ensure two instances of {FiberLocalContext} do not conflict. + # We previously used {FiberLocalContext#object_id} to ensure uniqueness + # but the VM is allowed to reuse `object_id`, allow for the possibility that + # a new FiberLocalContext would be able to read an old FiberLocalContext's + # value. + @mutex = Mutex.new + @unique_instance_id = Datadog::Core::Utils::Sequence.new + + def self.next_instance_id + @mutex.synchronize { @unique_instance_id.next } end private def set_scope(scope) - Thread.current[object_id.to_s] = scope + Thread.current[@thread_key] = scope end end end diff --git a/lib/datadog/tracing/context_provider.rb b/lib/datadog/tracing/context_provider.rb index 915944e998a..8169e310a5f 100644 --- a/lib/datadog/tracing/context_provider.rb +++ b/lib/datadog/tracing/context_provider.rb @@ -1,5 +1,6 @@ # typed: true +require 'datadog/core/utils/sequence' require 'datadog/tracing/context' module Datadog @@ -47,7 +48,7 @@ class FiberLocalContext # To support multiple tracers simultaneously, each {Datadog::Tracing::FiberLocalContext} # instance has its own fiber-local variable. def initialize - @key = "datadog_context_#{object_id}".to_sym + @key = "datadog_context_#{FiberLocalContext.next_instance_id}".to_sym self.local = Context.new end @@ -61,6 +62,18 @@ def local=(ctx) def local(storage = Thread.current) storage[@key] ||= Context.new end + + # Ensure two instances of {FiberLocalContext} do not conflict. + # We previously used {FiberLocalContext#object_id} to ensure uniqueness + # but the VM is allowed to reuse `object_id`, allow for the possibility that + # a new FiberLocalContext would be able to read an old FiberLocalContext's + # value. + @mutex = Mutex.new + @unique_instance_id = Datadog::Core::Utils::Sequence.new + + def self.next_instance_id + @mutex.synchronize { @unique_instance_id.next } + end end end end From e90cdf32dd30aa5b2a3a971a836a529beeb6984e Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Mon, 20 Jun 2022 17:45:06 -0400 Subject: [PATCH 0118/2133] Add Utility to Collect Platform Information (#2097) * Add host information utility * fixup! Add host information utility * Rename file to platform * fixup! Rename file to platform * Require etc in file --- lib/datadog/core/environment/platform.rb | 40 +++++++++++++ .../datadog/core/environment/platform_spec.rb | 57 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 lib/datadog/core/environment/platform.rb create mode 100644 spec/datadog/core/environment/platform_spec.rb diff --git a/lib/datadog/core/environment/platform.rb b/lib/datadog/core/environment/platform.rb new file mode 100644 index 00000000000..96c91ebd96a --- /dev/null +++ b/lib/datadog/core/environment/platform.rb @@ -0,0 +1,40 @@ +# typed: false + +require 'etc' + +require 'datadog/core/environment/identity' + +module Datadog + module Core + module Environment + # For gathering information about the platform + module Platform + module_function + + # @return [String] name of host; `uname -n` + def hostname + Identity.lang_version >= '2.2' ? Etc.uname[:nodename] : nil + end + + # @return [String] name of kernel; `uname -s` + def kernel_name + Identity.lang_version >= '2.2' ? Etc.uname[:sysname] : Gem::Platform.local.os.capitalize + end + + # @return [String] kernel release; `uname -r` + def kernel_release + if Identity.lang_engine == 'jruby' + Etc.uname[:version] # Java's `os.version` maps to `uname -r` + elsif Identity.lang_version >= '2.2' + Etc.uname[:release] + end + end + + # @return [String] kernel version; `uname -v` + def kernel_version + Etc.uname[:version] if Identity.lang_engine != 'jruby' && Identity.lang_version >= '2.2' + end + end + end + end +end diff --git a/spec/datadog/core/environment/platform_spec.rb b/spec/datadog/core/environment/platform_spec.rb new file mode 100644 index 00000000000..aac21aaf963 --- /dev/null +++ b/spec/datadog/core/environment/platform_spec.rb @@ -0,0 +1,57 @@ +# typed: false + +require 'spec_helper' +require 'datadog/core/environment/platform' + +RSpec.describe Datadog::Core::Environment::Platform do + describe '::hostname' do + subject(:hostname) { described_class.hostname } + + context 'when Ruby version < 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION < '2.2' do + it { is_expected.to be_nil } + end + + context 'when Ruby version >= 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION >= '2.2' do + it { is_expected.to be_a_kind_of(String) } + it { is_expected.to eql(`uname -n`.strip) } + end + end + + describe '::kernel_name' do + subject(:kernel_name) { described_class.kernel_name } + it { is_expected.to be_a_kind_of(String) } + it { is_expected.to eql(`uname -s`.strip) } + end + + describe '::kernel_release' do + subject(:kernel_release) { described_class.kernel_release } + + context 'when Ruby version < 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION < '2.2' do + it { is_expected.to be_nil } + end + + context 'when Ruby version >= 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION >= '2.2' do + it { is_expected.to be_a_kind_of(String) } + it { is_expected.to eql(`uname -r`.strip) } + end + end + + describe '::kernel_version' do + subject(:kernel_version) { described_class.kernel_version } + + context 'when using JRuby', if: Datadog::Core::Environment::Ext::RUBY_ENGINE == 'jruby' do + it { is_expected.to be_nil } + end + + context 'when not using JRuby', unless: Datadog::Core::Environment::Ext::RUBY_ENGINE == 'jruby' do + context 'when Ruby version < 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION < '2.2' do + it { is_expected.to be_nil } + end + + context 'when Ruby version >= 2.2', if: Datadog::Core::Environment::Ext::LANG_VERSION >= '2.2' do + it { is_expected.to be_a_kind_of(String) } + it { is_expected.to eql(`uname -v`.strip) } + end + end + end +end From 07218cba78ebe36488f0f4eb9ecfae8813bab6fe Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 21 Jun 2022 15:44:45 -0700 Subject: [PATCH 0119/2133] Test:Remove left over from Span#allocations removal (#2099) --- spec/datadog/tracing/tracer_spec.rb | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/spec/datadog/tracing/tracer_spec.rb b/spec/datadog/tracing/tracer_spec.rb index 5c2b21a1c03..3739b8e0704 100644 --- a/spec/datadog/tracing/tracer_spec.rb +++ b/spec/datadog/tracing/tracer_spec.rb @@ -194,25 +194,6 @@ expect(span.name).to eq(name) end - it 'tracks the number of allocations made in the span' do - skip 'Test unstable; improve stability before re-enabling.' - - # Create and discard first trace. - # When warming up, it might have more allocations than subsequent traces. - tracer.trace(name) {} - writer.spans - - # Then create traces to compare - tracer.trace(name) {} - tracer.trace(name) { Object.new } - - first, second = writer.spans - - # Different versions of Ruby will allocate a different number of - # objects, so this is what works across the board. - expect(second.allocations).to eq(first.allocations + 1) - end - context 'with diagnostics debug enabled' do include_context 'tracer logging' From 265fa48a736527241265c07a768f9883679eed30 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 21 Jun 2022 15:51:32 -0700 Subject: [PATCH 0120/2133] CI: Increase build and test jobs to medium+ (#2063) * CI: Increase build and test jobs to medium+ * Reduce to small for small jobs --- .circleci/config.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d89902921ee..ab3ab6c5280 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -407,6 +407,7 @@ jobs: - environment: *container_base_environment image: ivoanjo/docker-library:ddtrace_rb_2_5_9 + resource_class: small steps: - checkout - run: @@ -428,6 +429,7 @@ jobs: - environment: *container_base_environment image: ivoanjo/docker-library:ddtrace_rb_2_5_9 + resource_class: small steps: - run: name: Check if this commit author has publishing credentials @@ -466,42 +468,55 @@ job_configuration: <<: *filters_all_branches_and_tags ruby_version: '2.1' image: ivoanjo/docker-library:ddtrace_rb_2_1_10 + resource_class_to_use: medium+ - &config-2_2 <<: *filters_all_branches_and_tags ruby_version: '2.2' image: ivoanjo/docker-library:ddtrace_rb_2_2_10 + resource_class_to_use: medium+ - &config-2_3 <<: *filters_all_branches_and_tags ruby_version: '2.3' image: ivoanjo/docker-library:ddtrace_rb_2_3_8 + resource_class_to_use: medium+ - &config-2_4 <<: *filters_all_branches_and_tags ruby_version: '2.4' image: ivoanjo/docker-library:ddtrace_rb_2_4_10 + resource_class_to_use: medium+ - &config-2_5 <<: *filters_all_branches_and_tags ruby_version: '2.5' image: ivoanjo/docker-library:ddtrace_rb_2_5_9 + resource_class_to_use: medium+ - &config-2_6 <<: *filters_all_branches_and_tags ruby_version: '2.6' image: ivoanjo/docker-library:ddtrace_rb_2_6_7 + resource_class_to_use: medium+ - &config-2_7 <<: *filters_all_branches_and_tags ruby_version: '2.7' image: ivoanjo/docker-library:ddtrace_rb_2_7_3 + resource_class_to_use: medium+ + - &config-2_7-small + <<: *config-2_7 + resource_class_to_use: small - &config-3_0 <<: *filters_all_branches_and_tags ruby_version: '3.0' image: ivoanjo/docker-library:ddtrace_rb_3_0_3 + resource_class_to_use: medium+ - &config-3_1 <<: *filters_all_branches_and_tags ruby_version: '3.1' image: ivoanjo/docker-library:ddtrace_rb_3_1_1 + resource_class_to_use: medium+ - &config-3_2 <<: *filters_all_branches_and_tags ruby_version: '3.2' image: ivoanjo/docker-library:ddtrace_rb_3_2_0_preview1 + resource_class_to_use: medium+ # ADD NEW RUBIES HERE - &config-jruby-9_2_8_0 # Test with older 9.2 release because 9.2.9.0 changed behavior, see https://github.com/DataDog/dd-trace-rb/pull/1409 <<: *filters_all_branches_and_tags @@ -529,17 +544,17 @@ workflows: build-and-test: jobs: - orb/lint: - <<: *config-2_6 + <<: *config-2_7-small name: lint requires: - - build-2.6 + - build-2.7 - orb/sorbet_type_checker: - <<: *config-2_6 + <<: *config-2_7-small name: sorbet_type_checker requires: - - build-2.6 + - build-2.7 - orb/coverage: - <<: *config-2_7 + <<: *config-2_7-small name: coverage requires: - test-2.1 @@ -559,7 +574,7 @@ workflows: - test-jruby-9.3-latest # soon™️ - test-truffleruby-21.0.0 - orb/changelog: - <<: *config-2_7 + <<: *config-2_7-small name: changelog requires: - build-2.7 From a0f24af327386fe6efc8956ac5c32beb5acfdfa3 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 24 Jun 2022 14:00:58 +0200 Subject: [PATCH 0121/2133] Remove obsolete shared_context --- spec/datadog/tracing/tracer_spec.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/spec/datadog/tracing/tracer_spec.rb b/spec/datadog/tracing/tracer_spec.rb index 3739b8e0704..9711b891126 100644 --- a/spec/datadog/tracing/tracer_spec.rb +++ b/spec/datadog/tracing/tracer_spec.rb @@ -26,13 +26,6 @@ after { tracer.shutdown! } - shared_context 'parent span' do - let(:parent_span) { tracer.start_span('parent', service: service) } - let(:service) { 'test-service' } - let(:trace_id) { parent_span.trace_id } - let(:span_id) { parent_span.span_id } - end - describe '::new' do context 'given :trace_flush' do let(:tracer_options) { super().merge(trace_flush: trace_flush) } From 6c34c9bc81f4a32ba6f623cb24551068d18b370a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 27 Jun 2022 17:35:48 +0100 Subject: [PATCH 0122/2133] Tweaks to GitHub issue templates I'd like to thank @marcotc for adding the issue templates in #2090! Here's a few more tweaks inspired from the [issue templates](https://github.com/DataDog/libdatadog/tree/main/.github/ISSUE_TEMPLATE) we have for `libdatadog`. For the bug report template: * Mention log messages and screenshots in "steps to reproduce" suggestions * Add a "How does ddtrace help you" section. This helps us to know more about the customer's use case, and also gives some space for customers to hopefully tell us what we're doing well For the feature request template: * Add a few sections to guide the feature request. --- .github/ISSUE_TEMPLATE/bug_report.md | 9 +++++++-- .github/ISSUE_TEMPLATE/feature_request.md | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ecbf4b0982a..3ad5383a752 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -14,8 +14,13 @@ assignees: '' **Steps to reproduce** - + + +**How does `ddtrace` help you?** + **Environment** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 0004be6fa93..22e472d84d0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -6,3 +6,18 @@ labels: community, feature-request assignees: '' --- + +**Is your feature request related to a problem? Please describe.** + + +**Describe the goal of the feature** + + +**Describe alternatives you've considered** + + +**Additional context** + + +**How does `ddtrace` help you?** + From d846b4d655ecf35a9f2ad7d0abb0485e7608b8ef Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 27 Jun 2022 17:46:38 +0100 Subject: [PATCH 0123/2133] Add GitHub pull request template Inspired by #2090 where we added templates for issues, I've decided to add a pull request template as well. I took this from where it has been serving us well, and all feedback is welcome :) --- .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..7f06699e697 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +**What does this PR do?** + + +**Motivation** + + +**Additional Notes** + + +**How to test the change?** + From 4c9e812436c3f3fb1e6becd64a56201814778d67 Mon Sep 17 00:00:00 2001 From: Jennifer Chen Date: Mon, 27 Jun 2022 13:10:47 -0400 Subject: [PATCH 0124/2133] Change to Gemspec/DeprecatedAttributeAssignment --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index ce061f0046f..0bbb27fd642 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -108,7 +108,7 @@ Style/CaseEquality: # New cops since Rubocop 1.0. # We have to explicitly opt-in for new cops to apply # before the next major release. -Gemspec/DateAssignment: # (new in 1.10) +Gemspec/DeprecatedAttributeAssignment: # (Gemspec/DateAssignment integrated in 1.31.0) Enabled: true Layout/SpaceBeforeBrackets: # (new in 1.7) Enabled: true From 8e382141e2b7bf6879bb3cbab7c1963917c591c0 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Fri, 24 Jun 2022 14:55:09 -0300 Subject: [PATCH 0125/2133] feat: move datadog grpc metadata injection to it's own class why? this will allow us to extend the behavior of injection and extraction already present in HTTP. --- .../tracing/distributed/metadata/datadog.rb | 84 ++++++++ lib/datadog/tracing/propagation/grpc.rb | 115 ++++++----- .../distributed/metadata/datadog_spec.rb | 194 ++++++++++++++++++ 3 files changed, 339 insertions(+), 54 deletions(-) create mode 100755 lib/datadog/tracing/distributed/metadata/datadog.rb create mode 100644 spec/datadog/tracing/distributed/metadata/datadog_spec.rb diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb new file mode 100755 index 00000000000..09b4073a59f --- /dev/null +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -0,0 +1,84 @@ +require 'datadog/tracing/distributed/headers/ext' + +module Datadog + module Tracing + module Distributed + module Metadata + class Datadog + include Distributed::Headers::Ext + + def self.inject!(digest, metadata) + return if digest.nil? + + metadata[GRPC_METADATA_TRACE_ID] = digest.trace_id.to_s + metadata[GRPC_METADATA_PARENT_ID] = digest.span_id.to_s + if digest.trace_sampling_priority + metadata[GRPC_METADATA_SAMPLING_PRIORITY] = + digest.trace_sampling_priority.to_s + end + metadata[GRPC_METADATA_ORIGIN] = digest.trace_origin.to_s if digest.trace_origin + + metadata + end + + def self.extract(metadata) + carrier = Carrier.new(metadata) + + return nil unless carrier.valid? + + TraceDigest.new( + span_id: carrier.parent_id, + trace_id: carrier.trace_id, + trace_origin: carrier.origin, + trace_sampling_priority: carrier.sampling_priority + ) + end + + class Carrier + include Distributed::Headers::Ext + + def initialize(metadata = {}) + @metadata = metadata || {} + end + + def valid? + (trace_id && parent_id) || (origin && trace_id) + end + + def trace_id + value = metadata_for_key(GRPC_METADATA_TRACE_ID).to_i + value if (1..Span::EXTERNAL_MAX_ID).cover? value + end + + def parent_id + value = metadata_for_key(GRPC_METADATA_PARENT_ID).to_i + value if (1..Span::EXTERNAL_MAX_ID).cover? value + end + + def sampling_priority + value = metadata_for_key(GRPC_METADATA_SAMPLING_PRIORITY) + value && value.to_i + end + + def origin + value = metadata_for_key(GRPC_METADATA_ORIGIN) + value if value != '' + end + + private + + def metadata_for_key(key) + # metadata values can be arrays (multiple headers with the same key) + value = @metadata[key] + if value.is_a?(Array) + value.first + else + value + end + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/propagation/grpc.rb b/lib/datadog/tracing/propagation/grpc.rb index da146d9ca2c..13588ddaa41 100644 --- a/lib/datadog/tracing/propagation/grpc.rb +++ b/lib/datadog/tracing/propagation/grpc.rb @@ -1,6 +1,7 @@ # typed: true -require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/distributed/metadata/datadog' + require 'datadog/tracing/span' require 'datadog/tracing/trace_digest' require 'datadog/tracing/trace_operation' @@ -13,74 +14,80 @@ module Propagation # to the Propagation::HTTP; the key difference is the way gRPC handles # header information (called "metadata") as it operates over HTTP2 module GRPC - include Distributed::Headers::Ext + + PROPAGATION_STYLES = { + Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG => Distributed::Metadata::Datadog + } def self.inject!(digest, metadata) return if digest.nil? digest = digest.to_digest if digest.is_a?(TraceOperation) - metadata[GRPC_METADATA_TRACE_ID] = digest.trace_id.to_s - metadata[GRPC_METADATA_PARENT_ID] = digest.span_id.to_s - metadata[GRPC_METADATA_SAMPLING_PRIORITY] = digest.trace_sampling_priority.to_s if digest.trace_sampling_priority - metadata[GRPC_METADATA_ORIGIN] = digest.trace_origin.to_s if digest.trace_origin + Datadog.configuration.tracing.distributed_tracing.propagation_inject_style.each do |style| + propagator = PROPAGATION_STYLES[style] + begin + propagator.inject!(digest, metadata) unless propagator.nil? + rescue => e + Datadog.logger.error( + 'Error injecting propagated trace headers into the environment. ' \ + "Cause: #{e} Location: #{Array(e.backtrace).first}" + ) + end + end end def self.extract(metadata) - metadata = Carrier.new(metadata) - return nil unless metadata.valid? - - TraceDigest.new( - span_id: metadata.parent_id, - trace_id: metadata.trace_id, - trace_origin: metadata.origin, - trace_sampling_priority: metadata.sampling_priority - ) - end - - # opentracing.io compliant carrier object - class Carrier - include Distributed::Headers::Ext - - def initialize(metadata = {}) - @metadata = metadata || {} - end - - def valid? - trace_id && parent_id - end - - def trace_id - value = metadata_for_key(GRPC_METADATA_TRACE_ID).to_i - value if (1..Span::EXTERNAL_MAX_ID).cover? value - end - - def parent_id - value = metadata_for_key(GRPC_METADATA_PARENT_ID).to_i - value if (1..Span::EXTERNAL_MAX_ID).cover? value - end - - def sampling_priority - value = metadata_for_key(GRPC_METADATA_SAMPLING_PRIORITY) - value && value.to_i - end + trace_digest = nil + dd_trace_digest = nil + + Datadog.configuration.tracing.distributed_tracing.propagation_extract_style.each do |style| + propagator = PROPAGATION_STYLES[style] + + next if propagator.nil? + + # Extract trace headers + begin + extracted_trace_digest = propagator.extract(metadata) + rescue => e + Datadog.logger.error( + 'Error extracting propagated trace headers from the environment. ' \ + "Cause: #{e} Location: #{Array(e.backtrace).first}" + ) + end - def origin - value = metadata_for_key(GRPC_METADATA_ORIGIN) - value if value != '' - end + # Skip this style if no valid headers were found + next if extracted_trace_digest.nil? - private + # Keep track of the Datadog extract trace headers, we want to return + # this one if we have one + if extracted_trace_digest && style == Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG + dd_trace_digest = extracted_trace_digest + end - def metadata_for_key(key) - # metadata values can be arrays (multiple headers with the same key) - value = @metadata[key] - if value.is_a?(Array) - value.first + # No previously extracted trace headers, use the one we just extracted + if trace_digest.nil? + trace_digest = extracted_trace_digest else - value + unless trace_digest.trace_id == extracted_trace_digest.trace_id \ + && trace_digest.span_id == extracted_trace_digest.span_id + # Return an empty/new trace headers if we have a mismatch in values extracted + msg = "#{trace_digest.trace_id} != #{extracted_trace_digest.trace_id} && " \ + "#{trace_digest.span_id} != #{extracted_trace_digest.span_id}" + Datadog.logger.debug( + "Cannot extract trace headers from HTTP: extracted trace headers differ, #{msg}" + ) + # DEV: This will return from `self.extract` not this `each` block + return TraceDigest.new + end end end + + # Return the extracted trace headers if we found one or else a new empty trace headers + # Always return the Datadog trace headers if one exists since it has more + # information than the B3 headers e.g. origin, expanded priority + # sampling values, etc + dd_trace_digest || trace_digest || nil end end end diff --git a/spec/datadog/tracing/distributed/metadata/datadog_spec.rb b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb new file mode 100644 index 00000000000..0c28d9a57ef --- /dev/null +++ b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb @@ -0,0 +1,194 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/distributed/metadata/datadog' +require 'datadog/tracing/trace_digest' + +RSpec.describe Datadog::Tracing::Distributed::Metadata::Datadog do + describe '#inject!' do + subject!(:inject!) { described_class.inject!(digest, metadata) } + let(:metadata) { {} } + + context 'with nil digest' do + let(:digest) { nil } + it { is_expected.to be nil } + end + + context 'with TraceDigest' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + trace_id: 10000, + span_id: 20000 + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000') + end + + context 'with sampling priority' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 60000, + trace_id: 50000, + trace_sampling_priority: 1 + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '50000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '60000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1') + end + + context 'with origin' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 80000, + trace_id: 70000, + trace_origin: 'synthetics', + trace_sampling_priority: 1 + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '70000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '80000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + end + end + end + + context 'with origin' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 100000, + trace_id: 90000, + trace_origin: 'synthetics' + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '90000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '100000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + end + end + end + end + + describe '#extract' do + subject(:extract) { described_class.extract(metadata) } + let(:digest) { extract } + + let(:metadata) { {} } + + context 'with empty metadata' do + it { is_expected.to be nil } + end + + context 'with trace_id and span_id' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to be nil } + + context 'with sampling priority' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to eq(1) } + + context 'with origin' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to eq('synthetics') } + it { expect(digest.trace_sampling_priority).to eq(1) } + end + end + + context 'with origin' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to eq('synthetics') } + it { expect(digest.trace_sampling_priority).to be nil } + end + end + + context 'with span_id' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '10000' } } + + it { is_expected.to be nil } + end + + context 'with origin' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' } } + + it { is_expected.to be nil } + end + + context 'with sampling priority' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1' } } + + it { is_expected.to be nil } + end + + context 'with trace_id' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000' } } + + it { is_expected.to be nil } + + context 'with synthetics origin' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' } + end + + it { expect(digest.span_id).to be nil } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to eq('synthetics') } + it { expect(digest.trace_sampling_priority).to be nil } + end + + context 'with non-synthetics origin' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'custom-origin' } + end + + it { expect(digest.span_id).to be nil } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to eq('custom-origin') } + it { expect(digest.trace_sampling_priority).to be nil } + end + end + end +end From 5732e876e426abcbca7e99459dce27fcfb5aa1b2 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Fri, 24 Jun 2022 16:37:39 -0300 Subject: [PATCH 0126/2133] feat: first implementation of grpc b3 metadata injection and extraction --- .../tracing/distributed/headers/ext.rb | 6 + .../tracing/distributed/metadata/b3.rb | 103 +++++++++++++ .../tracing/distributed/metadata/datadog.rb | 5 +- .../tracing/distributed/metadata/b3_spec.rb | 138 ++++++++++++++++++ 4 files changed, 248 insertions(+), 4 deletions(-) create mode 100755 lib/datadog/tracing/distributed/metadata/b3.rb create mode 100644 spec/datadog/tracing/distributed/metadata/b3_spec.rb diff --git a/lib/datadog/tracing/distributed/headers/ext.rb b/lib/datadog/tracing/distributed/headers/ext.rb index 3a026fc71d4..411081a9164 100644 --- a/lib/datadog/tracing/distributed/headers/ext.rb +++ b/lib/datadog/tracing/distributed/headers/ext.rb @@ -24,6 +24,12 @@ module Ext GRPC_METADATA_PARENT_ID = 'x-datadog-parent-id'.freeze GRPC_METADATA_SAMPLING_PRIORITY = 'x-datadog-sampling-priority'.freeze GRPC_METADATA_ORIGIN = 'x-datadog-origin'.freeze + + # B3 gRPC metadata used for distributed tracing + B3_METADATA_TRACE_ID = 'x-b3-traceid'.freeze + B3_METADATA_SPAN_ID = 'x-b3-spanid'.freeze + B3_METADATA_SAMPLED = 'x-b3-sampled'.freeze + B3_METADATA_SINGLE = 'b3'.freeze end end end diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb new file mode 100755 index 00000000000..de8773155a6 --- /dev/null +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -0,0 +1,103 @@ +# typed: true + +require 'datadog/tracing/distributed/parser' +require 'datadog/tracing/distributed/helpers' +require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/trace_digest' + +module Datadog + module Tracing + module Distributed + module Metadata + # B3 provides helpers to inject or extract headers for B3 style headers + module B3 + include Distributed::Headers::Ext + + def self.inject!(digest, metadata) + return if digest.nil? + + # DEV: We need these to be hex encoded + metadata[B3_METADATA_TRACE_ID] = digest.trace_id.to_s(16) + metadata[B3_METADATA_SPAN_ID] = digest.span_id.to_s(16) + + if digest.trace_sampling_priority + sampling_priority = Helpers.clamp_sampling_priority( + digest.trace_sampling_priority + ) + metadata[B3_HEADER_SAMPLED] = sampling_priority.to_s + end + + metadata + end + + def self.extract(metadata) + # Extract values from headers + # DEV: B3 doesn't have "origin" + headers = MyParser.new(metadata) + trace_id = headers.id(B3_METADATA_TRACE_ID, 16) + span_id = headers.id(B3_METADATA_SPAN_ID, 16) + # We don't need to try and convert sampled since B3 supports 0/1 (AUTO_REJECT/AUTO_KEEP) + sampling_priority = headers.number(B3_METADATA_SAMPLED) + + # Return early if this propagation is not valid + return unless trace_id && span_id + + TraceDigest.new( + trace_id: trace_id, + span_id: span_id, + trace_sampling_priority: sampling_priority + ) + end + + class MyParser + def initialize(metadata) + @metadata = metadata + end + + def id(header_name, base = 10) + value_to_id(@metadata[header_name], base) + end + + def value_to_id(value, base = 10) + id = value_to_number(value, base) + + # Return early if we could not parse a number + return if id.nil? + + # Zero or greater than max allowed value of 2**64 + return if id.zero? || id > Span::EXTERNAL_MAX_ID + + id < 0 ? id + (2**64) : id + end + + def number(header_name, base = 10) + value_to_number(@metadata[header_name], base) + end + + def value_to_number(value, base = 10) + # It's important to make a difference between no header, + # and a header defined to zero. + return if value.nil? + + # Be sure we have a string + value = value.to_s + + # If we are parsing base16 number then truncate to 64-bit + value = Helpers.truncate_base16_number(value) if base == 16 + + # Convert header to an integer + # DEV: Ruby `.to_i` will return `0` if a number could not be parsed + num = value.to_i(base) + + # Ensure the parsed number is the same as the original string value + # e.g. We want to make sure to throw away `'nan'.to_i == 0` + return unless num.to_s(base) == value + + num + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index 09b4073a59f..06687eb1a34 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -12,10 +12,7 @@ def self.inject!(digest, metadata) metadata[GRPC_METADATA_TRACE_ID] = digest.trace_id.to_s metadata[GRPC_METADATA_PARENT_ID] = digest.span_id.to_s - if digest.trace_sampling_priority - metadata[GRPC_METADATA_SAMPLING_PRIORITY] = - digest.trace_sampling_priority.to_s - end + metadata[GRPC_METADATA_SAMPLING_PRIORITY] = digest.trace_sampling_priority.to_s if digest.trace_sampling_priority metadata[GRPC_METADATA_ORIGIN] = digest.trace_origin.to_s if digest.trace_origin metadata diff --git a/spec/datadog/tracing/distributed/metadata/b3_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_spec.rb new file mode 100644 index 00000000000..126db6189b9 --- /dev/null +++ b/spec/datadog/tracing/distributed/metadata/b3_spec.rb @@ -0,0 +1,138 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/distributed/metadata/b3' +require 'datadog/tracing/trace_digest' + +RSpec.describe Datadog::Tracing::Distributed::Metadata::B3 do + describe '#inject!' do + subject!(:inject!) { described_class.inject!(digest, metadata) } + let(:metadata) { {} } + + context 'with nil digest' do + let(:digest) { nil } + it { is_expected.to be nil } + end + + context 'with trace_id and span_id' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 20000, + trace_id: 10000 + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16)) + end + + [ + [-1, 0], + [0, 0], + [1, 1], + [2, 1] + ].each do |value, expected| + context "with sampling priority #{value}" do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 60000, + trace_id: 50000, + trace_sampling_priority: value + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 50000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 60000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => expected.to_s) + end + end + end + + context 'with origin' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 100000, + trace_id: 90000, + trace_origin: 'synthetics' + ) + end + + it do + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 90000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 100000.to_s(16)) + end + end + end + end + + describe '#extract' do + subject(:extract) { described_class.extract(metadata) } + let(:digest) { extract } + + let(:metadata) { {} } + + context 'with empty metadata' do + it { is_expected.to be_nil } + end + + context 'with trace_id and span_id' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16)} + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to be nil } + + context 'with sampling priority' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => '1' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to eq(1) } + end + + context 'with origin' do + let(:metadata) do + { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics' } + end + + it { expect(digest.span_id).to eq(20000) } + it { expect(digest.trace_id).to eq(10000) } + it { expect(digest.trace_sampling_priority).to be nil } + it { expect(digest.trace_origin).to be nil } + end + end + + context 'with span_id' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 10000.to_s(16) } } + + it { is_expected.to be nil } + end + + context 'with sampling priority' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => '1' } } + + it { is_expected.to be nil } + end + + context 'with trace_id' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16) } } + + it { is_expected.to be nil } + end + end +end From 5ba6ee96c5dd18ac759763682886b73aa0c0e099 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 10:08:58 -0300 Subject: [PATCH 0127/2133] feat: introduce the MetadataParser --- .../tracing/distributed/headers/b3_single.rb | 6 +- lib/datadog/tracing/distributed/helpers.rb | 34 +++++++++++ .../tracing/distributed/metadata/b3.rb | 60 ++----------------- .../tracing/distributed/metadata/datadog.rb | 25 ++------ .../tracing/distributed/metadata_parser.rb | 34 +++++++++++ lib/datadog/tracing/distributed/parser.rb | 38 +----------- 6 files changed, 85 insertions(+), 112 deletions(-) create mode 100755 lib/datadog/tracing/distributed/metadata_parser.rb diff --git a/lib/datadog/tracing/distributed/headers/b3_single.rb b/lib/datadog/tracing/distributed/headers/b3_single.rb index f4e58dac9df..e774db1b868 100644 --- a/lib/datadog/tracing/distributed/headers/b3_single.rb +++ b/lib/datadog/tracing/distributed/headers/b3_single.rb @@ -47,9 +47,9 @@ def self.extract(env) return if value.nil? parts = value.split('-') - trace_id = headers.value_to_id(parts[0], 16) unless parts.empty? - span_id = headers.value_to_id(parts[1], 16) if parts.length > 1 - sampling_priority = headers.value_to_number(parts[2]) if parts.length > 2 + trace_id = Helpers.value_to_id(parts[0], 16) unless parts.empty? + span_id = Helpers.value_to_id(parts[1], 16) if parts.length > 1 + sampling_priority = Helpers.value_to_number(parts[2]) if parts.length > 2 # Return early if this propagation is not valid return unless trace_id && span_id diff --git a/lib/datadog/tracing/distributed/helpers.rb b/lib/datadog/tracing/distributed/helpers.rb index f104490134d..96c5f4b7ce7 100644 --- a/lib/datadog/tracing/distributed/helpers.rb +++ b/lib/datadog/tracing/distributed/helpers.rb @@ -38,6 +38,40 @@ def self.truncate_base16_number(value) # or we find the first non-zero, this allows `'0000' -> '0'` and `'00001' -> '1'` value.sub(/^0*(?=(0$)|[^0])/, '') end + + def self.value_to_id(value, base = 10) + id = value_to_number(value, base) + + # Return early if we could not parse a number + return if id.nil? + + # Zero or greater than max allowed value of 2**64 + return if id.zero? || id > Span::EXTERNAL_MAX_ID + + id < 0 ? id + (2**64) : id + end + + def self.value_to_number(value, base = 10) + # It's important to make a difference between no header, + # and a header defined to zero. + return if value.nil? + + # Be sure we have a string + value = value.to_s + + # If we are parsing base16 number then truncate to 64-bit + value = Helpers.truncate_base16_number(value) if base == 16 + + # Convert header to an integer + # DEV: Ruby `.to_i` will return `0` if a number could not be parsed + num = value.to_i(base) + + # Ensure the parsed number is the same as the original string value + # e.g. We want to make sure to throw away `'nan'.to_i == 0` + return unless num.to_s(base) == value + + num + end end end end diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb index de8773155a6..5ccfb60e7e9 100755 --- a/lib/datadog/tracing/distributed/metadata/b3.rb +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/distributed/parser' require 'datadog/tracing/distributed/helpers' +require 'datadog/tracing/distributed/metadata_parser' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' @@ -31,13 +31,13 @@ def self.inject!(digest, metadata) end def self.extract(metadata) - # Extract values from headers + # Extract values from gRPC metadata # DEV: B3 doesn't have "origin" - headers = MyParser.new(metadata) - trace_id = headers.id(B3_METADATA_TRACE_ID, 16) - span_id = headers.id(B3_METADATA_SPAN_ID, 16) + metadata = MetadataParser.new(metadata) + trace_id = metadata.id(B3_METADATA_TRACE_ID, 16) + span_id = metadata.id(B3_METADATA_SPAN_ID, 16) # We don't need to try and convert sampled since B3 supports 0/1 (AUTO_REJECT/AUTO_KEEP) - sampling_priority = headers.number(B3_METADATA_SAMPLED) + sampling_priority = metadata.number(B3_METADATA_SAMPLED) # Return early if this propagation is not valid return unless trace_id && span_id @@ -48,54 +48,6 @@ def self.extract(metadata) trace_sampling_priority: sampling_priority ) end - - class MyParser - def initialize(metadata) - @metadata = metadata - end - - def id(header_name, base = 10) - value_to_id(@metadata[header_name], base) - end - - def value_to_id(value, base = 10) - id = value_to_number(value, base) - - # Return early if we could not parse a number - return if id.nil? - - # Zero or greater than max allowed value of 2**64 - return if id.zero? || id > Span::EXTERNAL_MAX_ID - - id < 0 ? id + (2**64) : id - end - - def number(header_name, base = 10) - value_to_number(@metadata[header_name], base) - end - - def value_to_number(value, base = 10) - # It's important to make a difference between no header, - # and a header defined to zero. - return if value.nil? - - # Be sure we have a string - value = value.to_s - - # If we are parsing base16 number then truncate to 64-bit - value = Helpers.truncate_base16_number(value) if base == 16 - - # Convert header to an integer - # DEV: Ruby `.to_i` will return `0` if a number could not be parsed - num = value.to_i(base) - - # Ensure the parsed number is the same as the original string value - # e.g. We want to make sure to throw away `'nan'.to_i == 0` - return unless num.to_s(base) == value - - num - end - end end end end diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index 06687eb1a34..1c174ffdfd4 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -1,4 +1,5 @@ require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/distributed/metadata_parser' module Datadog module Tracing @@ -35,7 +36,7 @@ class Carrier include Distributed::Headers::Ext def initialize(metadata = {}) - @metadata = metadata || {} + @metadata = MetadataParser.new(metadata || {}) end def valid? @@ -43,36 +44,22 @@ def valid? end def trace_id - value = metadata_for_key(GRPC_METADATA_TRACE_ID).to_i - value if (1..Span::EXTERNAL_MAX_ID).cover? value + @metadata.id(GRPC_METADATA_TRACE_ID) end def parent_id - value = metadata_for_key(GRPC_METADATA_PARENT_ID).to_i - value if (1..Span::EXTERNAL_MAX_ID).cover? value + @metadata.id(GRPC_METADATA_PARENT_ID) end def sampling_priority - value = metadata_for_key(GRPC_METADATA_SAMPLING_PRIORITY) + value = @metadata.metadata_for_key(GRPC_METADATA_SAMPLING_PRIORITY) value && value.to_i end def origin - value = metadata_for_key(GRPC_METADATA_ORIGIN) + value = @metadata.metadata_for_key(GRPC_METADATA_ORIGIN) value if value != '' end - - private - - def metadata_for_key(key) - # metadata values can be arrays (multiple headers with the same key) - value = @metadata[key] - if value.is_a?(Array) - value.first - else - value - end - end end end end diff --git a/lib/datadog/tracing/distributed/metadata_parser.rb b/lib/datadog/tracing/distributed/metadata_parser.rb new file mode 100755 index 00000000000..904de1ad2a1 --- /dev/null +++ b/lib/datadog/tracing/distributed/metadata_parser.rb @@ -0,0 +1,34 @@ +require 'datadog/tracing/span' +require 'datadog/tracing/distributed/helpers' + +module Datadog + module Tracing + module Distributed + class MetadataParser + + def initialize(metadata) + @metadata = metadata + end + + def id(key, base = 10) + Helpers.value_to_id(metadata_for_key(key), base) + end + + + def number(key, base = 10) + Helpers.value_to_number(metadata_for_key(key), base) + end + + def metadata_for_key(key) + # metadata values can be arrays (multiple headers with the same key) + value = @metadata[key] + if value.is_a?(Array) + value.first + else + value + end + end + end + end + end +end diff --git a/lib/datadog/tracing/distributed/parser.rb b/lib/datadog/tracing/distributed/parser.rb index 5be935a7254..803bd5c4bf2 100644 --- a/lib/datadog/tracing/distributed/parser.rb +++ b/lib/datadog/tracing/distributed/parser.rb @@ -24,45 +24,11 @@ def header(name) end def id(hdr, base = 10) - value_to_id(header(hdr), base) - end - - def value_to_id(value, base = 10) - id = value_to_number(value, base) - - # Return early if we could not parse a number - return if id.nil? - - # Zero or greater than max allowed value of 2**64 - return if id.zero? || id > Span::EXTERNAL_MAX_ID - - id < 0 ? id + (2**64) : id + Helpers.value_to_id(header(hdr), base) end def number(hdr, base = 10) - value_to_number(header(hdr), base) - end - - def value_to_number(value, base = 10) - # It's important to make a difference between no header, - # and a header defined to zero. - return if value.nil? - - # Be sure we have a string - value = value.to_s - - # If we are parsing base16 number then truncate to 64-bit - value = Helpers.truncate_base16_number(value) if base == 16 - - # Convert header to an integer - # DEV: Ruby `.to_i` will return `0` if a number could not be parsed - num = value.to_i(base) - - # Ensure the parsed number is the same as the original string value - # e.g. We want to make sure to throw away `'nan'.to_i == 0` - return unless num.to_s(base) == value - - num + Helpers.value_to_number(header(hdr), base) end end end From 93dc9afe9a40a17a9f9f3498337309466d07cde4 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 10:10:41 -0300 Subject: [PATCH 0128/2133] feat: adds support for b3 single header --- .../tracing/distributed/metadata/b3_single.rb | 66 ++++++++++ .../distributed/metadata/b3_single_spec.rb | 114 ++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100755 lib/datadog/tracing/distributed/metadata/b3_single.rb create mode 100644 spec/datadog/tracing/distributed/metadata/b3_single_spec.rb diff --git a/lib/datadog/tracing/distributed/metadata/b3_single.rb b/lib/datadog/tracing/distributed/metadata/b3_single.rb new file mode 100755 index 00000000000..592c2b7b945 --- /dev/null +++ b/lib/datadog/tracing/distributed/metadata/b3_single.rb @@ -0,0 +1,66 @@ +# typed: true + +require 'datadog/tracing/distributed/metadata_parser' +require 'datadog/tracing/distributed/helpers' +require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/trace_digest' + +module Datadog + module Tracing + module Distributed + module Metadata + # B3Single provides helpers to inject or extract headers for B3 single header style headers + module B3Single + include Distributed::Headers::Ext + + def self.inject!(digest, metadata) + return if digest.nil? + + # Header format: + # b3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId} + # https://github.com/apache/incubator-zipkin-b3-propagation/tree/7c6e9f14d6627832bd80baa87ac7dabee7be23cf#single-header + # DEV: `{SamplingState}` and `{ParentSpanId`}` are optional + + # DEV: We need these to be hex encoded + b3_header = "#{digest.trace_id.to_s(16)}-#{digest.span_id.to_s(16)}" + + if digest.trace_sampling_priority + sampling_priority = Helpers.clamp_sampling_priority( + digest.trace_sampling_priority + ) + b3_header += "-#{sampling_priority}" + end + + metadata[B3_METADATA_SINGLE] = b3_header + + metadata + end + + def self.extract(metadata) + # Metadata format: + # b3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId} + # https://github.com/apache/incubator-zipkin-b3-propagation/tree/7c6e9f14d6627832bd80baa87ac7dabee7be23cf#single-header + # DEV: `{SamplingState}` and `{ParentSpanId`}` are optional + + b3_single = MetadataParser.new(metadata).metadata_for_key(B3_METADATA_SINGLE) + return if b3_single.nil? + + parts = b3_single.split('-') + trace_id = Helpers.value_to_id(parts[0], 16) unless parts.empty? + span_id = Helpers.value_to_id(parts[1], 16) if parts.length > 1 + sampling_priority = Helpers.value_to_number(parts[2]) if parts.length > 2 + + # Return early if this propagation is not valid + return unless trace_id && span_id + + TraceDigest.new( + span_id: span_id, + trace_id: trace_id, + trace_sampling_priority: sampling_priority + ) + end + end + end + end + end +end diff --git a/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb new file mode 100644 index 00000000000..0e949c50027 --- /dev/null +++ b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb @@ -0,0 +1,114 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/tracing/distributed/headers/ext' +require 'datadog/tracing/distributed/metadata/b3_single' +require 'datadog/tracing/trace_digest' + +RSpec.describe Datadog::Tracing::Distributed::Metadata::B3Single do + # Header format: + # b3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId} + # https://github.com/apache/incubator-zipkin-b3-propagation/tree/7c6e9f14d6627832bd80baa87ac7dabee7be23cf#single-header + # DEV: `{SamplingState}` and `{ParentSpanId`}` are optional + + describe '#inject!' do + subject!(:inject!) { described_class.inject!(digest, metadata) } + let(:metadata) { {} } + + context 'with nil digest' do + let(:digest) { nil } + it { is_expected.to be nil } + end + + context 'with trace_id and span_id' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 20000, + trace_id: 10000 + ) + end + + it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '2710-4e20') } + + [ + [-1, 0], + [0, 0], + [1, 1], + [2, 1] + ].each do |value, expected| + context "with sampling priority #{value}" do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 60000, + trace_id: 50000, + trace_sampling_priority: value + ) + end + + it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => "c350-ea60-#{expected}") } + end + end + + context 'with origin' do + let(:digest) do + Datadog::Tracing::TraceDigest.new( + span_id: 100000, + trace_id: 90000, + trace_origin: 'synthetics' + ) + end + + it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0') } + end + end + end + + describe '#extract' do + subject(:extract) { described_class.extract(metadata) } + let(:digest) { extract } + + let(:metadata) { {} } + + context 'with empty metadata' do + it { is_expected.to be nil } + end + + context 'with trace_id and span_id' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0' } } + + it { expect(digest.span_id).to eq(100000) } + it { expect(digest.trace_id).to eq(90000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to be nil } + + context 'with sampling priority' do + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0-1' } } + + it { expect(digest.span_id).to eq(100000) } + it { expect(digest.trace_id).to eq(90000) } + it { expect(digest.trace_origin).to be nil } + it { expect(digest.trace_sampling_priority).to eq(1) } + + context 'with parent_id' do + let(:metadata) do + { + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0-1-4e20' + } + end + + it { expect(digest.trace_id).to eq(90000) } + it { expect(digest.span_id).to eq(100000) } + it { expect(digest.trace_sampling_priority).to eq(1) } + it { expect(digest.trace_origin).to be nil } + end + end + end + + context 'with trace_id' do + let(:env) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90' } } + + it { is_expected.to be nil } + end + end +end From e357452db2015f1a5da620fdac6043c21ec154fe Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 11:28:08 -0300 Subject: [PATCH 0129/2133] feat: move parsers to the right directories --- lib/datadog/tracing/distributed/headers/b3.rb | 2 +- .../tracing/distributed/headers/b3_single.rb | 2 +- .../tracing/distributed/headers/datadog.rb | 2 +- .../tracing/distributed/headers/parser.rb | 36 ++++++ .../tracing/distributed/metadata/b3.rb | 4 +- .../tracing/distributed/metadata/b3_single.rb | 4 +- .../tracing/distributed/metadata/datadog.rb | 4 +- .../tracing/distributed/metadata/parser.rb | 34 +++++ .../tracing/distributed/metadata_parser.rb | 34 ----- lib/datadog/tracing/distributed/parser.rb | 36 ------ .../distributed/{ => headers}/parser_spec.rb | 4 +- .../tracing/distributed/helpers_spec.rb | 119 ++++++++++++++++++ 12 files changed, 200 insertions(+), 81 deletions(-) create mode 100644 lib/datadog/tracing/distributed/headers/parser.rb create mode 100755 lib/datadog/tracing/distributed/metadata/parser.rb delete mode 100755 lib/datadog/tracing/distributed/metadata_parser.rb delete mode 100644 lib/datadog/tracing/distributed/parser.rb rename spec/datadog/tracing/distributed/{ => headers}/parser_spec.rb (97%) diff --git a/lib/datadog/tracing/distributed/headers/b3.rb b/lib/datadog/tracing/distributed/headers/b3.rb index a3a5977a15f..3685c766b53 100644 --- a/lib/datadog/tracing/distributed/headers/b3.rb +++ b/lib/datadog/tracing/distributed/headers/b3.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/distributed/parser' +require 'datadog/tracing/distributed/headers/parser' require 'datadog/tracing/distributed/helpers' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' diff --git a/lib/datadog/tracing/distributed/headers/b3_single.rb b/lib/datadog/tracing/distributed/headers/b3_single.rb index e774db1b868..8dd56f35a92 100644 --- a/lib/datadog/tracing/distributed/headers/b3_single.rb +++ b/lib/datadog/tracing/distributed/headers/b3_single.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/distributed/parser' +require 'datadog/tracing/distributed/headers/parser' require 'datadog/tracing/distributed/helpers' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' diff --git a/lib/datadog/tracing/distributed/headers/datadog.rb b/lib/datadog/tracing/distributed/headers/datadog.rb index d17a726c7a6..6214cb8e7df 100644 --- a/lib/datadog/tracing/distributed/headers/datadog.rb +++ b/lib/datadog/tracing/distributed/headers/datadog.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/distributed/parser' +require 'datadog/tracing/distributed/headers/parser' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' diff --git a/lib/datadog/tracing/distributed/headers/parser.rb b/lib/datadog/tracing/distributed/headers/parser.rb new file mode 100644 index 00000000000..082947e3893 --- /dev/null +++ b/lib/datadog/tracing/distributed/headers/parser.rb @@ -0,0 +1,36 @@ +# typed: false +require 'datadog/tracing/distributed/helpers' + +module Datadog + module Tracing + module Distributed + module Headers + # Parser provides easy access and validation methods for Rack headers + class Parser + def initialize(env) + @env = env + end + + # TODO: Don't assume Rack format. + # Make distributed tracing headers apathetic. + def header(name) + rack_header = "http-#{name}".upcase!.tr('-', '_') + + hdr = @env[rack_header] + + # Only return the value if it is not an empty string + hdr if hdr != '' + end + + def id(hdr, base = 10) + Helpers.value_to_id(header(hdr), base) + end + + def number(hdr, base = 10) + Helpers.value_to_number(header(hdr), base) + end + end + end + end + end +end diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb index 5ccfb60e7e9..a4a016baff5 100755 --- a/lib/datadog/tracing/distributed/metadata/b3.rb +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -1,7 +1,7 @@ # typed: true require 'datadog/tracing/distributed/helpers' -require 'datadog/tracing/distributed/metadata_parser' +require 'datadog/tracing/distributed/metadata/parser' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' @@ -33,7 +33,7 @@ def self.inject!(digest, metadata) def self.extract(metadata) # Extract values from gRPC metadata # DEV: B3 doesn't have "origin" - metadata = MetadataParser.new(metadata) + metadata = Parser.new(metadata) trace_id = metadata.id(B3_METADATA_TRACE_ID, 16) span_id = metadata.id(B3_METADATA_SPAN_ID, 16) # We don't need to try and convert sampled since B3 supports 0/1 (AUTO_REJECT/AUTO_KEEP) diff --git a/lib/datadog/tracing/distributed/metadata/b3_single.rb b/lib/datadog/tracing/distributed/metadata/b3_single.rb index 592c2b7b945..368210bffe7 100755 --- a/lib/datadog/tracing/distributed/metadata/b3_single.rb +++ b/lib/datadog/tracing/distributed/metadata/b3_single.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/distributed/metadata_parser' +require 'datadog/tracing/distributed/metadata/parser' require 'datadog/tracing/distributed/helpers' require 'datadog/tracing/distributed/headers/ext' require 'datadog/tracing/trace_digest' @@ -42,7 +42,7 @@ def self.extract(metadata) # https://github.com/apache/incubator-zipkin-b3-propagation/tree/7c6e9f14d6627832bd80baa87ac7dabee7be23cf#single-header # DEV: `{SamplingState}` and `{ParentSpanId`}` are optional - b3_single = MetadataParser.new(metadata).metadata_for_key(B3_METADATA_SINGLE) + b3_single = Parser.new(metadata).metadata_for_key(B3_METADATA_SINGLE) return if b3_single.nil? parts = b3_single.split('-') diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index 1c174ffdfd4..da580eeedd7 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -1,5 +1,5 @@ require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/distributed/metadata_parser' +require 'datadog/tracing/distributed/metadata/parser' module Datadog module Tracing @@ -36,7 +36,7 @@ class Carrier include Distributed::Headers::Ext def initialize(metadata = {}) - @metadata = MetadataParser.new(metadata || {}) + @metadata = Parser.new(metadata || {}) end def valid? diff --git a/lib/datadog/tracing/distributed/metadata/parser.rb b/lib/datadog/tracing/distributed/metadata/parser.rb new file mode 100755 index 00000000000..5597eeb185e --- /dev/null +++ b/lib/datadog/tracing/distributed/metadata/parser.rb @@ -0,0 +1,34 @@ +require 'datadog/tracing/distributed/helpers' + +module Datadog + module Tracing + module Distributed + module Metadata + class Parser + def initialize(metadata) + @metadata = metadata + end + + def id(key, base = 10) + Helpers.value_to_id(metadata_for_key(key), base) + end + + + def number(key, base = 10) + Helpers.value_to_number(metadata_for_key(key), base) + end + + def metadata_for_key(key) + # metadata values can be arrays (multiple headers with the same key) + value = @metadata[key] + if value.is_a?(Array) + value.first + else + value + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/distributed/metadata_parser.rb b/lib/datadog/tracing/distributed/metadata_parser.rb deleted file mode 100755 index 904de1ad2a1..00000000000 --- a/lib/datadog/tracing/distributed/metadata_parser.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'datadog/tracing/span' -require 'datadog/tracing/distributed/helpers' - -module Datadog - module Tracing - module Distributed - class MetadataParser - - def initialize(metadata) - @metadata = metadata - end - - def id(key, base = 10) - Helpers.value_to_id(metadata_for_key(key), base) - end - - - def number(key, base = 10) - Helpers.value_to_number(metadata_for_key(key), base) - end - - def metadata_for_key(key) - # metadata values can be arrays (multiple headers with the same key) - value = @metadata[key] - if value.is_a?(Array) - value.first - else - value - end - end - end - end - end -end diff --git a/lib/datadog/tracing/distributed/parser.rb b/lib/datadog/tracing/distributed/parser.rb deleted file mode 100644 index 803bd5c4bf2..00000000000 --- a/lib/datadog/tracing/distributed/parser.rb +++ /dev/null @@ -1,36 +0,0 @@ -# typed: false - -require 'datadog/tracing/span' -require 'datadog/tracing/distributed/helpers' - -module Datadog - module Tracing - module Distributed - # Parser provides easy access and validation methods for Rack headers - class Parser - def initialize(env) - @env = env - end - - # TODO: Don't assume Rack format. - # Make distributed tracing headers apathetic. - def header(name) - rack_header = "http-#{name}".upcase!.tr('-', '_') - - hdr = @env[rack_header] - - # Only return the value if it is not an empty string - hdr if hdr != '' - end - - def id(hdr, base = 10) - Helpers.value_to_id(header(hdr), base) - end - - def number(hdr, base = 10) - Helpers.value_to_number(header(hdr), base) - end - end - end - end -end diff --git a/spec/datadog/tracing/distributed/parser_spec.rb b/spec/datadog/tracing/distributed/headers/parser_spec.rb similarity index 97% rename from spec/datadog/tracing/distributed/parser_spec.rb rename to spec/datadog/tracing/distributed/headers/parser_spec.rb index f476fd48e8a..69cccda1870 100644 --- a/spec/datadog/tracing/distributed/parser_spec.rb +++ b/spec/datadog/tracing/distributed/headers/parser_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' -require 'datadog/tracing/distributed/parser' +require 'datadog/tracing/distributed/headers/parser' require 'datadog/tracing/span' -RSpec.describe Datadog::Tracing::Distributed::Parser do +RSpec.describe Datadog::Tracing::Distributed::Headers::Parser do subject(:headers) do described_class.new(env) end diff --git a/spec/datadog/tracing/distributed/helpers_spec.rb b/spec/datadog/tracing/distributed/helpers_spec.rb index 1de7dd48225..c6fb5a76dbf 100644 --- a/spec/datadog/tracing/distributed/helpers_spec.rb +++ b/spec/datadog/tracing/distributed/helpers_spec.rb @@ -62,4 +62,123 @@ end end end + + describe '#value_to_id' do + context 'when value is not present' do + subject(:subject) { described_class.value_to_id(nil) } + + it { is_expected.to be_nil } + end + + context 'when value is' do + [ + [nil, nil], + ['0', nil], + ['value', nil], + ['867-5309', nil], + ['ten', nil], + ['', nil], + [' ', nil], + + # Larger than we allow + [(Datadog::Tracing::Span::EXTERNAL_MAX_ID + 1).to_s, nil], + + # Negative number + ['-100', -100 + (2**64)], + + # Allowed values + [Datadog::Tracing::Span::RUBY_MAX_ID.to_s, Datadog::Tracing::Span::RUBY_MAX_ID], + [Datadog::Tracing::Span::EXTERNAL_MAX_ID.to_s, Datadog::Tracing::Span::EXTERNAL_MAX_ID], + ['1', 1], + ['100', 100], + ['1000', 1000] + ].each do |value, expected| + context value.inspect do + it { expect(described_class.value_to_id(value)).to eq(expected) } + end + end + + # Base 16 + [ + # Larger than we allow + # DEV: We truncate to 64-bit for base16 + [(Datadog::Tracing::Span::EXTERNAL_MAX_ID + 1).to_s(16), 1], + [Datadog::Tracing::Span::EXTERNAL_MAX_ID.to_s(16), nil], + + [Datadog::Tracing::Span::RUBY_MAX_ID.to_s(16), Datadog::Tracing::Span::RUBY_MAX_ID], + [(Datadog::Tracing::Span::EXTERNAL_MAX_ID - 1).to_s(16), Datadog::Tracing::Span::EXTERNAL_MAX_ID - 1], + + ['3e8', 1000], + ['3E8', 1000] + ].each do |value, expected| + context value.inspect do + it { expect(described_class.value_to_id(value, 16)).to eq(expected) } + end + end + end + end + + describe '#value_to_number' do + context 'when value is not present' do + subject(:subject) { described_class.value_to_number(nil) } + + it { is_expected.to be_nil } + end + + context 'when value is ' do + [ + [nil, nil], + ['value', nil], + ['867-5309', nil], + ['ten', nil], + ['', nil], + [' ', nil], + + # Sampling priorities + ['-1', -1], + ['0', 0], + ['1', 1], + ['2', 2], + + # Allowed values + [Datadog::Tracing::Span::RUBY_MAX_ID.to_s, Datadog::Tracing::Span::RUBY_MAX_ID], + [(Datadog::Tracing::Span::RUBY_MAX_ID + 1).to_s, Datadog::Tracing::Span::RUBY_MAX_ID + 1], + [Datadog::Tracing::Span::EXTERNAL_MAX_ID.to_s, Datadog::Tracing::Span::EXTERNAL_MAX_ID], + [(Datadog::Tracing::Span::EXTERNAL_MAX_ID + 1).to_s, Datadog::Tracing::Span::EXTERNAL_MAX_ID + 1], + ['-100', -100], + ['100', 100], + ['1000', 1000] + ].each do |value, expected| + context value.inspect do + subject(:subject) { described_class.value_to_number(value) } + + it { is_expected.to be == expected } + end + end + + # Base 16 + [ + # Larger than we allow + # DEV: We truncate to 64-bit for base16, so the + [Datadog::Tracing::Span::EXTERNAL_MAX_ID.to_s(16), 0], + [(Datadog::Tracing::Span::EXTERNAL_MAX_ID + 1).to_s(16), 1], + + [Datadog::Tracing::Span::RUBY_MAX_ID.to_s(16), Datadog::Tracing::Span::RUBY_MAX_ID], + [(Datadog::Tracing::Span::RUBY_MAX_ID + 1).to_s(16), Datadog::Tracing::Span::RUBY_MAX_ID + 1], + + ['3e8', 1000], + ['3E8', 1000], + ['deadbeef', 3735928559], + ['10000', 65536], + + ['invalid-base16', nil] + ].each do |value, expected| + context value.inspect do + subject(:subject) { described_class.value_to_number(value, 16) } + + it { is_expected.to be == expected } + end + end + end + end end From 794d176072ad8dc0b78aff0fe9a8a2d3211e79a7 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 15:32:20 -0300 Subject: [PATCH 0130/2133] feat: integrate b3 and b3 single header in grpc instrumentation --- lib/datadog/tracing/propagation/grpc.rb | 7 +- spec/datadog/tracing/propagation/grpc_spec.rb | 332 +++++++++++++++++- 2 files changed, 326 insertions(+), 13 deletions(-) diff --git a/lib/datadog/tracing/propagation/grpc.rb b/lib/datadog/tracing/propagation/grpc.rb index 13588ddaa41..299c7e0f032 100644 --- a/lib/datadog/tracing/propagation/grpc.rb +++ b/lib/datadog/tracing/propagation/grpc.rb @@ -1,6 +1,8 @@ # typed: true require 'datadog/tracing/distributed/metadata/datadog' +require 'datadog/tracing/distributed/metadata/b3' +require 'datadog/tracing/distributed/metadata/b3_single' require 'datadog/tracing/span' require 'datadog/tracing/trace_digest' @@ -14,10 +16,11 @@ module Propagation # to the Propagation::HTTP; the key difference is the way gRPC handles # header information (called "metadata") as it operates over HTTP2 module GRPC - PROPAGATION_STYLES = { + Configuration::Ext::Distributed::PROPAGATION_STYLE_B3 => Distributed::Metadata::B3, + Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER => Distributed::Metadata::B3Single, Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG => Distributed::Metadata::Datadog - } + }.freeze def self.inject!(digest, metadata) return if digest.nil? diff --git a/spec/datadog/tracing/propagation/grpc_spec.rb b/spec/datadog/tracing/propagation/grpc_spec.rb index 6ac106ab943..f568d922bcb 100644 --- a/spec/datadog/tracing/propagation/grpc_spec.rb +++ b/spec/datadog/tracing/propagation/grpc_spec.rb @@ -95,19 +95,329 @@ it { is_expected.to be nil } end - context 'given populated metadata' do - let(:metadata) do - { 'x-datadog-trace-id' => '1234567890', - 'x-datadog-parent-id' => '9876543210', - 'x-datadog-sampling-priority' => '0', - 'x-datadog-origin' => 'synthetics' } + context 'given an metadata containing' do + context 'datadog trace id and parent id' do + let(:metadata) do + { + 'x-datadog-trace-id' => '123', + 'x-datadog-parent-id' => '456' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(456) + expect(trace_digest.trace_id).to eq(123) + expect(trace_digest.trace_origin).to be_nil + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'x-datadog-sampling-priority' => '0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(8) + expect(trace_digest.trace_id).to eq(7) + expect(trace_digest.trace_origin).to be_nil + expect(trace_digest.trace_sampling_priority).to eq(0) + end + + context 'and origin' do + let(:metadata) do + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'x-datadog-sampling-priority' => '0', + 'x-datadog-origin' => 'synthetics' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(8) + expect(trace_digest.trace_id).to eq(7) + expect(trace_digest.trace_origin).to eq('synthetics') + expect(trace_digest.trace_sampling_priority).to eq(0) + end + end + end + + context 'and origin' do + let(:metadata) do + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'x-datadog-origin' => 'synthetics' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(8) + expect(trace_digest.trace_id).to eq(7) + expect(trace_digest.trace_origin).to eq('synthetics') + expect(trace_digest.trace_sampling_priority).to be nil + end + end end - it 'returns a populated TraceDigest' do - expect(trace_digest.span_id).to eq 9876543210 - expect(trace_digest.trace_id).to eq 1234567890 - expect(trace_digest.trace_origin).to eq 'synthetics' - expect(trace_digest.trace_sampling_priority).to be_zero + context 'B3 trace id and parent id' do + let(:metadata) do + { + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0', + 'x-b3-sampled' => '0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(0) + end + end + end + + context 'B3 single trace id and parent id' do + let(:metadata) do + { + 'b3' => '00ef01-011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'b3' => '00ef01-011ef0-0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(0) + end + end + end + + context 'datadog, and b3 header' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'x-datadog-sampling-priority' => '1', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0', + 'x-b3-sampled' => '0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(1) + end + + context 'with a failing propagator (Datadog)' do + let(:error) { StandardError.new('test_err').tap { |e| e.set_backtrace('caller:1') } } + + before do + allow(::Datadog::Tracing::Distributed::Metadata::Datadog).to receive(:extract).and_raise(error) + allow(Datadog.logger).to receive(:error) + end + + it 'does not propagate error to caller' do + trace_digest + expect(Datadog.logger).to have_received(:error).with(/Cause: test_err Location: caller:1/) + end + + it 'extracts values from non-failing propagator (B3)' do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(0) + end + end + end + + context 'with mismatched values' do + let(:metadata) do + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to be_nil + expect(trace_digest.trace_id).to be_nil + expect(trace_digest.trace_sampling_priority).to be nil + end + end + end + + context 'datadog, b3, and b3 single header' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0', + 'b3' => '00ef01-011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'x-datadog-sampling-priority' => '1', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0', + 'x-b3-sampled' => '1', + 'b3' => '00ef01-011ef0-1' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(1) + end + end + + context 'with mismatched values' do + let(:metadata) do + # DEV: We only need 1 to be mismatched + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'x-b3-traceid' => '00ef01', + 'x-b3-spanid' => '011ef0', + 'b3' => '00ef01-011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to be_nil + expect(trace_digest.trace_id).to be_nil + expect(trace_digest.trace_sampling_priority).to be nil + end + end + end + + context 'datadog, and b3 single header' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'b3' => '00ef01-011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to be nil + end + + context 'and sampling priority' do + let(:metadata) do + { + 'x-datadog-trace-id' => '61185', + 'x-datadog-parent-id' => '73456', + 'x-datadog-sampling-priority' => '1', + 'b3' => '00ef01-011ef0-1' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to eq(73456) + expect(trace_digest.trace_id).to eq(61185) + expect(trace_digest.trace_sampling_priority).to eq(1) + end + end + + context 'with mismatched values' do + let(:metadata) do + { + 'x-datadog-trace-id' => '7', + 'x-datadog-parent-id' => '8', + 'b3' => '00ef01-011ef0' + } + end + + it do + expect(trace_digest).to be_a_kind_of(Datadog::Tracing::TraceDigest) + expect(trace_digest.span_id).to be nil + expect(trace_digest.trace_id).to be nil + expect(trace_digest.trace_sampling_priority).to be nil + end + end end end From 52be673171902dd4606c8020113def472e17d7ee Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 16:49:43 -0300 Subject: [PATCH 0131/2133] fix: disable sorbet just like in http --- lib/datadog/tracing/propagation/grpc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/propagation/grpc.rb b/lib/datadog/tracing/propagation/grpc.rb index 299c7e0f032..039ae0545c3 100644 --- a/lib/datadog/tracing/propagation/grpc.rb +++ b/lib/datadog/tracing/propagation/grpc.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: false require 'datadog/tracing/distributed/metadata/datadog' require 'datadog/tracing/distributed/metadata/b3' From 1e1d80c821a1a292ca77c64d2e523a7a06db514b Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Mon, 27 Jun 2022 17:02:41 -0300 Subject: [PATCH 0132/2133] fix: style issues --- lib/datadog/tracing/distributed/metadata/datadog.rb | 5 ++++- lib/datadog/tracing/distributed/metadata/parser.rb | 3 +-- .../tracing/distributed/metadata/b3_single_spec.rb | 4 +++- spec/datadog/tracing/distributed/metadata/b3_spec.rb | 8 ++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index da580eeedd7..ace70ca4e92 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -13,7 +13,10 @@ def self.inject!(digest, metadata) metadata[GRPC_METADATA_TRACE_ID] = digest.trace_id.to_s metadata[GRPC_METADATA_PARENT_ID] = digest.span_id.to_s - metadata[GRPC_METADATA_SAMPLING_PRIORITY] = digest.trace_sampling_priority.to_s if digest.trace_sampling_priority + if digest.trace_sampling_priority + metadata[GRPC_METADATA_SAMPLING_PRIORITY] = + digest.trace_sampling_priority.to_s + end metadata[GRPC_METADATA_ORIGIN] = digest.trace_origin.to_s if digest.trace_origin metadata diff --git a/lib/datadog/tracing/distributed/metadata/parser.rb b/lib/datadog/tracing/distributed/metadata/parser.rb index 5597eeb185e..7562654b8be 100755 --- a/lib/datadog/tracing/distributed/metadata/parser.rb +++ b/lib/datadog/tracing/distributed/metadata/parser.rb @@ -1,5 +1,5 @@ require 'datadog/tracing/distributed/helpers' - + module Datadog module Tracing module Distributed @@ -13,7 +13,6 @@ def id(key, base = 10) Helpers.value_to_id(metadata_for_key(key), base) end - def number(key, base = 10) Helpers.value_to_number(metadata_for_key(key), base) end diff --git a/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb index 0e949c50027..033f13a1687 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb @@ -46,7 +46,9 @@ ) end - it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => "c350-ea60-#{expected}") } + it { + is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => "c350-ea60-#{expected}") + } end end diff --git a/spec/datadog/tracing/distributed/metadata/b3_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_spec.rb index 126db6189b9..81365cec2f0 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_spec.rb @@ -46,8 +46,8 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 50000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => expected.to_s) + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 60000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => expected.to_s) end end end @@ -63,7 +63,7 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 100000.to_s(16)) + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 100000.to_s(16)) end end end @@ -82,7 +82,7 @@ context 'with trace_id and span_id' do let(:metadata) do { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16)} + Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16) } end it { expect(digest.span_id).to eq(20000) } From b48e3add50516880cd0fc62b7997db73d776ecb1 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 27 Jun 2022 16:32:43 -0700 Subject: [PATCH 0133/2133] Doc-YARD:Fix documented type of min_spans_threshold This PR fixes the YARD documentation return type of `c.tracing.partial_flush.min_spans_threshold`. --- lib/datadog/core/configuration/settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 022adf52e9e..9c6a0df5515 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -505,7 +505,7 @@ def initialize(*_) # are always flushed immediately. # # @default 500 - # @return [Boolean] + # @return [Integer] option :min_spans_threshold, default: 500 end From 62901eaacc68a6df583f3c0178848316c7a9b230 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 27 Jun 2022 16:42:02 -0700 Subject: [PATCH 0134/2133] GH: Expand on PR template with link to docs Adds a link to https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md to the PR template, to help developers test and clean up their code. Also, expand the language around testing requirements for the PR --- .github/PULL_REQUEST_TEMPLATE.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7f06699e697..c74f529056b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,10 @@ + + **What does this PR do?** @@ -8,4 +15,9 @@ **How to test the change?** - + From 7c75c27b22728e146dbddcedffcea86560837650 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Tue, 28 Jun 2022 15:28:49 +0200 Subject: [PATCH 0135/2133] Span and trace IDs should not be zero The Agent drops IDs == 0. --- lib/datadog/core/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/core/utils.rb b/lib/datadog/core/utils.rb index 9eaebf18d48..e56ba4278be 100644 --- a/lib/datadog/core/utils.rb +++ b/lib/datadog/core/utils.rb @@ -19,7 +19,7 @@ module Utils # This method is thread-safe and fork-safe. def self.next_id after_fork! { reset! } - id_rng.rand(Tracing::Span::RUBY_MAX_ID) # TODO: This should never return zero + id_rng.rand(1..Tracing::Span::RUBY_MAX_ID) end def self.id_rng From 51a5fb39316a053296e882749e8aa9e1b9166036 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Tue, 28 Jun 2022 10:55:36 -0300 Subject: [PATCH 0136/2133] fix: add required documentation in classes --- lib/datadog/tracing/distributed/headers/parser.rb | 1 + lib/datadog/tracing/distributed/metadata/b3.rb | 2 +- lib/datadog/tracing/distributed/metadata/b3_single.rb | 2 +- lib/datadog/tracing/distributed/metadata/datadog.rb | 2 ++ lib/datadog/tracing/distributed/metadata/parser.rb | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/distributed/headers/parser.rb b/lib/datadog/tracing/distributed/headers/parser.rb index 082947e3893..18288acac44 100644 --- a/lib/datadog/tracing/distributed/headers/parser.rb +++ b/lib/datadog/tracing/distributed/headers/parser.rb @@ -1,4 +1,5 @@ # typed: false + require 'datadog/tracing/distributed/helpers' module Datadog diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb index a4a016baff5..98a14f9498f 100755 --- a/lib/datadog/tracing/distributed/metadata/b3.rb +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -9,7 +9,7 @@ module Datadog module Tracing module Distributed module Metadata - # B3 provides helpers to inject or extract headers for B3 style headers + # B3 provides helpers to inject or extract metadata for B3 style headers module B3 include Distributed::Headers::Ext diff --git a/lib/datadog/tracing/distributed/metadata/b3_single.rb b/lib/datadog/tracing/distributed/metadata/b3_single.rb index 368210bffe7..ffa81073f04 100755 --- a/lib/datadog/tracing/distributed/metadata/b3_single.rb +++ b/lib/datadog/tracing/distributed/metadata/b3_single.rb @@ -9,7 +9,7 @@ module Datadog module Tracing module Distributed module Metadata - # B3Single provides helpers to inject or extract headers for B3 single header style headers + # B3Single provides helpers to inject or extract metadata for B3 single header style headers module B3Single include Distributed::Headers::Ext diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index ace70ca4e92..233cffdc76d 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -5,6 +5,8 @@ module Datadog module Tracing module Distributed module Metadata + + # Datadog provides helpers to inject or extract metadata for Datadog style headers class Datadog include Distributed::Headers::Ext diff --git a/lib/datadog/tracing/distributed/metadata/parser.rb b/lib/datadog/tracing/distributed/metadata/parser.rb index 7562654b8be..998f242db3f 100755 --- a/lib/datadog/tracing/distributed/metadata/parser.rb +++ b/lib/datadog/tracing/distributed/metadata/parser.rb @@ -4,6 +4,7 @@ module Datadog module Tracing module Distributed module Metadata + # Parser provides easy access and validation methods for metadata headers class Parser def initialize(metadata) @metadata = metadata From 8212bd2d9df5f4291d2db4c634b9dea3eeed1f00 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Tue, 28 Jun 2022 11:00:42 -0300 Subject: [PATCH 0137/2133] fix: add missing documentation in class --- lib/datadog/tracing/distributed/metadata/datadog.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb index 233cffdc76d..63a73022531 100755 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -5,7 +5,6 @@ module Datadog module Tracing module Distributed module Metadata - # Datadog provides helpers to inject or extract metadata for Datadog style headers class Datadog include Distributed::Headers::Ext @@ -37,6 +36,7 @@ def self.extract(metadata) ) end + # opentracing.io compliant carrier object class Carrier include Distributed::Headers::Ext From edf4eb0c0502e08b5d6c3fb04b46259498e72a93 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 28 Jun 2022 17:13:55 +0100 Subject: [PATCH 0138/2133] Remove outdated note about profiling being beta Ooops! Profiling has been GA since December, but we totally missed this one line in the documentation. --- docs/GettingStarted.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 690b5967eb2..38389ede105 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2664,8 +2664,6 @@ However, additional instrumentation provided by Datadog can be activated alongsi ### Profiling -*Currently available as BETA feature.* - `ddtrace` can produce profiles that measure method-level application resource usage within production environments. These profiles can give insight into resources spent in Ruby code outside of existing trace instrumentation. **Setup** From 7de97e7df37d1f019b451cf3dfb1742f65380a66 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:00:58 -0700 Subject: [PATCH 0139/2133] Update utils.rb --- lib/datadog/core/utils.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/datadog/core/utils.rb b/lib/datadog/core/utils.rb index e56ba4278be..927374b881d 100644 --- a/lib/datadog/core/utils.rb +++ b/lib/datadog/core/utils.rb @@ -9,6 +9,9 @@ module Core # @public_api module Utils extend Forking + + # Excludes zero from possible values + ID_RANGE = (1..Tracing::Span::RUBY_MAX_ID).freeze EMPTY_STRING = ''.encode(::Encoding::UTF_8).freeze # We use a custom random number generator because we want no interference @@ -19,7 +22,7 @@ module Utils # This method is thread-safe and fork-safe. def self.next_id after_fork! { reset! } - id_rng.rand(1..Tracing::Span::RUBY_MAX_ID) + id_rng.rand(ID_RANGE) end def self.id_rng From 128164250b6547dbf5b69b7f2492424e21b7ab3d Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:02:07 -0700 Subject: [PATCH 0140/2133] Update lib/datadog/tracing/context_provider.rb Co-authored-by: Ivo Anjo --- lib/datadog/tracing/context_provider.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datadog/tracing/context_provider.rb b/lib/datadog/tracing/context_provider.rb index 8169e310a5f..9e76788a55e 100644 --- a/lib/datadog/tracing/context_provider.rb +++ b/lib/datadog/tracing/context_provider.rb @@ -68,11 +68,11 @@ def local(storage = Thread.current) # but the VM is allowed to reuse `object_id`, allow for the possibility that # a new FiberLocalContext would be able to read an old FiberLocalContext's # value. - @mutex = Mutex.new - @unique_instance_id = Datadog::Core::Utils::Sequence.new + UNIQUE_INSTANCE_MUTEX = Mutex.new + UNIQUE_INSTANCE_GENERATOR = Datadog::Core::Utils::Sequence.new def self.next_instance_id - @mutex.synchronize { @unique_instance_id.next } + UNIQUE_INSTANCE_MUTEX.synchronize { UNIQUE_INSTANCE_GENERATOR.next } end end end From d4a2751ec23c75d4262f8ba39f20194b1f79a294 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:07:51 -0700 Subject: [PATCH 0141/2133] Fix other class instance variables --- lib/datadog/opentracer/thread_local_scope_manager.rb | 8 +++++--- lib/datadog/tracing/context_provider.rb | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/datadog/opentracer/thread_local_scope_manager.rb b/lib/datadog/opentracer/thread_local_scope_manager.rb index 8beb71c5cb7..c4322957510 100644 --- a/lib/datadog/opentracer/thread_local_scope_manager.rb +++ b/lib/datadog/opentracer/thread_local_scope_manager.rb @@ -47,11 +47,13 @@ def active # but the VM is allowed to reuse `object_id`, allow for the possibility that # a new FiberLocalContext would be able to read an old FiberLocalContext's # value. - @mutex = Mutex.new - @unique_instance_id = Datadog::Core::Utils::Sequence.new + UNIQUE_INSTANCE_MUTEX = Mutex.new + UNIQUE_INSTANCE_GENERATOR = Datadog::Core::Utils::Sequence.new + + private_constant :UNIQUE_INSTANCE_MUTEX, :UNIQUE_INSTANCE_GENERATOR def self.next_instance_id - @mutex.synchronize { @unique_instance_id.next } + UNIQUE_INSTANCE_MUTEX.synchronize { UNIQUE_INSTANCE_GENERATOR.next } end private diff --git a/lib/datadog/tracing/context_provider.rb b/lib/datadog/tracing/context_provider.rb index 9e76788a55e..074ec5a6aa6 100644 --- a/lib/datadog/tracing/context_provider.rb +++ b/lib/datadog/tracing/context_provider.rb @@ -71,6 +71,8 @@ def local(storage = Thread.current) UNIQUE_INSTANCE_MUTEX = Mutex.new UNIQUE_INSTANCE_GENERATOR = Datadog::Core::Utils::Sequence.new + private_constant :UNIQUE_INSTANCE_MUTEX, :UNIQUE_INSTANCE_GENERATOR + def self.next_instance_id UNIQUE_INSTANCE_MUTEX.synchronize { UNIQUE_INSTANCE_GENERATOR.next } end From 11df34545895de3fef423fca83d10f65b06e10c4 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:13:02 -0700 Subject: [PATCH 0142/2133] Fix circular dependency --- lib/datadog/core/utils.rb | 5 +---- lib/datadog/tracing/span.rb | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/datadog/core/utils.rb b/lib/datadog/core/utils.rb index 927374b881d..d46a6d8aaca 100644 --- a/lib/datadog/core/utils.rb +++ b/lib/datadog/core/utils.rb @@ -9,9 +9,6 @@ module Core # @public_api module Utils extend Forking - - # Excludes zero from possible values - ID_RANGE = (1..Tracing::Span::RUBY_MAX_ID).freeze EMPTY_STRING = ''.encode(::Encoding::UTF_8).freeze # We use a custom random number generator because we want no interference @@ -22,7 +19,7 @@ module Utils # This method is thread-safe and fork-safe. def self.next_id after_fork! { reset! } - id_rng.rand(ID_RANGE) + id_rng.rand(Tracing::Span::RUBY_ID_RANGE) end def self.id_rng diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index 804c12a0009..a2db8d6f164 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -28,6 +28,9 @@ class Span # The range of IDs also has to consider portability across different languages and platforms. RUBY_MAX_ID = (1 << 62) - 1 + # Excludes zero from possible values + RUBY_ID_RANGE = (1..RUBY_MAX_ID).freeze + # While we only generate 63-bit integers due to limitations in other languages, we support # parsing 64-bit integers for distributed tracing since an upstream system may generate one EXTERNAL_MAX_ID = 1 << 64 From edc042cd982e580da8d0d207cda826ef116bd0e9 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:24:11 -0700 Subject: [PATCH 0143/2133] Add comment for after_fork possible assignment issue --- lib/datadog/tracing/context_provider.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/datadog/tracing/context_provider.rb b/lib/datadog/tracing/context_provider.rb index 074ec5a6aa6..a1f70f252fa 100644 --- a/lib/datadog/tracing/context_provider.rb +++ b/lib/datadog/tracing/context_provider.rb @@ -31,6 +31,7 @@ def context(key = nil) # that were generated from the parent process. Reset it such # that it acts like a distributed trace. current_context.after_fork! do + # TODO: Only assign to `self.context` when working on the current thread (`key == nil`) current_context = self.context = current_context.fork_clone end From 27cd8430af23bed7ba939287e75c8ca9b7b8f07d Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 28 Jun 2022 14:57:54 -0700 Subject: [PATCH 0144/2133] Address comments --- lib/datadog/tracing/sampling/rate_sampler.rb | 3 +++ lib/datadog/tracing/sampling/span/ext.rb | 4 ++-- lib/datadog/tracing/sampling/span/rule.rb | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/sampling/rate_sampler.rb b/lib/datadog/tracing/sampling/rate_sampler.rb index 5d61e58b084..0c7dfe7126d 100644 --- a/lib/datadog/tracing/sampling/rate_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_sampler.rb @@ -20,6 +20,9 @@ class RateSampler < Sampler # * +sample_rate+: the sample rate as a {Float} between 0.0 and 1.0. 0.0 # means that no trace will be sampled; 1.0 means that all traces will be # sampled. + # + # DEV-2.0: Allow for `sample_rate` zero (drop all) to be allowed. This eases + # DEV-2.0: usage for many consumers of the {RateSampler} class. def initialize(sample_rate = 1.0) super() diff --git a/lib/datadog/tracing/sampling/span/ext.rb b/lib/datadog/tracing/sampling/span/ext.rb index c8b416e6232..8630cc4ef23 100644 --- a/lib/datadog/tracing/sampling/span/ext.rb +++ b/lib/datadog/tracing/sampling/span/ext.rb @@ -4,8 +4,8 @@ module Datadog module Tracing module Sampling module Span - # Checks if a span conforms to a matching criteria. - class Ext + # Single Span Sampling constants. + module Ext # Accept all spans (100% retention). DEFAULT_SAMPLE_RATE = 1.0 # Unlimited. diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index efc2b216a00..c152f292f00 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -30,6 +30,10 @@ def initialize( @rate_limit = rate_limit @sampler = Sampling::RateSampler.new + # Set the sample_rate outside of the initializer to allow for + # zero to be a "drop all". + # The RateSampler initializer enforces non-zero, falling back to 100% sampling + # if zero is provided. @sampler.sample_rate = sample_rate @rate_limiter = Sampling::TokenBucket.new(rate_limit) end From 26e8a2da7f04e446e109993b6276746dcbbd46f9 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 29 Jun 2022 09:39:07 -0700 Subject: [PATCH 0145/2133] Doc:Change YARD link to our hosted doc version The S3-hosted YARD documentation respects`.yardopts`, while the public `rubydoc.info` does not. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1875171a7d6..1286f057592 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Gem](https://img.shields.io/gem/v/ddtrace)](https://rubygems.org/gems/ddtrace/) [![CircleCI](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master.svg?style=svg&circle-token=b0bd5ef866ec7f7b018f48731bb495f2d1372cc1)](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master) [![codecov](https://codecov.io/gh/DataDog/dd-trace-rb/branch/master/graph/badge.svg)](https://app.codecov.io/gh/DataDog/dd-trace-rb/branch/master) -[![YARD documentation](https://img.shields.io/badge/YARD-documentation-blue)](https://www.rubydoc.info/gems/ddtrace/) +[![YARD documentation](https://img.shields.io/badge/YARD-documentation-blue)](https://s3.amazonaws.com/gems.datadoghq.com/trace/docs/index.html) ``ddtrace`` is Datadog’s tracing client for Ruby. It is used to trace requests as they flow across web servers, databases and microservices so that developers have great visiblity into bottlenecks and troublesome requests. From 719b5392dfd572d18ec879b70ee6f1ad40ea88dc Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Thu, 30 Jun 2022 10:02:37 -0300 Subject: [PATCH 0146/2133] feat: add option distributed tracing why? to disable the injection of metadata injection in the gRPC client calls. --- .../contrib/grpc/configuration/settings.rb | 1 + .../contrib/grpc/datadog_interceptor.rb | 4 ++ .../grpc/datadog_interceptor/client.rb | 2 +- .../grpc/datadog_interceptor/client_spec.rb | 49 +++++++++++++++++-- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/lib/datadog/tracing/contrib/grpc/configuration/settings.rb b/lib/datadog/tracing/contrib/grpc/configuration/settings.rb index 1bb8809bedc..009dc99732d 100644 --- a/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/grpc/configuration/settings.rb @@ -27,6 +27,7 @@ class Settings < Contrib::Configuration::Settings o.lazy end + option :distributed_tracing, default: true option :service_name, default: Ext::DEFAULT_PEER_SERVICE_NAME option :error_handler, default: Tracing::SpanOperation::Events::DEFAULT_ON_ERROR end diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb index d301218e664..9e02f58fe7c 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb @@ -53,6 +53,10 @@ def analytics_enabled? Contrib::Analytics.enabled?(datadog_configuration[:analytics_enabled]) end + def distributed_tracing? + Datadog.configuration_for(self, :distributed_tracing) || datadog_configuration[:distributed_tracing] + end + def analytics_sample_rate datadog_configuration[:analytics_sample_rate] end diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb index 7ae76a95d79..6f9338e68c1 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb @@ -47,7 +47,7 @@ def annotate!(trace, span, metadata, call) # Set analytics sample rate Contrib::Analytics.set_sample_rate(span, analytics_sample_rate) if analytics_enabled? - Tracing::Propagation::GRPC.inject!(trace, metadata) + Tracing::Propagation::GRPC.inject!(trace, metadata) if distributed_tracing? rescue StandardError => e Datadog.logger.debug("GRPC client trace failed: #{e}") end diff --git a/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb b/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb index 0b393d9e517..c80a6ff6b17 100644 --- a/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb +++ b/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb @@ -4,6 +4,8 @@ require 'datadog/tracing/contrib/support/spec_helper' require 'datadog/tracing/contrib/analytics_examples' +require 'datadog/tracing/distributed/headers/ext' + require 'grpc' require 'ddtrace' @@ -86,33 +88,64 @@ it_behaves_like 'measured span for integration', false end + shared_examples 'inject distributed tracing metada' do + context 'when distributed tracing is disabled' do + let(:configuration_options) { { service_name: 'rspec', distributed_tracing: false } } + + it 'doesn\'t inject the trace headers in gRPC metadata' do + expect(keywords[:metadata]).to eq(original_metadata) + end + end + + context 'when distributed tracing is enabled' do + let(:configuration_options) { { service_name: 'rspec', distributed_tracing: true } } + + it 'does inject the trace headers in gRPC metadata' do + metadata_keys = [ + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID, + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID, + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY, + ] + + expect(keywords[:metadata].keys).to include(*metadata_keys) + end + end + end + describe '#request_response' do let(:keywords) do { request: instance_double(Object), call: instance_double('GRPC::ActiveCall', peer: peer), method: 'MyService.Endpoint', - metadata: { some: 'datum' } } + metadata: original_metadata.clone } end + let(:original_metadata) { { some: 'datum' } } + before do subject.request_response(**keywords) {} end it_behaves_like 'span data contents' + + it_behaves_like 'inject distributed tracing metada' end describe '#client_streamer' do let(:keywords) do { call: instance_double('GRPC::ActiveCall', peer: peer), method: 'MyService.Endpoint', - metadata: { some: 'datum' } } + metadata: original_metadata.clone } end + let(:original_metadata) { { some: 'datum' } } before do subject.client_streamer(**keywords) {} end it_behaves_like 'span data contents' + + it_behaves_like 'inject distributed tracing metada' end describe '#server_streamer' do @@ -120,14 +153,18 @@ { request: instance_double(Object), call: instance_double('GRPC::ActiveCall', peer: peer), method: 'MyService.Endpoint', - metadata: { some: 'datum' } } + metadata: original_metadata.clone } end + let(:original_metadata) { { some: 'datum' } } + before do subject.server_streamer(**keywords) {} end it_behaves_like 'span data contents' + + it_behaves_like 'inject distributed tracing metada' end describe '#bidi_streamer' do @@ -135,13 +172,17 @@ { requests: instance_double(Array), call: instance_double('GRPC::ActiveCall', peer: peer), method: 'MyService.Endpoint', - metadata: { some: 'datum' } } + metadata: original_metadata.clone } end + let(:original_metadata) { { some: 'datum' } } + before do subject.bidi_streamer(**keywords) {} end it_behaves_like 'span data contents' + + it_behaves_like 'inject distributed tracing metada' end end From 86c7aa72361c8c1d688b1eeff2c77630339be5e3 Mon Sep 17 00:00:00 2001 From: Henrich Moraes Date: Thu, 30 Jun 2022 14:43:44 -0300 Subject: [PATCH 0147/2133] fix: remove unnecessary constants --- lib/datadog/tracing/distributed/headers/ext.rb | 6 ------ lib/datadog/tracing/distributed/metadata/b3.rb | 10 +++++----- lib/datadog/tracing/distributed/metadata/b3_single.rb | 4 ++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/datadog/tracing/distributed/headers/ext.rb b/lib/datadog/tracing/distributed/headers/ext.rb index 411081a9164..3a026fc71d4 100644 --- a/lib/datadog/tracing/distributed/headers/ext.rb +++ b/lib/datadog/tracing/distributed/headers/ext.rb @@ -24,12 +24,6 @@ module Ext GRPC_METADATA_PARENT_ID = 'x-datadog-parent-id'.freeze GRPC_METADATA_SAMPLING_PRIORITY = 'x-datadog-sampling-priority'.freeze GRPC_METADATA_ORIGIN = 'x-datadog-origin'.freeze - - # B3 gRPC metadata used for distributed tracing - B3_METADATA_TRACE_ID = 'x-b3-traceid'.freeze - B3_METADATA_SPAN_ID = 'x-b3-spanid'.freeze - B3_METADATA_SAMPLED = 'x-b3-sampled'.freeze - B3_METADATA_SINGLE = 'b3'.freeze end end end diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb index 98a14f9498f..a77693951bd 100755 --- a/lib/datadog/tracing/distributed/metadata/b3.rb +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -17,8 +17,8 @@ def self.inject!(digest, metadata) return if digest.nil? # DEV: We need these to be hex encoded - metadata[B3_METADATA_TRACE_ID] = digest.trace_id.to_s(16) - metadata[B3_METADATA_SPAN_ID] = digest.span_id.to_s(16) + metadata[B3_HEADER_TRACE_ID] = digest.trace_id.to_s(16) + metadata[B3_HEADER_SPAN_ID] = digest.span_id.to_s(16) if digest.trace_sampling_priority sampling_priority = Helpers.clamp_sampling_priority( @@ -34,10 +34,10 @@ def self.extract(metadata) # Extract values from gRPC metadata # DEV: B3 doesn't have "origin" metadata = Parser.new(metadata) - trace_id = metadata.id(B3_METADATA_TRACE_ID, 16) - span_id = metadata.id(B3_METADATA_SPAN_ID, 16) + trace_id = metadata.id(B3_HEADER_TRACE_ID, 16) + span_id = metadata.id(B3_HEADER_SPAN_ID, 16) # We don't need to try and convert sampled since B3 supports 0/1 (AUTO_REJECT/AUTO_KEEP) - sampling_priority = metadata.number(B3_METADATA_SAMPLED) + sampling_priority = metadata.number(B3_HEADER_SAMPLED) # Return early if this propagation is not valid return unless trace_id && span_id diff --git a/lib/datadog/tracing/distributed/metadata/b3_single.rb b/lib/datadog/tracing/distributed/metadata/b3_single.rb index ffa81073f04..26caed655db 100755 --- a/lib/datadog/tracing/distributed/metadata/b3_single.rb +++ b/lib/datadog/tracing/distributed/metadata/b3_single.rb @@ -31,7 +31,7 @@ def self.inject!(digest, metadata) b3_header += "-#{sampling_priority}" end - metadata[B3_METADATA_SINGLE] = b3_header + metadata[B3_HEADER_SINGLE] = b3_header metadata end @@ -42,7 +42,7 @@ def self.extract(metadata) # https://github.com/apache/incubator-zipkin-b3-propagation/tree/7c6e9f14d6627832bd80baa87ac7dabee7be23cf#single-header # DEV: `{SamplingState}` and `{ParentSpanId`}` are optional - b3_single = Parser.new(metadata).metadata_for_key(B3_METADATA_SINGLE) + b3_single = Parser.new(metadata).metadata_for_key(B3_HEADER_SINGLE) return if b3_single.nil? parts = b3_single.split('-') From f25b31b4c906f489f3338d9cc9951f3af576d572 Mon Sep 17 00:00:00 2001 From: Alex Robbin Date: Wed, 29 Jun 2022 21:14:14 -0400 Subject: [PATCH 0148/2133] correctly set the default service based off of Rails config While the code comment states: > By default, default service would be guessed from the script being executed, but here we know better, get it from Rails config. In practice, because `Datadog.configuration.service` is *always* present ([here](https://github.com/DataDog/dd-trace-rb/blob/26e8a2da7f04e446e109993b6276746dcbbd46f9/lib/datadog/core/configuration/settings.rb#L271-L287)), `||=` will never set anything. Now, the Rails framework integration leverages `Datadog.configuration.service_without_fallback` to determine if `Datadog.configuration.service` should be set. --- .../tracing/contrib/rails/framework.rb | 14 +++++------- .../tracing/contrib/rails/defaults_spec.rb | 22 +++++++++---------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/lib/datadog/tracing/contrib/rails/framework.rb b/lib/datadog/tracing/contrib/rails/framework.rb index 7ba2fbea921..3055674733e 100644 --- a/lib/datadog/tracing/contrib/rails/framework.rb +++ b/lib/datadog/tracing/contrib/rails/framework.rb @@ -36,18 +36,14 @@ def self.setup # used to reconfigure tracer components with Rails-sourced defaults. # This is a trade-off we take to get nice defaults. Datadog.configure do |datadog_config| + rails_config = datadog_config.tracing[:rails] + # By default, default service would be guessed from the script # being executed, but here we know better, get it from Rails config. # Don't set this if service has been explicitly provided by the user. - rails_service_name = Datadog.configuration.tracing[:rails][:service_name] \ - || Datadog.configuration.service_without_fallback \ - || Utils.app_name - - datadog_config.service ||= rails_service_name - end - - Datadog.configure do |datadog_config| - rails_config = datadog_config.tracing[:rails] + if datadog_config.service_without_fallback.nil? + datadog_config.service = rails_config[:service_name] || Utils.app_name + end activate_rack!(datadog_config, rails_config) activate_action_cable!(datadog_config, rails_config) diff --git a/spec/datadog/tracing/contrib/rails/defaults_spec.rb b/spec/datadog/tracing/contrib/rails/defaults_spec.rb index 8a3a923c09c..facec225523 100644 --- a/spec/datadog/tracing/contrib/rails/defaults_spec.rb +++ b/spec/datadog/tracing/contrib/rails/defaults_spec.rb @@ -6,42 +6,40 @@ include_context 'Rails test application' context 'when Datadog.configuration.service' do - before do - Datadog.configure { |c| c.service = default_service } - app - end - - after { Datadog.configure { |c| c.service = nil } } + after { without_warnings { Datadog.configuration.reset! } } context 'is not configured' do - let(:default_service) { nil } + before { app } describe 'Datadog.configuration.service' do subject(:global_default_service) { Datadog.configuration.service } - it { expect(global_default_service).to match(/rails/) } + it { expect(global_default_service).to start_with('rails') } end describe 'Global tracer default_service' do subject(:tracer_default_service) { Datadog::Tracing.send(:tracer).default_service } - it { expect(tracer_default_service).to match(/rails/) } + it { expect(tracer_default_service).to start_with('rails') } end end context 'is configured' do - let(:default_service) { 'default-service' } + before do + Datadog.configure { |c| c.service = 'default-service' } + app + end describe 'Datadog.configuration.service' do subject(:global_default_service) { Datadog.configuration.service } - it { expect(global_default_service).to be default_service } + it { expect(global_default_service).to eq('default-service') } end describe 'Global tracer default_service' do subject(:tracer_default_service) { Datadog::Tracing.send(:tracer).default_service } - it { expect(tracer_default_service).to eq(default_service) } + it { expect(tracer_default_service).to eq('default-service') } end end end From fdecf6e91d4533a446f17eb787301e703a188043 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 11:08:40 -0700 Subject: [PATCH 0149/2133] Fix remaining references to B3_METADATA_SINGLE --- .../tracing/distributed/metadata/b3_single_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb index 033f13a1687..9a8ab9feb2e 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_single_spec.rb @@ -29,7 +29,7 @@ ) end - it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '2710-4e20') } + it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '2710-4e20') } [ [-1, 0], @@ -47,7 +47,7 @@ end it { - is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => "c350-ea60-#{expected}") + is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => "c350-ea60-#{expected}") } end end @@ -61,7 +61,7 @@ ) end - it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0') } + it { is_expected.to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '15f90-186a0') } end end end @@ -77,7 +77,7 @@ end context 'with trace_id and span_id' do - let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0' } } + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '15f90-186a0' } } it { expect(digest.span_id).to eq(100000) } it { expect(digest.trace_id).to eq(90000) } @@ -85,7 +85,7 @@ it { expect(digest.trace_sampling_priority).to be nil } context 'with sampling priority' do - let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0-1' } } + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '15f90-186a0-1' } } it { expect(digest.span_id).to eq(100000) } it { expect(digest.trace_id).to eq(90000) } @@ -95,7 +95,7 @@ context 'with parent_id' do let(:metadata) do { - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90-186a0-1-4e20' + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '15f90-186a0-1-4e20' } end @@ -108,7 +108,7 @@ end context 'with trace_id' do - let(:env) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SINGLE => '15f90' } } + let(:env) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SINGLE => '15f90' } } it { is_expected.to be nil } end From 3605679ea3b4aec748239ba37e937e73e6c75296 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 11:10:23 -0700 Subject: [PATCH 0150/2133] Document grpc distributed_tracing option --- docs/GettingStarted.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 690b5967eb2..114ad8ab40d 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1144,6 +1144,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | Key | Description | Default | | --- | ----------- | ------- | +| `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` | | `service_name` | Service name used for `grpc` instrumentation | `'grpc'` | | `error_handler` | Custom error handler invoked when a request is an error. A `Proc` that accepts `span` and `error` parameters. Sets error on the span by default. | `proc { |span, error| span.set_error(error) unless span.nil? }` | From 9e929e3255215e423ecff9bf3df6fcabc427ba8e Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 11:11:45 -0700 Subject: [PATCH 0151/2133] Fix references to B3_METADATA_* --- .../tracing/distributed/metadata/b3_spec.rb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/spec/datadog/tracing/distributed/metadata/b3_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_spec.rb index 81365cec2f0..473463968d6 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_spec.rb @@ -25,8 +25,8 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16)) + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) end [ @@ -45,9 +45,9 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 50000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => expected.to_s) + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) end end end @@ -62,8 +62,8 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 100000.to_s(16)) + expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) end end end @@ -81,8 +81,8 @@ context 'with trace_id and span_id' do let(:metadata) do - { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16) } + { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16) } end it { expect(digest.span_id).to eq(20000) } @@ -92,9 +92,9 @@ context 'with sampling priority' do let(:metadata) do - { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => '1' } + { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => '1' } end it { expect(digest.span_id).to eq(20000) } @@ -105,8 +105,8 @@ context 'with origin' do let(:metadata) do - { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 20000.to_s(16), + { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16), Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics' } end @@ -118,19 +118,19 @@ end context 'with span_id' do - let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SPAN_ID => 10000.to_s(16) } } + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 10000.to_s(16) } } it { is_expected.to be nil } end context 'with sampling priority' do - let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_SAMPLED => '1' } } + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => '1' } } it { is_expected.to be nil } end context 'with trace_id' do - let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_METADATA_TRACE_ID => 10000.to_s(16) } } + let(:metadata) { { Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16) } } it { is_expected.to be nil } end From aa4ab801ff81adf84a3e5e20b0d3f8dbb556b1a5 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 11:30:39 -0700 Subject: [PATCH 0152/2133] =?UTF-8?q?Sacrifice=20for=20the=20linting=20god?= =?UTF-8?q?s=20=E2=98=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/datadog/tracing/metadata/tagging.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 6ce64e78dc3..90e8a2a33b3 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -72,10 +72,10 @@ def clear_tag(key) # Convenient interface for setting a single tag. alias []= set_tag - + # Convenient interface for getting a single tag. alias [] get_tag - + # Return the metric with the given key, nil if it doesn't exist. def get_metric(key) metrics[key] || meta[key] From 8f4617e8ef62b0291ba3b061b8d2d6b81496052e Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 11:54:32 -0700 Subject: [PATCH 0153/2133] Rename bool/nil to symbols --- lib/datadog/tracing/sampling/span/rule.rb | 10 +++++----- spec/datadog/tracing/sampling/span/rule_spec.rb | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index c152f292f00..7fae5517b95 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -53,18 +53,18 @@ def initialize( # This method modifies the `span` if it matches the provided matcher. # # @param [Datadog::Tracing::SpanOperation] span_op span to be sampled - # @return [Boolean] should this span be sampled? - # @return [nil] span did not satisfy the matcher, no changes are made to the span + # @return [:kept,:rejected] should this span be sampled? + # @return [:not_matched] span did not satisfy the matcher, no changes are made to the span def sample!(span_op) - return nil unless @matcher.match?(span_op) + return :not_matched unless @matcher.match?(span_op) if @sampler.sample?(span_op) && @rate_limiter.allow?(1) span_op.set_metric(Span::Ext::TAG_MECHANISM, Span::Ext::MECHANISM_SPAN_SAMPLING_RATE) span_op.set_metric(Span::Ext::TAG_RULE_RATE, @sample_rate) span_op.set_metric(Span::Ext::TAG_MAX_PER_SECOND, @rate_limit) - true + :kept else - false + :rejected end end end diff --git a/spec/datadog/tracing/sampling/span/rule_spec.rb b/spec/datadog/tracing/sampling/span/rule_spec.rb index fb3672b5125..0489e91f230 100644 --- a/spec/datadog/tracing/sampling/span/rule_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_spec.rb @@ -39,8 +39,8 @@ context 'not sampled' do let(:sample_rate) { 0.0 } - it 'returns false' do - is_expected.to eq(false) + it 'returns rejected' do + is_expected.to eq(:rejected) end it_behaves_like 'does not modify span' @@ -52,8 +52,8 @@ context 'rate limited' do let(:rate_limit) { 0 } - it 'returns false' do - is_expected.to eq(false) + it 'returns rejected' do + is_expected.to eq(:rejected) end it_behaves_like 'does not modify span' @@ -62,8 +62,8 @@ context 'not rate limited' do let(:rate_limit) { 3 } - it 'returns true' do - is_expected.to eq(true) + it 'returns kept' do + is_expected.to eq(:kept) end it 'sets mechanism, rule rate and rate limit metrics' do @@ -83,7 +83,7 @@ end it 'returns nil' do - is_expected.to be_nil + is_expected.to eq(:not_matched) end it_behaves_like 'does not modify span' From 8645e4cd43429667003f7419e791f0461ad0cfea Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 13:05:59 -0700 Subject: [PATCH 0154/2133] [Single Span Sampling] Parse user configuration --- lib/datadog/tracing/sampling/rate_limiter.rb | 3 + lib/datadog/tracing/sampling/span/matcher.rb | 9 + lib/datadog/tracing/sampling/span/rule.rb | 8 + .../tracing/sampling/span/rule_parser.rb | 98 +++++++++++ .../tracing/sampling/rate_limiter_spec.rb | 16 ++ .../tracing/sampling/span/rule_parser_spec.rb | 154 ++++++++++++++++++ 6 files changed, 288 insertions(+) create mode 100644 lib/datadog/tracing/sampling/span/rule_parser.rb create mode 100644 spec/datadog/tracing/sampling/span/rule_parser_spec.rb diff --git a/lib/datadog/tracing/sampling/rate_limiter.rb b/lib/datadog/tracing/sampling/rate_limiter.rb index 8f7661c9055..bf76a7e81dc 100644 --- a/lib/datadog/tracing/sampling/rate_limiter.rb +++ b/lib/datadog/tracing/sampling/rate_limiter.rb @@ -39,6 +39,9 @@ class TokenBucket < RateLimiter def initialize(rate, max_tokens = rate) super() + raise ArgumentError, "rate must be a number: #{rate}" unless rate.is_a?(Numeric) + raise ArgumentError, "max_tokens must be a number: #{max_tokens}" unless max_tokens.is_a?(Numeric) + @rate = rate @max_tokens = max_tokens diff --git a/lib/datadog/tracing/sampling/span/matcher.rb b/lib/datadog/tracing/sampling/span/matcher.rb index 1d3d6d95bd9..aa40ec22516 100644 --- a/lib/datadog/tracing/sampling/span/matcher.rb +++ b/lib/datadog/tracing/sampling/span/matcher.rb @@ -6,6 +6,8 @@ module Sampling module Span # Checks if a span conforms to a matching criteria. class Matcher + attr_reader :name, :service + # Pattern that matches any string MATCH_ALL_PATTERN = '*' @@ -54,6 +56,13 @@ def match?(span) end end + def ==(other) + return super unless other.is_a?(Matcher) + + name == other.name && + service == other.service + end + private # @param pattern [String] diff --git a/lib/datadog/tracing/sampling/span/rule.rb b/lib/datadog/tracing/sampling/span/rule.rb index 7fae5517b95..43bf0f44361 100644 --- a/lib/datadog/tracing/sampling/span/rule.rb +++ b/lib/datadog/tracing/sampling/span/rule.rb @@ -67,6 +67,14 @@ def sample!(span_op) :rejected end end + + def ==(other) + return super unless other.is_a?(Rule) + + matcher == other.matcher && + sample_rate == other.sample_rate && + rate_limit == other.rate_limit + end end end end diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb new file mode 100644 index 00000000000..105949809e9 --- /dev/null +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +require 'json' +require 'datadog/tracing/sampling/span/ext' +require 'datadog/tracing/sampling/span/matcher' +require 'datadog/tracing/sampling/span/rule' + +module Datadog + module Tracing + module Sampling + module Span + # Converts user configuration into {Datadog::Tracing::Sampling::Span::Rule} objects, + # handling any parsing errors. + module RuleParser + class << self + # Parses the provided JSON string containing the Single Span + # Sampling configuration list. + # In case of parsing errors, `nil` is returned. + # + # @param rules [String] the JSON configuration rules to be parsed + # @return [Array] a list of parsed rules + # @return [nil] if parsing failed + def parse_json(rules) + begin + list = JSON.parse(rules) + rescue JSON::ParserError => e + Datadog.logger.warn("Error parsing Span Sampling Rules \"#{e}\" for rules: #{rules}") + return nil + end + + parse_list(list) + end + + # Parses a list of Hashes containing the parsed JSON information + # for Single Span Sampling configuration. + # In case of parsing errors, `nil` is returned. + # + # @param rules [Array] a list of parsed rules + # @return [nil] if parsing failed + def parse_list(rules) + unless rules.is_a?(Array) + # Using JSON terminology for the expected error type + Datadog.logger.warn("Span Sampling Rules are not an array: #{JSON.dump(rules)}") + return nil + end + + parsed = rules.map do |hash| + unless hash.is_a?(Hash) + # Using JSON terminology for the expected error type + Datadog.logger.warn("Span Sampling Rule is not a key-value object: #{JSON.dump(hash)}") + return nil + end + + begin + parse_rule(hash) + rescue => e + Datadog.logger.warn("Cannot parse Span Sampling Rule #{JSON.dump(hash)}: " \ + "#{e.class.name} #{e} at #{Array(e.backtrace).first}") + nil + end + end + + parsed.compact! + parsed + end + + private + + def parse_rule(hash) + matcher_options = {} + if (name_pattern = hash['name']) + matcher_options[:name_pattern] = name_pattern + end + + if (service_pattern = hash['service']) + matcher_options[:service_pattern] = service_pattern + end + + matcher = Matcher.new(**matcher_options) + + rule_options = {} + if (sample_rate = hash['sample_rate']) + rule_options[:sample_rate] = sample_rate + end + + if (max_per_second = hash['max_per_second']) + rule_options[:rate_limit] = max_per_second + end + + Rule.new(matcher, **rule_options) + end + end + end + end + end + end +end diff --git a/spec/datadog/tracing/sampling/rate_limiter_spec.rb b/spec/datadog/tracing/sampling/rate_limiter_spec.rb index 693e25f52ed..f6ea0f6ecd2 100644 --- a/spec/datadog/tracing/sampling/rate_limiter_spec.rb +++ b/spec/datadog/tracing/sampling/rate_limiter_spec.rb @@ -18,6 +18,22 @@ it 'has all tokens available' do expect(bucket.available_tokens).to eq(max_tokens) end + + context 'with invalid rate' do + let(:rate) { :bad } + + it 'raises argument error' do + expect { bucket }.to raise_error(ArgumentError, /bad/) + end + end + + context 'with invalid max_tokens' do + let(:max_tokens) { :bad } + + it 'raises argument error' do + expect { bucket }.to raise_error(ArgumentError, /bad/) + end + end end describe '#allow?' do diff --git a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb new file mode 100644 index 00000000000..e0237fa9b9d --- /dev/null +++ b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb @@ -0,0 +1,154 @@ +require 'datadog/tracing/sampling/span/rule_parser' + +RSpec.describe Datadog::Tracing::Sampling::Span::RuleParser do + describe '.parse_json' do + subject(:parse) { described_class.parse_json(rules_string) } + let(:rules_string) { JSON.dump(json_input) } + let(:json_input) { [] } + + shared_examples 'does not modify span' do + it { expect { sample! }.to_not(change { span_op.send(:build_span).to_hash }) } + end + + context 'invalid JSON' do + let(:rules_string) { '-not-json-' } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include(rules_string)) + is_expected.to be(nil) + end + end + + context 'valid JSON' do + context 'not a list' do + let(:json_input) { { not: 'list' } } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include(rules_string)) + is_expected.to be(nil) + end + end + + context 'a list' do + context 'without valid rules' do + let(:json_input) { ['not a hash'] } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include('not a hash')) + is_expected.to be(nil) + end + end + + context 'with valid rules' do + let(:json_input) { [rule] } + + let(:rule) do + { + name: name, + service: service, + sample_rate: sample_rate, + max_per_second: max_per_second, + } + end + + let(:name) { nil } + let(:service) { nil } + let(:sample_rate) { nil } + let(:max_per_second) { nil } + + context 'and default values' do + it 'delegates defaults to the rule and matcher' do + is_expected.to contain_exactly( + Datadog::Tracing::Sampling::Span::Rule.new(Datadog::Tracing::Sampling::Span::Matcher.new) + ) + end + end + + context 'with name' do + let(:name) { 'name' } + + it 'sets the rule matcher name' do + is_expected.to contain_exactly( + Datadog::Tracing::Sampling::Span::Rule.new( + Datadog::Tracing::Sampling::Span::Matcher.new(name_pattern: name) + ) + ) + end + + context 'with an invalid value' do + let(:name) { { bad: 'name' } } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include('{"bad":"name"}') & include('Error')) + is_expected.to be_empty + end + end + end + + context 'with service' do + let(:service) { 'service' } + + it 'sets the rule matcher service' do + is_expected.to contain_exactly( + Datadog::Tracing::Sampling::Span::Rule.new( + Datadog::Tracing::Sampling::Span::Matcher.new(service_pattern: service) + ) + ) + end + + context 'with an invalid value' do + let(:service) { { bad: 'service' } } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include('{"bad":"service"}') & include('Error')) + is_expected.to be_empty + end + end + end + + context 'with sample_rate' do + let(:sample_rate) { 1.0 } + + it 'sets the rule matcher service' do + is_expected.to contain_exactly( + Datadog::Tracing::Sampling::Span::Rule.new( + Datadog::Tracing::Sampling::Span::Matcher.new, sample_rate: sample_rate + ) + ) + end + + context 'with an invalid value' do + let(:sample_rate) { { bad: 'sample_rate' } } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include('{"bad":"sample_rate"}') & include('Error')) + is_expected.to be_empty + end + end + end + + context 'with max_per_second' do + let(:max_per_second) { 10 } + + it 'sets the rule matcher service' do + is_expected.to contain_exactly( + Datadog::Tracing::Sampling::Span::Rule.new( + Datadog::Tracing::Sampling::Span::Matcher.new, rate_limit: max_per_second + ) + ) + end + + context 'with an invalid value' do + let(:max_per_second) { { bad: 'max_per_second' } } + + it 'warns and returns nil' do + expect(Datadog.logger).to receive(:warn).with(include('{"bad":"max_per_second"}') & include('Error')) + is_expected.to be_empty + end + end + end + end + end + end + end +end From d00ea3aca9932428fb6fa277a7c4ac1caadf90e4 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 12:14:23 -0700 Subject: [PATCH 0155/2133] Better error message on json parse error --- lib/datadog/tracing/sampling/span/rule_parser.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index 105949809e9..2a6185def00 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -23,8 +23,9 @@ class << self def parse_json(rules) begin list = JSON.parse(rules) - rescue JSON::ParserError => e - Datadog.logger.warn("Error parsing Span Sampling Rules \"#{e}\" for rules: #{rules}") + rescue => e + Datadog.logger.warn("Error parsing Span Sampling Rules `#{rules}`. "\ + "Cause #{e.class.name} #{e.message} Location: #{Array(e.backtrace).first}") return nil end From de3b4a33290fd7c7cc1814a311a824de9caf6bae Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 12:16:04 -0700 Subject: [PATCH 0156/2133] Even better error messages --- .../tracing/sampling/span/rule_parser.rb | 10 +++++----- .../tracing/sampling/span/rule_parser_spec.rb | 20 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index 2a6185def00..87af3f9ac5c 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -24,8 +24,8 @@ def parse_json(rules) begin list = JSON.parse(rules) rescue => e - Datadog.logger.warn("Error parsing Span Sampling Rules `#{rules}`. "\ - "Cause #{e.class.name} #{e.message} Location: #{Array(e.backtrace).first}") + Datadog.logger.warn("Error parsing Span Sampling Rules `#{rules.inspect}`: "\ + "#{e.class.name} #{e.message} at #{Array(e.backtrace).first}") return nil end @@ -42,21 +42,21 @@ def parse_json(rules) def parse_list(rules) unless rules.is_a?(Array) # Using JSON terminology for the expected error type - Datadog.logger.warn("Span Sampling Rules are not an array: #{JSON.dump(rules)}") + Datadog.logger.warn("Span Sampling Rules are not an array: #{rules.inspect}") return nil end parsed = rules.map do |hash| unless hash.is_a?(Hash) # Using JSON terminology for the expected error type - Datadog.logger.warn("Span Sampling Rule is not a key-value object: #{JSON.dump(hash)}") + Datadog.logger.warn("Span Sampling Rule is not a key-value object: #{hash.inspect}") return nil end begin parse_rule(hash) rescue => e - Datadog.logger.warn("Cannot parse Span Sampling Rule #{JSON.dump(hash)}: " \ + Datadog.logger.warn("Cannot parse Span Sampling Rule #{hash.inspect}: " \ "#{e.class.name} #{e} at #{Array(e.backtrace).first}") nil end diff --git a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb index e0237fa9b9d..a67cc3b1897 100644 --- a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb @@ -21,10 +21,10 @@ context 'valid JSON' do context 'not a list' do - let(:json_input) { { not: 'list' } } + let(:json_input) { { 'not' => 'list' } } it 'warns and returns nil' do - expect(Datadog.logger).to receive(:warn).with(include(rules_string)) + expect(Datadog.logger).to receive(:warn).with(include(json_input.inspect)) is_expected.to be(nil) end end @@ -76,10 +76,10 @@ end context 'with an invalid value' do - let(:name) { { bad: 'name' } } + let(:name) { { 'bad' => 'name' } } it 'warns and returns nil' do - expect(Datadog.logger).to receive(:warn).with(include('{"bad":"name"}') & include('Error')) + expect(Datadog.logger).to receive(:warn).with(include(name.inspect) & include('Error')) is_expected.to be_empty end end @@ -97,10 +97,10 @@ end context 'with an invalid value' do - let(:service) { { bad: 'service' } } + let(:service) { { 'bad' => 'service' } } it 'warns and returns nil' do - expect(Datadog.logger).to receive(:warn).with(include('{"bad":"service"}') & include('Error')) + expect(Datadog.logger).to receive(:warn).with(include(service.inspect) & include('Error')) is_expected.to be_empty end end @@ -118,10 +118,10 @@ end context 'with an invalid value' do - let(:sample_rate) { { bad: 'sample_rate' } } + let(:sample_rate) { { 'bad' => 'sample_rate' } } it 'warns and returns nil' do - expect(Datadog.logger).to receive(:warn).with(include('{"bad":"sample_rate"}') & include('Error')) + expect(Datadog.logger).to receive(:warn).with(include(sample_rate.inspect) & include('Error')) is_expected.to be_empty end end @@ -139,10 +139,10 @@ end context 'with an invalid value' do - let(:max_per_second) { { bad: 'max_per_second' } } + let(:max_per_second) { { 'bad' => 'max_per_second' } } it 'warns and returns nil' do - expect(Datadog.logger).to receive(:warn).with(include('{"bad":"max_per_second"}') & include('Error')) + expect(Datadog.logger).to receive(:warn).with(include(max_per_second.inspect) & include('Error')) is_expected.to be_empty end end From a03ae7f31b4fe62408481b31a9d150a58c822fa3 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 12:27:36 -0700 Subject: [PATCH 0157/2133] Remove stable JSON-related comments --- lib/datadog/tracing/sampling/span/rule_parser.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index 87af3f9ac5c..d10f6a5747a 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -41,14 +41,12 @@ def parse_json(rules) # @return [nil] if parsing failed def parse_list(rules) unless rules.is_a?(Array) - # Using JSON terminology for the expected error type Datadog.logger.warn("Span Sampling Rules are not an array: #{rules.inspect}") return nil end parsed = rules.map do |hash| unless hash.is_a?(Hash) - # Using JSON terminology for the expected error type Datadog.logger.warn("Span Sampling Rule is not a key-value object: #{hash.inspect}") return nil end From df907c68c19426a546f1c66225ad13a9ded6e5d5 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 12:29:59 -0700 Subject: [PATCH 0158/2133] Return complete parsing error on partial failures --- .rubocop.yml | 3 ++- lib/datadog/tracing/sampling/span/rule_parser.rb | 2 +- spec/datadog/tracing/sampling/span/rule_parser_spec.rb | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0bbb27fd642..aed7c2e61a9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -124,8 +124,9 @@ Lint/EmptyClass: # (new in 1.3) Enabled: true Lint/LambdaWithoutLiteralBlock: # (new in 1.8) Enabled: true +# Prevents `return` in an assignment block `var = begin; return; end` block. Lint/NoReturnInBeginEndBlocks: # (new in 1.2) - Enabled: true + Enabled: false Lint/NumberedParameterAssignment: # (new in 1.9) Enabled: true Lint/OrAssignmentToConstant: # (new in 1.9) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index d10f6a5747a..24187f1f617 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -56,7 +56,7 @@ def parse_list(rules) rescue => e Datadog.logger.warn("Cannot parse Span Sampling Rule #{hash.inspect}: " \ "#{e.class.name} #{e} at #{Array(e.backtrace).first}") - nil + return nil end end diff --git a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb index a67cc3b1897..ca1a692f4ea 100644 --- a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb @@ -80,7 +80,7 @@ it 'warns and returns nil' do expect(Datadog.logger).to receive(:warn).with(include(name.inspect) & include('Error')) - is_expected.to be_empty + is_expected.to be_nil end end end @@ -101,7 +101,7 @@ it 'warns and returns nil' do expect(Datadog.logger).to receive(:warn).with(include(service.inspect) & include('Error')) - is_expected.to be_empty + is_expected.to be_nil end end end @@ -122,7 +122,7 @@ it 'warns and returns nil' do expect(Datadog.logger).to receive(:warn).with(include(sample_rate.inspect) & include('Error')) - is_expected.to be_empty + is_expected.to be_nil end end end @@ -143,7 +143,7 @@ it 'warns and returns nil' do expect(Datadog.logger).to receive(:warn).with(include(max_per_second.inspect) & include('Error')) - is_expected.to be_empty + is_expected.to be_nil end end end From 8dc706f576f8f9bb057ae8a461d59e2f1ca5aee3 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 17 Jun 2022 16:11:10 -0700 Subject: [PATCH 0159/2133] [Single Span Sampling] Span Sampler --- lib/datadog/tracing/sampling/span/sampler.rb | 45 +++++++++++++ lib/datadog/tracing/tracer.rb | 17 ++++- .../tracing/sampling/span/sampler_spec.rb | 64 +++++++++++++++++++ spec/datadog/tracing/tracer_spec.rb | 37 +++++++++++ 4 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 lib/datadog/tracing/sampling/span/sampler.rb create mode 100644 spec/datadog/tracing/sampling/span/sampler_spec.rb diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb new file mode 100644 index 00000000000..2ff44ae6448 --- /dev/null +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -0,0 +1,45 @@ +module Datadog + module Tracing + module Sampling + module Span + # Applies a set of rules to a span. + # This class is used to apply sampling operations to all + # spans in the tracer. + # + # Span sampling is distinct from trace sampling: span + # sampling can keep a span that is part of tracer that was + # rejected by trace sampling. + # + # This class only applies operations to spans that are part + # of traces that were rejected by trace sampling. There's no + # reason to try to sample spans that are already kept by + # the trace sampler. + class Sampler + # Receives sampling rules to apply to individual spans. + # + # @param [Array] rules list of rules to apply to spans + def initialize(rules = []) + @rules = rules + end + + # Applies sampling rules to the span if the trace has been rejected. + # + # If multiple rules match, only the first one is applied. + # + # @param [Datadog::Tracing::TraceOperation] trace_op trace for the provided span + # @param [Datadog::Tracing::SpanOperation] span_op Span to apply sampling rules + # @return [void] + def sample!(trace_op, span_op) + return if trace_op.sampled? + + # Return as soon as one rule returns non-nil + # DEV: `all?{|x|x.nil?}` is faster than `any?{|x|!x.nil?}` + @rules.all? do |rule| + rule.sample!(span_op).nil? + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/tracer.rb b/lib/datadog/tracing/tracer.rb index 315b10fc7b1..22b8d70ab92 100644 --- a/lib/datadog/tracing/tracer.rb +++ b/lib/datadog/tracing/tracer.rb @@ -11,6 +11,7 @@ require 'datadog/tracing/sampling/all_sampler' require 'datadog/tracing/sampling/rule_sampler' require 'datadog/tracing/sampling/priority_sampler' +require 'datadog/tracing/sampling/span/sampler' require 'datadog/tracing/span_operation' require 'datadog/tracing/trace_digest' require 'datadog/tracing/trace_operation' @@ -28,6 +29,7 @@ class Tracer :trace_flush, :provider, :sampler, + :span_sampler, :tags attr_accessor \ @@ -56,6 +58,7 @@ def initialize( base_sampler: Sampling::AllSampler.new, post_sampler: Sampling::RuleSampler.new ), + span_sampler: Sampling::Span::Sampler.new, tags: {}, writer: Writer.new ) @@ -64,6 +67,7 @@ def initialize( @enabled = enabled @provider = context_provider @sampler = sampler + @span_sampler = span_sampler @tags = tags @writer = writer end @@ -341,7 +345,8 @@ def bind_trace_events!(trace_op) sample_trace(event_trace_op) if event_span_op && event_span_op.parent_id == 0 end - events.span_finished.subscribe do |_event_span, event_trace_op| + events.span_finished.subscribe do |event_span, event_trace_op| + sample_span(event_trace_op, event_span) flush_trace(event_trace_op) end end @@ -461,7 +466,15 @@ def sample_trace(trace_op) begin @sampler.sample!(trace_op) rescue StandardError => e - Datadog.logger.debug { "Failed to sample trace: #{e}" } + Datadog.logger.warn { "Failed to sample trace: #{e}" } + end + end + + def sample_span(trace_op, span) + begin + @span_sampler.sample!(trace_op, span) + rescue StandardError => e + Datadog.logger.warn { "Failed to sample span: #{e.class.name} #{e} at #{Array(e.backtrace).first}" } end end diff --git a/spec/datadog/tracing/sampling/span/sampler_spec.rb b/spec/datadog/tracing/sampling/span/sampler_spec.rb new file mode 100644 index 00000000000..e016aab6b09 --- /dev/null +++ b/spec/datadog/tracing/sampling/span/sampler_spec.rb @@ -0,0 +1,64 @@ +require 'datadog/tracing/sampling/span/matcher' +require 'datadog/tracing/sampling/span/rule' + +require 'datadog/tracing/sampling/span/sampler' + +RSpec.describe Datadog::Tracing::Sampling::Span::Sampler do + subject(:sampler) { described_class.new(rules) } + let(:rules) { [] } + + let(:trace_op) { Datadog::Tracing::TraceOperation.new } + let(:span_op) { Datadog::Tracing::SpanOperation.new('name', service: 'service') } + + describe '#sample!' do + subject(:sample!) { sampler.sample!(trace_op, span_op) } + + shared_examples 'does not modify span' do + it { expect { sample! }.to_not(change { span_op.send(:build_span).to_hash }) } + end + + let(:match_all) { Datadog::Tracing::Sampling::Span::Matcher.new } + context 'no matching rules' do + it_behaves_like 'does not modify span' + end + + context 'with matching rules' do + let(:rules) { [Datadog::Tracing::Sampling::Span::Rule.new(match_all, sample_rate: 1.0, rate_limit: 3)] } + + context 'a kept trace' do + before { trace_op.keep! } + + it_behaves_like 'does not modify span' + end + + context 'a rejected trace' do + before { trace_op.reject! } + + it 'sets mechanism, rule rate and rate limit metrics' do + sample! + + expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) + expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) + expect(span_op.get_metric('_dd.span_sampling.max_per_second')).to eq(3) + end + + context 'multiple rules' do + let(:rules) do + [ + Datadog::Tracing::Sampling::Span::Rule.new(match_all, sample_rate: 1.0, rate_limit: 3), + Datadog::Tracing::Sampling::Span::Rule.new(match_all, sample_rate: 0.5, rate_limit: 2), + ] + end + + it 'applies the first matching rule' do + sample! + + expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) + expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) + expect(span_op.get_metric('_dd.span_sampling.max_per_second')).to eq(3) + end + end + end + end + end +end diff --git a/spec/datadog/tracing/tracer_spec.rb b/spec/datadog/tracing/tracer_spec.rb index 9711b891126..c7527be26d9 100644 --- a/spec/datadog/tracing/tracer_spec.rb +++ b/spec/datadog/tracing/tracer_spec.rb @@ -509,6 +509,26 @@ end end end + + context 'for span sampling' do + let(:tracer_options) { super().merge(span_sampler: span_sampler) } + let(:span_sampler) { instance_double(Datadog::Tracing::Sampling::Span::Sampler) } + let(:block) do + proc do |span_op, trace_op| + @span_op = span_op + @trace_op = trace_op + end + end + + before do + allow(span_sampler).to receive(:sample!) + end + + it 'invokes the span sampler with the current span and trace operation' do + trace + expect(span_sampler).to have_received(:sample!).with(@trace_op, @span_op.send(:build_span)) + end + end end context 'without a block' do @@ -572,6 +592,23 @@ expect(child.end_time).to be > parent.end_time end end + + context 'for span sampling' do + let(:tracer_options) { super().merge(span_sampler: span_sampler) } + let(:span_sampler) { instance_double(Datadog::Tracing::Sampling::Span::Sampler) } + + before do + allow(span_sampler).to receive(:sample!) + end + + it 'invokes the span sampler with the current span and trace operation' do + span_op = trace + trace_op = tracer.active_trace + span = span_op.finish + + expect(span_sampler).to have_received(:sample!).with(trace_op, span) + end + end end end From 46e05629b91f9da304621281d048fbadbbf141eb Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Jun 2022 12:52:23 -0700 Subject: [PATCH 0160/2133] Update result value due to upstream changes --- lib/datadog/tracing/sampling/span/sampler.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index 2ff44ae6448..b0b097b7645 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -32,11 +32,12 @@ def initialize(rules = []) def sample!(trace_op, span_op) return if trace_op.sampled? - # Return as soon as one rule returns non-nil - # DEV: `all?{|x|x.nil?}` is faster than `any?{|x|!x.nil?}` - @rules.all? do |rule| - rule.sample!(span_op).nil? + # Return as soon as one rule matches + @rules.any? do |rule| + rule.sample!(span_op) != :not_matched end + + nil end end end From 23abe8b94abde5a709540b8a62c1fdf887574011 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 4 Jul 2022 15:08:08 +0100 Subject: [PATCH 0161/2133] Add thanks to @miketheman for gifting us access to the `datadog` gem We've long been in talks to adopt the `datadog` gem name for future projects, but an issue was that the name was already taken on rubygems.org @miketheman was awesome in allowing us to get that name, and all he asked in return was that his contribution not be forgotten, which is extremely fair :) So, let's thank him! And good luck for current/future endeavors! P.s.: In the future, if/when we create a repository for the `datadog` gem, let's remember to keep these thanks there as well! --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1286f057592..a5fe70bfea3 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,8 @@ For contributing, checkout the [contribution guidelines][contribution docs] and [visualization docs]: https://docs.datadoghq.com/tracing/visualization/ [contribution docs]: https://github.com/DataDog/dd-trace-rb/blob/master/CONTRIBUTING.md [development docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md + +## Special thanks + +* [Mike Fiedler](https://github.com/miketheman) for working on a number of Datadog Ruby projects, as well as graciously + gifting control of the `datadog` gem From e8a93879253ade4f68033916b8f903987670fe1d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 4 Jul 2022 12:27:22 +0100 Subject: [PATCH 0162/2133] [PROF-5747] Fix broken libddprof linking on Heroku and AWS Elastic Beanstalk As reported in #2067, in these environments ddtrace (and libddprof) are moved after installation, which broke linking from the profiling native extension to libddprof. As a fix/"workaround", we additionally add the relative path between both gems while linking; see the comments on the `.libddprof_folder_relative_to_native_lib_folder` helper for more details and how this works. Note that key word above is **aditionally** -- e.g., we're adding more paths in which to find libddprof, and keeping the existing absolute path, so this should not impact any setups where things were already working fine. Big and special thanks to @sanchda for brainstorming with me on this issue. Fixes #2067 --- .../extconf.rb | 9 ++++ .../native_extension_helpers.rb | 46 +++++++++++++++++++ .../native_extension_helpers_spec.rb | 32 ++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index ef596abf4fa..e0db5bea125 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -141,10 +141,19 @@ def add_compiler_flag(flag) # If we got here, libddprof is available and loaded ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libddprof.pkgconfig_folder}" Logging.message(" [ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") + unless pkg_config('ddprof_ffi_with_rpath') skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF) end +# See comments on the helper method being used for why we need to additionally set this +# The extremely excessive escaping around ORIGIN below seems to be correct and was determined after a lot of +# experimentation. We need to get these special characters across a lot of tools untouched... +$LDFLAGS += \ + ' -Wl,-rpath,$$$\\\\{ORIGIN\\}/' \ + "#{Datadog::Profiling::NativeExtensionHelpers.libddprof_folder_relative_to_native_lib_folder}" +Logging.message(" [ddtrace] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n") + # Tag the native extension library with the Ruby version and Ruby platform. # This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that # the wrong library is never loaded. diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index a7961597d8f..5375cc72498 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -3,6 +3,7 @@ # typed: ignore require 'libddprof' +require 'pathname' module Datadog module Profiling @@ -20,6 +21,51 @@ def self.fail_install_if_missing_extension? ENV[ENV_FAIL_INSTALL_IF_MISSING_EXTENSION].to_s.strip.downcase == 'true' end + # Used as an workaround for a limitation with how dynamic linking works in environments where ddtrace and + # libddprof are moved after the extension gets compiled. + # + # Because the libddpprof native library is installed on a non-standard system path, in order for it to be + # found by the system dynamic linker (e.g. what takes care of dlopen(), which is used to load the profiling + # native extension), we need to add a "runpath" -- a list of folders to search for libddprof. + # + # This runpath gets hardcoded at native library linking time. You can look at it using the `readelf` tool in + # Linux: e.g. `readelf -d ddtrace_profiling_native_extension.2.7.3_x86_64-linux.so`. + # + # In ddtrace 1.1.0, we only set as runpath an absolute path to libddprof. (This gets set automatically by the call + # to `pkg_config('ddprof_ffi_with_rpath')` in `extconf.rb`). This worked fine as long as libddprof was **NOT** + # moved from the folder it was present at ddtrace installation/linking time. + # + # Unfortunately, environments such as Heroku and AWS Elastic Beanstalk move gems around in the filesystem after + # installation. Thus, the profiling native extension could not be loaded in these environments + # (see https://github.com/DataDog/dd-trace-rb/issues/2067) because libddprof could not be found. + # + # To workaround this issue, this method computes the **relative** path between the folder where the profiling + # native extension is going to be installed and the folder where libddprof is installed, and returns it + # to be set as an additional runpath. (Yes, you can set multiple runpath folders to be searched). + # + # This way, if both gems are moved together (and it turns out that they are in these environments), + # the relative path can still be traversed to find libddprof. + # + # This is incredibly awful, and it's kinda bizarre how it's not possible to just find these paths at runtime + # and set them correctly; rather than needing to set stuff at linking-time and then praying to $deity that + # weird moves don't happen. + # + # As a curiosity, `LD_LIBRARY_PATH` can be used to influence the folders that get searched but **CANNOT BE + # SET DYNAMICALLY**, e.g. it needs to be set at the start of the process (Ruby VM) and thus it's not something + # we could setup when doing a `require`. + # + def self.libddprof_folder_relative_to_native_lib_folder( + current_folder: __dir__, + libddprof_pkgconfig_folder: Libddprof.pkgconfig_folder + ) + return unless libddprof_pkgconfig_folder + + profiling_native_lib_folder = "#{current_folder}/../../lib/" + libddprof_lib_folder = "#{libddprof_pkgconfig_folder}/../" + + Pathname.new(libddprof_lib_folder).relative_path_from(profiling_native_lib_folder).to_s + end + # Used to check if profiler is supported, including user-visible clear messages explaining why their # system may not be supported. # rubocop:disable Metrics/ModuleLength diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index f0958a16e4a..c15fd9e88a9 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -1,7 +1,37 @@ # typed: ignore require 'ext/ddtrace_profiling_native_extension/native_extension_helpers' -require 'libddprof' + +require 'datadog/profiling/spec_helper' + +RSpec.describe Datadog::Profiling::NativeExtensionHelpers do + describe '.libddprof_folder_relative_to_native_lib_folder' do + context 'when libddprof is available' do + before do + skip_if_profiling_not_supported(self) + if PlatformHelpers.mac? && Libddprof.pkgconfig_folder.nil? && ENV['LIBDDPROF_VENDOR_OVERRIDE'].nil? + raise 'You have a libddprof setup without macOS support. Did you forget to set LIBDDPROF_VENDOR_OVERRIDE?' + end + end + + it 'returns a relative path to libddprof folder from the gem lib folder' do + relative_path = described_class.libddprof_folder_relative_to_native_lib_folder + + gem_lib_folder = "#{Gem.loaded_specs['ddtrace'].gem_dir}/lib" + full_libddprof_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{RbConfig::CONFIG['SOEXT']}" + + expect(relative_path).to start_with('../') + expect(File.exist?(full_libddprof_path)).to be true + end + end + + context 'when libddprof is unsupported' do + it do + expect(described_class.libddprof_folder_relative_to_native_lib_folder(libddprof_pkgconfig_folder: nil)).to be nil + end + end + end +end RSpec.describe Datadog::Profiling::NativeExtensionHelpers::Supported do describe '.supported?' do From 03ae999a4b0e3865d42f4ee32cae948086303256 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 09:55:41 +0100 Subject: [PATCH 0163/2133] Fix libddprof_folder_relative_to_native_lib_folder for legacy Rubies Of course older Rubies would need extra code ;) --- .../native_extension_helpers.rb | 2 +- spec/datadog/profiling/native_extension_helpers_spec.rb | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 5375cc72498..29fc53caa0c 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -63,7 +63,7 @@ def self.libddprof_folder_relative_to_native_lib_folder( profiling_native_lib_folder = "#{current_folder}/../../lib/" libddprof_lib_folder = "#{libddprof_pkgconfig_folder}/../" - Pathname.new(libddprof_lib_folder).relative_path_from(profiling_native_lib_folder).to_s + Pathname.new(libddprof_lib_folder).relative_path_from(Pathname.new(profiling_native_lib_folder)).to_s end # Used to check if profiler is supported, including user-visible clear messages explaining why their diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index c15fd9e88a9..653bfc34d7c 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -17,11 +17,16 @@ it 'returns a relative path to libddprof folder from the gem lib folder' do relative_path = described_class.libddprof_folder_relative_to_native_lib_folder + # RbConfig::CONFIG['SOEXT'] was only introduced in Ruby 2.5, so we have a fallback for older Rubies... + libddprof_extension = + RbConfig::CONFIG['SOEXT'] || + PlatformHelpers.linux? ? 'so' : (PlatformHelpers.mac? ? 'dylib' : raise('Missing SOEXT for current platform')) + gem_lib_folder = "#{Gem.loaded_specs['ddtrace'].gem_dir}/lib" - full_libddprof_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{RbConfig::CONFIG['SOEXT']}" + full_libddprof_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{libddprof_extension}" expect(relative_path).to start_with('../') - expect(File.exist?(full_libddprof_path)).to be true + expect(File.exist?(full_libddprof_path)).to be(true), "Libddprof not available in expected path: #{full_libddprof_path.inspect}" end end From 88a7d4d2d3f8d00dc444ca3d58d459eb8af0f911 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 09:59:18 +0100 Subject: [PATCH 0164/2133] Pin json-schema version to version that also works on <= 2.4 Rubies We're happy with v2 anyway, and it's only used for tests, so this seems like as reasonable trade-off. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 83907e9860e..93b94900bf0 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'builder' gem 'climate_control', '~> 0.2.0' # Leave it open as we also have it as an integration and want Appraisal to control the version under test. gem 'concurrent-ruby' -gem 'json-schema' +gem 'json-schema', '< 3' # V3 only works with 2.5+ gem 'memory_profiler', '~> 0.9' gem 'os', '~> 1.1' gem 'pimpmychangelog', '>= 0.1.2' From fd4621e30d06ade4a4bb4e744f5ed243d2fc2313 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 10:04:11 +0100 Subject: [PATCH 0165/2133] Rubocop fixes --- spec/datadog/profiling/native_extension_helpers_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index 653bfc34d7c..6c6f4309b62 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -20,13 +20,16 @@ # RbConfig::CONFIG['SOEXT'] was only introduced in Ruby 2.5, so we have a fallback for older Rubies... libddprof_extension = RbConfig::CONFIG['SOEXT'] || - PlatformHelpers.linux? ? 'so' : (PlatformHelpers.mac? ? 'dylib' : raise('Missing SOEXT for current platform')) + ('so' if PlatformHelpers.linux?) || + ('dylib' if PlatformHelpers.mac?) || + raise('Missing SOEXT for current platform') gem_lib_folder = "#{Gem.loaded_specs['ddtrace'].gem_dir}/lib" full_libddprof_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{libddprof_extension}" expect(relative_path).to start_with('../') - expect(File.exist?(full_libddprof_path)).to be(true), "Libddprof not available in expected path: #{full_libddprof_path.inspect}" + expect(File.exist?(full_libddprof_path)) + .to be(true), "Libddprof not available in expected path: #{full_libddprof_path.inspect}" end end From 0aa109c7b6420e3683f075b6ed9f0b479c96c10b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 10:10:35 +0100 Subject: [PATCH 0166/2133] Pin benchmark-memory to version usable in older Rubies In all existing lockfiles used for CI testing, bundler/rubygems resolved `benchmark-memory` to 0.1.2 which was version compatible with all Rubies we use, as well as matching the `memory_profiler` `~> 0.9` restriction we have. But in some runs I now saw the wrong version being resolved, so I've added a stronger restriction to get bundler/rubygems to pick the version it should. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 93b94900bf0..9b254df9cd6 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gemspec gem 'addressable', '~> 2.4.0' # locking transitive dependency of webmock gem 'appraisal', '~> 2.2' gem 'benchmark-ips', '~> 2.8' -gem 'benchmark-memory', '~> 0.1' +gem 'benchmark-memory', '< 0.2' # V0.2 only works with 2.5+ gem 'builder' gem 'climate_control', '~> 0.2.0' # Leave it open as we also have it as an integration and want Appraisal to control the version under test. From 389eb53208bdd0c21bf96ff34868455e44af575f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 10:26:49 +0100 Subject: [PATCH 0167/2133] Remove old workaround for Ruby 2.0 I think... this is not needed anymore, and it's causing other issues in CI (in particular, it conflicts with sorbet, which cannot be installed with the "ruby" platform). See for one such example. --- integration/apps/rack/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/integration/apps/rack/Dockerfile b/integration/apps/rack/Dockerfile index d29b4238c3c..201df0e5c3f 100644 --- a/integration/apps/rack/Dockerfile +++ b/integration/apps/rack/Dockerfile @@ -15,9 +15,6 @@ ENV DD_DEMO_ENV_GEM_REF_DDTRACE ${ddtrace_ref} # Install dependencies COPY Gemfile /app/Gemfile -# This forces gems with native extensions to be compiled, rather than using pre-compiled binaries; it's needed because -# some google-protobuf versions ship with missing binaries for older rubies. -ENV BUNDLE_FORCE_RUBY_PLATFORM true RUN bundle install # Add files From 3020a57cd6d23273f6b3f4e31a4c2340c5239be0 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 5 Jul 2022 10:40:02 +0100 Subject: [PATCH 0168/2133] Add google-protobuf version restrictions to CI rack app We had these restrictions for other apps, but not the rack app. Instead, the rack app was being made to work using `BUNDLE_FORCE_RUBY_PLATFORM`, but that was removed in the previous commit. This is getting to be an awful mess, but profiling will soon not require protobuf so I don't think it's work investing in improving for now; we just need it to hold for a little longer and then we can remove it. --- integration/apps/rack/Gemfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integration/apps/rack/Gemfile b/integration/apps/rack/Gemfile index 88fab96c054..4c30194802c 100644 --- a/integration/apps/rack/Gemfile +++ b/integration/apps/rack/Gemfile @@ -22,11 +22,19 @@ source 'https://rubygems.org' do gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') # Needed for ddtrace profiling + google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' + ] if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') - gem 'google-protobuf' + gem 'google-protobuf', *google_protobuf_versions else # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) - gem 'google-protobuf', '< 3.19.2' + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' end # Development From b910e41c9078f83ec693d4b458585abe9ecd95b5 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 15:43:16 -0700 Subject: [PATCH 0169/2133] Make sure important Tracer errors don't spam output --- lib/datadog/tracing/tracer.rb | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/datadog/tracing/tracer.rb b/lib/datadog/tracing/tracer.rb index 22b8d70ab92..e718c435e43 100644 --- a/lib/datadog/tracing/tracer.rb +++ b/lib/datadog/tracing/tracer.rb @@ -466,28 +466,43 @@ def sample_trace(trace_op) begin @sampler.sample!(trace_op) rescue StandardError => e - Datadog.logger.warn { "Failed to sample trace: #{e}" } + SAMPLE_TRACE_LOG_ONLY_ONCE.run do + Datadog.logger.warn { "Failed to sample trace: #{e.class.name} #{e} at #{Array(e.backtrace).first}" } + end end end + SAMPLE_TRACE_LOG_ONLY_ONCE = Utils::OnlyOnce.new + private_constant :SAMPLE_TRACE_LOG_ONLY_ONCE + def sample_span(trace_op, span) begin @span_sampler.sample!(trace_op, span) rescue StandardError => e - Datadog.logger.warn { "Failed to sample span: #{e.class.name} #{e} at #{Array(e.backtrace).first}" } + SAMPLE_SPAN_LOG_ONLY_ONCE.run do + Datadog.logger.warn { "Failed to sample span: #{e.class.name} #{e} at #{Array(e.backtrace).first}" } + end end end + SAMPLE_SPAN_LOG_ONLY_ONCE = Utils::OnlyOnce.new + private_constant :SAMPLE_SPAN_LOG_ONLY_ONCE + # Flush finished spans from the trace buffer, send them to writer. def flush_trace(trace_op) begin trace = @trace_flush.consume!(trace_op) write(trace) if trace && !trace.empty? rescue StandardError => e - Datadog.logger.debug { "Failed to flush trace: #{e}" } + FLUSH_TRACE_LOG_ONLY_ONCE.run do + Datadog.logger.warn { "Failed to flush trace: #{e.class.name} #{e} at #{Array(e.backtrace).first}" } + end end end + FLUSH_TRACE_LOG_ONLY_ONCE = Utils::OnlyOnce.new + private_constant :FLUSH_TRACE_LOG_ONLY_ONCE + # Send the trace to the writer to enqueue the spans list in the agent # sending queue. def write(trace) From bba9f8d2c48552042b7a8e223f28cc956ec1a306 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 15:48:35 -0700 Subject: [PATCH 0170/2133] Fix namespace lookup --- lib/datadog/tracing/tracer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datadog/tracing/tracer.rb b/lib/datadog/tracing/tracer.rb index e718c435e43..2fa13cdd73a 100644 --- a/lib/datadog/tracing/tracer.rb +++ b/lib/datadog/tracing/tracer.rb @@ -472,7 +472,7 @@ def sample_trace(trace_op) end end - SAMPLE_TRACE_LOG_ONLY_ONCE = Utils::OnlyOnce.new + SAMPLE_TRACE_LOG_ONLY_ONCE = Core::Utils::OnlyOnce.new private_constant :SAMPLE_TRACE_LOG_ONLY_ONCE def sample_span(trace_op, span) @@ -485,7 +485,7 @@ def sample_span(trace_op, span) end end - SAMPLE_SPAN_LOG_ONLY_ONCE = Utils::OnlyOnce.new + SAMPLE_SPAN_LOG_ONLY_ONCE = Core::Utils::OnlyOnce.new private_constant :SAMPLE_SPAN_LOG_ONLY_ONCE # Flush finished spans from the trace buffer, send them to writer. @@ -500,7 +500,7 @@ def flush_trace(trace_op) end end - FLUSH_TRACE_LOG_ONLY_ONCE = Utils::OnlyOnce.new + FLUSH_TRACE_LOG_ONLY_ONCE = Core::Utils::OnlyOnce.new private_constant :FLUSH_TRACE_LOG_ONLY_ONCE # Send the trace to the writer to enqueue the spans list in the agent From 3b635baae65dd15f4aef09276ffaad8617564180 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 15:48:49 -0700 Subject: [PATCH 0171/2133] Simplify test assertion with fewer internal assumptions --- .../tracing/sampling/span/sampler_spec.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/datadog/tracing/sampling/span/sampler_spec.rb b/spec/datadog/tracing/sampling/span/sampler_spec.rb index e016aab6b09..f6cf87ea701 100644 --- a/spec/datadog/tracing/sampling/span/sampler_spec.rb +++ b/spec/datadog/tracing/sampling/span/sampler_spec.rb @@ -17,7 +17,15 @@ it { expect { sample! }.to_not(change { span_op.send(:build_span).to_hash }) } end + shared_examples 'tags span with sampling decision' do + it do + sample! + expect(span_op.get_metric('_dd.span_sampling.mechanism')).to_not be_nil + end + end + let(:match_all) { Datadog::Tracing::Sampling::Span::Matcher.new } + context 'no matching rules' do it_behaves_like 'does not modify span' end @@ -34,13 +42,7 @@ context 'a rejected trace' do before { trace_op.reject! } - it 'sets mechanism, rule rate and rate limit metrics' do - sample! - - expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) - expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) - expect(span_op.get_metric('_dd.span_sampling.max_per_second')).to eq(3) - end + it_behaves_like 'tags span with sampling decision' context 'multiple rules' do let(:rules) do @@ -53,7 +55,6 @@ it 'applies the first matching rule' do sample! - expect(span_op.get_metric('_dd.span_sampling.mechanism')).to eq(8) expect(span_op.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) expect(span_op.get_metric('_dd.span_sampling.max_per_second')).to eq(3) end From c01f95c4f24da3f9e922a8f9b6969680dddc4993 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 15:52:00 -0700 Subject: [PATCH 0172/2133] Use public SpanOperation API instead --- spec/datadog/tracing/tracer_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/tracing/tracer_spec.rb b/spec/datadog/tracing/tracer_spec.rb index c7527be26d9..c13e7666a39 100644 --- a/spec/datadog/tracing/tracer_spec.rb +++ b/spec/datadog/tracing/tracer_spec.rb @@ -526,7 +526,7 @@ it 'invokes the span sampler with the current span and trace operation' do trace - expect(span_sampler).to have_received(:sample!).with(@trace_op, @span_op.send(:build_span)) + expect(span_sampler).to have_received(:sample!).with(@trace_op, @span_op.finish) end end end From eeb2a2b03961882e68f46f16956cbdb598a71629 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 23 Jun 2022 15:22:56 -0700 Subject: [PATCH 0173/2133] [Single Span Sampling] Rule configuration settings --- docs/GettingStarted.md | 8 +++ lib/datadog/core/configuration/settings.rb | 42 +++++++++++++++ lib/datadog/tracing/configuration/ext.rb | 6 +++ .../core/configuration/settings_spec.rb | 54 +++++++++++++++++++ 4 files changed, 110 insertions(+) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 81c21472854..cdceb3e8884 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -87,6 +87,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d - [Sampling](#sampling) - [Application-side sampling](#application-side-sampling) - [Priority sampling](#priority-sampling) + - [Single Span Sampling](#single-span-sampling) - [Distributed tracing](#distributed-tracing) - [HTTP request queuing](#http-request-queuing) - [Processing pipeline](#processing-pipeline) @@ -2036,6 +2037,7 @@ end | `tracing.sampler` | | `nil` | Advanced usage only. Sets a custom `Datadog::Tracing::Sampling::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior. See [Application-side sampling](#application-side-sampling) for details. | | `tracing.sampling.default_rate` | `DD_TRACE_SAMPLE_RATE` | `nil` | Sets the trace sampling rate between `0.0` (0%) and `1.0` (100%). See [Application-side sampling](#application-side-sampling) for details. | | `tracing.sampling.rate_limit` | `DD_TRACE_RATE_LIMIT` | `100` (per second) | Sets a maximum number of traces per second to sample. Set a rate limit to avoid the ingestion volume overages in the case of traffic spikes. | +| `tracing.sampling.span.rules` | `DD_SPAN_SAMPLING_RULES`,`ENV_SPAN_SAMPLING_RULES_FILE` | `nil` | Sets [Single Span Sampling](#single-span-sampling) rules. These rules allow you to keep spans even when their respective traces are dropped. | | `tracing.report_hostname` | `DD_TRACE_REPORT_HOSTNAME` | `false` | Adds hostname tag to traces. | | `tracing.test_mode.enabled` | `DD_TRACE_TEST_MODE_ENABLED` | `false` | Enables or disables test mode, for use of tracing in test suites. | | `tracing.test_mode.trace_flush` | | `nil` | Object that determines trace flushing behavior. | @@ -2180,6 +2182,12 @@ trace.reject! trace.keep! ``` +#### Single Span Sampling + +You can configure sampling rule that allow you keep spans despite their respective traces being dropped by a trace-level sampling rule. + +See (TODO: Insert documentation URL here when published) for the full documentation on Single Span Sampling. + ### Distributed Tracing Distributed tracing allows traces to be propagated across multiple instrumented applications so that a request can be presented as a single trace, rather than a separate trace per service. diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 9c6a0df5515..efe7577fe4e 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -527,6 +527,7 @@ def initialize(*_) option :sampler # Client-side sampling configuration. + # @see https://docs.datadoghq.com/tracing/trace_ingestion/mechanisms/ # @public_api settings :sampling do # Default sampling rate for the tracer. @@ -553,6 +554,47 @@ def initialize(*_) o.default { env_to_float(Tracing::Configuration::Ext::Sampling::ENV_RATE_LIMIT, 100) } o.lazy end + + # Client-side single span sampling configuration. + # @public_api + settings :span do + # Single span sampling rules. + # These rules allow a span to be kept when its encompassing trace is dropped. + # + # The syntax for single span sampling rules can be found here: + # TODO: Insert documentation URL here when published + # + # @default `DD_SPAN_SAMPLING_RULES` environment variable. + # Otherwise, `ENV_SPAN_SAMPLING_RULES_FILE` environment variable. + # Otherwise `nil`. + # @return [String,nil] + option :rules do |o| + o.default do + rules = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES] + rules_file = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE] + + if rules + if rules_file + Datadog.logger.warn( + 'Both DD_SPAN_SAMPLING_RULES and DD_SPAN_SAMPLING_RULES_FILE were provided: only ' \ + 'DD_SPAN_SAMPLING_RULES will be used. Please do not provide DD_SPAN_SAMPLING_RULES_FILE when ' \ + 'also providing DD_SPAN_SAMPLING_RULES as their configuration conflicts.' + ) + end + rules + elsif rules_file + begin + File.read(rules_file) + rescue => e + # `File#read` errors have clear and actionable messages, no need to add extra exception info. + Datadog.logger.warn("Cannot read span sampling rules file: #{e.message}") + nil + end + end + end + o.lazy + end + end end # [Continuous Integration Visibility](https://docs.datadoghq.com/continuous_integration/) configuration. diff --git a/lib/datadog/tracing/configuration/ext.rb b/lib/datadog/tracing/configuration/ext.rb index 3682ee3f851..a139b71a122 100644 --- a/lib/datadog/tracing/configuration/ext.rb +++ b/lib/datadog/tracing/configuration/ext.rb @@ -32,6 +32,12 @@ module NET module Sampling ENV_SAMPLE_RATE = 'DD_TRACE_SAMPLE_RATE'.freeze ENV_RATE_LIMIT = 'DD_TRACE_RATE_LIMIT'.freeze + + # @public_api + module Span + ENV_SPAN_SAMPLING_RULES = 'DD_SPAN_SAMPLING_RULES'.freeze + ENV_SPAN_SAMPLING_RULES_FILE = 'DD_SPAN_SAMPLING_RULES_FILE'.freeze + end end # @public_api diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index cd887254db7..4f4cbd3e077 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -1208,6 +1208,60 @@ it { is_expected.to eq(0.5) } end end + + describe '#span' do + describe '#rules' do + subject(:rules) { settings.tracing.sampling.span.rules } + + context 'default' do + it { is_expected.to be nil } + end + + context 'when DD_SPAN_SAMPLING_RULES is provided' do + around do |example| + ClimateControl.modify( + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES => '{}' + ) do + example.run + end + end + + it { is_expected.to eq('{}') } + + context 'and DD_SPAN_SAMPLING_RULES_FILE is also provided' do + around do |example| + ClimateControl.modify( + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => 'path' + ) do + example.run + end + end + + it 'emits a conflict warning and returns DD_SPAN_SAMPLING_RULES' do + expect(Datadog.logger).to receive(:warn).with(include('configuration conflict')) + is_expected.to eq('{}') + end + end + end + + context 'when DD_SPAN_SAMPLING_RULES_FILE is provided' do + around do |example| + Tempfile.open('DD_SPAN_SAMPLING_RULES_FILE') do |f| + f.write('{from:"file"}') + f.flush + + ClimateControl.modify( + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => f.path + ) do + example.run + end + end + end + + it { is_expected.to eq('{from:"file"}') } + end + end + end end describe '#test_mode' do From f3ff487e44b8975e0ccfcbe81556567894e44153 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 16:10:50 -0700 Subject: [PATCH 0174/2133] Better TODO message --- docs/GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index cdceb3e8884..f14aed32590 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2186,7 +2186,7 @@ trace.keep! You can configure sampling rule that allow you keep spans despite their respective traces being dropped by a trace-level sampling rule. -See (TODO: Insert documentation URL here when published) for the full documentation on Single Span Sampling. +See (TODO: Insert documentation URL here when published. Search for references of this TODO) for the full documentation on Single Span Sampling. ### Distributed Tracing From 1fc16211cd8f75d6992b2531fc6e274911e1ac94 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 16:12:09 -0700 Subject: [PATCH 0175/2133] Remove one setting nesting level --- docs/GettingStarted.md | 2 +- lib/datadog/core/configuration/settings.rb | 64 +++++++++--------- .../core/configuration/settings_spec.rb | 66 +++++++++---------- 3 files changed, 64 insertions(+), 68 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index f14aed32590..addde37741a 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2037,7 +2037,7 @@ end | `tracing.sampler` | | `nil` | Advanced usage only. Sets a custom `Datadog::Tracing::Sampling::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior. See [Application-side sampling](#application-side-sampling) for details. | | `tracing.sampling.default_rate` | `DD_TRACE_SAMPLE_RATE` | `nil` | Sets the trace sampling rate between `0.0` (0%) and `1.0` (100%). See [Application-side sampling](#application-side-sampling) for details. | | `tracing.sampling.rate_limit` | `DD_TRACE_RATE_LIMIT` | `100` (per second) | Sets a maximum number of traces per second to sample. Set a rate limit to avoid the ingestion volume overages in the case of traffic spikes. | -| `tracing.sampling.span.rules` | `DD_SPAN_SAMPLING_RULES`,`ENV_SPAN_SAMPLING_RULES_FILE` | `nil` | Sets [Single Span Sampling](#single-span-sampling) rules. These rules allow you to keep spans even when their respective traces are dropped. | +| `tracing.sampling.span_rules` | `DD_SPAN_SAMPLING_RULES`,`ENV_SPAN_SAMPLING_RULES_FILE` | `nil` | Sets [Single Span Sampling](#single-span-sampling) rules. These rules allow you to keep spans even when their respective traces are dropped. | | `tracing.report_hostname` | `DD_TRACE_REPORT_HOSTNAME` | `false` | Adds hostname tag to traces. | | `tracing.test_mode.enabled` | `DD_TRACE_TEST_MODE_ENABLED` | `false` | Enables or disables test mode, for use of tracing in test suites. | | `tracing.test_mode.trace_flush` | | `nil` | Object that determines trace flushing behavior. | diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index efe7577fe4e..5309c88836a 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -555,45 +555,42 @@ def initialize(*_) o.lazy end - # Client-side single span sampling configuration. + # Single span sampling rules. + # These rules allow a span to be kept when its encompassing trace is dropped. + # + # The syntax for single span sampling rules can be found here: + # TODO: Insert documentation URL here when published. Search for references of this TODO + # + # @default `DD_SPAN_SAMPLING_RULES` environment variable. + # Otherwise, `ENV_SPAN_SAMPLING_RULES_FILE` environment variable. + # Otherwise `nil`. + # @return [String,nil] # @public_api - settings :span do - # Single span sampling rules. - # These rules allow a span to be kept when its encompassing trace is dropped. - # - # The syntax for single span sampling rules can be found here: - # TODO: Insert documentation URL here when published - # - # @default `DD_SPAN_SAMPLING_RULES` environment variable. - # Otherwise, `ENV_SPAN_SAMPLING_RULES_FILE` environment variable. - # Otherwise `nil`. - # @return [String,nil] - option :rules do |o| - o.default do - rules = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES] - rules_file = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE] - - if rules - if rules_file - Datadog.logger.warn( - 'Both DD_SPAN_SAMPLING_RULES and DD_SPAN_SAMPLING_RULES_FILE were provided: only ' \ + option :span_rules do |o| + o.default do + rules = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES] + rules_file = ENV[Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE] + + if rules + if rules_file + Datadog.logger.warn( + 'Both DD_SPAN_SAMPLING_RULES and DD_SPAN_SAMPLING_RULES_FILE were provided: only ' \ 'DD_SPAN_SAMPLING_RULES will be used. Please do not provide DD_SPAN_SAMPLING_RULES_FILE when ' \ 'also providing DD_SPAN_SAMPLING_RULES as their configuration conflicts.' - ) - end - rules - elsif rules_file - begin - File.read(rules_file) - rescue => e - # `File#read` errors have clear and actionable messages, no need to add extra exception info. - Datadog.logger.warn("Cannot read span sampling rules file: #{e.message}") - nil - end + ) + end + rules + elsif rules_file + begin + File.read(rules_file) + rescue => e + # `File#read` errors have clear and actionable messages, no need to add extra exception info. + Datadog.logger.warn("Cannot read span sampling rules file: #{e.message}") + nil end end - o.lazy end + o.lazy end end @@ -659,6 +656,7 @@ def initialize(*_) o.lazy end end + # rubocop:enable Metrics/BlockLength # rubocop:enable Metrics/ClassLength # rubocop:enable Layout/LineLength diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index 4f4cbd3e077..0c8d52a4caf 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -1209,57 +1209,55 @@ end end - describe '#span' do - describe '#rules' do - subject(:rules) { settings.tracing.sampling.span.rules } + describe '#span_rules' do + subject(:rules) { settings.tracing.sampling.span_rules } - context 'default' do - it { is_expected.to be nil } + context 'default' do + it { is_expected.to be nil } + end + + context 'when DD_SPAN_SAMPLING_RULES is provided' do + around do |example| + ClimateControl.modify( + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES => '{}' + ) do + example.run + end end - context 'when DD_SPAN_SAMPLING_RULES is provided' do + it { is_expected.to eq('{}') } + + context 'and DD_SPAN_SAMPLING_RULES_FILE is also provided' do around do |example| ClimateControl.modify( - Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES => '{}' + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => 'path' ) do example.run end end - it { is_expected.to eq('{}') } - - context 'and DD_SPAN_SAMPLING_RULES_FILE is also provided' do - around do |example| - ClimateControl.modify( - Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => 'path' - ) do - example.run - end - end - - it 'emits a conflict warning and returns DD_SPAN_SAMPLING_RULES' do - expect(Datadog.logger).to receive(:warn).with(include('configuration conflict')) - is_expected.to eq('{}') - end + it 'emits a conflict warning and returns DD_SPAN_SAMPLING_RULES' do + expect(Datadog.logger).to receive(:warn).with(include('configuration conflict')) + is_expected.to eq('{}') end end + end - context 'when DD_SPAN_SAMPLING_RULES_FILE is provided' do - around do |example| - Tempfile.open('DD_SPAN_SAMPLING_RULES_FILE') do |f| - f.write('{from:"file"}') - f.flush + context 'when DD_SPAN_SAMPLING_RULES_FILE is provided' do + around do |example| + Tempfile.open('DD_SPAN_SAMPLING_RULES_FILE') do |f| + f.write('{from:"file"}') + f.flush - ClimateControl.modify( - Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => f.path - ) do - example.run - end + ClimateControl.modify( + Datadog::Tracing::Configuration::Ext::Sampling::Span::ENV_SPAN_SAMPLING_RULES_FILE => f.path + ) do + example.run end end - - it { is_expected.to eq('{from:"file"}') } end + + it { is_expected.to eq('{from:"file"}') } end end end From c3eea875f2d9b527e688b57e9c5c2db5a673b332 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 16:13:48 -0700 Subject: [PATCH 0176/2133] Add value to conflict setting message --- lib/datadog/core/configuration/settings.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 5309c88836a..2d25c441894 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -576,7 +576,8 @@ def initialize(*_) Datadog.logger.warn( 'Both DD_SPAN_SAMPLING_RULES and DD_SPAN_SAMPLING_RULES_FILE were provided: only ' \ 'DD_SPAN_SAMPLING_RULES will be used. Please do not provide DD_SPAN_SAMPLING_RULES_FILE when ' \ - 'also providing DD_SPAN_SAMPLING_RULES as their configuration conflicts.' + 'also providing DD_SPAN_SAMPLING_RULES as their configuration conflicts. ' \ + "DD_SPAN_SAMPLING_RULES_FILE=#{rules_file} DD_SPAN_SAMPLING_RULES=#{rules}" ) end rules From 898709be75b40f1fca9009656caa92233cc72da6 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 5 Jul 2022 16:15:33 -0700 Subject: [PATCH 0177/2133] Better file read error message --- lib/datadog/core/configuration/settings.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 2d25c441894..527445936bc 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -586,7 +586,10 @@ def initialize(*_) File.read(rules_file) rescue => e # `File#read` errors have clear and actionable messages, no need to add extra exception info. - Datadog.logger.warn("Cannot read span sampling rules file: #{e.message}") + Datadog.logger.warn( + "Cannot read span sampling rules file `#{rules_file}`: #{e.message}." \ + 'No span sampling rules will be applied.' + ) nil end end From 584c6d6218a8e78501756bdc5ace659193550da8 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 10 Jun 2022 12:52:50 +0200 Subject: [PATCH 0178/2133] Implement private attributes `top_level` for span --- lib/datadog/tracing/span.rb | 9 ++- lib/datadog/tracing/span_operation.rb | 9 ++- lib/datadog/tracing/trace_operation.rb | 2 + spec/datadog/tracing/trace_operation_spec.rb | 83 ++++++++++++++++++++ 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index a2db8d6f164..ca67e61eed2 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -81,7 +81,8 @@ def initialize( start_time: nil, status: 0, type: span_type, - trace_id: nil + trace_id: nil, + top_level: nil ) @name = Core::Utils::SafeDup.frozen_or_dup(name) @service = Core::Utils::SafeDup.frozen_or_dup(service) @@ -106,6 +107,8 @@ def initialize( # duration_start and duration_end track monotonic clock, and may remain nil in cases where it # is known that we have to use wall clock to measure duration. @duration = duration + + @top_level = top_level end # Return whether the duration is started or not @@ -210,6 +213,10 @@ def start_time_nano def duration_nano (duration * 1e9).to_i end + + def top_level? + !!@top_level + end end end end diff --git a/lib/datadog/tracing/span_operation.rb b/lib/datadog/tracing/span_operation.rb index 69df7fd8fc4..ba6246692fc 100644 --- a/lib/datadog/tracing/span_operation.rb +++ b/lib/datadog/tracing/span_operation.rb @@ -437,6 +437,8 @@ def message :parent, :span + attr_writer :top_level + if RUBY_VERSION < '2.2' # nil.dup only fails in Ruby 2.1 # Ensures #initialize can call nil.dup safely module RefineNil @@ -468,10 +470,15 @@ def build_span start_time: @start_time, status: @status, type: @type, - trace_id: @trace_id + trace_id: @trace_id, + top_level: top_level? ) end + def top_level? + !!@top_level + end + # Set this span's parent, inheriting any properties not explicitly set. # If the parent is nil, set the span as the root span. # diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index e6189a40db0..0d8df938c7d 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -343,6 +343,8 @@ def subscribe_deactivate_trace(&block) def activate_span!(span_op) parent = @active_span + span_op.__send__(:top_level=, true) if parent.nil? || (span_op.service && parent.service != span_op.service) + span_op.send(:parent=, parent) unless parent.nil? @active_span = span_op diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index cb4da305574..208f2d14a54 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -2187,6 +2187,81 @@ def span end describe 'integration tests' do + context 'top_level attributes' do + context 'when service not given' do + it do + trace_op.measure('root') do |_, trace| + trace.measure('children_1') do + sleep(0.01) + end + + trace.measure('children_2') do + sleep(0.01) + end + end + + trace_segment = trace_op.flush! + + expect(trace_segment.spans.map(&:service)).to all(be_nil) + + hash = trace_segment.spans.each_with_object({}) do |span, h| + h[span.name] = span.__send__(:top_level?) + end + expect(hash['root']).to be true + expect(hash['children_1']).to be false + expect(hash['children_2']).to be false + end + end + + context 'when service provided at root' do + it do + trace_op.measure('root', service: 'service_1') do |_, trace| + trace.measure('children_1') do + sleep(0.01) + end + + trace.measure('children_2') do + sleep(0.01) + end + end + + trace_segment = trace_op.flush! + + hash = trace_segment.spans.each_with_object({}) do |span, h| + h[span.name] = span.__send__(:top_level?) + end + + expect(hash['root']).to be true + expect(hash['children_1']).to be false + expect(hash['children_2']).to be false + end + end + + context 'when service changed' do + it do + trace_op.measure('root', service: 'service_1') do |_, trace| + trace.measure('children_1', service: 'service_2') do + sleep(0.01) + end + + trace.measure('children_2') do + sleep(0.01) + end + end + + trace_segment = trace_op.flush! + + hash = trace_segment.spans.each_with_object({}) do |span, h| + h[span.name] = span.__send__(:top_level?) + end + + expect(hash['root']).to be true + expect(hash['children_1']).to be true + expect(hash['children_2']).to be false + end + end + end + context 'for a mock job with fan-out/fan-in behavior' do subject(:trace) do @thread_traces = Queue.new @@ -2274,6 +2349,7 @@ def span resource: 'import_job', service: 'job-worker' ) + expect(job_span.__send__(:top_level?)).to be true expect(load_data_span).to have_attributes( trace_id: trace_id, @@ -2283,6 +2359,7 @@ def span resource: 'imports.csv', service: 'job-worker' ) + expect(load_data_span.__send__(:top_level?)).to be false expect(read_file_span).to have_attributes( trace_id: trace_id, @@ -2292,6 +2369,7 @@ def span resource: 'imports.csv', service: 'job-worker' ) + expect(read_file_span.__send__(:top_level?)).to be false expect(deserialize_span).to have_attributes( trace_id: trace_id, @@ -2301,6 +2379,7 @@ def span resource: 'inventory', service: 'job-worker' ) + expect(deserialize_span.__send__(:top_level?)).to be false expect(start_inserts_span).to have_attributes( trace_id: trace_id, @@ -2310,6 +2389,7 @@ def span resource: 'inventory', service: 'job-worker' ) + expect(start_inserts_span.__send__(:top_level?)).to be false expect(db_query_spans).to all( have_attributes( @@ -2321,6 +2401,7 @@ def span service: 'database' ) ) + expect(db_query_spans.map { |s| s.__send__(:top_level?) }).to all(be true) expect(wait_insert_span).to have_attributes( trace_id: trace_id, @@ -2331,6 +2412,7 @@ def span service: 'job-worker' ) expect(wait_insert_span.get_tag('worker.count')).to eq(5.0) + expect(wait_insert_span.__send__(:top_level?)).to be false expect(update_log_span).to have_attributes( trace_id: trace_id, @@ -2340,6 +2422,7 @@ def span resource: 'inventory', service: 'job-worker' ) + expect(update_log_span.__send__(:top_level?)).to be false end end end From 7cb7819219ee09891cb22b45b116fc3dfce50755 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 29 Jun 2022 11:38:12 +0200 Subject: [PATCH 0179/2133] Failing spec for changing service within the block --- spec/datadog/tracing/trace_operation_spec.rb | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index 208f2d14a54..11edc4bec06 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -2260,6 +2260,31 @@ def span expect(hash['children_2']).to be false end end + + context 'when service changed within the block' do + it do + trace_op.measure('root', service: 'service_1') do |_, trace| + trace.measure('children_1') do |span| + span.service = 'service_2' + sleep(0.01) + end + + trace.measure('children_2') do + sleep(0.01) + end + end + + trace_segment = trace_op.flush! + + hash = trace_segment.spans.each_with_object({}) do |span, h| + h[span.name] = span.__send__(:top_level?) + end + + expect(hash['root']).to be true + expect(hash['children_1']).to be true + expect(hash['children_2']).to be false + end + end end context 'for a mock job with fan-out/fan-in behavior' do From f45acfcb040466b028b73f224cca51ff783dc1f9 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 29 Jun 2022 12:00:40 +0200 Subject: [PATCH 0180/2133] Fix span_operation define service within block --- lib/datadog/tracing/span_operation.rb | 6 +----- lib/datadog/tracing/trace_operation.rb | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/datadog/tracing/span_operation.rb b/lib/datadog/tracing/span_operation.rb index ba6246692fc..77abfbc6490 100644 --- a/lib/datadog/tracing/span_operation.rb +++ b/lib/datadog/tracing/span_operation.rb @@ -471,14 +471,10 @@ def build_span status: @status, type: @type, trace_id: @trace_id, - top_level: top_level? + top_level: parent.nil? || (service && parent.service != service) ) end - def top_level? - !!@top_level - end - # Set this span's parent, inheriting any properties not explicitly set. # If the parent is nil, set the span as the root span. # diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index 0d8df938c7d..e6189a40db0 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -343,8 +343,6 @@ def subscribe_deactivate_trace(&block) def activate_span!(span_op) parent = @active_span - span_op.__send__(:top_level=, true) if parent.nil? || (span_op.service && parent.service != span_op.service) - span_op.send(:parent=, parent) unless parent.nil? @active_span = span_op From ef4594e0b3cb525a272c32a52f3e360f70017d97 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 29 Jun 2022 12:17:52 +0200 Subject: [PATCH 0181/2133] Rename to service_entry --- lib/datadog/tracing/span.rb | 12 ++++++--- lib/datadog/tracing/span_operation.rb | 4 +-- spec/datadog/tracing/trace_operation_spec.rb | 26 ++++++++++---------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index ca67e61eed2..9fcbabe2560 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -82,7 +82,7 @@ def initialize( status: 0, type: span_type, trace_id: nil, - top_level: nil + service_entry: nil ) @name = Core::Utils::SafeDup.frozen_or_dup(name) @service = Core::Utils::SafeDup.frozen_or_dup(service) @@ -108,7 +108,11 @@ def initialize( # is known that we have to use wall clock to measure duration. @duration = duration - @top_level = top_level + # https://docs.datadoghq.com/tracing/visualization/#service-entry-span + # A span is a service entry span when it is the entrypoint method for a request to a service. + # You can visualize this within Datadog APM when the color of the immediate parent on a flame graph is a different + # color. Services are also listed on the right when viewing a flame graph. + @service_entry = service_entry end # Return whether the duration is started or not @@ -214,8 +218,8 @@ def duration_nano (duration * 1e9).to_i end - def top_level? - !!@top_level + def service_entry? + !!@service_entry end end end diff --git a/lib/datadog/tracing/span_operation.rb b/lib/datadog/tracing/span_operation.rb index 77abfbc6490..657c564cb76 100644 --- a/lib/datadog/tracing/span_operation.rb +++ b/lib/datadog/tracing/span_operation.rb @@ -437,8 +437,6 @@ def message :parent, :span - attr_writer :top_level - if RUBY_VERSION < '2.2' # nil.dup only fails in Ruby 2.1 # Ensures #initialize can call nil.dup safely module RefineNil @@ -471,7 +469,7 @@ def build_span status: @status, type: @type, trace_id: @trace_id, - top_level: parent.nil? || (service && parent.service != service) + service_entry: parent.nil? || (service && parent.service != service) ) end diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index 11edc4bec06..ada5d09fefc 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -2187,7 +2187,7 @@ def span end describe 'integration tests' do - context 'top_level attributes' do + context 'service_entry attributes' do context 'when service not given' do it do trace_op.measure('root') do |_, trace| @@ -2205,7 +2205,7 @@ def span expect(trace_segment.spans.map(&:service)).to all(be_nil) hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:top_level?) + h[span.name] = span.__send__(:service_entry?) end expect(hash['root']).to be true expect(hash['children_1']).to be false @@ -2228,7 +2228,7 @@ def span trace_segment = trace_op.flush! hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:top_level?) + h[span.name] = span.__send__(:service_entry?) end expect(hash['root']).to be true @@ -2252,7 +2252,7 @@ def span trace_segment = trace_op.flush! hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:top_level?) + h[span.name] = span.__send__(:service_entry?) end expect(hash['root']).to be true @@ -2277,7 +2277,7 @@ def span trace_segment = trace_op.flush! hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:top_level?) + h[span.name] = span.__send__(:service_entry?) end expect(hash['root']).to be true @@ -2374,7 +2374,7 @@ def span resource: 'import_job', service: 'job-worker' ) - expect(job_span.__send__(:top_level?)).to be true + expect(job_span.__send__(:service_entry?)).to be true expect(load_data_span).to have_attributes( trace_id: trace_id, @@ -2384,7 +2384,7 @@ def span resource: 'imports.csv', service: 'job-worker' ) - expect(load_data_span.__send__(:top_level?)).to be false + expect(load_data_span.__send__(:service_entry?)).to be false expect(read_file_span).to have_attributes( trace_id: trace_id, @@ -2394,7 +2394,7 @@ def span resource: 'imports.csv', service: 'job-worker' ) - expect(read_file_span.__send__(:top_level?)).to be false + expect(read_file_span.__send__(:service_entry?)).to be false expect(deserialize_span).to have_attributes( trace_id: trace_id, @@ -2404,7 +2404,7 @@ def span resource: 'inventory', service: 'job-worker' ) - expect(deserialize_span.__send__(:top_level?)).to be false + expect(deserialize_span.__send__(:service_entry?)).to be false expect(start_inserts_span).to have_attributes( trace_id: trace_id, @@ -2414,7 +2414,7 @@ def span resource: 'inventory', service: 'job-worker' ) - expect(start_inserts_span.__send__(:top_level?)).to be false + expect(start_inserts_span.__send__(:service_entry?)).to be false expect(db_query_spans).to all( have_attributes( @@ -2426,7 +2426,7 @@ def span service: 'database' ) ) - expect(db_query_spans.map { |s| s.__send__(:top_level?) }).to all(be true) + expect(db_query_spans.map { |s| s.__send__(:service_entry?) }).to all(be true) expect(wait_insert_span).to have_attributes( trace_id: trace_id, @@ -2437,7 +2437,7 @@ def span service: 'job-worker' ) expect(wait_insert_span.get_tag('worker.count')).to eq(5.0) - expect(wait_insert_span.__send__(:top_level?)).to be false + expect(wait_insert_span.__send__(:service_entry?)).to be false expect(update_log_span).to have_attributes( trace_id: trace_id, @@ -2447,7 +2447,7 @@ def span resource: 'inventory', service: 'job-worker' ) - expect(update_log_span.__send__(:top_level?)).to be false + expect(update_log_span.__send__(:service_entry?)).to be false end end end From 2fb7f0002cd6ea9fd5f292cfccc4dab399a7424b Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 29 Jun 2022 12:20:26 +0200 Subject: [PATCH 0182/2133] Remove sleep in test for speed --- spec/datadog/tracing/trace_operation_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index ada5d09fefc..01dc10b9822 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -2192,11 +2192,11 @@ def span it do trace_op.measure('root') do |_, trace| trace.measure('children_1') do - sleep(0.01) + # sleep(0.01) end trace.measure('children_2') do - sleep(0.01) + # sleep(0.01) end end @@ -2217,11 +2217,11 @@ def span it do trace_op.measure('root', service: 'service_1') do |_, trace| trace.measure('children_1') do - sleep(0.01) + # sleep(0.01) end trace.measure('children_2') do - sleep(0.01) + # sleep(0.01) end end @@ -2241,11 +2241,11 @@ def span it do trace_op.measure('root', service: 'service_1') do |_, trace| trace.measure('children_1', service: 'service_2') do - sleep(0.01) + # sleep(0.01) end trace.measure('children_2') do - sleep(0.01) + # sleep(0.01) end end @@ -2266,11 +2266,11 @@ def span trace_op.measure('root', service: 'service_1') do |_, trace| trace.measure('children_1') do |span| span.service = 'service_2' - sleep(0.01) + # sleep(0.01) end trace.measure('children_2') do - sleep(0.01) + # sleep(0.01) end end From 5baabfbefe99b84b39e148571ae5f4eacd831cf4 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 30 Jun 2022 09:37:13 +0200 Subject: [PATCH 0183/2133] Update comment for yard --- lib/datadog/tracing/span.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index 9fcbabe2560..89c361c8e24 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -66,6 +66,7 @@ class Span # * +type+: the type of the span (such as +http+, +db+ and so on) # * +parent_id+: the identifier of the parent span # * +trace_id+: the identifier of the root span for this trace + # * +service_entry+: whether it is a service entry span. # TODO: Remove span_type def initialize( name, @@ -108,10 +109,6 @@ def initialize( # is known that we have to use wall clock to measure duration. @duration = duration - # https://docs.datadoghq.com/tracing/visualization/#service-entry-span - # A span is a service entry span when it is the entrypoint method for a request to a service. - # You can visualize this within Datadog APM when the color of the immediate parent on a flame graph is a different - # color. Services are also listed on the right when viewing a flame graph. @service_entry = service_entry end @@ -218,6 +215,12 @@ def duration_nano (duration * 1e9).to_i end + # https://docs.datadoghq.com/tracing/visualization/#service-entry-span + # A span is a service entry span when it is the entrypoint method for a request to a service. + # You can visualize this within Datadog APM when the color of the immediate parent on a flame graph is a different + # color. Services are also listed on the right when viewing a flame graph. + # + # @return [Boolean] `true` if the span is a serivce entry span def service_entry? !!@service_entry end From 34880a6dc62799f0011e97c220c4de1bc5ac1d16 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 6 Jul 2022 17:19:23 +0200 Subject: [PATCH 0184/2133] Add spec for span_operation --- spec/datadog/tracing/span_operation_spec.rb | 80 +++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/spec/datadog/tracing/span_operation_spec.rb b/spec/datadog/tracing/span_operation_spec.rb index d5c9b982ef3..03c60b57d04 100644 --- a/spec/datadog/tracing/span_operation_spec.rb +++ b/spec/datadog/tracing/span_operation_spec.rb @@ -525,6 +525,86 @@ end end end + + context 'identifying service_entry_span' do + context 'when service of root and child are `nil`' do + it do + root_span_op = described_class.new("root") + child_span_op = described_class.new("child_1", child_of: root_span_op) + + root_span_op.measure do + child_span_op.measure do + # Do stuff + end + end + + root_span = root_span_op.finish + child_span = child_span_op.finish + + expect(root_span.__send__(:service_entry?)).to be true + expect(child_span.__send__(:service_entry?)).to be false + end + end + + context 'when service of root and child are identical' do + it do + root_span_op = described_class.new("root", service: 'root_service') + child_span_op = described_class.new("child_1", child_of: root_span_op, service: root_span_op.service) + + root_span_op.measure do + child_span_op.measure do + # Do stuff + end + end + + root_span = root_span_op.finish + child_span = child_span_op.finish + + expect(root_span.__send__(:service_entry?)).to be true + expect(child_span.__send__(:service_entry?)).to be false + end + end + + context 'when service of root and child are different' do + it do + root_span_op = described_class.new("root") + child_span_op = described_class.new("child_1", child_of: root_span_op, service: 'child_service') + + root_span_op.measure do + child_span_op.measure do + # Do stuff + end + end + + root_span = root_span_op.finish + child_span = child_span_op.finish + + expect(root_span.__send__(:service_entry?)).to be true + expect(child_span.__send__(:service_entry?)).to be true + end + end + + context 'when service of root and child are different, overriden within the measure block' do + it do + root_span_op = described_class.new("root") + child_span_op = described_class.new("child_1", child_of: root_span_op) + + root_span_op.measure do + child_span_op.measure do |span_op| + span_op.service = 'child_service' + + # Do stuff + end + end + + root_span = root_span_op.finish + child_span = child_span_op.finish + + expect(root_span.__send__(:service_entry?)).to be true + expect(child_span.__send__(:service_entry?)).to be true + end + end + end end describe '#start' do From 24e85021e43941a4bc9a2718bb8beeb089748b35 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 6 Jul 2022 17:21:09 +0200 Subject: [PATCH 0185/2133] Enforce boolean with `==` --- lib/datadog/tracing/span.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index 89c361c8e24..bd593173739 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -222,7 +222,7 @@ def duration_nano # # @return [Boolean] `true` if the span is a serivce entry span def service_entry? - !!@service_entry + @service_entry == true end end end From c2bc004925bfe26ac959c2fe2906e4d231439654 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 6 Jul 2022 17:40:26 +0200 Subject: [PATCH 0186/2133] Refactor spec with a_span_with --- spec/datadog/tracing/span_operation_spec.rb | 16 +++---- spec/datadog/tracing/trace_operation_spec.rb | 49 ++++++++------------ spec/support/span_helpers.rb | 9 ++++ 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/spec/datadog/tracing/span_operation_spec.rb b/spec/datadog/tracing/span_operation_spec.rb index 03c60b57d04..f0f2f866557 100644 --- a/spec/datadog/tracing/span_operation_spec.rb +++ b/spec/datadog/tracing/span_operation_spec.rb @@ -529,8 +529,8 @@ context 'identifying service_entry_span' do context 'when service of root and child are `nil`' do it do - root_span_op = described_class.new("root") - child_span_op = described_class.new("child_1", child_of: root_span_op) + root_span_op = described_class.new('root') + child_span_op = described_class.new('child_1', child_of: root_span_op) root_span_op.measure do child_span_op.measure do @@ -548,8 +548,8 @@ context 'when service of root and child are identical' do it do - root_span_op = described_class.new("root", service: 'root_service') - child_span_op = described_class.new("child_1", child_of: root_span_op, service: root_span_op.service) + root_span_op = described_class.new('root', service: 'root_service') + child_span_op = described_class.new('child_1', child_of: root_span_op, service: root_span_op.service) root_span_op.measure do child_span_op.measure do @@ -567,8 +567,8 @@ context 'when service of root and child are different' do it do - root_span_op = described_class.new("root") - child_span_op = described_class.new("child_1", child_of: root_span_op, service: 'child_service') + root_span_op = described_class.new('root') + child_span_op = described_class.new('child_1', child_of: root_span_op, service: 'child_service') root_span_op.measure do child_span_op.measure do @@ -586,8 +586,8 @@ context 'when service of root and child are different, overriden within the measure block' do it do - root_span_op = described_class.new("root") - child_span_op = described_class.new("child_1", child_of: root_span_op) + root_span_op = described_class.new('root') + child_span_op = described_class.new('child_1', child_of: root_span_op) root_span_op.measure do child_span_op.measure do |span_op| diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index 01dc10b9822..f188a973673 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -2202,14 +2202,11 @@ def span trace_segment = trace_op.flush! - expect(trace_segment.spans.map(&:service)).to all(be_nil) - - hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:service_entry?) - end - expect(hash['root']).to be true - expect(hash['children_1']).to be false - expect(hash['children_2']).to be false + expect(trace_segment.spans).to include( + a_span_with(name: 'root', service_entry?: true), + a_span_with(name: 'children_1', service_entry?: false), + a_span_with(name: 'children_2', service_entry?: false) + ) end end @@ -2227,13 +2224,11 @@ def span trace_segment = trace_op.flush! - hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:service_entry?) - end - - expect(hash['root']).to be true - expect(hash['children_1']).to be false - expect(hash['children_2']).to be false + expect(trace_segment.spans).to include( + a_span_with(name: 'root', service_entry?: true), + a_span_with(name: 'children_1', service_entry?: false), + a_span_with(name: 'children_2', service_entry?: false) + ) end end @@ -2251,13 +2246,11 @@ def span trace_segment = trace_op.flush! - hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:service_entry?) - end - - expect(hash['root']).to be true - expect(hash['children_1']).to be true - expect(hash['children_2']).to be false + expect(trace_segment.spans).to include( + a_span_with(name: 'root', service_entry?: true), + a_span_with(name: 'children_1', service_entry?: true), + a_span_with(name: 'children_2', service_entry?: false) + ) end end @@ -2276,13 +2269,11 @@ def span trace_segment = trace_op.flush! - hash = trace_segment.spans.each_with_object({}) do |span, h| - h[span.name] = span.__send__(:service_entry?) - end - - expect(hash['root']).to be true - expect(hash['children_1']).to be true - expect(hash['children_2']).to be false + expect(trace_segment.spans).to include( + a_span_with(name: 'root', service_entry?: true), + a_span_with(name: 'children_1', service_entry?: true), + a_span_with(name: 'children_2', service_entry?: false) + ) end end end diff --git a/spec/support/span_helpers.rb b/spec/support/span_helpers.rb index 140e0794166..f316c4d9d53 100644 --- a/spec/support/span_helpers.rb +++ b/spec/support/span_helpers.rb @@ -96,4 +96,13 @@ def description_of(actual) end end end + + RSpec::Matchers.define :a_span_with do |expected| + match do |actual| + actual.instance_of?(Datadog::Tracing::Span) && + expected.all? do |key, value| + actual.__send__(key) == value + end + end + end end From fc2adb75ab2702959591d42663920f220d781b20 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 6 Jul 2022 14:24:18 -0700 Subject: [PATCH 0187/2133] CI:RSpec documentation format to debug hung tests --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab3ab6c5280..f9741c163ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,8 @@ job_defaults: &job_defaults # TODO: Changing this requires rebuilding all docker images. working_directory: /app shell: /bin/bash --login + environment: + - SPEC_OPTS: --format documentation # Ensures it's possible to debug hung tests in CI test_containers: - &job_parameters From c623405a9f3ce4da7d9a354369e4bba3cde1c798 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 7 Jul 2022 09:43:02 +0100 Subject: [PATCH 0188/2133] [PROF-5748] Improve error message when pkg-config tool is not installed In #2068 a customer reported that they were not getting profiling with the message: > Profiling was requested but is not supported, profiling disabled: > Your ddtrace installation is missing support for the Continuous > Profiler because there was a problem in setting up the libddprof > dependency. After investigating this issue (and adding extra tools to debug it, see #2069) it turns out that the customer was missing the `pkg-config` tool. This tool is currently invoked indirectly via Ruby's `mkmf` helper, and is used to configure linking to libddprof/libdatadog. I must admit I was surprised that there's not better error logging in `mkmf` when the `pkg-config` tool is actually missing (vs it being installed but returning an error when being called). Thus, to hopefully avoid other customers running into this issue, I've added a bit of code to detect it, and hopefully present a better error message in that situation. I've also learned that `pkg-config` is "old news" on some Linux distributions, and instead they ship something called `pkgconf` which is a reimplementation of `pkg-config`. Beyond the RSpec tests, this can be triggered for testing by: 1. Changing the `pkg_config` call on extconf.rb ```diff -unless pkg_config('ddprof_ffi_with_rpath') +unless pkg_config('ddprof_ffi_with_rpath_broken') ``` which triggers the generic message (because pkg-config is available but returns an error since the configuration file is not found): ``` +------------------------------------------------------------------------------+ | Could not compile the Datadog Continuous Profiler because | | there was a problem in setting up the `libddprof` dependency. | | | | The Datadog Continuous Profiler will not be available, | | but all other ddtrace features will work fine! | | | | For help solving this issue, please contact Datadog support at | | . | +------------------------------------------------------------------------------+ ``` 2. Crippling `pkg_config`: ```bash $ docker-compose run --no-deps --rm tracer-2.1 /bin/bash # doing this inside docker is fine because it doesn't persist $ rm /usr/bin/pkg-config $ bundle exec rake clean compile # ... +------------------------------------------------------------------------------+ | Could not compile the Datadog Continuous Profiler because | | the `pkg-config` system tool is missing. | | This issue can usually be fixed by installing: | | 1. the `pkg-config` package on Homebrew and Debian/Ubuntu-based Linux; | | 2. the `pkgconf` package on Arch and Alpine-based Linux; | | 3. the `pkgconf-pkg-config` package on Fedora/Red Hat-based Linux. | | | | The Datadog Continuous Profiler will not be available, | | but all other ddtrace features will work fine! | | | | For help solving this issue, please contact Datadog support at | | . | +------------------------------------------------------------------------------+ ``` Closes #2068 --- .../extconf.rb | 9 +++- .../native_extension_helpers.rb | 19 +++++++++ .../native_extension_helpers_spec.rb | 42 +++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index e0db5bea125..5fb48bf250b 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -143,7 +143,14 @@ def add_compiler_flag(flag) Logging.message(" [ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") unless pkg_config('ddprof_ffi_with_rpath') - skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF) + skip_building_extension!( + if Datadog::Profiling::NativeExtensionHelpers::Supported.pkg_config_missing? + Datadog::Profiling::NativeExtensionHelpers::Supported::PKG_CONFIG_IS_MISSING + else + # Less specific error message + Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF + end + ) end # See comments on the helper method being used for why we need to additionally set this diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 29fc53caa0c..a3be126fd8e 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -126,6 +126,14 @@ def self.render_skipped_reason_file(reason:, suggested:) [*reason, *suggested].join(' ') end + # mkmf sets $PKGCONFIG after the `pkg_config` gets used in extconf.rb. When `pkg_config` is unsuccessful, we use + # this helper to decide if we can show more specific error message vs a generic "something went wrong". + def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/GlobalVars + pkg_config_available = command && xsystem("#{command} --version") + + pkg_config_available != true + end + CONTACT_SUPPORT = [ 'For help solving this issue, please contact Datadog support at', '.', @@ -153,6 +161,17 @@ def self.render_skipped_reason_file(reason:, suggested:) suggested: CONTACT_SUPPORT, ) + # Validation for this check is done in extconf.rb because it relies on mkmf + PKG_CONFIG_IS_MISSING = explain_issue( + #+-----------------------------------------------------------------------------+ + 'the `pkg-config` system tool is missing.', + 'This issue can usually be fixed by installing:', + '1. the `pkg-config` package on Homebrew and Debian/Ubuntu-based Linux;', + '2. the `pkgconf` package on Arch and Alpine-based Linux;', + '3. the `pkgconf-pkg-config` package on Fedora/Red Hat-based Linux.', + suggested: CONTACT_SUPPORT, + ) + private_class_method def self.disabled_via_env? disabled_via_env = explain_issue( 'the `DD_PROFILING_NO_EXTENSION` environment variable is/was set to', diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index 6c6f4309b62..bc3c4b2ef03 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -181,4 +181,46 @@ end end end + + describe '.pkg_config_missing?' do + subject(:pkg_config_missing) { described_class.pkg_config_missing?(command: command) } + + before do + skip_if_profiling_not_supported(self) + end + + context 'when command is not available' do + let(:command) { nil } + + it { is_expected.to be true } + end + + # This spec is semi-realistic, because it actually calls into the pkg-config external process. + # + # We know pkg-config must be available on the machine running the tests because otherwise profiling would not be + # supported (and thus `skip_if_profiling_not_supported` would've been triggered). + # + # We could also mock the entire interaction, but this seemed like a simple enough way to go. + context 'when command is available' do + before do + # This helper is designed to be called from extconf.rb, which requires mkmf, which defines xsystem. + # When executed in RSpec, mkmf is not required, so we replace it with the regular system call. + without_partial_double_verification do + expect(described_class).to receive(:xsystem) { |*args| system(*args) } + end + end + + context 'and pkg-config can successfully be called' do + let(:command) { 'pkg-config' } + + it { is_expected.to be false } + end + + context 'and pkg-config cannot be called' do + let(:command) { 'does-not-exist' } + + it { is_expected.to be true } + end + end + end end From b357a52e32ab903b420bd1b5277398ea92625a2e Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 13 May 2022 17:36:46 +0100 Subject: [PATCH 0189/2133] Bootstrap per-thread context and hashmap to store it There will be a few things that we'll want to track for each thread (such as "when did we last sample it"). This is similar to what we already did for the `OldStack` collector, where we store these things as instance variables in the `Thread` object. Currently the struct is actually empty; I'll start adding things there soon. A big FIXME at this point is that we never remove dead threads from the context. --- .../collectors_cpu_and_wall_time.c | 93 +++++++++++++++++++ .../profiling/collectors/cpu_and_wall_time.rb | 7 ++ 2 files changed, 100 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 4b5d6b1b872..efe544deccf 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -8,20 +8,36 @@ static VALUE collectors_cpu_and_wall_time_class = Qnil; +// Contains state for a single CpuAndWallTime instance struct cpu_and_wall_time_collector_state { // Note: Places in this file that usually need to be changed when this struct is changed are tagged with // "Update this when modifying state struct" + + // Required by Datadog::Profiling::Collectors::Stack as a scratch buffer during sampling sampling_buffer *sampling_buffer; + // Hashmap + st_table *hash_map_per_thread_context; + // Datadog::Profiling::StackRecorder instance VALUE recorder_instance; }; +// Tracks per-thread state +struct per_thread_context { +}; + static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr); +static int hash_map_per_thread_context_mark(st_data_t key_thread, st_data_t _value, st_data_t _argument); +static int hash_map_per_thread_context_free_values(st_data_t _thread, st_data_t value_per_thread_context, st_data_t _argument); static VALUE _native_new(VALUE klass); static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames); static VALUE _native_sample(VALUE self, VALUE collector_instance); static void sample(VALUE collector_instance); static VALUE _native_thread_list(VALUE self); +static struct per_thread_context *get_or_create_context_for(VALUE thread, struct cpu_and_wall_time_collector_state *state); +static VALUE _native_inspect(VALUE self, VALUE collector_instance); +static VALUE per_thread_context_st_table_as_ruby_hash(struct cpu_and_wall_time_collector_state *state); +static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value_context, st_data_t result_hash); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -40,6 +56,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 3); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_sample", _native_sample, 1); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_thread_list", _native_thread_list, 0); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_inspect", _native_inspect, 1); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -55,11 +72,14 @@ static const rb_data_type_t cpu_and_wall_time_collector_typed_data = { .flags = RUBY_TYPED_FREE_IMMEDIATELY }; +// This function is called by the Ruby GC to give us a chance to mark any Ruby objects that we're holding on to, +// so that they don't get garbage collected static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr) { struct cpu_and_wall_time_collector_state *state = (struct cpu_and_wall_time_collector_state *) state_ptr; // Update this when modifying state struct rb_gc_mark(state->recorder_instance); + st_foreach(state->hash_map_per_thread_context, hash_map_per_thread_context_mark, 0 /* unused */); } static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { @@ -71,14 +91,36 @@ static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { // pointers that have been set NULL there may still be NULL here. if (state->sampling_buffer != NULL) sampling_buffer_free(state->sampling_buffer); + // Free each entry in the map + st_foreach(state->hash_map_per_thread_context, hash_map_per_thread_context_free_values, 0 /* unused */); + // ...and then the map + st_free_table(state->hash_map_per_thread_context); + ruby_xfree(state); } +// Mark Ruby thread references we keep as keys in hash_map_per_thread_context +static int hash_map_per_thread_context_mark(st_data_t key_thread, st_data_t _value, st_data_t _argument) { + VALUE thread = (VALUE) key_thread; + rb_gc_mark(thread); + return ST_CONTINUE; +} + +// Used to clear each of the per_thread_contexts inside the hash_map_per_thread_context +static int hash_map_per_thread_context_free_values(st_data_t _thread, st_data_t value_per_thread_context, st_data_t _argument) { + struct per_thread_context *per_thread_context = (struct per_thread_context*) value_per_thread_context; + ruby_xfree(per_thread_context); + return ST_CONTINUE; +} + static VALUE _native_new(VALUE klass) { struct cpu_and_wall_time_collector_state *state = ruby_xcalloc(1, sizeof(struct cpu_and_wall_time_collector_state)); // Update this when modifying state struct state->sampling_buffer = NULL; + state->hash_map_per_thread_context = + // "numtable" is an awful name, but TL;DR it's what should be used when keys are `VALUE`s. + st_init_numtable(); state->recorder_instance = Qnil; return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); @@ -95,6 +137,7 @@ static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE reco // Update this when modifying state struct state->sampling_buffer = sampling_buffer_new(max_frames_requested); + // hash_map_per_thread_context is already initialized, nothing to do here state->recorder_instance = recorder_instance; return Qtrue; @@ -116,6 +159,7 @@ static void sample(VALUE collector_instance) { const long thread_count = RARRAY_LEN(threads); for (long i = 0; i < thread_count; i++) { VALUE thread = RARRAY_AREF(threads, i); + struct per_thread_context *thread_context = get_or_create_context_for(thread, state); int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; @@ -139,3 +183,52 @@ static void sample(VALUE collector_instance) { static VALUE _native_thread_list(VALUE self) { return ddtrace_thread_list(); } + +static struct per_thread_context *get_or_create_context_for(VALUE thread, struct cpu_and_wall_time_collector_state *state) { + struct per_thread_context* thread_context = NULL; + st_data_t value_context = 0; + + if (st_lookup(state->hash_map_per_thread_context, (st_data_t) thread, &value_context)) { + thread_context = (struct per_thread_context*) value_context; + } else { + thread_context = ruby_xcalloc(1, sizeof(struct per_thread_context)); + // FIXME FIXME! Right now we never remove threads from this map! So as long as the sampler object is alive, this + // will leak threads! + st_insert(state->hash_map_per_thread_context, (st_data_t) thread, (st_data_t) thread_context); + } + + return thread_context; +} + +static VALUE _native_inspect(VALUE self, VALUE collector_instance) { + struct cpu_and_wall_time_collector_state *state; + TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + + VALUE result = rb_str_new2(" (native state)"); + + // Update this when modifying state struct + rb_str_concat(result, rb_sprintf(" hash_map_per_thread_context=%"PRIsVALUE, per_thread_context_st_table_as_ruby_hash(state))); + rb_str_concat(result, rb_sprintf(" recorder_instance=%"PRIsVALUE, state->recorder_instance)); + + return result; +} + +static VALUE per_thread_context_st_table_as_ruby_hash(struct cpu_and_wall_time_collector_state *state) { + VALUE result = rb_hash_new(); + st_foreach(state->hash_map_per_thread_context, per_thread_context_as_ruby_hash, result); + return result; +} + +#define VALUE_COUNT(array) (sizeof(array) / sizeof(VALUE)) + +static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value_context, st_data_t result_hash) { + VALUE thread = (VALUE) key_thread; + VALUE result = (VALUE) result_hash; + VALUE context_as_hash = rb_hash_new(); + rb_hash_aset(result_hash, thread, context_as_hash); + + VALUE arguments[] = {}; + for (long unsigned int i = 0; i < VALUE_COUNT(arguments); i += 2) rb_hash_aset(context_as_hash, arguments[i], arguments[i+1]); + + return ST_CONTINUE; +} diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index 4bd8305634f..d2f1887ecbf 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -23,6 +23,13 @@ def sample def thread_list self.class._native_thread_list end + + def inspect + # Compose Ruby's default inspect with our custom inspect for the native parts + result = super() + result[-1] = "#{self.class._native_inspect(self)}>" + result + end end end end From d1f3af99237b05a8b3450ff9af7d760cc6c2125c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 8 Jun 2022 16:38:09 +0100 Subject: [PATCH 0190/2133] Scaffold fix for never cleaning threads from the per_thread_context I've added a simple approach to cleaning up dead threads from `hash_map_per_thread_context` and also tests for it. The tests don't currently pass since I'm using a dummy `thread_alive` -- I'll implement this in the next commit. --- .../collectors_cpu_and_wall_time.c | 34 ++++++ .../profiling/collectors/cpu_and_wall_time.rb | 6 + .../collectors/cpu_and_wall_time_spec.rb | 108 +++++++++--------- 3 files changed, 96 insertions(+), 52 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index efe544deccf..14cbe71684e 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -38,6 +38,9 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct static VALUE _native_inspect(VALUE self, VALUE collector_instance); static VALUE per_thread_context_st_table_as_ruby_hash(struct cpu_and_wall_time_collector_state *state); static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value_context, st_data_t result_hash); +static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_state *state); +static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument); +static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -57,6 +60,7 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_sample", _native_sample, 1); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_thread_list", _native_thread_list, 0); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_inspect", _native_inspect, 1); + rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_per_thread_context", _native_per_thread_context, 1); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -176,6 +180,9 @@ static void sample(VALUE collector_instance) { (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME: TODO we need to gather the expected labels ); } + + // TODO: This seems somewhat overkill and inefficient to do every time we sample; to be improved later + remove_context_for_dead_threads(state); } // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. @@ -232,3 +239,30 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value return ST_CONTINUE; } + +static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_state *state) { + st_foreach(state->hash_map_per_thread_context, remove_if_dead_thread, 0 /* unused */); +} + +static bool thread_alive(VALUE thread) { + // TODO: FIX THIS TO ACTUALLY WORK + return true; +} + +static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument) { + VALUE thread = (VALUE) key_thread; + struct per_thread_context* thread_context = (struct per_thread_context*) value_context; + + if (thread_alive(thread)) return ST_CONTINUE; + + ruby_xfree(thread_context); + return ST_DELETE; +} + +// Returns the whole contents of the per_thread_context structs being tracked, for debugging/testing +static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance) { + struct cpu_and_wall_time_collector_state *state; + TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + + return per_thread_context_st_table_as_ruby_hash(state); +} diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index d2f1887ecbf..ac3a827e35c 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -24,6 +24,12 @@ def thread_list self.class._native_thread_list end + # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def per_thread_context + self.class._native_per_thread_context(self) + end + def inspect # Compose Ruby's default inspect with our custom inspect for the native parts result = super() diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 656e871b90a..92cd575c810 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -11,39 +11,39 @@ subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } - describe '#sample' do - let(:ready_queue) { Queue.new } - let!(:t1) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep - end + let(:ready_queue) { Queue.new } + let!(:t1) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep end - let!(:t2) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep - end + end + let!(:t2) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep end - let!(:t3) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep - end + end + let!(:t3) do + Thread.new(ready_queue) do |ready_queue| + ready_queue << true + sleep end + end - before do - 3.times { ready_queue.pop } - expect(Thread.list).to include(Thread.main, t1, t2, t3) - end + before do + 3.times { ready_queue.pop } + expect(Thread.list).to include(Thread.main, t1, t2, t3) + end - after do - [t1, t2, t3].each do |thread| - thread.kill - thread.join - end + after do + [t1, t2, t3].each do |thread| + thread.kill + thread.join end + end + describe '#sample' do it 'samples all threads' do all_threads = Thread.list @@ -64,40 +64,44 @@ def sample_and_decode end describe '#thread_list' do - let(:ready_queue) { Queue.new } - let!(:t1) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep - end - end - let!(:t2) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep - end + it "returns the same as Ruby's Thread.list" do + expect(cpu_and_wall_time_collector.thread_list).to eq Thread.list end - let!(:t3) do - Thread.new(ready_queue) do |ready_queue| - ready_queue << true - sleep + end + + # Validate that we correctly clean up and don't leak per_thread_context + describe '#per_thread_context' do + context 'before sampling' do + it do + expect(cpu_and_wall_time_collector.per_thread_context).to be_empty end end - before do - 3.times { ready_queue.pop } - expect(Thread.list).to include(Thread.main, t1, t2, t3) - end + context 'after sampling' do + before do + cpu_and_wall_time_collector.sample + end - after do - [t1, t2, t3].each do |thread| - thread.kill - thread.join + it 'contains all the sampled threads' do + expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t2, t3) end end - it "returns the same as Ruby's Thread.list" do - expect(cpu_and_wall_time_collector.thread_list).to eq Thread.list + context 'after sampling multiple times' do + it 'contains only the threads still alive' do + cpu_and_wall_time_collector.sample + + # All alive threads still in there + expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t2, t3) + + # Get rid of t2 + t2.kill + t2.join + + cpu_and_wall_time_collector.sample + expect(cpu_and_wall_time_collector.per_thread_context.keys).to_not include(t2) + expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t3) + end end end end From 11a9e4579c17150c8a1af45fbe276448e8f7f550 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 8 Jun 2022 17:27:04 +0100 Subject: [PATCH 0191/2133] Clean up dead threads from per_thread_context --- .../collectors_cpu_and_wall_time.c | 9 +-------- .../private_vm_api_access.c | 4 ++++ .../private_vm_api_access.h | 1 + .../collectors/cpu_and_wall_time_spec.rb | 17 ++++++++--------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 14cbe71684e..8be61134534 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -199,8 +199,6 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct thread_context = (struct per_thread_context*) value_context; } else { thread_context = ruby_xcalloc(1, sizeof(struct per_thread_context)); - // FIXME FIXME! Right now we never remove threads from this map! So as long as the sampler object is alive, this - // will leak threads! st_insert(state->hash_map_per_thread_context, (st_data_t) thread, (st_data_t) thread_context); } @@ -244,16 +242,11 @@ static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_s st_foreach(state->hash_map_per_thread_context, remove_if_dead_thread, 0 /* unused */); } -static bool thread_alive(VALUE thread) { - // TODO: FIX THIS TO ACTUALLY WORK - return true; -} - static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument) { VALUE thread = (VALUE) key_thread; struct per_thread_context* thread_context = (struct per_thread_context*) value_context; - if (thread_alive(thread)) return ST_CONTINUE; + if (is_thread_alive(thread)) return ST_CONTINUE; ruby_xfree(thread_context); return ST_DELETE; diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 079b029dd10..afbd752c135 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -129,6 +129,10 @@ static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, v } #endif // USE_LEGACY_LIVING_THREADS_ST +bool is_thread_alive(VALUE thread) { + return thread_struct_from_object(thread)->status != THREAD_KILLED; +} + // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. // Each function is annotated with its origin, why we imported it, and the changes made. diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index 715a44fd241..59da7db4d6d 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -18,6 +18,7 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); VALUE ddtrace_thread_list(void); +bool is_thread_alive(VALUE thread); int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 92cd575c810..cb116c9a54f 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -4,13 +4,14 @@ require 'datadog/profiling/collectors/cpu_and_wall_time' RSpec.describe Datadog::Profiling::Collectors::CpuAndWallTime do - before { skip_if_profiling_not_supported(self) } - - let(:recorder) { Datadog::Profiling::StackRecorder.new } - let(:max_frames) { 123 } + before do + skip_if_profiling_not_supported(self) - subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } + 3.times { ready_queue.pop } + expect(Thread.list).to include(Thread.main, t1, t2, t3) + end + let(:recorder) { Datadog::Profiling::StackRecorder.new } let(:ready_queue) { Queue.new } let!(:t1) do Thread.new(ready_queue) do |ready_queue| @@ -30,11 +31,9 @@ sleep end end + let(:max_frames) { 123 } - before do - 3.times { ready_queue.pop } - expect(Thread.list).to include(Thread.main, t1, t2, t3) - end + subject(:cpu_and_wall_time_collector) { described_class.new(recorder: recorder, max_frames: max_frames) } after do [t1, t2, t3].each do |thread| From f916e8b487e8f5cae30f4e8eb47f2c0eb064503c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 9 Jun 2022 09:22:03 +0100 Subject: [PATCH 0192/2133] Fix up issue with thread ordering after rubocop "fix" Ahhh Rubocop... --- .../profiling/collectors/cpu_and_wall_time_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index cb116c9a54f..afc2dfde89b 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -7,25 +7,25 @@ before do skip_if_profiling_not_supported(self) - 3.times { ready_queue.pop } + [t1, t2, t3].each { ready_queue.pop } expect(Thread.list).to include(Thread.main, t1, t2, t3) end let(:recorder) { Datadog::Profiling::StackRecorder.new } let(:ready_queue) { Queue.new } - let!(:t1) do + let(:t1) do Thread.new(ready_queue) do |ready_queue| ready_queue << true sleep end end - let!(:t2) do + let(:t2) do Thread.new(ready_queue) do |ready_queue| ready_queue << true sleep end end - let!(:t3) do + let(:t3) do Thread.new(ready_queue) do |ready_queue| ready_queue << true sleep From 4c05ac2dfd66efe7e9c8260c043e065b4804fa2f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 9 Jun 2022 09:56:27 +0100 Subject: [PATCH 0193/2133] Use actual `VALUE` argument when calling `rb_hash_aset` --- .../collectors_cpu_and_wall_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 8be61134534..3f96e6fd9c8 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -230,7 +230,7 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value VALUE thread = (VALUE) key_thread; VALUE result = (VALUE) result_hash; VALUE context_as_hash = rb_hash_new(); - rb_hash_aset(result_hash, thread, context_as_hash); + rb_hash_aset(result, thread, context_as_hash); VALUE arguments[] = {}; for (long unsigned int i = 0; i < VALUE_COUNT(arguments); i += 2) rb_hash_aset(context_as_hash, arguments[i], arguments[i+1]); From de5ae4069fc6061e058be93f10c08fb40c21fbfd Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 9 Jun 2022 10:03:51 +0100 Subject: [PATCH 0194/2133] Avoid Ruby 2.3 crash with `Floating point exception` On purpose, this PR did not yet add anything to the `struct per_thread_context`. This means that its `sizeof(...)` is 0, and for all Rubies OTHER than 2.3 it's fine to do `ruby_xcalloc(1, sizeof(struct per_thread_context))` even if the struct is empty, but 2.3 doesn't like this and crashes with a `Floating point exception`. So for now let's just add a single dummy member to the struct to unbreak CI, which will be replaced by the actual context we need in a follow-up PR. --- .../collectors_cpu_and_wall_time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 3f96e6fd9c8..800a264a244 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -23,6 +23,7 @@ struct cpu_and_wall_time_collector_state { // Tracks per-thread state struct per_thread_context { + int dummy_placeholder_will_be_removed_in_next_pr; }; static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); From cf124124cd66f698c399771ffcc8965b172cd922 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 7 Jul 2022 10:23:51 +0100 Subject: [PATCH 0195/2133] Call `remove_context_for_dead_threads` only every 100th sample As indicated in the TODO, there's probably much better ways to clean up the state after dead threads, but for now we'll go with this simpler mechanism. --- .../collectors_cpu_and_wall_time.c | 11 +++++++++-- .../profiling/collectors/cpu_and_wall_time_spec.rb | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 800a264a244..af61b382d2b 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -19,6 +19,8 @@ struct cpu_and_wall_time_collector_state { st_table *hash_map_per_thread_context; // Datadog::Profiling::StackRecorder instance VALUE recorder_instance; + // Track how many samples we've taken. + unsigned int sample_count; }; // Tracks per-thread state @@ -127,6 +129,7 @@ static VALUE _native_new(VALUE klass) { // "numtable" is an awful name, but TL;DR it's what should be used when keys are `VALUE`s. st_init_numtable(); state->recorder_instance = Qnil; + state->sample_count = 0; return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); } @@ -182,8 +185,11 @@ static void sample(VALUE collector_instance) { ); } - // TODO: This seems somewhat overkill and inefficient to do every time we sample; to be improved later - remove_context_for_dead_threads(state); + state->sample_count++; + + // TODO: This seems somewhat overkill and inefficient to do often; right now we just doing every few samples + // but there's probably a better way to do this if we actually track when threads finish + if (state->sample_count % 100 == 0) remove_context_for_dead_threads(state); } // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. @@ -215,6 +221,7 @@ static VALUE _native_inspect(VALUE self, VALUE collector_instance) { // Update this when modifying state struct rb_str_concat(result, rb_sprintf(" hash_map_per_thread_context=%"PRIsVALUE, per_thread_context_st_table_as_ruby_hash(state))); rb_str_concat(result, rb_sprintf(" recorder_instance=%"PRIsVALUE, state->recorder_instance)); + rb_str_concat(result, rb_sprintf(" sample_count=%u", state->sample_count)); return result; } diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index afc2dfde89b..0685d2508d6 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -97,7 +97,10 @@ def sample_and_decode t2.kill t2.join - cpu_and_wall_time_collector.sample + # Currently the clean-up gets triggered only every 100th sample, so we need to do this to trigger the + # clean-up. This can probably be improved (see TODO on the actual implementation) + 100.times { cpu_and_wall_time_collector.sample } + expect(cpu_and_wall_time_collector.per_thread_context.keys).to_not include(t2) expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t3) end From b8e097a9a60ab6babd498f2426c1d9be4e950df7 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 7 Jul 2022 17:32:04 -0700 Subject: [PATCH 0196/2133] Fix have_metadata RSpec helper --- .../ddtrace/transport/trace_formatter_spec.rb | 71 ++++++++++++++----- spec/support/span_helpers.rb | 20 +++++- 2 files changed, 71 insertions(+), 20 deletions(-) diff --git a/spec/ddtrace/transport/trace_formatter_spec.rb b/spec/ddtrace/transport/trace_formatter_spec.rb index 5bf629ec1f0..767d7822d7e 100644 --- a/spec/ddtrace/transport/trace_formatter_spec.rb +++ b/spec/ddtrace/transport/trace_formatter_spec.rb @@ -113,6 +113,7 @@ context 'when initialized with a TraceSegment' do shared_examples 'root span with no tags' do it do + format! expect(root_span).to have_metadata( Datadog::Tracing::Metadata::Ext::Sampling::TAG_AGENT_RATE => nil, Datadog::Tracing::Metadata::Ext::NET::TAG_HOSTNAME => nil, @@ -130,6 +131,7 @@ shared_examples 'root span with tags' do it do + format! expect(root_span).to have_metadata( Datadog::Tracing::Metadata::Ext::Sampling::TAG_AGENT_RATE => agent_sample_rate, Datadog::Tracing::Metadata::Ext::NET::TAG_HOSTNAME => hostname, @@ -146,22 +148,32 @@ context 'but peer.service is set' do before do + allow(root_span).to receive(:get_tag).and_call_original allow(root_span).to receive(:get_tag) .with(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE) .and_return('a-peer-service') end - it { expect(root_span).to have_metadata(Datadog::Core::Runtime::Ext::TAG_LANG => nil) } + it 'does not set language tag' do + format! + expect(root_span).to have_metadata(Datadog::Core::Runtime::Ext::TAG_LANG => nil) + end end end shared_examples 'root span with generic tags' do context 'metrics' do - it { expect(root_span.metrics).to include({ 'baz' => 42 }) } + it 'sets root span tags from trace tags' do + format! + expect(root_span.metrics).to include({ 'baz' => 42 }) + end end context 'meta' do - it { expect(root_span.meta).to include({ 'foo' => 'bar' }) } + it 'sets root span tags from trace tags' do + format! + expect(root_span.meta).to include({ 'foo' => 'bar' }) + end end end @@ -178,11 +190,12 @@ context 'with no root span' do include_context 'no root span' - before { format! } - context 'when trace has no metadata set' do it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with no tags' end @@ -191,7 +204,10 @@ include_context 'trace metadata' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with tags' end @@ -200,7 +216,10 @@ include_context 'trace metadata with tags' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with tags' it_behaves_like 'root span without generic tags' @@ -210,11 +229,12 @@ context 'with missing root span' do include_context 'missing root span' - before { format! } - context 'when trace has no metadata set' do it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with no tags' end @@ -223,7 +243,10 @@ include_context 'trace metadata' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with tags' end @@ -232,7 +255,10 @@ include_context 'trace metadata with tags' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with tags' it_behaves_like 'root span without generic tags' @@ -242,11 +268,12 @@ context 'with a root span' do include_context 'available root span' - before { format! } - context 'when trace has no metadata set' do it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq('my.job') } + + it 'does not override the root span resource' do + expect { format! }.to_not(change { root_span.resource }) + end it_behaves_like 'root span with no tags' end @@ -255,7 +282,11 @@ include_context 'trace metadata' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq(resource) } + + it 'sets the root span resource from trace resource' do + format! + expect(root_span.resource).to eq(resource) + end it_behaves_like 'root span with tags' end @@ -264,7 +295,11 @@ include_context 'trace metadata with tags' it { is_expected.to be(trace) } - it { expect(root_span.resource).to eq(resource) } + + it 'sets the root span resource from trace resource' do + format! + expect(root_span.resource).to eq(resource) + end it_behaves_like 'root span with tags' it_behaves_like 'root span with generic tags' diff --git a/spec/support/span_helpers.rb b/spec/support/span_helpers.rb index f316c4d9d53..2f50b91247a 100644 --- a/spec/support/span_helpers.rb +++ b/spec/support/span_helpers.rb @@ -89,12 +89,28 @@ def description_of(actual) end end - RSpec::Matchers.define :have_metadata do |**tags| + # @param tags [Hash] key value pairs to tags/metrics to assert on + RSpec::Matchers.define :have_metadata do |tags| match do |actual| tags.all? do |key, value| - actual.get_tag(key) == value + values_match? value, actual.get_tag(key) end end + + match_when_negated do |actual| + if tags.respond_to?(:any?) + tags.any? do |key, value| + !values_match? value, actual.get_tag(key) + end + else + # Allows for `expect(span).to_not have_metadata('my.tag')` syntax + values_match? nil, actual.get_tag(tags) + end + end + + def description_of(actual) + "Span with metadata #{actual.send(:meta).merge(actual.send(:metrics))}" + end end RSpec::Matchers.define :a_span_with do |expected| From 7359c15f53f444667b801f1e02a823eb3363593a Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 7 Jul 2022 17:01:40 -0700 Subject: [PATCH 0197/2133] Compute top-level span in tracer --- lib/datadog/tracing/metadata/ext.rb | 3 +++ lib/datadog/tracing/span.rb | 3 +++ spec/datadog/tracing/span_spec.rb | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/lib/datadog/tracing/metadata/ext.rb b/lib/datadog/tracing/metadata/ext.rb index 979c3f7ea67..96b6569b724 100644 --- a/lib/datadog/tracing/metadata/ext.rb +++ b/lib/datadog/tracing/metadata/ext.rb @@ -22,6 +22,9 @@ module Ext TAG_KIND = 'span.kind' + # Set this tag to `1.0` if the span is a Service Entry span. + TAG_TOP_LEVEL = '_dd.top_level' + # Defines constants for trace analytics # @public_api module Analytics diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index bd593173739..ef88ff0ac5f 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -110,6 +110,9 @@ def initialize( @duration = duration @service_entry = service_entry + + # Mark with the service entry span metric, if applicable + set_metric(Metadata::Ext::TAG_TOP_LEVEL, 1.0) if service_entry end # Return whether the duration is started or not diff --git a/spec/datadog/tracing/span_spec.rb b/spec/datadog/tracing/span_spec.rb index 31386a1dfd4..c716fdc13e1 100644 --- a/spec/datadog/tracing/span_spec.rb +++ b/spec/datadog/tracing/span_spec.rb @@ -51,6 +51,32 @@ end end end + + context 'service_entry' do + context 'with nil' do + let(:span_options) { { service_entry: nil } } + + it 'does not tag as top-level' do + expect(span).to_not have_metadata('_dd.top_level') + end + end + + context 'with false' do + let(:span_options) { { service_entry: false } } + + it 'does not tag as top-level' do + expect(span).to_not have_metadata('_dd.top_level') + end + end + + context 'with true' do + let(:span_options) { { service_entry: true } } + + it 'tags as top-level' do + expect(span).to have_metadata('_dd.top_level' => 1.0) + end + end + end end context 'ids' do From d5c9a44c3fe08f2616e4e1ba62da4b8aa18ed304 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 7 Jul 2022 18:13:17 -0700 Subject: [PATCH 0198/2133] Tell agent to trust trace top-level span tagging --- lib/ddtrace/transport/ext.rb | 7 +++++++ lib/ddtrace/transport/http.rb | 3 +++ spec/ddtrace/transport/http_spec.rb | 1 + 3 files changed, 11 insertions(+) diff --git a/lib/ddtrace/transport/ext.rb b/lib/ddtrace/transport/ext.rb index 288e9d92ce4..703997225d6 100644 --- a/lib/ddtrace/transport/ext.rb +++ b/lib/ddtrace/transport/ext.rb @@ -13,6 +13,13 @@ module HTTP HEADER_CONTAINER_ID = 'Datadog-Container-ID'.freeze HEADER_DD_API_KEY = 'DD-API-KEY'.freeze + # Tells agent that `_dd.top_level` metrics have been set by the tracer. + # The agent will not calculate top-level spans but instead trust the tracer tagging. + # + # This prevents partially flushed traces being mistakenly marked as top-level. + # + # Setting this header to any non-empty value enables this feature. + HEADER_CLIENT_COMPUTED_TOP_LEVEL = 'Datadog-Client-Computed-Top-Level'.freeze HEADER_META_LANG = 'Datadog-Meta-Lang'.freeze HEADER_META_LANG_VERSION = 'Datadog-Meta-Lang-Version'.freeze HEADER_META_LANG_INTERPRETER = 'Datadog-Meta-Lang-Interpreter'.freeze diff --git a/lib/ddtrace/transport/http.rb b/lib/ddtrace/transport/http.rb index a7cb8e8cccc..3f160502244 100644 --- a/lib/ddtrace/transport/http.rb +++ b/lib/ddtrace/transport/http.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # typed: true require 'uri' @@ -67,6 +69,7 @@ def default( def default_headers { + Datadog::Transport::Ext::HTTP::HEADER_CLIENT_COMPUTED_TOP_LEVEL => '1', Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, diff --git a/spec/ddtrace/transport/http_spec.rb b/spec/ddtrace/transport/http_spec.rb index 7ca044b7e62..809a4f20bd0 100644 --- a/spec/ddtrace/transport/http_spec.rb +++ b/spec/ddtrace/transport/http_spec.rb @@ -169,6 +169,7 @@ it do is_expected.to include( + Datadog::Transport::Ext::HTTP::HEADER_CLIENT_COMPUTED_TOP_LEVEL => '1', Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, From 480271b586a94ed6fcc7dabbdd14bdf59b43287d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 15:22:10 +0100 Subject: [PATCH 0199/2133] Upgrade to `libdatadog` 0.7, replacing `libddprof` 0.6 `libdatadog` is the new name of `libddprof`, and thus the gem name changed to match. This commit includes only the Ruby-level changes; C API changes from the 0.6.0 to 0.7.0 release will be fixed separately. --- ddtrace.gemspec | 4 +- .../extconf.rb | 10 ++--- .../native_extension_helpers.rb | 40 +++++++++---------- .../native_extension_helpers_spec.rb | 40 +++++++++---------- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 8ea49b1d47d..478a95dbbd9 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -64,8 +64,8 @@ Gem::Specification.new do |spec| # Used by appsec spec.add_dependency 'libddwaf', '~> 1.3.0.2.0' - # Used by profiling - spec.add_dependency 'libddprof', '~> 0.6.0.1.0' + # Used by profiling (and possibly others in the future) + spec.add_dependency 'libdatadog', '~> 0.7.0.1.0.rc1' spec.extensions = ['ext/ddtrace_profiling_native_extension/extconf.rb', 'ext/ddtrace_profiling_loader/extconf.rb'] end diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 5fb48bf250b..72132f0393a 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -138,8 +138,8 @@ def add_compiler_flag(flag) # In Ruby 2.1, living_threads were stored in a hashmap (st) $defs << '-DUSE_LEGACY_LIVING_THREADS_ST' if RUBY_VERSION < '2.2' -# If we got here, libddprof is available and loaded -ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libddprof.pkgconfig_folder}" +# If we got here, libdatadog is available and loaded +ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libdatadog.pkgconfig_folder}" Logging.message(" [ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") unless pkg_config('ddprof_ffi_with_rpath') @@ -148,17 +148,17 @@ def add_compiler_flag(flag) Datadog::Profiling::NativeExtensionHelpers::Supported::PKG_CONFIG_IS_MISSING else # Less specific error message - Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDDPROF + Datadog::Profiling::NativeExtensionHelpers::Supported::FAILED_TO_CONFIGURE_LIBDATADOG end ) end -# See comments on the helper method being used for why we need to additionally set this +# See comments on the helper method being used for why we need to additionally set this. # The extremely excessive escaping around ORIGIN below seems to be correct and was determined after a lot of # experimentation. We need to get these special characters across a lot of tools untouched... $LDFLAGS += \ ' -Wl,-rpath,$$$\\\\{ORIGIN\\}/' \ - "#{Datadog::Profiling::NativeExtensionHelpers.libddprof_folder_relative_to_native_lib_folder}" + "#{Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_native_lib_folder}" Logging.message(" [ddtrace] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n") # Tag the native extension library with the Ruby version and Ruby platform. diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index a3be126fd8e..c696815d8ca 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -2,7 +2,7 @@ # typed: ignore -require 'libddprof' +require 'libdatadog' require 'pathname' module Datadog @@ -22,29 +22,29 @@ def self.fail_install_if_missing_extension? end # Used as an workaround for a limitation with how dynamic linking works in environments where ddtrace and - # libddprof are moved after the extension gets compiled. + # libdatadog are moved after the extension gets compiled. # # Because the libddpprof native library is installed on a non-standard system path, in order for it to be # found by the system dynamic linker (e.g. what takes care of dlopen(), which is used to load the profiling - # native extension), we need to add a "runpath" -- a list of folders to search for libddprof. + # native extension), we need to add a "runpath" -- a list of folders to search for libdatadog. # # This runpath gets hardcoded at native library linking time. You can look at it using the `readelf` tool in # Linux: e.g. `readelf -d ddtrace_profiling_native_extension.2.7.3_x86_64-linux.so`. # - # In ddtrace 1.1.0, we only set as runpath an absolute path to libddprof. (This gets set automatically by the call - # to `pkg_config('ddprof_ffi_with_rpath')` in `extconf.rb`). This worked fine as long as libddprof was **NOT** + # In ddtrace 1.1.0, we only set as runpath an absolute path to libdatadog. (This gets set automatically by the call + # to `pkg_config('ddprof_ffi_with_rpath')` in `extconf.rb`). This worked fine as long as libdatadog was **NOT** # moved from the folder it was present at ddtrace installation/linking time. # # Unfortunately, environments such as Heroku and AWS Elastic Beanstalk move gems around in the filesystem after # installation. Thus, the profiling native extension could not be loaded in these environments - # (see https://github.com/DataDog/dd-trace-rb/issues/2067) because libddprof could not be found. + # (see https://github.com/DataDog/dd-trace-rb/issues/2067) because libdatadog could not be found. # # To workaround this issue, this method computes the **relative** path between the folder where the profiling - # native extension is going to be installed and the folder where libddprof is installed, and returns it + # native extension is going to be installed and the folder where libdatadog is installed, and returns it # to be set as an additional runpath. (Yes, you can set multiple runpath folders to be searched). # # This way, if both gems are moved together (and it turns out that they are in these environments), - # the relative path can still be traversed to find libddprof. + # the relative path can still be traversed to find libdatadog. # # This is incredibly awful, and it's kinda bizarre how it's not possible to just find these paths at runtime # and set them correctly; rather than needing to set stuff at linking-time and then praying to $deity that @@ -54,16 +54,16 @@ def self.fail_install_if_missing_extension? # SET DYNAMICALLY**, e.g. it needs to be set at the start of the process (Ruby VM) and thus it's not something # we could setup when doing a `require`. # - def self.libddprof_folder_relative_to_native_lib_folder( + def self.libdatadog_folder_relative_to_native_lib_folder( current_folder: __dir__, - libddprof_pkgconfig_folder: Libddprof.pkgconfig_folder + libdatadog_pkgconfig_folder: Libdatadog.pkgconfig_folder ) - return unless libddprof_pkgconfig_folder + return unless libdatadog_pkgconfig_folder profiling_native_lib_folder = "#{current_folder}/../../lib/" - libddprof_lib_folder = "#{libddprof_pkgconfig_folder}/../" + libdatadog_lib_folder = "#{libdatadog_pkgconfig_folder}/../" - Pathname.new(libddprof_lib_folder).relative_path_from(Pathname.new(profiling_native_lib_folder)).to_s + Pathname.new(libdatadog_lib_folder).relative_path_from(Pathname.new(profiling_native_lib_folder)).to_s end # Used to check if profiler is supported, including user-visible clear messages explaining why their @@ -87,7 +87,7 @@ def self.unsupported_reason on_unknown_os? || not_on_amd64_or_arm64? || expected_to_use_mjit_but_mjit_is_disabled? || - libddprof_not_usable? + libdatadog_not_usable? end # This banner will show up in the logs/terminal while compiling the native extension @@ -149,8 +149,8 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global ].freeze # Validation for this check is done in extconf.rb because it relies on mkmf - FAILED_TO_CONFIGURE_LIBDDPROF = explain_issue( - 'there was a problem in setting up the `libddprof` dependency.', + FAILED_TO_CONFIGURE_LIBDATADOG = explain_issue( + 'there was a problem in setting up the `libdatadog` dependency.', suggested: CONTACT_SUPPORT, ) @@ -255,17 +255,17 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global ruby_without_mjit if CAN_USE_MJIT_HEADER && RbConfig::CONFIG['MJIT_SUPPORT'] != 'yes' end - private_class_method def self.libddprof_not_usable? + private_class_method def self.libdatadog_not_usable? no_binaries_for_current_platform = explain_issue( - 'the `libddprof` gem installed on your system is missing binaries for your', + 'the `libdatadog` gem installed on your system is missing binaries for your', 'platform variant.', "(Your platform: `#{Gem::Platform.local}`)", '(Available binaries: ', - "`#{Libddprof.available_binaries.join('`, `')}`)", + "`#{Libdatadog.available_binaries.join('`, `')}`)", suggested: CONTACT_SUPPORT, ) - no_binaries_for_current_platform unless Libddprof.pkgconfig_folder + no_binaries_for_current_platform unless Libdatadog.pkgconfig_folder end end # rubocop:enable Metrics/ModuleLength diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index bc3c4b2ef03..fc9c9674ae2 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -5,37 +5,37 @@ require 'datadog/profiling/spec_helper' RSpec.describe Datadog::Profiling::NativeExtensionHelpers do - describe '.libddprof_folder_relative_to_native_lib_folder' do - context 'when libddprof is available' do + describe '.libdatadog_folder_relative_to_native_lib_folder' do + context 'when libdatadog is available' do before do skip_if_profiling_not_supported(self) - if PlatformHelpers.mac? && Libddprof.pkgconfig_folder.nil? && ENV['LIBDDPROF_VENDOR_OVERRIDE'].nil? - raise 'You have a libddprof setup without macOS support. Did you forget to set LIBDDPROF_VENDOR_OVERRIDE?' + if PlatformHelpers.mac? && Libdatadog.pkgconfig_folder.nil? && ENV['LIBDATADOG_VENDOR_OVERRIDE'].nil? + raise 'You have a libdatadog setup without macOS support. Did you forget to set LIBDATADOG_VENDOR_OVERRIDE?' end end - it 'returns a relative path to libddprof folder from the gem lib folder' do - relative_path = described_class.libddprof_folder_relative_to_native_lib_folder + it 'returns a relative path to libdatadog folder from the gem lib folder' do + relative_path = described_class.libdatadog_folder_relative_to_native_lib_folder # RbConfig::CONFIG['SOEXT'] was only introduced in Ruby 2.5, so we have a fallback for older Rubies... - libddprof_extension = + libdatadog_extension = RbConfig::CONFIG['SOEXT'] || ('so' if PlatformHelpers.linux?) || ('dylib' if PlatformHelpers.mac?) || raise('Missing SOEXT for current platform') gem_lib_folder = "#{Gem.loaded_specs['ddtrace'].gem_dir}/lib" - full_libddprof_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{libddprof_extension}" + full_libdatadog_path = "#{gem_lib_folder}/#{relative_path}/libddprof_ffi.#{libdatadog_extension}" expect(relative_path).to start_with('../') - expect(File.exist?(full_libddprof_path)) - .to be(true), "Libddprof not available in expected path: #{full_libddprof_path.inspect}" + expect(File.exist?(full_libdatadog_path)) + .to be(true), "Libddprof not available in expected path: #{full_libdatadog_path.inspect}" end end - context 'when libddprof is unsupported' do + context 'when libdatadog is unsupported' do it do - expect(described_class.libddprof_folder_relative_to_native_lib_folder(libddprof_pkgconfig_folder: nil)).to be nil + expect(described_class.libdatadog_folder_relative_to_native_lib_folder(libdatadog_pkgconfig_folder: nil)).to be nil end end end @@ -119,18 +119,18 @@ end shared_examples 'mjit header validation' do - shared_examples 'libddprof usable' do - context 'when libddprof DOES NOT HAVE binaries for the current platform' do + shared_examples 'libdatadog usable' do + context 'when libdatadog DOES NOT HAVE binaries for the current platform' do before do - expect(Libddprof).to receive(:pkgconfig_folder).and_return(nil) - expect(Libddprof).to receive(:available_binaries).and_return(%w[fooarch-linux bararch-linux-musl]) + expect(Libdatadog).to receive(:pkgconfig_folder).and_return(nil) + expect(Libdatadog).to receive(:available_binaries).and_return(%w[fooarch-linux bararch-linux-musl]) end it { is_expected.to include 'platform variant' } end - context 'when libddprof HAS BINARIES for the current platform' do - before { expect(Libddprof).to receive(:pkgconfig_folder).and_return('/simulated/pkgconfig_folder') } + context 'when libdatadog HAS BINARIES for the current platform' do + before { expect(Libdatadog).to receive(:pkgconfig_folder).and_return('/simulated/pkgconfig_folder') } it('marks the native extension as supported') { is_expected.to be nil } end @@ -139,7 +139,7 @@ context 'on a Ruby version where we CAN NOT use the MJIT header' do before { stub_const('Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER', false) } - include_examples 'libddprof usable' + include_examples 'libdatadog usable' end context 'on a Ruby version where we CAN use the MJIT header' do @@ -154,7 +154,7 @@ context 'and DOES have MJIT support' do before { expect(RbConfig::CONFIG).to receive(:[]).with('MJIT_SUPPORT').and_return('yes') } - include_examples 'libddprof usable' + include_examples 'libdatadog usable' end end end From e179aea412155edb69e8bbd70c8e3e7ba0e0c15c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 15:30:28 +0100 Subject: [PATCH 0200/2133] Update native extension implementation to use libdatadog 0.7 APIs --- .../http_transport.c | 2 +- .../stack_recorder.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 7f71750d45c..d5eb1877493 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -252,7 +252,7 @@ static VALUE perform_export( bool success = result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE; ruby_status = success ? ok_symbol : error_symbol; - ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.failure); + ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.err); // Clean up all dynamically-allocated things ddprof_ffi_SendResult_drop(args.result); diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index cbc34495e8d..5b0f3fbb3e8 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -61,7 +61,7 @@ static const rb_data_type_t stack_recorder_typed_data = { static VALUE _native_new(VALUE klass) { ddprof_ffi_Slice_value_type sample_types = {.ptr = enabled_value_types, .len = ENABLED_VALUE_TYPES_COUNT}; - ddprof_ffi_Profile *profile = ddprof_ffi_Profile_new(sample_types, NULL /* Period is optional */); + ddprof_ffi_Profile *profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); return TypedData_Wrap_Struct(klass, &stack_recorder_typed_data, profile); } @@ -89,7 +89,7 @@ static VALUE _native_serialize(VALUE self, VALUE recorder_instance) { // We use rb_thread_call_without_gvl2 here because unlike the regular _gvl variant, gvl2 does not process // interruptions and thus does not raise exceptions after running our code. - rb_thread_call_without_gvl2(call_serialize_without_gvl, &args, /* No interruption function supported */ NULL, NULL); + rb_thread_call_without_gvl2(call_serialize_without_gvl, &args, NULL /* No interruption function needed in this case */, NULL /* Not needed */); } ddprof_ffi_SerializeResult serialized_profile = args.result; @@ -111,7 +111,9 @@ static VALUE _native_serialize(VALUE self, VALUE recorder_instance) { VALUE start = ruby_time_from(ddprof_start); VALUE finish = ruby_time_from(ddprof_finish); - if (!ddprof_ffi_Profile_reset(profile)) return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Failed to reset profile")); + if (!ddprof_ffi_Profile_reset(profile, NULL /* start_time is optional */ )) { + return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Failed to reset profile")); + } return rb_ary_new_from_args(2, ok_symbol, rb_ary_new_from_args(3, start, finish, encoded_pprof)); } @@ -136,7 +138,7 @@ void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample) { static void *call_serialize_without_gvl(void *call_args) { struct call_serialize_without_gvl_arguments *args = (struct call_serialize_without_gvl_arguments *) call_args; - args->result = ddprof_ffi_Profile_serialize(args->profile); + args->result = ddprof_ffi_Profile_serialize(args->profile, NULL /* end_time is optional */, NULL /* duration_nanos is optional */); args->serialize_ran = true; return NULL; // Unused From ff18ad251f65950b87137293327cffa7475f3f78 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 31 May 2022 15:41:38 +0100 Subject: [PATCH 0201/2133] Replace request clean-up hack with new `ddprof_ffi_Request_drop` Now that we can explicitly get rid of the request, we can simplify the `pending_exception` code path when reporting a profile. --- .../http_transport.c | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index d5eb1877493..a3a8c4e3802 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -229,39 +229,31 @@ static VALUE perform_export( while (!args.send_ran && !pending_exception) { rb_thread_call_without_gvl2(call_exporter_without_gvl, &args, interrupt_exporter_call, cancel_token); + + // To make sure we don't leak memory, we never check for pending exceptions if send ran if (!args.send_ran) pending_exception = check_if_pending_exception(); } - VALUE ruby_status; - VALUE ruby_result; + // Cleanup exporter and token, no longer needed + ddprof_ffi_CancellationToken_drop(cancel_token); + ddprof_ffi_NewProfileExporterV3Result_drop(valid_exporter_result); if (pending_exception) { - // We're in a weird situation that libddprof doesn't quite support. The ddprof_ffi_Request payload is dynamically - // allocated and needs to be freed, but libddprof doesn't have an API for dropping a request. - // - // There's plans to add a `ddprof_ffi_Request_drop` - // (https://github.com/DataDog/dd-trace-rb/pull/1923#discussion_r882096221); once that happens, we can use it here. - // - // As a workaround, we get libddprof to clean up the request by asking for the send to be cancelled, and then calling - // it anyway. This will make libddprof free the request and return immediately which gets us the expected effect. - interrupt_exporter_call((void *) cancel_token); - call_exporter_without_gvl((void *) &args); + // If we got here send did not run, so we need to explicitly dispose of the request + ddprof_ffi_Request_drop(request); + + // Let Ruby propagate the exception. This will not return. + rb_jump_tag(pending_exception); } ddprof_ffi_SendResult result = args.result; bool success = result.tag == DDPROF_FFI_SEND_RESULT_HTTP_RESPONSE; - ruby_status = success ? ok_symbol : error_symbol; - ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.err); + VALUE ruby_status = success ? ok_symbol : error_symbol; + VALUE ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.err); - // Clean up all dynamically-allocated things ddprof_ffi_SendResult_drop(args.result); - ddprof_ffi_CancellationToken_drop(cancel_token); - ddprof_ffi_NewProfileExporterV3Result_drop(valid_exporter_result); - // The request itself does not need to be freed as libddprof takes care of it. - - // We've cleaned up everything, so if there's an exception to be raised, let's have it - if (pending_exception) rb_jump_tag(pending_exception); + // The request itself does not need to be freed as libddprof takes care of it as part of sending. return rb_ary_new_from_args(2, ruby_status, ruby_result); } From 142d4040ac1299d69ae3900e55e239ae0d5d9b59 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 11:22:52 +0100 Subject: [PATCH 0202/2133] Clean up a few more references to libddprof name --- ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c | 2 +- .../NativeExtensionDesign.md | 2 +- ext/ddtrace_profiling_native_extension/http_transport.c | 6 +++--- ext/ddtrace_profiling_native_extension/stack_recorder.c | 6 +++--- lib/datadog/profiling/http_transport.rb | 2 +- spec/datadog/profiling/http_transport_spec.rb | 4 ++-- spec/datadog/profiling/native_extension_helpers_spec.rb | 2 +- spec/datadog/profiling/spec_helper.rb | 2 +- spec/datadog/profiling/stack_recorder_spec.rb | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c b/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c index 462ee9b27d4..7327a200e29 100644 --- a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c +++ b/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c @@ -20,7 +20,7 @@ // This idea was shamelessly stolen from @lloeki's work in https://github.com/rubyjs/mini_racer/pull/179, big thanks! // // Extra note: Currently (May 2022), that we know of, the profiling native extension only exposes one potentially -// problematic symbol: `rust_eh_personality` (coming from libddprof/libdatadog). +// problematic symbol: `rust_eh_personality` (coming from libdatadog). // Future versions of Rust have been patched not to expose this // (see https://github.com/rust-lang/rust/pull/95604#issuecomment-1108563434) so we may want to revisit the need // for this loader in the future, and perhaps delete it if we no longer require its services :) diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md index ac5d812242d..8eabf9546ed 100644 --- a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md @@ -2,7 +2,7 @@ The profiling native extension is used to: 1. Implement features which are expensive (in terms of resources) or otherwise impossible to implement using Ruby code. -2. Bridge between Ruby-specific profiling features and [`libddprof`](https://github.com/DataDog/libddprof), a Rust-based +2. Bridge between Ruby-specific profiling features and [`libdatadog`](https://github.com/DataDog/libdatadog), a Rust-based library with common profiling functionality. Due to (1), this extension is quite coupled with MRI Ruby ("C Ruby") internals, and is not intended to support other rubies such as diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index a3a8c4e3802..98bdab2cebc 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -166,7 +166,7 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { VALUE err_details = ruby_string_from_vec_u8(push_result.err); ddprof_ffi_PushTagResult_drop(push_result); - // libddprof validates tags and may catch invalid tags that ddtrace didn't actually catch. + // libdatadog validates tags and may catch invalid tags that ddtrace didn't actually catch. // We warn users about such tags, and then just ignore them. safely_log_failure_to_process_tag(tags, err_details); } else { @@ -193,7 +193,7 @@ static void safely_log_failure_to_process_tag(ddprof_ffi_Vec_tag tags, VALUE err } } -// Note: This function handles a bunch of libddprof dynamically-allocated objects, so it MUST not use any Ruby APIs +// Note: This function handles a bunch of libdatadog dynamically-allocated objects, so it MUST not use any Ruby APIs // which can raise exceptions, otherwise the objects will be leaked. static VALUE perform_export( ddprof_ffi_NewProfileExporterV3Result valid_exporter_result, // Must be called with a valid exporter result @@ -253,7 +253,7 @@ static VALUE perform_export( VALUE ruby_result = success ? UINT2NUM(result.http_response.code) : ruby_string_from_vec_u8(result.err); ddprof_ffi_SendResult_drop(args.result); - // The request itself does not need to be freed as libddprof takes care of it as part of sending. + // The request itself does not need to be freed as libdatadog takes care of it as part of sending. return rb_ary_new_from_args(2, ruby_status, ruby_result); } diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 5b0f3fbb3e8..be214f20be5 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -31,9 +31,9 @@ void stack_recorder_init(VALUE profiling_module) { // Instances of the StackRecorder class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. - // In our case, we're going to keep a libddprof profile reference inside our object. + // In our case, we're going to keep a libdatadog profile reference inside our object. // - // Because Ruby doesn't know how to initialize libddprof profiles, we MUST override the allocation function for objects + // Because Ruby doesn't know how to initialize libdatadog profiles, we MUST override the allocation function for objects // of this class so that we can manage this part. Not overriding or disabling the allocation function is a common // gotcha for "TypedData" objects that can very easily lead to VM crashes, see for instance // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. @@ -105,7 +105,7 @@ static VALUE _native_serialize(VALUE self, VALUE recorder_instance) { ddprof_ffi_Timespec ddprof_start = serialized_profile.ok.start; ddprof_ffi_Timespec ddprof_finish = serialized_profile.ok.end; - // Clean up libddprof object to avoid leaking in case ruby_time_from raises an exception + // Clean up libdatadog object to avoid leaking in case ruby_time_from raises an exception ddprof_ffi_SerializeResult_drop(serialized_profile); VALUE start = ruby_time_from(ddprof_start); diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index 1a88ba8e53f..c838fa6755f 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -28,7 +28,7 @@ def export(flush) upload_timeout_milliseconds: @upload_timeout_milliseconds, # why "timespec"? - # libddprof represents time using POSIX's struct timespec, see + # libdatadog represents time using POSIX's struct timespec, see # https://www.gnu.org/software/libc/manual/html_node/Time-Types.html # aka it represents the seconds part separate from the nanoseconds part start_timespec_seconds: flush.start.tv_sec, diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index cbbb926da09..ce3fb5584b2 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -12,8 +12,8 @@ # between the Ruby code and the native methods, and thus in this class we have a bunch of tests to make sure the # native methods are invoked correctly. # -# We also have "integration" specs, where we exercise the Ruby code together with the C code and libddprof to ensure -# that things come out of libddprof as we expected. +# We also have "integration" specs, where we exercise the Ruby code together with the C code and libdatadog to ensure +# that things come out of libdatadog as we expected. RSpec.describe Datadog::Profiling::HttpTransport do before { skip_if_profiling_not_supported(self) } diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index fc9c9674ae2..17c1b1a9633 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -29,7 +29,7 @@ expect(relative_path).to start_with('../') expect(File.exist?(full_libdatadog_path)) - .to be(true), "Libddprof not available in expected path: #{full_libdatadog_path.inspect}" + .to be(true), "Libdatadog not available in expected path: #{full_libdatadog_path.inspect}" end end diff --git a/spec/datadog/profiling/spec_helper.rb b/spec/datadog/profiling/spec_helper.rb index a70f0fc25f3..c9b1bc8252d 100644 --- a/spec/datadog/profiling/spec_helper.rb +++ b/spec/datadog/profiling/spec_helper.rb @@ -35,7 +35,7 @@ def skip_if_profiling_not_supported(testcase) testcase.skip('Profiling is not supported on JRuby') if PlatformHelpers.jruby? testcase.skip('Profiling is not supported on TruffleRuby') if PlatformHelpers.truffleruby? - # Profiling is not officially supported on macOS due to missing libddprof binaries, + # Profiling is not officially supported on macOS due to missing libdatadog binaries, # but it's still useful to allow it to be enabled for development. if PlatformHelpers.mac? && ENV['DD_PROFILING_MACOS_TESTING'] != 'true' testcase.skip( diff --git a/spec/datadog/profiling/stack_recorder_spec.rb b/spec/datadog/profiling/stack_recorder_spec.rb index fe63358405f..687cc8d04cd 100644 --- a/spec/datadog/profiling/stack_recorder_spec.rb +++ b/spec/datadog/profiling/stack_recorder_spec.rb @@ -8,8 +8,8 @@ subject(:stack_recorder) { described_class.new } - # NOTE: A lot of libddprof integration behaviors are tested in the Collectors::Stack specs, since we need actual - # samples in order to observe what comes out of libddprof + # NOTE: A lot of libdatadog integration behaviors are tested in the Collectors::Stack specs, since we need actual + # samples in order to observe what comes out of libdatadog describe '#serialize' do subject(:serialize) { stack_recorder.serialize } From dcba0a43eabd018df7f38e8792ffbf370335ed35 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 13:45:07 +0100 Subject: [PATCH 0203/2133] Use libdatadog 0.7.0.1.0 --- ddtrace.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 478a95dbbd9..277f8494359 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -65,7 +65,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'libddwaf', '~> 1.3.0.2.0' # Used by profiling (and possibly others in the future) - spec.add_dependency 'libdatadog', '~> 0.7.0.1.0.rc1' + spec.add_dependency 'libdatadog', '~> 0.7.0.1.0' spec.extensions = ['ext/ddtrace_profiling_native_extension/extconf.rb', 'ext/ddtrace_profiling_loader/extconf.rb'] end From f9260889335790c0695b769d04813b24fdf1a66c Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 6 Jul 2022 12:18:46 -0700 Subject: [PATCH 0204/2133] [Single Span Sampling] Consider traces with priority sampling <= 0 as rejected --- lib/datadog/tracing/sampling/span/sampler.rb | 5 +++- lib/datadog/tracing/trace_operation.rb | 16 +++++++++- .../tracing/sampling/span/sampler_spec.rb | 9 ++++++ spec/datadog/tracing/trace_operation_spec.rb | 30 +++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index b0b097b7645..0f789e8678f 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -23,6 +23,9 @@ def initialize(rules = []) end # Applies sampling rules to the span if the trace has been rejected. + # The tracer can be outright rejected, and never reach the transport, + # or be set as rejected by priority sampling. In both cases, the trace + # is considered rejected for Single Span Sampling purposes. # # If multiple rules match, only the first one is applied. # @@ -30,7 +33,7 @@ def initialize(rules = []) # @param [Datadog::Tracing::SpanOperation] span_op Span to apply sampling rules # @return [void] def sample!(trace_op, span_op) - return if trace_op.sampled? + return if trace_op.sampled? && trace_op.priority_sampled? # Return as soon as one rule matches @rules.any? do |rule| diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index e6189a40db0..8ff420ecdfe 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -113,8 +113,22 @@ def finished? @finished == true end + # Will this trace be flushed by the tracer transport? + # This includes cases where the span is kept solely due to priority sampling. + # + # This is not the ultimate Datadog App sampling decision. Downstream systems + # can decide to reject this trace, especially for cases where priority + # sampling is set to AUTO_KEEP. + # + # @return [Boolean] def sampled? - @sampled == true || (!@sampling_priority.nil? && @sampling_priority > 0) + @sampled == true || priority_sampled? + end + + # Has the priority sampling chosen to keep this span? + # @return [Boolean] + def priority_sampled? + !@sampling_priority.nil? && @sampling_priority > 0 end def keep! diff --git a/spec/datadog/tracing/sampling/span/sampler_spec.rb b/spec/datadog/tracing/sampling/span/sampler_spec.rb index f6cf87ea701..1207ecda280 100644 --- a/spec/datadog/tracing/sampling/span/sampler_spec.rb +++ b/spec/datadog/tracing/sampling/span/sampler_spec.rb @@ -60,6 +60,15 @@ end end end + + context 'a trace rejected by priority sampling only' do + before do + trace_op.keep! + trace_op.sampling_priority = Datadog::Tracing::Sampling::Ext::Priority::AUTO_REJECT + end + + it_behaves_like 'tags span with sampling decision' + end end end end diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index f188a973673..7c428167e78 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -724,6 +724,36 @@ end end + describe '#priority_sampled?' do + subject(:priority_sampled?) { trace_op.priority_sampled? } + + it { is_expected.to be false } + + context 'when :sampling_priority is set to' do + let(:options) { { sampling_priority: sampling_priority } } + + context 'AUTO_KEEP' do + let(:sampling_priority) { Datadog::Tracing::Sampling::Ext::Priority::AUTO_KEEP } + it { is_expected.to be true } + end + + context 'AUTO_REJECT' do + let(:sampling_priority) { Datadog::Tracing::Sampling::Ext::Priority::AUTO_REJECT } + it { is_expected.to be false } + end + + context 'USER_KEEP' do + let(:sampling_priority) { Datadog::Tracing::Sampling::Ext::Priority::USER_KEEP } + it { is_expected.to be true } + end + + context 'USER_REJECT' do + let(:sampling_priority) { Datadog::Tracing::Sampling::Ext::Priority::USER_REJECT } + it { is_expected.to be false } + end + end + end + describe '#keep!' do subject(:keep!) { trace_op.keep! } From 5013c3114583ba752c76d05332a2fbfcdf9f0283 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 7 Jul 2022 18:13:17 -0700 Subject: [PATCH 0205/2133] Tell agent to trust trace top-level span tagging --- lib/ddtrace/transport/ext.rb | 7 +++++++ lib/ddtrace/transport/http.rb | 3 +++ spec/ddtrace/transport/http_spec.rb | 1 + 3 files changed, 11 insertions(+) diff --git a/lib/ddtrace/transport/ext.rb b/lib/ddtrace/transport/ext.rb index 288e9d92ce4..703997225d6 100644 --- a/lib/ddtrace/transport/ext.rb +++ b/lib/ddtrace/transport/ext.rb @@ -13,6 +13,13 @@ module HTTP HEADER_CONTAINER_ID = 'Datadog-Container-ID'.freeze HEADER_DD_API_KEY = 'DD-API-KEY'.freeze + # Tells agent that `_dd.top_level` metrics have been set by the tracer. + # The agent will not calculate top-level spans but instead trust the tracer tagging. + # + # This prevents partially flushed traces being mistakenly marked as top-level. + # + # Setting this header to any non-empty value enables this feature. + HEADER_CLIENT_COMPUTED_TOP_LEVEL = 'Datadog-Client-Computed-Top-Level'.freeze HEADER_META_LANG = 'Datadog-Meta-Lang'.freeze HEADER_META_LANG_VERSION = 'Datadog-Meta-Lang-Version'.freeze HEADER_META_LANG_INTERPRETER = 'Datadog-Meta-Lang-Interpreter'.freeze diff --git a/lib/ddtrace/transport/http.rb b/lib/ddtrace/transport/http.rb index a7cb8e8cccc..3f160502244 100644 --- a/lib/ddtrace/transport/http.rb +++ b/lib/ddtrace/transport/http.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # typed: true require 'uri' @@ -67,6 +69,7 @@ def default( def default_headers { + Datadog::Transport::Ext::HTTP::HEADER_CLIENT_COMPUTED_TOP_LEVEL => '1', Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, diff --git a/spec/ddtrace/transport/http_spec.rb b/spec/ddtrace/transport/http_spec.rb index 7ca044b7e62..809a4f20bd0 100644 --- a/spec/ddtrace/transport/http_spec.rb +++ b/spec/ddtrace/transport/http_spec.rb @@ -169,6 +169,7 @@ it do is_expected.to include( + Datadog::Transport::Ext::HTTP::HEADER_CLIENT_COMPUTED_TOP_LEVEL => '1', Datadog::Transport::Ext::HTTP::HEADER_META_LANG => Datadog::Core::Environment::Ext::LANG, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_VERSION => Datadog::Core::Environment::Ext::LANG_VERSION, Datadog::Transport::Ext::HTTP::HEADER_META_LANG_INTERPRETER => Datadog::Core::Environment::Ext::LANG_INTERPRETER, From ca91ac883bea79506b184b693d069ac97e89db06 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 6 Jul 2022 14:38:13 -0700 Subject: [PATCH 0206/2133] Wire Single Span Sampling --- lib/datadog/core/configuration/components.rb | 8 + lib/datadog/tracing/flush.rb | 3 +- lib/datadog/tracing/metadata/tagging.rb | 7 + .../tracing/sampling/span/rule_parser.rb | 2 + lib/datadog/tracing/sampling/span/sampler.rb | 2 + lib/datadog/tracing/span.rb | 7 + lib/datadog/tracing/trace_operation.rb | 48 ++- lib/datadog/tracing/trace_segment.rb | 1 + spec/datadog/ci/flush_spec.rb | 24 +- .../core/configuration/components_spec.rb | 32 ++ spec/datadog/tracing/flush_spec.rb | 50 +-- spec/datadog/tracing/integration_spec.rb | 236 +++++++++++++- .../tracing/sampling/span/rule_parser_spec.rb | 8 + spec/datadog/tracing/span_spec.rb | 20 ++ spec/datadog/tracing/trace_operation_spec.rb | 296 ++++++++++++------ 15 files changed, 581 insertions(+), 163 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 7fb23802548..63cf238494c 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -10,6 +10,8 @@ require 'datadog/tracing/tracer' require 'datadog/tracing/flush' require 'datadog/tracing/sync_writer' +require 'datadog/tracing/sampling/span/rule_parser' +require 'datadog/tracing/sampling/span/sampler' module Datadog module Core @@ -75,6 +77,7 @@ def build_tracer(settings, agent_settings) enabled: settings.tracing.enabled, trace_flush: trace_flush, sampler: sampler, + span_sampler: build_span_sampler(settings), writer: writer, tags: build_tracer_tags(settings), ) @@ -178,6 +181,11 @@ def writer_update_priority_sampler_rates_callback(sampler) end end + def build_span_sampler(settings) + rules = Tracing::Sampling::Span::RuleParser.parse_json(settings.tracing.sampling.span_rules) + Tracing::Sampling::Span::Sampler.new(rules || []) + end + def build_profiler(settings, agent_settings, tracer) return unless settings.profiling.enabled diff --git a/lib/datadog/tracing/flush.rb b/lib/datadog/tracing/flush.rb index 2be184bccbf..8c580c4fa41 100644 --- a/lib/datadog/tracing/flush.rb +++ b/lib/datadog/tracing/flush.rb @@ -18,7 +18,7 @@ def consume!(trace_op) end def full_flush?(trace_op) - trace_op && trace_op.sampled? && trace_op.finished? + trace_op && trace_op.finished? end protected @@ -56,7 +56,6 @@ def consume!(trace_op) end def partial_flush?(trace_op) - return false unless trace_op.sampled? return true if trace_op.finished? return false if trace_op.finished_span_count < @min_spans_for_partial diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 90e8a2a33b3..10b1a2edc6b 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -65,6 +65,13 @@ def set_tags(tags) tags.each { |k, v| set_tag(k, v) } end + # Returns true if the provided `tag` was set to a non-nil value. False otherwise. + # @param [String] tag the tag or metric to check for presence + # @return [Boolean] + def tag?(tag) + !get_tag(tag).nil? # nil is considered not present, thus we can't use `Hash#has_key?` + end + # This method removes a tag for the given key. def clear_tag(key) meta.delete(key) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index 24187f1f617..7d57c599f4a 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -21,6 +21,8 @@ class << self # @return [Array] a list of parsed rules # @return [nil] if parsing failed def parse_json(rules) + return nil unless rules + begin list = JSON.parse(rules) rescue => e diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index 0f789e8678f..693fb3986af 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -15,6 +15,8 @@ module Span # reason to try to sample spans that are already kept by # the trace sampler. class Sampler + attr_reader :rules + # Receives sampling rules to apply to individual spans. # # @param [Array] rules list of rules to apply to spans diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index ef88ff0ac5f..1094ac6d179 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -204,6 +204,13 @@ def pretty_print(q) end end + # Single Span Sampling has chosen to keep this span + # regardless of the trace-level sampling decision + # @!visibility private + def single_sampled? + get_metric(Sampling::Span::Ext::TAG_MECHANISM) == Sampling::Span::Ext::MECHANISM_SPAN_SAMPLING_RATE + end + private # Used for serialization diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index 8ff420ecdfe..25e8cc4520a 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -240,15 +240,27 @@ def build_span( end end + # Returns a {TraceSegment} with all finished spans that can be flushed + # at invocation time. All other **finished** spans are discarded. + # + # A span can be flushed if: + # + # 1. The span has finished, and + # 2. Either: + # a. The trace is kept by sampling. + # b. The span is kept by single span sampling. + # + # Unfinished spans are not affected by this method. + # + # @return [TraceSegment] def flush! - finished = finished? - - # Copy out completed spans - spans = @spans.dup - @spans = [] - - # Use them to build a trace - build_trace(spans, !finished) + if sampled? + flush_all_spans! + else + # Only spans where the span-level sampling overrides + # the trace-level sampling can be flushed. + flush_single_sampled_spans_only! + end end # Returns a set of trace headers used for continuing traces. @@ -417,6 +429,26 @@ def set_root_span!(span) @root_span = span end + # Flushes all spans from this trace + def flush_all_spans! + # Copy out completed spans + spans = @spans.dup + @spans = [] + + # Use them to build a trace + build_trace(spans, !finished?) + end + + # Flush single sampled span only, as the trace as a whole was dropped by trace-level sampling + def flush_single_sampled_spans_only! + # Copy out completed, selected spans + spans = @spans.select(&:single_sampled?) + @spans = [] + + # Use them to build a trace + build_trace(spans, true) + end + def build_trace(spans, partial = false) TraceSegment.new( spans, diff --git a/lib/datadog/tracing/trace_segment.rb b/lib/datadog/tracing/trace_segment.rb index 272ecf0bca0..6ef801b9eb8 100644 --- a/lib/datadog/tracing/trace_segment.rb +++ b/lib/datadog/tracing/trace_segment.rb @@ -36,6 +36,7 @@ class TraceSegment # rubocop:disable Metrics/CyclomaticComplexity # rubocop:disable Metrics/PerceivedComplexity + # @param spans [Array] def initialize( spans, agent_sample_rate: nil, diff --git a/spec/datadog/ci/flush_spec.rb b/spec/datadog/ci/flush_spec.rb index dbe24fe28d1..a8df081e07b 100644 --- a/spec/datadog/ci/flush_spec.rb +++ b/spec/datadog/ci/flush_spec.rb @@ -13,14 +13,12 @@ instance_double( Datadog::Tracing::TraceOperation, origin: origin, - sampled?: sampled, finished?: finished, flush!: trace ) end let(:origin) { 'ci-origin' } - let(:sampled) { true } let(:finished) { true } let(:trace) { Datadog::Tracing::TraceSegment.new(spans, origin: origin) } @@ -31,23 +29,15 @@ context 'given a finished trace operation' do let(:finished) { true } - context 'that is not sampled' do - let(:sampled) { false } - it { is_expected.to be nil } - end - - context 'that is sampled' do - let(:sampled) { true } - it { is_expected.to eq(trace) } + it { is_expected.to eq(trace) } - it 'tags every span with the origin' do - is_expected.to eq(trace) + it 'tags every span with the origin' do + is_expected.to eq(trace) - # Expect each span to have an attached origin - trace.spans.each do |span| - expect(span.get_tag(Datadog::Tracing::Metadata::Ext::Distributed::TAG_ORIGIN)) - .to eq(trace.origin) - end + # Expect each span to have an attached origin + trace.spans.each do |span| + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::Distributed::TAG_ORIGIN)) + .to eq(trace.origin) end end end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 628d68e9e64..19d32c41aa9 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -379,6 +379,7 @@ end end end + let(:span_sampler) { be_a(Datadog::Tracing::Sampling::Span::Sampler) } let(:default_options) do { default_service: settings.service, @@ -386,6 +387,7 @@ trace_flush: trace_flush, tags: settings.tags, sampler: sampler, + span_sampler: span_sampler, writer: writer, } end @@ -592,6 +594,36 @@ end end + context 'with sampling.span_rules' do + before { allow(settings.tracing.sampling).to receive(:span_rules).and_return(rules) } + + context 'with rules' do + let(:rules) { '[{"name":"foo"}]' } + + it_behaves_like 'new tracer' do + let(:options) do + { + span_sampler: be_a(Datadog::Tracing::Sampling::Span::Sampler) & have_attributes( + rules: [ + Datadog::Tracing::Sampling::Span::Rule.new( + Datadog::Tracing::Sampling::Span::Matcher.new(name_pattern: 'foo') + ) + ] + ) + } + end + end + end + + context 'without rules' do + let(:rules) { nil } + + it_behaves_like 'new tracer' do + let(:options) { { span_sampler: be_a(Datadog::Tracing::Sampling::Span::Sampler) & have_attributes(rules: []) } } + end + end + end + context 'with :service' do let(:service) { double('service') } diff --git a/spec/datadog/tracing/flush_spec.rb b/spec/datadog/tracing/flush_spec.rb index 7573956132a..760018a2f46 100644 --- a/spec/datadog/tracing/flush_spec.rb +++ b/spec/datadog/tracing/flush_spec.rb @@ -10,13 +10,11 @@ let(:trace_op) do instance_double( Datadog::Tracing::TraceOperation, - sampled?: sampled, finished?: finished, flush!: trace ) end - let(:sampled) { true } let(:finished) { true } let(:trace) { instance_double(Datadog::Tracing::TraceSegment) } end @@ -25,15 +23,7 @@ context 'given a finished trace operation' do let(:finished) { true } - context 'that is not sampled' do - let(:sampled) { false } - it { is_expected.to be nil } - end - - context 'that is sampled' do - let(:sampled) { true } - it { is_expected.to eq(trace) } - end + it { is_expected.to eq(trace) } end end @@ -48,16 +38,7 @@ context 'with partially completed trace operation' do let(:finished) { false } - - context 'that is not sampled' do - let(:sampled) { false } - it { is_expected.to be nil } - end - - context 'that is sampled' do - let(:sampled) { true } - it { is_expected.to be nil } - end + it { is_expected.to be nil } end end end @@ -76,27 +57,18 @@ context 'with partially completed trace operation' do let(:finished) { false } - context 'that is not sampled' do - let(:sampled) { false } - it { is_expected.to be nil } + before do + allow(trace_op).to receive(:finished_span_count).and_return(finished_span_count) end - context 'that is sampled' do - let(:sampled) { true } - - before do - allow(trace_op).to receive(:finished_span_count).and_return(finished_span_count) - end - - context 'containing fewer than the minimum required spans' do - let(:finished_span_count) { min_spans_for_partial - 1 } - it { is_expected.to be nil } - end + context 'containing fewer than the minimum required spans' do + let(:finished_span_count) { min_spans_for_partial - 1 } + it { is_expected.to be nil } + end - context 'containing at least the minimum required spans' do - let(:finished_span_count) { min_spans_for_partial } - it { is_expected.to eq(trace) } - end + context 'containing at least the minimum required spans' do + let(:finished_span_count) { min_spans_for_partial } + it { is_expected.to eq(trace) } end end end diff --git a/spec/datadog/tracing/integration_spec.rb b/spec/datadog/tracing/integration_spec.rb index bc6600e93fc..608c38edf13 100644 --- a/spec/datadog/tracing/integration_spec.rb +++ b/spec/datadog/tracing/integration_spec.rb @@ -31,13 +31,20 @@ shared_examples 'flushed trace' do it do - expect(stats[:traces_flushed]).to eq(1) - expect(stats[:transport].client_error).to eq(0) - expect(stats[:transport].server_error).to eq(0) - expect(stats[:transport].internal_error).to eq(0) + expect(stats).to include(traces_flushed: 1) + expect(stats[:transport]) + .to have_attributes( + client_error: 0, + server_error: 0, + internal_error: 0 + ) end end + shared_examples 'flushed no trace' do + it { expect(stats).to include(traces_flushed: 0) } + end + after { tracer.shutdown! } describe 'agent receives span' do @@ -284,6 +291,227 @@ def agent_receives_span_step3(previous_success) end end + describe 'single span sampling' do + subject(:trace) do + tracer.trace('unrelated.top_level', service: 'other-service') do + tracer.trace('my.op', service: 'my-service') do # This is the span we are interested in + tracer.trace('other.trace', service: 'not-service') {} + end + end + end + + include_context 'agent-based test' + + before do + Datadog.configure do |c| + c.tracing.sampling.span_rules = json_rules if json_rules + c.tracing.sampling.default_rate = trace_sampling_rate if trace_sampling_rate + + # Test setup + c.tracing.sampler = custom_sampler if custom_sampler + c.tracing.priority_sampling = priority_sampling if priority_sampling + end + + # Capture trace segments as they are about to be serialized + allow_any_instance_of(Datadog::Transport::Traces::Transport) + .to receive(:send_traces).and_wrap_original do |function, traces| + trace_segments.concat(traces) + function.call(traces) + end + + trace # Run test subject + tracer.shutdown! # Ensure trace is flushed, so we can read writer statistics + end + + let(:trace_segments) { [] } + + let(:trace_op) { @trace_op } + let(:stats) { tracer.writer.stats } + + let(:custom_sampler) { nil } + let(:priority_sampling) { false } + + let(:trace_sampling_rate) { nil } + let(:json_rules) { JSON.dump(rules) if rules } + let(:rules) { nil } + + let(:spans) do + expect(trace_segments).to have(1).item + trace_segments[0].spans + end + + let(:single_sampled_span) do + single_sampled_spans = spans.select { |s| s.name == 'my.op' } + expect(single_sampled_spans).to have(1).item + single_sampled_spans[0] + end + + after do + Datadog.configuration.tracing.sampling.reset! + end + + shared_examples 'does not modify spans' do + it do + expect(spans).to_not include(have_tag('_dd.span_sampling.mechanism')) + expect(spans).to_not include(have_tag('_dd.span_sampling.rule_rate')) + expect(spans).to_not include(have_tag('_dd.span_sampling.max_per_second')) + end + end + + shared_examples 'set single span sampling tags' do + let(:rule_rate) { 1.0 } + let(:max_per_second) { -1 } + + it do + expect(single_sampled_span.get_metric('_dd.span_sampling.mechanism')).to eq(8) + expect(single_sampled_span.get_metric('_dd.span_sampling.rule_rate')).to eq(rule_rate) + expect(single_sampled_span.get_metric('_dd.span_sampling.max_per_second')).to eq(max_per_second) + end + end + + shared_examples 'flushed complete trace' do |expected_span_count: 3| + it_behaves_like 'flushed trace' + + it 'flushed all spans' do + expect(spans).to have(expected_span_count).items + end + end + + context 'with default settings' do + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + end + + context 'with a kept trace' do + let(:trace_sampling_rate) { 1.0 } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + end + + context 'with a dropped trace' do + context 'by priority sampling' do + let(:trace_sampling_rate) { 0.0 } + + context 'with rule matching' do + context 'on name' do + context 'with a dropped span' do + let(:rules) { [{ name: 'my.op', sample_rate: 0.0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + + context 'by rate limiting' do + let(:rules) { [{ name: 'my.op', sample_rate: 1.0, max_per_second: 0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + end + end + + context 'with a kept span' do + let(:rules) { [{ name: 'my.op', sample_rate: 1.0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'set single span sampling tags' + end + end + + context 'on service' do + context 'with a dropped span' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 0.0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + + context 'by rate limiting' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0, max_per_second: 0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' + end + end + + context 'with a kept span' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0 }] } + + it_behaves_like 'flushed complete trace' + it_behaves_like 'set single span sampling tags' + end + end + end + end + + context 'by direct sampling' do + let(:custom_sampler) { no_sampler } + let(:priority_sampling) { false } + + let(:no_sampler) do + Class.new do + def sample!(trace) + trace.reject! + end + end.new + end + + context 'with rule matching' do + context 'on name' do + context 'with a dropped span' do + context 'by sampling rate' do + let(:rules) { [{ name: 'my.op', sample_rate: 0.0 }] } + + it_behaves_like 'flushed no trace' + end + + context 'by rate limiting' do + let(:rules) { [{ name: 'my.op', sample_rate: 1.0, max_per_second: 0 }] } + + it_behaves_like 'flushed no trace' + end + end + + context 'with a kept span' do + let(:rules) { [{ name: 'my.op', sample_rate: 1.0 }] } + + # it_behaves_like 'flushed complete trace', expected_span_count: 1 + it_behaves_like 'set single span sampling tags' + end + end + + context 'on service' do + context 'with a dropped span' do + context 'by sampling rate' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 0.0 }] } + + it_behaves_like 'flushed no trace' + end + + context 'by rate limiting' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0, max_per_second: 0 }] } + + it_behaves_like 'flushed no trace' + end + end + + context 'with a kept span' do + let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0 }] } + + it_behaves_like 'flushed complete trace', expected_span_count: 1 + it_behaves_like 'set single span sampling tags' + end + end + end + end + + context 'ensures correct stats calculation in the agent' do + it 'sets the Datadog-Client-Computed-Top-Level header to a non-empty value' do + expect(WebMock) + .to have_requested(:post, %r{/traces}).with(headers: { 'Datadog-Client-Computed-Top-Level' => /.+/ }) + end + end + end + end + describe 'shutdown' do include_context 'agent-based test' diff --git a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb index ca1a692f4ea..d33ab8eb923 100644 --- a/spec/datadog/tracing/sampling/span/rule_parser_spec.rb +++ b/spec/datadog/tracing/sampling/span/rule_parser_spec.rb @@ -10,6 +10,14 @@ it { expect { sample! }.to_not(change { span_op.send(:build_span).to_hash }) } end + context 'with nil' do + let(:rules_string) { nil } + + it 'returns nil' do + is_expected.to be(nil) + end + end + context 'invalid JSON' do let(:rules_string) { '-not-json-' } diff --git a/spec/datadog/tracing/span_spec.rb b/spec/datadog/tracing/span_spec.rb index c716fdc13e1..5ab42b5784a 100644 --- a/spec/datadog/tracing/span_spec.rb +++ b/spec/datadog/tracing/span_spec.rb @@ -272,4 +272,24 @@ expect { pretty_print }.to output.to_stdout end end + + describe '#single_sampled?' do + subject(:single_sampled) { span.single_sampled? } + + context 'with the single span sampling sampling mechanism tag' do + let(:span_options) { { meta: { '_dd.span_sampling.mechanism' => 8 } } } + + it { is_expected.to eq(true) } + end + + context 'with another span sampling sampling mechanism tag' do + let(:span_options) { { meta: { '_dd.span_sampling.mechanism' => 999 } } } + + it { is_expected.to eq(false) } + end + + context 'without a span sampling sampling mechanism tag' do + it { is_expected.to eq(false) } + end + end end diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index 7c428167e78..f1ce0d08b78 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -911,6 +911,8 @@ end describe '#set_tag' do + include_context 'trace attributes' + it 'sets tag on trace before a measurement' do trace_op.set_tag('foo', 'bar') trace_op.measure('top') {} @@ -1551,120 +1553,226 @@ def span end end - context 'is finished' do - before do - trace_op.measure( - 'grandparent', - service: 'boo', - resource: 'far', - type: 'faz' - ) do + context 'is sampled' do + let(:sampled) { true } + context 'is finished' do + before do trace_op.measure( - 'parent', - service: 'foo', - resource: 'bar', - type: 'baz' + 'grandparent', + service: 'boo', + resource: 'far', + type: 'faz' ) do - # Do something + trace_op.measure( + 'parent', + service: 'foo', + resource: 'bar', + type: 'baz' + ) do + # Do something + end end end - end - it 'flushes a trace with all spans' do - expect(trace_op.finished?).to be true + it 'flushes a trace with all spans' do + expect(trace_op.finished?).to be true - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(2).items - expect(trace.spans.map(&:name)).to include('parent', 'grandparent') - expect(trace.send(:root_span_id)).to be_a_kind_of(Integer) + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(2).items + expect(trace.spans.map(&:name)).to include('parent', 'grandparent') + expect(trace.send(:root_span_id)).to be_a_kind_of(Integer) - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + end + + it 'does not yield duplicate spans' do + expect(trace_op.flush!.spans).to have(2).items + expect(trace_op.flush!.spans).to have(0).items + end end - it 'does not yield duplicate spans' do - expect(trace_op.flush!.spans).to have(2).items - expect(trace_op.flush!.spans).to have(0).items + context 'is partially finished' do + it 'flushes spans as they finish' do + trace_op.measure('grandparent') do + trace_op.measure('parent') do + # Do something + end + + # Partial flush + flush! + end + + # Verify partial flush + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(1).items + expect(trace.spans.map(&:name)).to include('parent') + expect(trace.send(:root_span_id)).to be nil + + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + + # There should be finished spans pending + expect(trace_op.finished?).to be true + expect(trace_op.finished_span_count).to eq(1) + + # Verify final flush + final_flush = trace_op.flush! + expect(final_flush.spans).to have(1).items + expect(final_flush.spans.map(&:name)).to include('grandparent') + expect(final_flush.send(:root_span_id)).to be_a_kind_of(Integer) + + expect(final_flush).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + + # Make sure its actually empty + expect(trace_op.flush!.spans).to have(0).items + end end end - context 'is partially finished' do - it 'flushes spans as they finish' do - trace_op.measure('grandparent') do - trace_op.measure('parent') do - # Do something + context 'is not sampled' do + let(:sampled) { false } + let(:sampling_priority) { nil } + + context 'is finished' do + before do + trace_op.measure( + 'grandparent', + service: 'boo', + resource: 'far', + type: 'faz' + ) do + trace_op.measure( + 'parent', + service: 'foo', + resource: 'bar', + type: 'baz', + tags: { '_dd.span_sampling.mechanism' => 8 } + ) do + # Do something + end end + end + + it 'flushes a trace with single sampled spans' do + expect(trace_op.finished?).to be true - # Partial flush - flush! + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(1).items + expect(trace.spans.map(&:name)).to include('parent') + expect(trace.send(:root_span_id)).to be nil + + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + + # Verify that final flush is empty + expect(trace_op.flush!.spans).to have(0).items end - # Verify partial flush - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(1).items - expect(trace.spans.map(&:name)).to include('parent') - expect(trace.send(:root_span_id)).to be nil + it 'does not yield duplicate spans' do + expect(trace_op.flush!.spans).to have(1).items + expect(trace_op.flush!.spans).to have(0).items + end + end - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) + context 'is partially finished' do + it 'flushes spans as they finish' do + trace_op.measure('grandparent') do + trace_op.measure('parent', tags: { '_dd.span_sampling.mechanism' => 8 }) do + # Do something + end - # There should be finished spans pending - expect(trace_op.finished?).to be true - expect(trace_op.finished_span_count).to eq(1) + # Partial flush + flush! + end - # Verify final flush - final_flush = trace_op.flush! - expect(final_flush.spans).to have(1).items - expect(final_flush.spans.map(&:name)).to include('grandparent') - expect(final_flush.send(:root_span_id)).to be_a_kind_of(Integer) + # Verify partial flush + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(1).items + expect(trace.spans.map(&:name)).to include('parent') + expect(trace.send(:root_span_id)).to be nil - expect(final_flush).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + + # There should be finished spans pending + expect(trace_op.finished?).to be true + expect(trace_op.finished_span_count).to eq(1) - # Make sure its actually empty - expect(trace_op.flush!.spans).to have(0).items + # Verify that final flush is empty + expect(trace_op.flush!.spans).to have(0).items + end end end end @@ -2217,6 +2325,8 @@ def span end describe 'integration tests' do + include_context 'trace attributes' + context 'service_entry attributes' do context 'when service not given' do it do From fb8fa3f5532e6a1514f77da88357b9272feaef05 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 11 Jul 2022 10:29:24 +0100 Subject: [PATCH 0207/2133] Added: 1.2.0 to CHANGELOG.md --- CHANGELOG.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2367ac3b14e..bfa325d588c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,44 @@ ## [Unreleased] +## [1.2.0] - 2022-07-11 + +Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v1.2.0 + +Git diff: https://github.com/DataDog/dd-trace-rb/compare/v1.1.0...v1.2.0 + +Special thanks go to [@miketheman][] for gifting Datadog access to the `datadog` gem a few days ago. + +### Added + +* Add Postgres (`pg` gem) instrumentation ([#2054][]) ([@jennchenn][]) +* Add env var for debugging profiling native extension compilation issues ([#2069][]) +* Teach Rest Client integration the `:split_by_domain` option ([#2079][]) ([@agrobbin][]) +* Allow passing request_queuing option to Rack through Rails tracer ([#2082][]) ([@KieranP][]) +* Add Utility to Collect Platform Information ([#2097][]) ([@jennchenn][]) +* Add convenient interface for getting and setting tags using `[]` and `[]=` respectively ([#2076][]) ([@ioquatix][]) +* Add b3 metadata in grpc ([#2110][]) ([@henrich-m][]) + +### Changed + +* Profiler now reports profiling data using the libddprof gem ([#2059][]) +* Rename `Kernel#at_fork_blocks` monkey patch to `Kernel#ddtrace_at_fork_blocks` ([#2070][]) +* Improved error message for enabling profiling when `pkg-config` system tool is not installed ([#2134][]) + +### Fixed + +* Prevent errors in `action_controller` integration when tracing is disabled ([#2027][]) ([@ahorner][]) +* Fix profiler not building on ruby-head (3.2) due to VM refactoring ([#2066][]) +* Span and trace IDs should not be zero ([#2113][]) ([@albertvaka][]) +* Fix object_id usage as thread local key ([#2096][]) +* Fix profiling not working on Heroku and AWS Elastic Beanstalk due to linking issues ([#2125][]) + ## [1.1.0] - 2022-05-25 +Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v1.1.0 + +Git diff: https://github.com/DataDog/dd-trace-rb/compare/v1.0.0...v1.1.0 + ### Added * [Application Security Monitoring](https://docs.datadoghq.com/security_platform/application_security/) @@ -2852,7 +2888,22 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [#2010]: https://github.com/DataDog/dd-trace-rb/issues/2010 [#2011]: https://github.com/DataDog/dd-trace-rb/issues/2011 [#2022]: https://github.com/DataDog/dd-trace-rb/issues/2022 +[#2027]: https://github.com/DataDog/dd-trace-rb/issues/2027 [#2028]: https://github.com/DataDog/dd-trace-rb/issues/2028 +[#2054]: https://github.com/DataDog/dd-trace-rb/issues/2054 +[#2059]: https://github.com/DataDog/dd-trace-rb/issues/2059 +[#2066]: https://github.com/DataDog/dd-trace-rb/issues/2066 +[#2069]: https://github.com/DataDog/dd-trace-rb/issues/2069 +[#2070]: https://github.com/DataDog/dd-trace-rb/issues/2070 +[#2076]: https://github.com/DataDog/dd-trace-rb/issues/2076 +[#2079]: https://github.com/DataDog/dd-trace-rb/issues/2079 +[#2082]: https://github.com/DataDog/dd-trace-rb/issues/2082 +[#2096]: https://github.com/DataDog/dd-trace-rb/issues/2096 +[#2097]: https://github.com/DataDog/dd-trace-rb/issues/2097 +[#2110]: https://github.com/DataDog/dd-trace-rb/issues/2110 +[#2113]: https://github.com/DataDog/dd-trace-rb/issues/2113 +[#2125]: https://github.com/DataDog/dd-trace-rb/issues/2125 +[#2134]: https://github.com/DataDog/dd-trace-rb/issues/2134 [@AdrianLC]: https://github.com/AdrianLC [@Azure7111]: https://github.com/Azure7111 [@BabyGroot]: https://github.com/BabyGroot @@ -2865,6 +2916,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@Jared-Prime]: https://github.com/Jared-Prime [@Joas1988]: https://github.com/Joas1988 [@JustSnow]: https://github.com/JustSnow +[@KieranP]: https://github.com/KieranP [@MMartyn]: https://github.com/MMartyn [@NobodysNightmare]: https://github.com/NobodysNightmare [@Redapted]: https://github.com/Redapted @@ -2875,7 +2927,9 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@agirlnamedsophia]: https://github.com/agirlnamedsophia [@agrobbin]: https://github.com/agrobbin [@ahammel]: https://github.com/ahammel +[@ahorner]: https://github.com/ahorner [@al-kudryavtsev]: https://github.com/al-kudryavtsev +[@albertvaka]: https://github.com/albertvaka [@alksl]: https://github.com/alksl [@alloy]: https://github.com/alloy [@aurelian]: https://github.com/aurelian @@ -2921,11 +2975,14 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@guizmaii]: https://github.com/guizmaii [@hatstand]: https://github.com/hatstand [@hawknewton]: https://github.com/hawknewton +[@henrich-m]: https://github.com/henrich-m [@hs-bguven]: https://github.com/hs-bguven [@illdelph]: https://github.com/illdelph +[@ioquatix]: https://github.com/ioquatix [@jamiehodge]: https://github.com/jamiehodge [@janz93]: https://github.com/janz93 [@jeffjo]: https://github.com/jeffjo +[@jennchenn]: https://github.com/jennchenn [@jfrancoist]: https://github.com/jfrancoist [@joeyAghion]: https://github.com/joeyAghion [@jpaulgs]: https://github.com/jpaulgs @@ -2945,6 +3002,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@mdehoog]: https://github.com/mdehoog [@mdross95]: https://github.com/mdross95 [@michaelkl]: https://github.com/michaelkl +[@miketheman]: https://github.com/miketheman [@mriddle]: https://github.com/mriddle [@mscrivo]: https://github.com/mscrivo [@mstruve]: https://github.com/mstruve @@ -2983,4 +3041,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@vramaiah]: https://github.com/vramaiah [@walterking]: https://github.com/walterking [@y-yagi]: https://github.com/y-yagi -[@zachmccormick]: https://github.com/zachmccormick +[@zachmccormick]: https://github.com/zachmccormick \ No newline at end of file From e2770ea02813cef0d6b5a3e83af44202bee1f686 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 11 Jul 2022 10:30:11 +0100 Subject: [PATCH 0208/2133] Bumping version 1.1.0 to 1.2.0 --- lib/ddtrace/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ddtrace/version.rb b/lib/ddtrace/version.rb index 82ab99e627e..f448f20ce2c 100644 --- a/lib/ddtrace/version.rb +++ b/lib/ddtrace/version.rb @@ -3,7 +3,7 @@ module DDTrace module VERSION MAJOR = 1 - MINOR = 1 + MINOR = 2 PATCH = 0 PRE = nil From b43c237d7bc5623faea6d94fb852f8624f925841 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 11 Jul 2022 11:42:33 +0100 Subject: [PATCH 0209/2133] Updated: gemfiles for 1.2.0 --- gemfiles/jruby_9.2.18.0_contrib.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock | 6 +++--- gemfiles/jruby_9.2.18.0_core_old.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock | 8 ++++---- ...jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...uby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- ...ruby_9.2.18.0_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock | 8 ++++---- .../jruby_9.2.18.0_rails61_postgres.gemfile.lock | 8 ++++---- ...ruby_9.2.18.0_rails61_postgres_redis.gemfile.lock | 8 ++++---- ...by_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- ...uby_9.2.18.0_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock | 8 ++++---- ...jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...uby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- ...ruby_9.2.18.0_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_contrib.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock | 6 +++--- gemfiles/jruby_9.2.8.0_core_old.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock | 8 ++++---- .../jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...ruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- ...jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock | 8 ++++---- ...jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock | 8 ++++---- ...uby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- ...ruby_9.2.8.0_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock | 8 ++++---- .../jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...ruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- ...jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_contrib.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock | 6 +++--- gemfiles/jruby_9.3.4.0_core_old.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock | 8 ++++---- .../jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...ruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- ...jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock | 8 ++++---- ...jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock | 8 ++++---- ...uby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- ...ruby_9.3.4.0_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock | 8 ++++---- .../jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- ...ruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- ...jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.1.10_contrib.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.1.10_core_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock | 6 +++--- .../ruby_2.1.10_rails32_postgres_redis.gemfile.lock | 6 +++--- ...ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock | 6 +++--- gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock | 6 +++--- .../ruby_2.1.10_rails4_postgres_redis.gemfile.lock | 10 +++++----- .../ruby_2.1.10_rails4_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_contrib.gemfile.lock | 10 +++++----- gemfiles/ruby_2.2.10_core_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails32_postgres_redis.gemfile.lock | 6 +++--- ...ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails4_postgres_redis.gemfile.lock | 10 +++++----- .../ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails4_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails5_postgres_redis.gemfile.lock | 6 +++--- ..._rails5_postgres_redis_activesupport.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails5_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_contrib.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_contrib_old.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_core_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_cucumber3.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_cucumber4.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails32_postgres_redis.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails4_postgres_redis.gemfile.lock | 10 +++++----- .../ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails4_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails5_postgres_redis.gemfile.lock | 6 +++--- ..._rails5_postgres_redis_activesupport.gemfile.lock | 10 +++++----- .../ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails5_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock | 6 +++--- gemfiles/ruby_2.4.10_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.4.10_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock | 8 ++++---- .../ruby_2.4.10_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.4.10_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.5.9_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.5.9_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.6.7_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails5_postgres_redis.gemfile.lock | 8 ++++---- ..._rails5_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails5_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.6.7_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.7.3_contrib.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_contrib_old.gemfile.lock | 10 +++++----- gemfiles/ruby_2.7.3_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_2.7.3_cucumber3.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_cucumber4.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails5_postgres_redis.gemfile.lock | 12 ++++++------ ..._rails5_postgres_redis_activesupport.gemfile.lock | 12 ++++++------ .../ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock | 12 ++++++------ .../ruby_2.7.3_rails5_semantic_logger.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock | 12 ++++++------ .../ruby_2.7.3_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails6_postgres_redis.gemfile.lock | 8 ++++---- ..._rails6_postgres_redis_activesupport.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_2.7.3_rails6_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock | 12 ++++++------ gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_3.0.3_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock | 8 ++++---- .../ruby_3.0.3_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_3.0.3_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_3.1.1_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock | 8 ++++---- .../ruby_3.1.1_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_3.1.1_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_3.2.0_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_cucumber3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_cucumber5.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock | 8 ++++---- .../ruby_3.2.0_rails61_postgres_redis.gemfile.lock | 8 ++++---- .../ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock | 8 ++++---- .../ruby_3.2.0_rails61_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock | 8 ++++---- gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock | 8 ++++---- 251 files changed, 1004 insertions(+), 1004 deletions(-) diff --git a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock index 85b2cceeaab..8dc74c65a45 100644 --- a/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1461,7 +1461,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1643,7 +1643,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1665,7 +1665,7 @@ DEPENDENCIES httpclient i18n (= 1.8.7) jdbc-sqlite3 (>= 3.28) - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock index f944387e985..46445f5d0e9 100644 --- a/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -150,7 +150,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -160,7 +160,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) faraday (= 0.17) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock b/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock index 0af19022218..05d8dafc8fb 100644 --- a/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -50,7 +50,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -130,13 +130,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock index 91fc47e80f3..3bf6455733c 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -68,7 +68,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -150,14 +150,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 3.0.0, < 4.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock index 0b47d17ca16..27ec5cffee6 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 4.0.0, < 5.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock index 5b98c3a3a2b..71c36ff1b93 100644 --- a/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 5.0.0, < 6.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock index 14511f2dc81..c82dcc2af99 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -244,14 +244,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock index 08830dc1b0e..717fcbbc23c 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -244,14 +244,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock index a9c519e2eaf..b7a1d1a8c39 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -245,14 +245,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock index ef14e3f30ba..3a22749e3dc 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -261,14 +261,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock index 25ecbf21b17..1e756434641 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -118,7 +118,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -251,14 +251,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock index e2b05a807ae..fb6ec12f065 100644 --- a/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -112,7 +112,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -243,14 +243,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock index 69f97925c78..ecf7a65890a 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -263,14 +263,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock index cc9110d8711..a24ed5313fd 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -263,14 +263,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock index 1774c42be98..c51723f8c7b 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -264,14 +264,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock index ed02d9333da..c09320b3602 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -269,14 +269,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock index 27a3825c1f2..3585e63431f 100644 --- a/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -262,14 +262,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock index dcf1cbff2b5..0c83694882c 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -260,14 +260,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock index 8e8f2d5f15a..c37447f7875 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -260,14 +260,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock index 82785d69659..c3a43a2826c 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -261,14 +261,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock index a0cdf1deb82..3085c6af8a9 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -277,14 +277,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock index 2e3ad5cc793..ebe69e1fec9 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -131,7 +131,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -267,14 +267,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock index 49c389000b4..de4f27c3d6a 100644 --- a/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -125,7 +125,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -259,14 +259,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock index 06eb2ce0586..83e36679fb5 100644 --- a/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock index 43b50a35c35..b17dcd64237 100644 --- a/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock index 474425e4ebe..60be4eb0d80 100644 --- a/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1461,7 +1461,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1643,7 +1643,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1665,7 +1665,7 @@ DEPENDENCIES httpclient i18n (= 1.8.7) jdbc-sqlite3 (>= 3.28) - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock index f9886260180..21aacabb0f5 100644 --- a/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -150,7 +150,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -160,7 +160,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) faraday (= 0.17) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock b/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock index 02f85e69f72..a42b4b84c1a 100644 --- a/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -50,7 +50,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -130,13 +130,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock index b5576f91bed..9fb1cbef439 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -68,7 +68,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -150,14 +150,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 3.0.0, < 4.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock index 3180699aa20..9e61e303fee 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 4.0.0, < 5.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock index 5c57e65ce29..ac46650aea4 100644 --- a/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 5.0.0, < 6.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock index 4025af179d9..ccc704270a9 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -244,14 +244,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock index e9a9272516d..ee00499ef9f 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -244,14 +244,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock index c46c056ac79..d17ea89f9b6 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -245,14 +245,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock index da7b1e06527..e55fe39fd6c 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -261,14 +261,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock index a49f35a0b6a..493841be410 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -118,7 +118,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -251,14 +251,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock index 88928cf96b1..b518ed09ebf 100644 --- a/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -112,7 +112,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -243,14 +243,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock index b06889dd6c9..e97c9877553 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -263,14 +263,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock index 25cebac8a5a..1c89928601f 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -263,14 +263,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock index 97a8417f293..970ebf748fa 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -264,14 +264,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock index 516b615c9d2..217f8811497 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -269,14 +269,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock index d5811368087..8a142999c3d 100644 --- a/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -262,14 +262,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock index 1e6c326bf17..c0c1cca8105 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -260,14 +260,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock index 542ce286fa8..502f1053f9f 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -260,14 +260,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock index 74c22204a2d..a5a1069dc37 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -261,14 +261,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock index a5947fce3b4..7f1a99484b9 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -277,14 +277,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock index 22c5d4b8262..dc1232c1c85 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -131,7 +131,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -267,14 +267,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock index a18870616df..2e75560d9c3 100644 --- a/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -125,7 +125,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.12.5-java) racc (~> 1.4) @@ -259,14 +259,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock index b7c2869dbc1..50d43c65994 100644 --- a/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock index aa50eb01386..aca2ec62d61 100644 --- a/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.2.8.0_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock index bf5ec320596..5625a142f8e 100644 --- a/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1461,7 +1461,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1643,7 +1643,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1664,7 +1664,7 @@ DEPENDENCIES http httpclient jdbc-sqlite3 (>= 3.28) - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock b/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock index e4a02b183ed..cfac3253d69 100644 --- a/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -150,7 +150,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -160,7 +160,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) faraday (= 0.17) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock b/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock index dc8d9ec3aca..45ca4e6ec25 100644 --- a/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -50,7 +50,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -130,13 +130,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock index 60601f6239a..cb5c764b985 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -68,7 +68,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -150,14 +150,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 3.0.0, < 4.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock index b6f85739734..cc6e0222796 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 4.0.0, < 5.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock b/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock index e63b8ca4b45..576482e655e 100644 --- a/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -91,7 +91,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -183,14 +183,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby cucumber (>= 5.0.0, < 6.0.0) ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock index 7e3bf585b43..95aa0484255 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -244,13 +244,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock index 19a2d8b99c3..cbf7356142e 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -244,13 +244,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock index 3b53ef1616f..751690418a3 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -245,13 +245,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock index 00ca58fc812..f4c054d39a7 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -261,13 +261,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock index 479381f8bfd..49c43083fb6 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -118,7 +118,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -251,13 +251,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock index 101d5e70a8c..d95d5c62380 100644 --- a/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -112,7 +112,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -243,13 +243,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock index 51eb0c80e20..6c7a962edba 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -263,13 +263,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock index 0cd37eb48aa..459389a0cd4 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -263,13 +263,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock index 66fc9b93d9c..8c37ec50dc6 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -264,13 +264,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock index 8d5518a4c97..0ed9543fccd 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -269,13 +269,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock index 538d124e3b1..fa369077efa 100644 --- a/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -262,13 +262,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock index 85596a83a69..fe8b0eba7ca 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -260,13 +260,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock index f921cc04546..cda65cb5073 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -260,13 +260,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock index 2b1b8e452bc..44f6f734161 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -261,13 +261,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock index d4000a3d747..f82039bd11f 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -277,13 +277,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock index bf1b57c521e..f05627ed2d4 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -131,7 +131,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -267,13 +267,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock b/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock index bf7186baeb8..abf2a775151 100644 --- a/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -125,7 +125,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1-java) + msgpack (1.5.3-java) nio4r (2.5.8-java) nokogiri (1.13.3-java) racc (~> 1.4) @@ -259,13 +259,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock b/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock index df59a913da4..3fe6527561c 100644 --- a/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock b/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock index 935d4edf806..fb319d7ee11 100644 --- a/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock +++ b/gemfiles/jruby_9.3.4.0_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -51,7 +51,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1-java) + msgpack (1.5.3-java) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -152,13 +152,13 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.1.10_contrib.gemfile.lock b/gemfiles/ruby_2.1.10_contrib.gemfile.lock index 4302019f637..c162031d784 100644 --- a/gemfiles/ruby_2.1.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.1.10_contrib.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -105,7 +105,7 @@ GEM faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) ffi (1.12.2) - google-protobuf (3.6.1-x86_64-linux) + google-protobuf (3.6.1) hashdiff (1.0.1) hiredis (0.6.3) hitimes (1.3.0) @@ -126,8 +126,8 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) makara (0.4.1) activerecord (>= 3.0.0) @@ -260,7 +260,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk (~> 2.0) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -276,7 +276,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) makara (< 0.5.0) memory_profiler (~> 0.9) mongo (< 2.5) diff --git a/gemfiles/ruby_2.1.10_core_old.gemfile.lock b/gemfiles/ruby_2.1.10_core_old.gemfile.lock index b3b0ba111ef..f63670d89dd 100644 --- a/gemfiles/ruby_2.1.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.1.10_core_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,14 +95,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock index 2bde3417991..9bad605be25 100644 --- a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -74,8 +74,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) @@ -180,14 +180,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) makara (< 0.5.0) memory_profiler (~> 0.9) mysql2 (= 0.3.21) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock index f90d33e6315..382968081a0 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -171,14 +171,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock index be9d0be5ced..4f6c4c94dbf 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -188,14 +188,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock index 2640b2c3209..ffb1d7bdb5a 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -179,14 +179,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock index 860e612bbb5..5ad026f6c1b 100644 --- a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -191,14 +191,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock index 7e17d4411b7..2c7fb458b1b 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -191,14 +191,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock index 93faebeab85..83ee7d86b96 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -208,14 +208,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock index c6304228381..0a2da601b61 100644 --- a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -189,14 +189,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_contrib.gemfile.lock b/gemfiles/ruby_2.2.10_contrib.gemfile.lock index 347c925892d..13631c2279c 100644 --- a/gemfiles/ruby_2.2.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.2.10_contrib.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1268,8 +1268,8 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -1471,7 +1471,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1491,7 +1491,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) lograge (~> 0.11) makara (< 0.5.0) memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.2.10_core_old.gemfile.lock b/gemfiles/ruby_2.2.10_core_old.gemfile.lock index 469ae071fa0..1767d955e90 100644 --- a/gemfiles/ruby_2.2.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.2.10_core_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,14 +95,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock index 8c6b32f206a..a7dd63b9995 100644 --- a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -74,8 +74,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) @@ -178,14 +178,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) mysql2 (= 0.3.21) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock index bed95c7bc68..891e0bd15e3 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -171,14 +171,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock index 41e637916e5..6260e2c3f5c 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -188,14 +188,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock index d3733ce8634..98e0eb2624b 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -179,14 +179,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock index 835592edf6d..014272b6d95 100644 --- a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -191,14 +191,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock index 78d0675d4c3..b38f41dd38d 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -191,14 +191,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock index 3284915ee25..aedfbb747d6 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -208,14 +208,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock index 75448fced9f..85a7e14b799 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -199,14 +199,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock index e15a31f24d6..69e17f1fff0 100644 --- a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -189,14 +189,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock index 85308846e29..d284b57fbab 100644 --- a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -207,14 +207,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mimemagic (= 0.3.9) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock index 82a1d48e0dd..6dfbf031e17 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -207,14 +207,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mimemagic (= 0.3.9) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock index ed2ff394633..202deac9816 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -208,14 +208,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mimemagic (= 0.3.9) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock index 248707b52cf..d778378b80f 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -224,14 +224,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mimemagic (= 0.3.9) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock index 8209bc667d6..8e5b8335e74 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -217,14 +217,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mimemagic (= 0.3.9) diff --git a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock index bedba034de9..a4f356c1dcf 100644 --- a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -205,14 +205,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) mimemagic (= 0.3.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_contrib.gemfile.lock b/gemfiles/ruby_2.3.8_contrib.gemfile.lock index 949a67346ea..88ae2e6f756 100644 --- a/gemfiles/ruby_2.3.8_contrib.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1364,8 +1364,8 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -1569,7 +1569,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1588,7 +1588,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock index 082ceff49eb..702b142d070 100644 --- a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -49,8 +49,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -115,7 +115,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -124,7 +124,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) faraday (= 0.17) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_core_old.gemfile.lock b/gemfiles/ruby_2.3.8_core_old.gemfile.lock index e4d2f56348c..605d4b369f5 100644 --- a/gemfiles/ruby_2.3.8_core_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_core_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -97,14 +97,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock index 1a454ba9908..ab2ead66aca 100644 --- a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,8 +55,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -117,7 +117,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -125,7 +125,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock index 694ea6a61dc..2f023a8db76 100644 --- a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -148,7 +148,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -156,7 +156,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock index 081ea29975e..64b324b45ae 100644 --- a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -74,8 +74,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) @@ -180,14 +180,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) mysql2 (= 0.3.21) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock index fe38cd1f561..2b44c529472 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -173,14 +173,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock index b1322e04f72..64b744a6db7 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -190,14 +190,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock index c0649e93fbb..5768020588f 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -181,14 +181,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock index 6b92e0d5b03..e6c41429566 100644 --- a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -193,14 +193,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock index f2313e28606..25cb11b55aa 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -193,14 +193,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock index c9a4a972253..56ff949008b 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -78,8 +78,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -210,14 +210,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock index b4b9b816190..e36f3319c31 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -201,14 +201,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock index bb671832413..c04eb4a2dcf 100644 --- a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -192,14 +192,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock index 192d8670e19..ebbe7a9d5a8 100644 --- a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -85,8 +85,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -205,14 +205,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock index e20d386a9b5..b81b8f14ea2 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -205,14 +205,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock index 5c036b49ec3..daa1c52d767 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -206,14 +206,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock index cc1053328c7..09270c61f57 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -85,8 +85,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -222,14 +222,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock index 546f5d51ba5..0eb720101e5 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -215,14 +215,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock index 38f083d21cc..5170983f601 100644 --- a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -204,14 +204,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock index 0a1496c6286..8abcfb0d960 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -122,14 +122,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock index 7776139ae04..c5a179ebfe4 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -122,14 +122,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_contrib.gemfile.lock b/gemfiles/ruby_2.4.10_contrib.gemfile.lock index 05f579a0b8a..f0d10d8d8ee 100644 --- a/gemfiles/ruby_2.4.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1458,7 +1458,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1679,7 +1679,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1699,7 +1699,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock index e489fc4de9d..8253f55d456 100644 --- a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -153,7 +153,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -163,7 +163,7 @@ DEPENDENCIES faraday (= 0.17) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_core_old.gemfile.lock b/gemfiles/ruby_2.4.10_core_old.gemfile.lock index b82e1f046fc..0b2a0e2aa36 100644 --- a/gemfiles/ruby_2.4.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_core_old.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -44,7 +44,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.20.1) @@ -134,14 +134,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock index 3fdccfa20d1..02733d741de 100644 --- a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -62,7 +62,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -154,7 +154,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -162,7 +162,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock index 766aa6f9d34..c510110b379 100644 --- a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -84,7 +84,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -185,7 +185,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -193,7 +193,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock index 24621fbb9d6..1ee657618e1 100644 --- a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.10.10) @@ -242,14 +242,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock index 5ff35ebecab..cf0c1a57c2c 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -242,14 +242,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock index cc71df10b08..d70bf21d617 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -243,14 +243,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock index 3e5c3def920..2370120ccac 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -259,14 +259,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock index 4c2a6e5097a..1c74d551084 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -107,7 +107,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -252,14 +252,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock index ae97a3e7c5a..654b3e61efc 100644 --- a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -101,7 +101,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -241,14 +241,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock index fc75565419c..77cc70ee292 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -45,7 +45,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -159,14 +159,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock index da560d3a6f1..86315b53794 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -45,7 +45,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -159,14 +159,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, < 3.19.2, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_contrib.gemfile.lock b/gemfiles/ruby_2.5.9_contrib.gemfile.lock index 608d3b1bcc9..b4c10971e8a 100644 --- a/gemfiles/ruby_2.5.9_contrib.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1459,7 +1459,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1658,7 +1658,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1681,7 +1681,7 @@ DEPENDENCIES httpclient i18n (= 1.8.7) jdbc-sqlite3 (>= 3.28) - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock index 5b6d645fe7b..33c7e365455 100644 --- a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -162,7 +162,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -173,7 +173,7 @@ DEPENDENCIES faraday (= 0.17) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_core_old.gemfile.lock b/gemfiles/ruby_2.5.9_core_old.gemfile.lock index 623d769ebd1..832bb078ba4 100644 --- a/gemfiles/ruby_2.5.9_core_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -54,7 +54,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -142,14 +142,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock index 90ffce463d0..e1b70f7d418 100644 --- a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -72,7 +72,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -162,7 +162,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -170,7 +170,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock index e64fff4cf53..48f6eb767eb 100644 --- a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock index 280fcc0899d..30e64272bf8 100644 --- a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock index 30461278b54..bc4e3bc5952 100644 --- a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -251,7 +251,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -259,7 +259,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock index c3bee9e36f7..530b076b51f 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -251,7 +251,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -259,7 +259,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock index a76fa37cecf..bc453afbc3e 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -252,7 +252,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -260,7 +260,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock index 09c562d8d52..c94639382d0 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -268,7 +268,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -276,7 +276,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock index 38eb7289c6b..8d0f4e8c16d 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -258,7 +258,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -266,7 +266,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock index 1272d8a5bf7..26fd604bd1f 100644 --- a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -110,7 +110,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -250,7 +250,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -258,7 +258,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock index 69f936ffe3e..cddfcc111c2 100644 --- a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -270,7 +270,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -278,7 +278,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock index fd113974c1c..4252e0f4649 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -270,7 +270,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -278,7 +278,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock index 4bc34636c0d..ed2058447f9 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -271,7 +271,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -279,7 +279,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock index bce029b5cec..745cc492bf7 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -276,7 +276,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -284,7 +284,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock index efbaaae8c2b..58b8802e985 100644 --- a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -127,7 +127,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -269,7 +269,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -277,7 +277,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock index d0547d53d07..3733498e25a 100644 --- a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -267,7 +267,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -275,7 +275,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock index c12c049fc4f..db5b376d03a 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -267,7 +267,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -275,7 +275,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock index 2a7472a21ca..e1a7df107b5 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -268,7 +268,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -276,7 +276,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock index 18b5064601c..1e2560359fb 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -284,7 +284,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -292,7 +292,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock index ff8a505dd41..d9fae274eed 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -274,7 +274,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -282,7 +282,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock index 01f0a440448..7c892753029 100644 --- a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -123,7 +123,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -266,7 +266,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -274,7 +274,7 @@ DEPENDENCIES dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) i18n (= 1.8.7) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock index 8fea44aa6a3..fe7e7d43761 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -164,14 +164,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock index 07fd0664639..5bf97abbad1 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -164,14 +164,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_contrib.gemfile.lock b/gemfiles/ruby_2.6.7_contrib.gemfile.lock index 6f017626296..4b9c59bdfe6 100644 --- a/gemfiles/ruby_2.6.7_contrib.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1460,7 +1460,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1660,7 +1660,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1682,7 +1682,7 @@ DEPENDENCIES http httpclient jdbc-sqlite3 (>= 3.28) - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock index 2e42b2da843..8953dfb3014 100644 --- a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -175,7 +175,7 @@ DEPENDENCIES faraday (= 0.17) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_core_old.gemfile.lock b/gemfiles/ruby_2.6.7_core_old.gemfile.lock index 2e4ee0e45ff..a3384bb1627 100644 --- a/gemfiles/ruby_2.6.7_core_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -144,14 +144,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock index 081f1e25933..3c3eb6ae92a 100644 --- a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -73,7 +73,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -172,7 +172,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock index c826e55d82d..26df44d8c8e 100644 --- a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -96,7 +96,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -197,7 +197,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -205,7 +205,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock index d2e08c8a425..5ddd89445e4 100644 --- a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -96,7 +96,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -197,7 +197,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -205,7 +205,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock index 4dfc13d0bb1..94e80923572 100644 --- a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -253,14 +253,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock index 27c6513234b..1daea2682f5 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -253,14 +253,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock index ad5ea4b2ace..ee7ab7198aa 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -254,14 +254,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock index 05b5284acdf..26b1f41f462 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -270,14 +270,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock index 2f7b85338ea..83f1e731b1a 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -260,14 +260,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock index abadb0f9636..10d1bdec1c4 100644 --- a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -111,7 +111,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -252,14 +252,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock index e5ccfc7105f..b8a12efb7c1 100644 --- a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -272,14 +272,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock index fd58fe7079d..6bc078d0653 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -272,14 +272,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock index b1789e94c71..449c05d05bd 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -273,14 +273,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock index 6394f86c346..563360d98e0 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -278,14 +278,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock index 1f76e04a626..cd42fdf7074 100644 --- a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -271,14 +271,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock index ab7f0bff548..ffcbefe1482 100644 --- a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -269,14 +269,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock index 9e92800fef8..79a85a228a5 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -269,14 +269,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock index 3605188fd99..7c0f3262f3d 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -270,14 +270,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock index 9d145d2f9dd..2fea08a5dff 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -286,14 +286,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock index eb73b44d3ec..73297fe1681 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -276,14 +276,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock index 91b0ca567a9..6c27207d7f5 100644 --- a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -124,7 +124,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -268,14 +268,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock index 0f420bd2d52..64fc10a82ba 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock index 53d797e7482..595e2411bad 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_contrib.gemfile.lock b/gemfiles/ruby_2.7.3_contrib.gemfile.lock index 26b95f839d2..77e9e0453a8 100644 --- a/gemfiles/ruby_2.7.3_contrib.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1437,8 +1437,8 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -1460,7 +1460,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1660,7 +1660,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1680,7 +1680,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) lograge (~> 0.11) makara memory_profiler (~> 0.9) diff --git a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock index 576eaef53e2..55cd897472e 100644 --- a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -64,8 +64,8 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -175,7 +175,7 @@ DEPENDENCIES faraday (= 0.17) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_core_old.gemfile.lock b/gemfiles/ruby_2.7.3_core_old.gemfile.lock index 35a826c9a94..338c34dfea4 100644 --- a/gemfiles/ruby_2.7.3_core_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -144,14 +144,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock index 6ad4f4e2ba8..f99e0ff9062 100644 --- a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -68,12 +68,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -172,7 +172,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock index 7b8bbda2bcb..c6bd0e8072f 100644 --- a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock index 9b83bc932b7..1982cd7aa1b 100644 --- a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock index d3c6b010d81..4667a83d526 100644 --- a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -98,8 +98,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -254,14 +254,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock index 9d949ee989c..569c768d24d 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -254,14 +254,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock index e6ef57f4a55..c271f500370 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -98,8 +98,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -255,14 +255,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock index 6017f9bfdf4..d9da4519453 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -98,8 +98,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -271,14 +271,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock index 553024b3e15..e555e56e983 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -99,8 +99,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -118,7 +118,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -261,14 +261,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock index f28b15222ca..2a3b5e2edd9 100644 --- a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -98,8 +98,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) @@ -112,7 +112,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -253,14 +253,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock index fbb4b02706f..ec4adbe6203 100644 --- a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,8 +115,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -273,14 +273,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock index ece097ad3e0..b4f69db8a87 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -115,8 +115,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -273,14 +273,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock index 7217bf994cb..d922653bc7b 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -274,14 +274,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock index 35fc42a83d4..b779cdd1b05 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -279,14 +279,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock index e34aa5e0f50..1563bcd44c6 100644 --- a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -272,14 +272,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock index 0393f24d39d..d6cb76f0085 100644 --- a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -111,8 +111,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -270,14 +270,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (< 1) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock index bd15969ee45..846a8d1ca62 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -270,14 +270,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock index 580e5f33e95..b93a8a87198 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -271,14 +271,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock index 6fbb048fd22..9825ccfc619 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -287,14 +287,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock index e42ba0d766c..0cfb0274bc1 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -131,7 +131,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -277,14 +277,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock index c1259f45bde..7d2d06a8bbb 100644 --- a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -125,7 +125,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -269,14 +269,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock index 9ae04c544c2..0ccbbe7388d 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libddprof (0.6.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock index e48b28efcd8..dd9d38ec9d7 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_contrib.gemfile.lock b/gemfiles/ruby_3.0.3_contrib.gemfile.lock index 7b8d75ad1f5..711e19262b0 100644 --- a/gemfiles/ruby_3.0.3_contrib.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1464,7 +1464,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1672,7 +1672,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1692,7 +1692,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) makara (>= 0.6.0.pre) memory_profiler (~> 0.9) mongo (>= 2.8.0, < 2.15.0) diff --git a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock index 60040d7140d..918ad4dad5c 100644 --- a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -174,7 +174,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_core_old.gemfile.lock b/gemfiles/ruby_3.0.3_core_old.gemfile.lock index 7e359388a8c..57f5ca4ae89 100644 --- a/gemfiles/ruby_3.0.3_core_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -144,14 +144,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock index 29f193406a6..b1bf33092ee 100644 --- a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -73,7 +73,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -172,7 +172,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock index e7f675db806..53eddc9e081 100644 --- a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock index 83ddd9493f1..bdf4fd06c30 100644 --- a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock index 992433f1a21..4d0cdb5e172 100644 --- a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) net-protocol (0.1.2) io-wait @@ -281,14 +281,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock index 8fd46b64c20..6537b96d6f8 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -281,14 +281,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock index d32c0525e6d..3ec62e15dd2 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -282,14 +282,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock index 6bb56b576ff..739a3947251 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -136,7 +136,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -293,14 +293,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock index 91bf8451a75..940c0b61c5e 100644 --- a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -280,14 +280,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) net-smtp opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock index 85430977342..d9a5e047a5c 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock index df3c3d5774e..b0d8dfb4787 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_contrib.gemfile.lock b/gemfiles/ruby_3.1.1_contrib.gemfile.lock index 6f6d63a4521..b4ee57044da 100644 --- a/gemfiles/ruby_3.1.1_contrib.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1464,7 +1464,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1672,7 +1672,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1692,7 +1692,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) makara (>= 0.6.0.pre) memory_profiler (~> 0.9) mongo (>= 2.8.0, < 2.15.0) diff --git a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock index 4c0a9106fe4..60d764c8e1a 100644 --- a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -174,7 +174,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_core_old.gemfile.lock b/gemfiles/ruby_3.1.1_core_old.gemfile.lock index c8273317b9f..cbdd9b924a2 100644 --- a/gemfiles/ruby_3.1.1_core_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -144,14 +144,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock index 234e1fff007..8140d9360ba 100644 --- a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -73,7 +73,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -164,7 +164,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -172,7 +172,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock index 71291ff56a7..234e436cc54 100644 --- a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock index ef08152b2d1..3ba58082d83 100644 --- a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -95,7 +95,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -195,7 +195,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -203,7 +203,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock index 0abe1ea4269..2cd2fc9488d 100644 --- a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) mysql2 (0.5.3) net-protocol (0.1.2) io-wait @@ -281,14 +281,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) mysql2 (~> 0.5) diff --git a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock index 378e885e320..622a4692a96 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -281,14 +281,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock index 3e6161a8c12..22de865ba0c 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -282,14 +282,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock index 36d12836cfb..01cdf8b4c18 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -136,7 +136,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -293,14 +293,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock index 0b64c0bcea2..faf5b1749d6 100644 --- a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.2) io-wait timeout @@ -280,14 +280,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) net-smtp opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock index d9b86cb848d..37867cf9456 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock index fb085de3be5..25922167f57 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -56,7 +56,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -166,14 +166,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_contrib.gemfile.lock b/gemfiles/ruby_3.2.0_contrib.gemfile.lock index a61abb78063..3da795fea0d 100644 --- a/gemfiles/ruby_3.2.0_contrib.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1467,7 +1467,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1671,7 +1671,7 @@ DEPENDENCIES appraisal (~> 2.2) aws-sdk benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -1691,7 +1691,7 @@ DEPENDENCIES hiredis http httpclient - json-schema + json-schema (< 3) makara (>= 0.6.0.pre) memory_profiler (~> 0.9) mongo (>= 2.8.0, < 2.15.0) diff --git a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock index cb9b358f5f7..0ee7fc59aa8 100644 --- a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -160,7 +160,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -170,7 +170,7 @@ DEPENDENCIES elasticsearch (< 8.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) graphql (>= 1.12.0, < 2.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_core_old.gemfile.lock b/gemfiles/ruby_3.2.0_core_old.gemfile.lock index 55de13e80a1..47eea2208e0 100644 --- a/gemfiles/ruby_3.2.0_core_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -54,7 +54,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -140,14 +140,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (~> 4) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock index 413de92d740..6c0c3a4bad1 100644 --- a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -72,7 +72,7 @@ GEM ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -160,7 +160,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -168,7 +168,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock index 2d7eb4bb8fd..d4ebe9f3dff 100644 --- a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -94,7 +94,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -191,7 +191,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -199,7 +199,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock index 817be53294f..6bca31d7802 100644 --- a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -94,7 +94,7 @@ GEM method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -191,7 +191,7 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby @@ -199,7 +199,7 @@ DEPENDENCIES ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock index 63a7fd4fc9e..9ec3a51f47a 100644 --- a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -276,14 +276,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock index a14aeb95932..8e9dd330fb8 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -277,14 +277,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock index ae07ea54d8a..c96e895cc0b 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -278,14 +278,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock index 5a08f744155..4af0dd6862e 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -135,7 +135,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -289,14 +289,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) lograge (~> 0.11) memory_profiler (~> 0.9) net-smtp diff --git a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock index 1fd37366a9b..866d53d425f 100644 --- a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -129,7 +129,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.1) + msgpack (1.5.3) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -276,14 +276,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) net-smtp opentracing (>= 0.4.1) diff --git a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock index c98523d3907..88ee7aaf927 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -162,14 +162,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) diff --git a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock index ad7ca0ab0b9..45968a44ab8 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.1.0) + ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) libddprof (~> 0.6.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -55,7 +55,7 @@ GEM memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.1) + msgpack (1.5.3) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -162,14 +162,14 @@ DEPENDENCIES addressable (~> 2.4.0) appraisal (~> 2.2) benchmark-ips (~> 2.8) - benchmark-memory (~> 0.1) + benchmark-memory (< 0.2) builder climate_control (~> 0.2.0) concurrent-ruby ddtrace! dogstatsd-ruby (>= 3.3.0, != 5.1.0, != 5.0.1, != 5.0.0) google-protobuf (~> 3.0, != 3.7.1, != 3.7.0) - json-schema + json-schema (< 3) memory_profiler (~> 0.9) opentracing (>= 0.4.1) os (~> 1.1) From 67e6e1e2858c41769f45f8371b2fb1b861ac21cc Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 11 Jul 2022 15:57:52 +0200 Subject: [PATCH 0210/2133] Sinatra integration --- integration/apps/sinatra/Dockerfile | 25 +++++ integration/apps/sinatra/Dockerfile-ci | 13 +++ integration/apps/sinatra/Gemfile | 38 ++++++++ integration/apps/sinatra/README.md | 91 +++++++++++++++++++ integration/apps/sinatra/app/acme.rb | 70 ++++++++++++++ integration/apps/sinatra/bin/run | 24 +++++ integration/apps/sinatra/bin/setup | 17 ++++ integration/apps/sinatra/bin/test | 24 +++++ integration/apps/sinatra/config.ru | 4 + integration/apps/sinatra/config/puma.rb | 14 +++ integration/apps/sinatra/config/unicorn.rb | 23 +++++ .../apps/sinatra/docker-compose.ci.yml | 67 ++++++++++++++ integration/apps/sinatra/docker-compose.yml | 81 +++++++++++++++++ integration/apps/sinatra/script/build-images | 35 +++++++ integration/apps/sinatra/script/ci | 58 ++++++++++++ .../sinatra/spec/integration/basic_spec.rb | 13 +++ integration/apps/sinatra/spec/spec_helper.rb | 16 ++++ .../spec/support/integration_helper.rb | 27 ++++++ 18 files changed, 640 insertions(+) create mode 100644 integration/apps/sinatra/Dockerfile create mode 100644 integration/apps/sinatra/Dockerfile-ci create mode 100644 integration/apps/sinatra/Gemfile create mode 100644 integration/apps/sinatra/README.md create mode 100644 integration/apps/sinatra/app/acme.rb create mode 100755 integration/apps/sinatra/bin/run create mode 100755 integration/apps/sinatra/bin/setup create mode 100755 integration/apps/sinatra/bin/test create mode 100644 integration/apps/sinatra/config.ru create mode 100644 integration/apps/sinatra/config/puma.rb create mode 100644 integration/apps/sinatra/config/unicorn.rb create mode 100644 integration/apps/sinatra/docker-compose.ci.yml create mode 100644 integration/apps/sinatra/docker-compose.yml create mode 100755 integration/apps/sinatra/script/build-images create mode 100755 integration/apps/sinatra/script/ci create mode 100644 integration/apps/sinatra/spec/integration/basic_spec.rb create mode 100644 integration/apps/sinatra/spec/spec_helper.rb create mode 100644 integration/apps/sinatra/spec/support/integration_helper.rb diff --git a/integration/apps/sinatra/Dockerfile b/integration/apps/sinatra/Dockerfile new file mode 100644 index 00000000000..201df0e5c3f --- /dev/null +++ b/integration/apps/sinatra/Dockerfile @@ -0,0 +1,25 @@ +# Select base image +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Setup specific version of ddtrace, if specified. +ARG ddtrace_git +ENV DD_DEMO_ENV_GEM_GIT_DDTRACE ${ddtrace_git} + +ARG ddtrace_ref +ENV DD_DEMO_ENV_GEM_REF_DDTRACE ${ddtrace_ref} + +# Install dependencies +COPY Gemfile /app/Gemfile +RUN bundle install + +# Add files +COPY . /app + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] +CMD ["bin/setup && bin/run"] diff --git a/integration/apps/sinatra/Dockerfile-ci b/integration/apps/sinatra/Dockerfile-ci new file mode 100644 index 00000000000..7eb3d041256 --- /dev/null +++ b/integration/apps/sinatra/Dockerfile-ci @@ -0,0 +1,13 @@ +# Select base image +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +# Add gem +COPY . /vendor/dd-trace-rb + +# Install dependencies +ENV DD_DEMO_ENV_GEM_LOCAL_DDTRACE /vendor/dd-trace-rb + +RUN /vendor/dd-demo/build_ddtrace_profiling_native_extension.rb + +RUN bundle install diff --git a/integration/apps/sinatra/Gemfile b/integration/apps/sinatra/Gemfile new file mode 100644 index 00000000000..8b1a1954cf6 --- /dev/null +++ b/integration/apps/sinatra/Gemfile @@ -0,0 +1,38 @@ +require 'datadog/demo_env' + +source 'https://rubygems.org' do + gem 'puma' + gem 'unicorn' + gem 'sinatra' + gem 'rake' + + gem 'dogstatsd-ruby' + # Choose correct specs for 'ddtrace' demo environment + gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') + + # Needed for ddtrace profiling + google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' + ] + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions + else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' + end + + # Development + gem 'pry-byebug' + # gem 'pry-stack_explorer', platform: :ruby + # gem 'rbtrace' + # gem 'ruby-prof' + + gem 'rspec' + gem 'rspec-wait' + gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick +end diff --git a/integration/apps/sinatra/README.md b/integration/apps/sinatra/README.md new file mode 100644 index 00000000000..de6f1976b68 --- /dev/null +++ b/integration/apps/sinatra/README.md @@ -0,0 +1,91 @@ +# Sinatra: Demo application for Datadog APM + +A generic Sinatra web application with some common use scenarios. + +For generating Datadog APM traces and profiles. + +## Installation + +Install [direnv](https://github.com/direnv/direnv) for applying local settings. + +1. `cp .envrc.sample .envrc` and add your Datadog API key. +2. `direnv allow` to load the env var. +4. `docker-compose run --rm app bin/setup` + +## Running the application + +### To monitor performance of Docker containers with Datadog + +```sh +docker run --rm --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e API_KEY=$DD_API_KEY datadog/docker-dd-agent:latest +``` + +### Starting the web server + +Run `docker-compose up` to auto-start the webserver. It should bind to `localhost:80`. + +Alternatively, you can run it manually with: + +```sh +docker-compose run --rm -p 80:80 app "bin/run " +``` + +The `` argument is optional, and will default to `DD_DEMO_ENV_PROCESS` if not provided. See [Processes](#processes) for more details. + +##### Processes + +Within the container, run `bin/run ` where `` is one of the following values: + + - `puma`: Puma web server + - `unicorn`: Unicorn web server + - `webrick`: WEBrick web server + - `irb`: IRB session + + Alternatively, set `DD_DEMO_ENV_PROCESS` to run a particular process by default when `bin/run` is run. + +##### Features + +Set `DD_DEMO_ENV_FEATURES` to a comma-delimited list of any of the following values to activate the feature: + + - `tracing`: Tracing instrumentation + - `profiling`: Profiling (NOTE: Must also set `DD_PROFILING_ENABLED` to match.) + - `debug`: Enable diagnostic debug mode + - `analytics`: Enable trace analytics + - `runtime_metrics`: Enable runtime metrics + - `pprof_to_file`: Dump profiling pprof to file instead of agent. + +e.g. `DD_DEMO_ENV_FEATURES=tracing,profiling` + +##### Routes + +```sh +# Health check +curl -v localhost/health + +# Basic demo scenarios +curl -v localhost/basic/fibonacci +curl -v -XPOST localhost/basic/default +``` + +### Load tester + +Docker configuration automatically creates and runs [Wrk](https://github.com/wg/wrk) load testing containers. By default it runs the `basic/default` scenario described in the `wrk` image to give a baseload. + +You can modify the `load-tester` container in `docker-compose.yml` to change the load type or scenario run. Set the container's `command` to any set of arguments `wrk` accepts. + +You can also define your own custom scenario by creating a LUA file, mounting it into the container, and passing it as an argument via `command`. + +### Running integration tests + +You can run integration tests using the following and substituting for the Ruby major and minor version (e.g. `2.7`) + +```sh +./script/build-images -v +./script/ci -v +``` + +Or inside a running container: + +```sh +./bin/test +``` diff --git a/integration/apps/sinatra/app/acme.rb b/integration/apps/sinatra/app/acme.rb new file mode 100644 index 00000000000..7bfcf3e8b22 --- /dev/null +++ b/integration/apps/sinatra/app/acme.rb @@ -0,0 +1,70 @@ +require 'sinatra/base' +require 'ddtrace' + +Datadog.configure do |c| + c.service = 'acme-sinatra' + c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') + c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics') + + if Datadog::DemoEnv.feature?('tracing') + c.tracing.analytics.enabled = true if Datadog::DemoEnv.feature?('analytics') + c.tracing.instrument :sinatra + end + + if Datadog::DemoEnv.feature?('appsec') + c.appsec.enabled = true + + c.appsec.instrument :rack + end + + if Datadog::DemoEnv.feature?('pprof_to_file') + # Reconfigure transport to write pprof to file + c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport + end +end + +class Acme < Sinatra::Base + register Datadog::Tracing::Contrib::Sinatra::Tracer + + get '/' do + 'Hello world!' + end + + get '/health' do + 204 + end + + get '/health/detailed' do + [ + 200, + { 'Content-Type' => 'application/json' }, + JSON.generate( + webserver_process: $PROGRAM_NAME, + profiler_available: Datadog::Profiling.start_if_enabled, + # NOTE: Threads can't be named on Ruby 2.1 and 2.2 + profiler_threads: ((Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }) unless RUBY_VERSION < '2.3') + ) + ] + end + + get '/basic/default' do + status 204 + end + + get '/basic/fibonacci' do + n = rand(25..35) + result = fib(n) + + [ + 200, + { 'Content-Type' => 'text/plain' }, + ["Basic: Fibonacci(#{n}): #{result}"] + ] + end + + private + + def fib(n) + n <= 1 ? n : fib(n-1) + fib(n-2) + end +end diff --git a/integration/apps/sinatra/bin/run b/integration/apps/sinatra/bin/run new file mode 100755 index 00000000000..c12a0769980 --- /dev/null +++ b/integration/apps/sinatra/bin/run @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' + +puts "\n== Starting application process ==" + +process = (ARGV[0] || Datadog::DemoEnv.process) +command = case process + when 'puma' + "bundle exec ddtracerb exec puma -C /app/config/puma.rb /app/config.ru" + when 'unicorn' + "bundle exec ddtracerb exec unicorn --port 80 -c /app/config/unicorn.rb /app/config.ru" + when 'webrick' + "bundle exec ddtracerb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" + when 'irb' + "bundle exec ddtracerb exec irb" + when nil, '' + abort("\n== ERROR: Must specify a application process! ==") + else + abort("\n== ERROR: Unknown application process '#{process}' ==") + end + +puts "Run: #{command}" +Kernel.exec(command) diff --git a/integration/apps/sinatra/bin/setup b/integration/apps/sinatra/bin/setup new file mode 100755 index 00000000000..1d18191decd --- /dev/null +++ b/integration/apps/sinatra/bin/setup @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + puts "Run: #{args.join(' ')}" + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + puts "\n== Installing dependencies ==" + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') +end diff --git a/integration/apps/sinatra/bin/test b/integration/apps/sinatra/bin/test new file mode 100755 index 00000000000..d227d2c2ed5 --- /dev/null +++ b/integration/apps/sinatra/bin/test @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + puts "Run: #{args.join(' ')}" + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + puts "\n== Performing setup ==" + system!('./bin/setup') + + if ENV['TEST_INTEGRATION'] + puts "\n== Wait for healthy HTTP server... ==" + system!('bash /vendor/dd-demo/http-health-check') + end + + puts "\n== Run test suite ==" + system!('rspec') +end diff --git a/integration/apps/sinatra/config.ru b/integration/apps/sinatra/config.ru new file mode 100644 index 00000000000..d46d610d3d3 --- /dev/null +++ b/integration/apps/sinatra/config.ru @@ -0,0 +1,4 @@ +require 'datadog/demo_env' +require_relative 'app/acme' + +run Acme diff --git a/integration/apps/sinatra/config/puma.rb b/integration/apps/sinatra/config/puma.rb new file mode 100644 index 00000000000..39caa82a4b5 --- /dev/null +++ b/integration/apps/sinatra/config/puma.rb @@ -0,0 +1,14 @@ +require 'datadog/demo_env' + +Datadog::DemoEnv.print_env('Puma master environment') + +workers Integer(ENV["WEB_CONCURRENCY"] || 1) +threads 2, Integer(ENV['WEB_MAX_THREADS'] || 24) + +preload_app! + +bind 'tcp://0.0.0.0:80' + +on_worker_boot do + Datadog::DemoEnv.print_env('Puma worker environment') +end diff --git a/integration/apps/sinatra/config/unicorn.rb b/integration/apps/sinatra/config/unicorn.rb new file mode 100644 index 00000000000..4644b64b9c2 --- /dev/null +++ b/integration/apps/sinatra/config/unicorn.rb @@ -0,0 +1,23 @@ +require 'datadog/demo_env' + +# config/unicorn.rb +worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) +timeout 15 +preload_app true + +Datadog::DemoEnv.print_env('Unicorn master environment') + +before_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn master intercepting TERM and sending myself QUIT instead' + Process.kill 'QUIT', Process.pid + end +end + +after_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' + end + + Datadog::DemoEnv.print_env('Unicorn worker environment') +end diff --git a/integration/apps/sinatra/docker-compose.ci.yml b/integration/apps/sinatra/docker-compose.ci.yml new file mode 100644 index 00000000000..14cacbf188a --- /dev/null +++ b/integration/apps/sinatra/docker-compose.ci.yml @@ -0,0 +1,67 @@ +version: '3.4' +services: + app: + # Build at dd-trace-rb level to copy in current code + # and use it as the `ddtrace` gem. + build: + context: ../../.. + dockerfile: integration/apps/sinatra/Dockerfile-ci + args: + BASE_IMAGE: ${APP_IMAGE} + depends_on: + - ddagent + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - DD_METRIC_AGENT_PORT=8125 + - DD_TRACE_AGENT_PORT=8126 + - DD_HEALTH_METRICS_ENABLED=true + - DD_SERVICE=acme-sinatra + - DD_PROFILING_ENABLED=true + # Use these to choose what is run + - DD_DEMO_ENV_PROCESS # needs to be specified, see README for available options + - DD_DEMO_ENV_FEATURES=tracing + expose: + - "80" + stdin_open: true + tty: true + ddagent: + image: datadog/dd-apm-demo:agent + environment: + - DD_APM_ENABLED=true + - DD_PROCESS_AGENT_ENABLED=false + - DD_BIND_HOST=0.0.0.0 + - DD_API_KEY=00000000000000000000000000000000 + - LOG_LEVEL=DEBUG + - DD_LOGS_STDOUT=yes + - DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true + expose: + - "8125/udp" + - "8126" + # Build at dd-trace-rb level to copy in current code + # and use it as the `ddtrace` gem. + integration-tester: + build: + context: ../../.. + dockerfile: integration/apps/sinatra/Dockerfile-ci + args: + BASE_IMAGE: ${APP_IMAGE} + command: bin/test + depends_on: + - app + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - TEST_HOSTNAME=app + - TEST_PORT=80 + - TEST_INTEGRATION=true + - HEALTH_CHECK_URL=http://app/health + - HEALTH_CHECK_INTERVAL=1 + - HEALTH_CHECK_MAX_ATTEMPTS=30 + # volumes: + # - .:/app + # - ../../images/include:/vendor/dd-demo + # - ../../..:/vendor/dd-trace-rb + redis: + image: redis:6.2-buster + expose: + - "6379" diff --git a/integration/apps/sinatra/docker-compose.yml b/integration/apps/sinatra/docker-compose.yml new file mode 100644 index 00000000000..79fbf0cc616 --- /dev/null +++ b/integration/apps/sinatra/docker-compose.yml @@ -0,0 +1,81 @@ +version: '3.4' +services: + app: + build: + context: . + args: + BASE_IMAGE: datadog/dd-apm-demo:rb-2.7 + depends_on: + - ddagent + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - DD_METRIC_AGENT_PORT=8125 + - DD_TRACE_AGENT_PORT=8126 + - DD_HEALTH_METRICS_ENABLED=true + - DD_SERVICE=acme-sinatra + - DD_PROFILING_ENABLED=true + # Use these to choose what is run + - DD_DEMO_ENV_PROCESS=puma + # - DD_DEMO_ENV_FEATURES=tracing,profiling + - DD_DEMO_ENV_FEATURES=tracing + # Use this for a local version of ddtrace + - DD_DEMO_ENV_GEM_LOCAL_DDTRACE=/vendor/dd-trace-rb + # Use these for a specific revision of ddtrace + # - DD_DEMO_ENV_GEM_GIT_DDTRACE=https://github.com/DataDog/dd-trace-rb.git + # - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a + # Enable building the profiling native extension + # - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + expose: + - "80" + stdin_open: true + tty: true + volumes: + - .:/app + - ./data/app:/data/app + - bundle:/usr/local/bundle + - ../../images/include:/vendor/dd-demo + - ../../..:/vendor/dd-trace-rb + ddagent: + image: datadog/dd-apm-demo:agent + environment: + - DD_APM_ENABLED=true + - DD_PROCESS_AGENT_ENABLED=false + - DD_BIND_HOST=0.0.0.0 + - DD_API_KEY + - LOG_LEVEL=DEBUG + - DD_LOGS_STDOUT=yes + - DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true + expose: + - "8125/udp" + - "8126" + volumes: + - ../../images/agent/agent.yaml:/etc/datadog-agent/datadog.yaml + # For monitoring performance of containers (e.g. CPU, Memory, etc...) + # - type: bind + # source: ../../images/agent/agent.yaml + # target: /etc/datadog-agent/datadog.yaml + # - type: bind + # source: /var/run/docker.sock + # target: /var/run/docker.sock:ro + # - type: bind + # source: /proc/ + # target: /host/proc/:ro + # - type: bind + # source: /sys/fs/cgroup/ + # target: /host/sys/fs/cgroup:ro + load-tester: + build: + context: ../../images + dockerfile: wrk/Dockerfile + command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/fibonacci + depends_on: + - app + environment: + - HEALTH_CHECK_URL=http://app/health + - HEALTH_CHECK_INTERVAL=1 + - HEALTH_CHECK_MAX_ATTEMPTS=60 + volumes: + - ../../images/wrk/scripts:/scripts +volumes: + bundle: diff --git a/integration/apps/sinatra/script/build-images b/integration/apps/sinatra/script/build-images new file mode 100755 index 00000000000..d5ebf40b786 --- /dev/null +++ b/integration/apps/sinatra/script/build-images @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +APP_DIR=${APP_SCRIPT_DIR%/script} +cd $APP_DIR + +while getopts ":v:" opt; do + case $opt in + v) + APP_RUBY_VERSION=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +echo "== Building Sinatra images... ==" +if [ -v APP_RUBY_VERSION ]; then + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-rack . +else + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.0 -t datadog/dd-apm-demo:rb-3.0-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.1 -t datadog/dd-apm-demo:rb-3.1-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.2 -t datadog/dd-apm-demo:rb-3.2-sinatra . + # ADD NEW RUBIES HERE +fi +echo "== Done building Sinatra images. ==" diff --git a/integration/apps/sinatra/script/ci b/integration/apps/sinatra/script/ci new file mode 100755 index 00000000000..33695feb04d --- /dev/null +++ b/integration/apps/sinatra/script/ci @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +APP_DIR=${APP_SCRIPT_DIR%/script} +cd $APP_DIR + +# Parse options +while getopts "v:" opt; do + case $opt in + v) + APP_RUBY_VERSION=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +# Validate options +if [ -z ${APP_RUBY_VERSION+x} ]; then + echo "You must specify a Ruby version with -v. (e.g. 2.7)" >&2 + exit 1 +fi + +# Set configuration +APP_BASE_IMAGE=${APP_BASE_IMAGE:-datadog/dd-apm-demo:rb-$APP_RUBY_VERSION} +APP_IMAGE=${APP_IMAGE:-$APP_BASE_IMAGE-sinatra} +APP_COMPOSE_FILES="-f docker-compose.ci.yml" + +echo "== Running integration tests... ==" +echo " - App: Sinatra" +echo " - Ruby version: $APP_RUBY_VERSION" +echo " - Base image: $APP_BASE_IMAGE" +echo " - App image: $APP_IMAGE" +echo "" + +# Pull/build any missing images +APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES build + +# Run the test suite with the different web servers +for DD_DEMO_ENV_PROCESS in puma unicorn webrick +do + echo -e "\n== Running with $DD_DEMO_ENV_PROCESS ================================================\n" + + export DD_DEMO_ENV_PROCESS + + APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES run integration-tester || \ + (APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES logs && exit -1) # Print container logs on `run` failure + + # Cleanup + APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES down -t 0 --remove-orphans +done diff --git a/integration/apps/sinatra/spec/integration/basic_spec.rb b/integration/apps/sinatra/spec/integration/basic_spec.rb new file mode 100644 index 00000000000..8469487a8f8 --- /dev/null +++ b/integration/apps/sinatra/spec/integration/basic_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' +require 'rspec/wait' +require 'securerandom' +require 'json' + +RSpec.describe 'Basic scenarios' do + include_context 'integration test' + + context 'default' do + subject { get('basic/default') } + it { is_expected.to be_a_kind_of(Net::HTTPOK) } + end +end diff --git a/integration/apps/sinatra/spec/spec_helper.rb b/integration/apps/sinatra/spec/spec_helper.rb new file mode 100644 index 00000000000..a77dd7398c6 --- /dev/null +++ b/integration/apps/sinatra/spec/spec_helper.rb @@ -0,0 +1,16 @@ +require 'byebug' +require 'support/integration_helper' + +RSpec.configure do |config| + config.include IntegrationHelper + + config.expect_with :rspec do |expectations| + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true + end + + config.shared_context_metadata_behavior = :apply_to_host_groups +end diff --git a/integration/apps/sinatra/spec/support/integration_helper.rb b/integration/apps/sinatra/spec/support/integration_helper.rb new file mode 100644 index 00000000000..76d4b297bfa --- /dev/null +++ b/integration/apps/sinatra/spec/support/integration_helper.rb @@ -0,0 +1,27 @@ +require 'net/http' + +module IntegrationHelper + shared_context 'integration test' do + before do + skip 'Integration tests not enabled.' unless ENV['TEST_INTEGRATION'] + end + + def hostname + ENV['TEST_HOSTNAME'] + end + + def port + ENV['TEST_PORT'] + end + + def get(path) + uri = URI("http://#{hostname}:#{port}/#{path}") + Net::HTTP.get_response(uri) + end + + def post(path, arguments) + uri = URI("http://#{hostname}:#{port}/#{path}") + Net::HTTP.post_form(uri, arguments) + end + end +end From 239c04678edb9e969f70b46a0c6bf2f9a81a4250 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 11 Jul 2022 11:03:23 -0700 Subject: [PATCH 0211/2133] Update lib/datadog/tracing/sampling/span/sampler.rb Co-authored-by: Ivo Anjo --- lib/datadog/tracing/sampling/span/sampler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index 0f789e8678f..178a612f479 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -23,7 +23,7 @@ def initialize(rules = []) end # Applies sampling rules to the span if the trace has been rejected. - # The tracer can be outright rejected, and never reach the transport, + # The trace can be outright rejected, and never reach the transport, # or be set as rejected by priority sampling. In both cases, the trace # is considered rejected for Single Span Sampling purposes. # From 633071262ed34dd82451ea008be0ae5ddf833517 Mon Sep 17 00:00:00 2001 From: Yuki Murasawa Date: Tue, 12 Jul 2022 17:44:01 +0900 Subject: [PATCH 0212/2133] fix typo --- lib/datadog/tracing.rb | 12 ++++++------ lib/datadog/tracing/sampling/priority_sampler.rb | 2 +- .../tracing/sampling/rate_by_service_sampler.rb | 2 +- lib/datadog/tracing/sampling/rate_sampler.rb | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/datadog/tracing.rb b/lib/datadog/tracing.rb index 7a98a1735bf..45af0a38766 100644 --- a/lib/datadog/tracing.rb +++ b/lib/datadog/tracing.rb @@ -18,7 +18,7 @@ def trace(name, continue_from: nil, **span_options, &block) tracer.trace(name, continue_from: continue_from, **span_options, &block) end - # (see Datadog:::Tracing::Tracer#continue_trace!) + # (see Datadog::Tracing::Tracer#continue_trace!) # @public_api def continue_trace!(digest, &block) tracer.continue_trace!(digest, &block) @@ -45,7 +45,7 @@ def active_trace current_tracer.active_trace end - # (see Datadog:::Tracing::Tracer#active_span) + # (see Datadog::Tracing::Tracer#active_span) # @public_api def active_span current_tracer = tracer @@ -54,7 +54,7 @@ def active_span current_tracer.active_span end - # (see Datadog:::Tracing::TraceSegment#keep!) + # (see Datadog::Tracing::TraceSegment#keep!) # If no trace is active, no action is taken. # @public_api def keep! @@ -62,7 +62,7 @@ def keep! active_trace.keep! if trace end - # (see Datadog:::Tracing::TraceSegment#reject!) + # (see Datadog::Tracing::TraceSegment#reject!) # If no trace is active, no action is taken. # @public_api def reject! @@ -70,7 +70,7 @@ def reject! active_trace.reject! if trace end - # (see Datadog:::Tracing::Tracer#active_correlation) + # (see Datadog::Tracing::Tracer#active_correlation) # @public_api def correlation current_tracer = tracer @@ -113,7 +113,7 @@ def shutdown! current_tracer.shutdown! end - # (see Datadog:::Tracing::Pipeline.before_flush) + # (see Datadog::Tracing::Pipeline.before_flush) def before_flush(*processors, &processor_block) Pipeline.before_flush(*processors, &processor_block) end diff --git a/lib/datadog/tracing/sampling/priority_sampler.rb b/lib/datadog/tracing/sampling/priority_sampler.rb index 8469643b957..52ec9320b98 100644 --- a/lib/datadog/tracing/sampling/priority_sampler.rb +++ b/lib/datadog/tracing/sampling/priority_sampler.rb @@ -8,7 +8,7 @@ module Datadog module Tracing module Sampling - # {Datadog:::Tracing::Sampling::PrioritySampler} + # {Datadog::Tracing::Sampling::PrioritySampler} # @public_api class PrioritySampler # NOTE: We do not advise using a pre-sampler. It can save resources, diff --git a/lib/datadog/tracing/sampling/rate_by_service_sampler.rb b/lib/datadog/tracing/sampling/rate_by_service_sampler.rb index 3d8ada1ea3a..7864be44808 100644 --- a/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_by_service_sampler.rb @@ -6,7 +6,7 @@ module Datadog module Tracing module Sampling - # {Datadog:::Tracing::Sampling::RateByServiceSampler} samples different services at different rates + # {Datadog::Tracing::Sampling::RateByServiceSampler} samples different services at different rates # @public_api class RateByServiceSampler < RateByKeySampler DEFAULT_KEY = 'service:,env:'.freeze diff --git a/lib/datadog/tracing/sampling/rate_sampler.rb b/lib/datadog/tracing/sampling/rate_sampler.rb index 5d61e58b084..7fcc13c31d7 100644 --- a/lib/datadog/tracing/sampling/rate_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_sampler.rb @@ -8,12 +8,12 @@ module Datadog module Tracing module Sampling - # {Datadog:::Tracing::Sampling::RateSampler} is based on a sample rate. + # {Datadog::Tracing::Sampling::RateSampler} is based on a sample rate. # @public_api class RateSampler < Sampler KNUTH_FACTOR = 1111111111111111111 - # Initialize a {Datadog:::Tracing::Sampling::RateSampler}. + # Initialize a {Datadog::Tracing::Sampling::RateSampler}. # This sampler keeps a random subset of the traces. Its main purpose is to # reduce the instrumentation footprint. # From 8da91784fac8f9586f98cfac59ebcb28be6d9f88 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 12:21:33 +0100 Subject: [PATCH 0213/2133] Disable building the profiling native extension on Ruby 2.1 This is the first piece of dropping profiling support for Ruby 2.1. Instead of the extension building, customers will get the following message: ``` +------------------------------------------------------------------------------+ | Could not compile the Datadog Continuous Profiler because | | your Ruby version (2.1) is too old to be supported. | | | | The Datadog Continuous Profiler will not be available, | | but all other ddtrace features will work fine! | | | | Upgrade to a modern Ruby to enable profiling for your app. | +------------------------------------------------------------------------------+ ``` (Note that, as the message says, other dd-trace-rb features are untouched and will still work). --- .../native_extension_helpers.rb | 14 ++++ .../native_extension_helpers_spec.rb | 64 +++++++++++-------- spec/datadog/profiling/spec_helper.rb | 1 + 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index c696815d8ca..7de6385ab76 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -86,6 +86,7 @@ def self.unsupported_reason on_macos? || on_unknown_os? || not_on_amd64_or_arm64? || + on_ruby_2_1? || expected_to_use_mjit_but_mjit_is_disabled? || libdatadog_not_usable? end @@ -148,6 +149,10 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global "Get in touch with us if you're interested in profiling your app!" ].freeze + UPGRADE_RUBY = [ + "Upgrade to a modern Ruby to enable profiling for your app." + ].freeze + # Validation for this check is done in extconf.rb because it relies on mkmf FAILED_TO_CONFIGURE_LIBDATADOG = explain_issue( 'there was a problem in setting up the `libdatadog` dependency.', @@ -242,6 +247,15 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global architecture_not_supported unless RUBY_PLATFORM.start_with?('x86_64', 'aarch64') end + private_class_method def self.on_ruby_2_1? + ruby_version_not_supported = explain_issue( + 'your Ruby version (2.1) is too old to be supported.', + suggested: UPGRADE_RUBY, + ) + + ruby_version_not_supported if RUBY_VERSION.start_with?('2.1.') + end + # On some Rubies, we require the mjit header to be present. If Ruby was installed without MJIT support, we also skip # building the extension. private_class_method def self.expected_to_use_mjit_but_mjit_is_disabled? diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index 17c1b1a9633..66ad003cafd 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -118,57 +118,67 @@ it { is_expected.to include 'architecture is not supported' } end - shared_examples 'mjit header validation' do - shared_examples 'libdatadog usable' do - context 'when libdatadog DOES NOT HAVE binaries for the current platform' do - before do - expect(Libdatadog).to receive(:pkgconfig_folder).and_return(nil) - expect(Libdatadog).to receive(:available_binaries).and_return(%w[fooarch-linux bararch-linux-musl]) + shared_examples 'supported ruby validation' do + context 'when not on Ruby 2.1' do + before { stub_const('RUBY_VERSION', '2.2.0') } + + shared_examples 'libdatadog usable' do + context 'when libdatadog DOES NOT HAVE binaries for the current platform' do + before do + expect(Libdatadog).to receive(:pkgconfig_folder).and_return(nil) + expect(Libdatadog).to receive(:available_binaries).and_return(%w[fooarch-linux bararch-linux-musl]) + end + + it { is_expected.to include 'platform variant' } end - it { is_expected.to include 'platform variant' } + context 'when libdatadog HAS BINARIES for the current platform' do + before { expect(Libdatadog).to receive(:pkgconfig_folder).and_return('/simulated/pkgconfig_folder') } + + it('marks the native extension as supported') { is_expected.to be nil } + end end - context 'when libdatadog HAS BINARIES for the current platform' do - before { expect(Libdatadog).to receive(:pkgconfig_folder).and_return('/simulated/pkgconfig_folder') } + context 'on a Ruby version where we CAN NOT use the MJIT header' do + before { stub_const('Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER', false) } - it('marks the native extension as supported') { is_expected.to be nil } + include_examples 'libdatadog usable' end - end - context 'on a Ruby version where we CAN NOT use the MJIT header' do - before { stub_const('Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER', false) } + context 'on a Ruby version where we CAN use the MJIT header' do + before { stub_const('Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER', true) } - include_examples 'libdatadog usable' - end + context 'but DOES NOT have MJIT support' do + before { expect(RbConfig::CONFIG).to receive(:[]).with('MJIT_SUPPORT').and_return('no') } - context 'on a Ruby version where we CAN use the MJIT header' do - before { stub_const('Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER', true) } + it { is_expected.to include 'without JIT' } + end - context 'but DOES NOT have MJIT support' do - before { expect(RbConfig::CONFIG).to receive(:[]).with('MJIT_SUPPORT').and_return('no') } + context 'and DOES have MJIT support' do + before { expect(RbConfig::CONFIG).to receive(:[]).with('MJIT_SUPPORT').and_return('yes') } - it { is_expected.to include 'without JIT' } + include_examples 'libdatadog usable' + end end + end - context 'and DOES have MJIT support' do - before { expect(RbConfig::CONFIG).to receive(:[]).with('MJIT_SUPPORT').and_return('yes') } + context 'when on Ruby 2.1' do + before { stub_const('RUBY_VERSION', '2.1.10') } - include_examples 'libdatadog usable' - end + it { is_expected.to include '(2.1) is too old' } end end context 'when on amd64 (x86-64) linux' do before { stub_const('RUBY_PLATFORM', 'x86_64-linux') } - include_examples 'mjit header validation' + include_examples 'supported ruby validation' end context 'when on arm64 (aarch64) linux' do before { stub_const('RUBY_PLATFORM', 'aarch64-linux') } - include_examples 'mjit header validation' + include_examples 'supported ruby validation' end context 'when macOS testing override is enabled' do @@ -176,7 +186,7 @@ before { stub_const('RUBY_PLATFORM', 'x86_64-darwin19') } - include_examples 'mjit header validation' + include_examples 'supported ruby validation' end end end diff --git a/spec/datadog/profiling/spec_helper.rb b/spec/datadog/profiling/spec_helper.rb index c9b1bc8252d..f31b217195d 100644 --- a/spec/datadog/profiling/spec_helper.rb +++ b/spec/datadog/profiling/spec_helper.rb @@ -34,6 +34,7 @@ def build_stack_sample( def skip_if_profiling_not_supported(testcase) testcase.skip('Profiling is not supported on JRuby') if PlatformHelpers.jruby? testcase.skip('Profiling is not supported on TruffleRuby') if PlatformHelpers.truffleruby? + testcase.skip('Profiling is not supported on Ruby 2.1') if RUBY_VERSION.start_with?('2.1.') # Profiling is not officially supported on macOS due to missing libdatadog binaries, # but it's still useful to allow it to be enabled for development. From d82d5085095c6ee41d1b855a3d7e09746d3bd2ef Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 12:29:14 +0100 Subject: [PATCH 0214/2133] Remove hacks and exceptions needed to support Ruby 2.1 in profiling native extension Less weird exceptions to maintain, yay! --- .../collectors_stack.c | 4 +-- .../extconf.rb | 14 ++------- .../private_vm_api_access.c | 30 ++----------------- .../private_vm_api_access.h | 6 +--- .../stack_recorder.h | 2 +- 5 files changed, 8 insertions(+), 48 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 0f9115cfd37..f70353ddcf3 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -137,8 +137,8 @@ void sample_thread(VALUE thread, sampling_buffer* buffer, VALUE recorder_instanc // **IMPORTANT**: Be very careful when calling any `rb_profile_frame_...` API with a non-Ruby frame, as legacy // Rubies may assume that what's in a buffer will lead to a Ruby frame. // - // In particular for Ruby 2.2 and below the buffer contains a Ruby string (see the notes on our custom - // rb_profile_frames for Ruby 2.2 and below) and CALLING **ANY** OF THOSE APIs ON IT WILL CAUSE INSTANT VM CRASHES + // In particular for Ruby 2.2 the buffer contains a Ruby string (see the notes on our custom + // rb_profile_frames for Ruby 2.2) and CALLING **ANY** OF THOSE APIs ON IT WILL CAUSE INSTANT VM CRASHES #ifndef USE_LEGACY_RB_PROFILE_FRAMES // Modern Rubies name = ddtrace_rb_profile_frame_method_name(buffer->stack_buffer[i]); diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 72132f0393a..6763abcb1be 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -105,7 +105,7 @@ def add_compiler_flag(flag) # have_library 'pthread' # have_func 'pthread_getcpuclockid' # ``` - # but it broke the build on Windows and on older Ruby versions (2.1 and 2.2) + # but it broke the build on Windows and on older Ruby versions (2.2) # so instead we just assume that we have the function we need on Linux, and nowhere else $defs << '-DHAVE_PTHREAD_GETCPUCLOCKID' end @@ -135,9 +135,6 @@ def add_compiler_flag(flag) $defs << '-DUSE_LEGACY_RB_PROFILE_FRAMES' end -# In Ruby 2.1, living_threads were stored in a hashmap (st) -$defs << '-DUSE_LEGACY_LIVING_THREADS_ST' if RUBY_VERSION < '2.2' - # If we got here, libdatadog is available and loaded ENV['PKG_CONFIG_PATH'] = "#{ENV['PKG_CONFIG_PATH']}:#{Libdatadog.pkgconfig_folder}" Logging.message(" [ddtrace] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") @@ -194,13 +191,6 @@ def add_compiler_flag(flag) # This gem ships source code copies of these VM headers for the different Ruby VM versions; # see https://github.com/ruby-debug/debase-ruby_core_source for details - thread_native_for_ruby_2_1 = proc { true } - if RUBY_VERSION < '2.2' - # This header became public in Ruby 2.2, but we need to pull it from the private headers folder for 2.1 - thread_native_for_ruby_2_1 = proc { have_header('thread_native.h') } - $defs << '-DRUBY_2_1_WORKAROUND' - end - create_header require 'debase/ruby_core_source' @@ -208,7 +198,7 @@ def add_compiler_flag(flag) Debase::RubyCoreSource .create_makefile_with_core( - proc { have_header('vm_core.h') && have_header('iseq.h') && thread_native_for_ruby_2_1.call }, + proc { have_header('vm_core.h') && have_header('iseq.h') }, EXTENSION_NAME, ) end diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index afbd752c135..688378d6bdb 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -68,7 +68,6 @@ ptrdiff_t stack_depth_for(VALUE thread) { #define ccan_list_for_each list_for_each #endif -#ifndef USE_LEGACY_LIVING_THREADS_ST // Ruby > 2.1 // Tries to match rb_thread_list() but that method isn't accessible to extensions VALUE ddtrace_thread_list(void) { VALUE result = rb_ary_new(); @@ -103,31 +102,6 @@ VALUE ddtrace_thread_list(void) { return result; } -#else // USE_LEGACY_LIVING_THREADS_ST -static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, void *result_object); - -// Alternative ddtrace_thread_list implementation for Ruby 2.1. In this Ruby version, living threads were stored in a -// hashmap (st) instead of a list. -VALUE ddtrace_thread_list() { - VALUE result = rb_ary_new(); - st_foreach(thread_struct_from_object(rb_thread_current())->vm->living_threads, ddtrace_thread_list_each, result); - return result; -} - -static int ddtrace_thread_list_each(st_data_t thread_object, st_data_t _value, void *result_object) { - VALUE result = (VALUE) result_object; - rb_thread_t *thread = thread_struct_from_object((VALUE) thread_object); - switch (thread->status) { - case THREAD_RUNNABLE: - case THREAD_STOPPED: - case THREAD_STOPPED_FOREVER: - rb_ary_push(result, thread->self); - default: - break; - } - return ST_CONTINUE; -} -#endif // USE_LEGACY_LIVING_THREADS_ST bool is_thread_alive(VALUE thread) { return thread_struct_from_object(thread)->status != THREAD_KILLED; @@ -620,11 +594,11 @@ calc_lineno(const rb_iseq_t *iseq, const VALUE *pc) // * Check thread status and do not sample if thread has been killed. // // The `rb_profile_frames` function changed quite a bit between Ruby 2.2 and 2.3. Since the change was quite complex -// I opted not to try to extend support to Ruby 2.2 and below using the same custom function, and instead I started +// I opted not to try to extend support to Ruby 2.2 using the same custom function, and instead I started // anew from the Ruby 2.2 version of the function, applying some of the same fixes that we have for the modern version. int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame) { - // **IMPORTANT: THIS IS A CUSTOM RB_PROFILE_FRAMES JUST FOR RUBY 2.2 AND BELOW; + // **IMPORTANT: THIS IS A CUSTOM RB_PROFILE_FRAMES JUST FOR RUBY 2.2; // SEE ABOVE FOR THE FUNCTION THAT GETS USED FOR MODERN RUBIES** int i; diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index 59da7db4d6d..8e92868cbb6 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -6,11 +6,7 @@ // so we use PRIVATE_VM_API_ACCESS_SKIP_RUBY_INCLUDES to be able to include private_vm_api_access.h on that file // without also dragging the incompatible includes #ifndef PRIVATE_VM_API_ACCESS_SKIP_RUBY_INCLUDES - #ifdef RUBY_2_1_WORKAROUND - #include - #else - #include - #endif + #include #endif #include "extconf.h" diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.h b/ext/ddtrace_profiling_native_extension/stack_recorder.h index 2f538882846..cad66904ebf 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.h +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.h @@ -3,7 +3,7 @@ #include // Note: Please DO NOT use `VALUE_STRING` anywhere else, instead use `DDPROF_FFI_CHARSLICE_C`. -// `VALUE_STRING` is only needed because older versions of gcc (4.9.2, used in our Ruby 2.1 and 2.2 CI test images) +// `VALUE_STRING` is only needed because older versions of gcc (4.9.2, used in our Ruby 2.2 CI test images) // tripped when compiling `enabled_value_types` using `-std=gnu99` due to the extra cast that is included in // `DDPROF_FFI_CHARSLICE_C` with the following error: // From dedf521e82a51fe25515ae5cbbebe25b749259cb Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 13:59:38 +0100 Subject: [PATCH 0215/2133] Remove Ruby 2.1-specific checks from profiler tests --- .../profiling/collectors/old_stack_spec.rb | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/spec/datadog/profiling/collectors/old_stack_spec.rb b/spec/datadog/profiling/collectors/old_stack_spec.rb index 61cb59a4132..63a81478811 100644 --- a/spec/datadog/profiling/collectors/old_stack_spec.rb +++ b/spec/datadog/profiling/collectors/old_stack_spec.rb @@ -23,8 +23,7 @@ end before do - skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? - skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? + skip_if_profiling_not_supported(self) allow(recorder) .to receive(:[]) @@ -86,9 +85,6 @@ # See cthread.rb for more details before do - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2') - skip 'Test case only applies to Ruby 2.2+ (previous versions did not have the Process::Waiter class)' - end skip 'Test case only applies to MRI Ruby' if RUBY_ENGINE != 'ruby' end @@ -484,9 +480,6 @@ context 'Process::Waiter crash regression tests' do before do - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2') - skip 'Test case only applies to Ruby 2.2+ (previous versions did not have the Process::Waiter class)' - end skip 'Test case only applies to MRI Ruby' if RUBY_ENGINE != 'ruby' end @@ -735,12 +728,6 @@ describe 'Process::Waiter crash regression tests' do # Related to https://bugs.ruby-lang.org/issues/17807 ; see comments on main class for details - before do - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2') - skip 'Test case only applies to Ruby 2.2+ (previous versions did not have the Process::Waiter class)' - end - end - let(:process_waiter_thread) { Process.detach(fork { sleep }) } describe 'the crash' do From ac1eb599dd7680dff26e46b64923db928c6ef956 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 13:59:54 +0100 Subject: [PATCH 0216/2133] Remove references to Ruby 2.1 from profiler comments --- lib/datadog/profiling/stack_recorder.rb | 3 +-- spec/datadog/profiling/http_transport_spec.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index 4b92b09a1f3..329809cb90c 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -23,8 +23,7 @@ def serialize end end - # Used only for Ruby 2.2 and below which don't have the native `rb_time_timespec_new` API - # Called from native code + # Used only for Ruby 2.2 which doesn't have the native `rb_time_timespec_new` API; called from native code def self.ruby_time_from(timespec_seconds, timespec_nanoseconds) Time.at(0).utc + timespec_seconds + (timespec_nanoseconds.to_r / 1_000_000_000) end diff --git a/spec/datadog/profiling/http_transport_spec.rb b/spec/datadog/profiling/http_transport_spec.rb index ce3fb5584b2..15bee7d065e 100644 --- a/spec/datadog/profiling/http_transport_spec.rb +++ b/spec/datadog/profiling/http_transport_spec.rb @@ -358,7 +358,7 @@ if RUBY_VERSION.start_with?('2.2.') # Workaround for webrick bug in Ruby 2.2. - # This `setup_shutdown_pipe` method was added in 2.2 (so 2.1 is not affected) but it had a bug when webrick + # This `setup_shutdown_pipe` method was added in 2.2 but it had a bug when webrick # was configured with `DoNotListen: true` and was never called, which led to failures as webrick requires and # expects it to have been called. # In Ruby 2.3 this was fixed and this method always gets called, even with `DoNotListen: true`. From 992bc20756285821c8b27f3be6f6561ef66c3d16 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 14:03:12 +0100 Subject: [PATCH 0217/2133] Rubocop fixes --- .../native_extension_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 7de6385ab76..0d5b786a7d3 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -150,7 +150,7 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global ].freeze UPGRADE_RUBY = [ - "Upgrade to a modern Ruby to enable profiling for your app." + 'Upgrade to a modern Ruby to enable profiling for your app.' ].freeze # Validation for this check is done in extconf.rb because it relies on mkmf From 003428c41239cf5ac32f074c313674deba6ce9b8 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 14:14:29 +0100 Subject: [PATCH 0218/2133] Skip attempting to compile profiling native extension in CI for Ruby 2.1 --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 27236a59a7d..f90b195eaf4 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,7 @@ namespace :spec do ' spec/**/auto_instrument_spec.rb' t.rspec_opts = args.to_a.join(' ') end - if RUBY_ENGINE == 'ruby' && OS.linux? + if RUBY_ENGINE == 'ruby' && OS.linux? && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0') # "bundle exec rake compile" currently only works on MRI Ruby on Linux Rake::Task[:main].enhance([:compile]) end From d0f91f7d26bf2f4ced19c6946eef593ae4beb58b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 14:29:17 +0100 Subject: [PATCH 0219/2133] Update rack integration app tests to not test for profiler on Ruby 2.1 --- integration/apps/rack/spec/integration/basic_spec.rb | 10 ++++++---- .../build_ddtrace_profiling_native_extension.rb | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/integration/apps/rack/spec/integration/basic_spec.rb b/integration/apps/rack/spec/integration/basic_spec.rb index a40ba09cb5e..ffc57de99e7 100644 --- a/integration/apps/rack/spec/integration/basic_spec.rb +++ b/integration/apps/rack/spec/integration/basic_spec.rb @@ -11,8 +11,10 @@ it { is_expected.to be_a_kind_of(Net::HTTPOK) } end + let(:expected_profiler_available) { RUBY_VERSION >= '2.2' } + let(:expected_profiler_threads) do - # NOTE: Threads can't be named on Ruby 2.1 and 2.2 + # NOTE: Threads can't be named on Ruby 2.2 contain_exactly('Datadog::Profiling::Collectors::OldStack', 'Datadog::Profiling::Scheduler') unless RUBY_VERSION < '2.3' end @@ -25,7 +27,7 @@ it 'should be profiling' do expect(json_result).to include( - profiler_available: true, + profiler_available: expected_profiler_available, profiler_threads: expected_profiler_threads, ) end @@ -49,7 +51,7 @@ expect(JSON.parse(body, symbolize_names: true)).to include( key: key, resque_process: match(/resque/), - profiler_available: true, + profiler_available: expected_profiler_available, profiler_threads: expected_profiler_threads, ) end @@ -69,7 +71,7 @@ expect(JSON.parse(body, symbolize_names: true)).to include( key: key, sidekiq_process: match(/sidekiq/), - profiler_available: true, + profiler_available: expected_profiler_available, profiler_threads: expected_profiler_threads, ) end diff --git a/integration/images/include/build_ddtrace_profiling_native_extension.rb b/integration/images/include/build_ddtrace_profiling_native_extension.rb index 87e6caaf0c8..9ce9c1a4e91 100755 --- a/integration/images/include/build_ddtrace_profiling_native_extension.rb +++ b/integration/images/include/build_ddtrace_profiling_native_extension.rb @@ -1,10 +1,14 @@ #!/usr/bin/env ruby if local_gem_path = ENV['DD_DEMO_ENV_GEM_LOCAL_DDTRACE'] - puts "\n== Building profiler native extension ==" - success = - system("export BUNDLE_GEMFILE=#{local_gem_path}/Gemfile && cd #{local_gem_path} && bundle install && bundle exec rake compile") - raise 'Failure to compile profiler native extension' unless success + if RUBY_VERSION.start_with?('2.1.') + puts "\n== Skipping build of profiler native extension on Ruby 2.1 ==" + else + puts "\n== Building profiler native extension ==" + success = + system("export BUNDLE_GEMFILE=#{local_gem_path}/Gemfile && cd #{local_gem_path} && bundle install && bundle exec rake compile") + raise 'Failure to compile profiler native extension' unless success + end else puts "\n== Skipping build of profiler native extension, no DD_DEMO_ENV_GEM_LOCAL_DDTRACE set ==" end From 8d867e9a11b2ff4672e5887f8b75f1c0c03bf0b1 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 8 Jul 2022 14:36:27 +0100 Subject: [PATCH 0220/2133] Not in README that profiling is not supported for Ruby 2.1 --- docs/GettingStarted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 81c21472854..677e25ece82 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -124,7 +124,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d | | | 2.4 | Full | Latest | | | | 2.3 | Full | Latest | | | | 2.2 | Full | Latest | -| | | 2.1 | Full | Latest | +| | | 2.1 | Full (except for Profiling) | Latest | | | | 2.0 | EOL since June 7th, 2021 | < 0.50.0 | | | | 1.9.3 | EOL since August 6th, 2020 | < 0.27.0 | | | | 1.9.1 | EOL since August 6th, 2020 | < 0.27.0 | @@ -143,7 +143,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d | Type | Documentation | Version | Gem version support | | ----------- | ----------------------------------------------- | --------------------- | ------------------- | -| OpenTracing | https://github.com/opentracing/opentracing-ruby | 0.4.1+ (w/ Ruby 2.1+) | >= 0.16.0 | +| OpenTracing | https://github.com/opentracing/opentracing-ruby | 0.4.1+ | >= 0.16.0 | *Full* support indicates all tracer features are available. From cf2330a622c972ae47d38eeef8bd05ca080992c9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 11 Jul 2022 09:08:30 +0100 Subject: [PATCH 0221/2133] Reword Ruby 2.1 not supported message Message is now going to be > Could not compile the Datadog Continuous Profiler because > the profiler only supports Ruby 2.2 or newer. at installation time, and > Your ddtrace installation is missing support for the Continuous > Profiler because the profiler only supports Ruby 2.2 or newer. --- .../native_extension_helpers.rb | 2 +- spec/datadog/profiling/native_extension_helpers_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 0d5b786a7d3..6a27b46bd99 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -249,7 +249,7 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global private_class_method def self.on_ruby_2_1? ruby_version_not_supported = explain_issue( - 'your Ruby version (2.1) is too old to be supported.', + 'the profiler only supports Ruby 2.2 or newer.', suggested: UPGRADE_RUBY, ) diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index 66ad003cafd..ef513d84b14 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -165,7 +165,7 @@ context 'when on Ruby 2.1' do before { stub_const('RUBY_VERSION', '2.1.10') } - it { is_expected.to include '(2.1) is too old' } + it { is_expected.to include 'profiler only supports Ruby 2.2 or newer' } end end From 6843563d2d7bc3fbfdedc06e1118a2084e82d5f4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 12 Jul 2022 12:28:44 +0100 Subject: [PATCH 0222/2133] Inline list of classes that we monkey patch The previous code was a bit hard to follow, since it had the whole logic to pick the singleton_class vs class, and the whole thing about accessing the toplevel binding. In fact, all said and done, the affected classes were the ones you can now see here. I've validated that the set of classes chosen is correct and exactly matches the previous logic for Ruby 1.9 to 3.1. In particular, I'm not sure why we had that whole thing about the TOPLEVEL_BINDING.receiver and whatnot just to get the `Object` class. Perhaps we hadn't noticed at the time that in the end we really did get the `Object` class? --- lib/datadog/profiling/ext/forking.rb | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index 402c3ccef5b..ca16889e9da 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -13,27 +13,13 @@ def self.supported? def self.apply! return false unless supported? - modules = [::Process, ::Kernel] - # TODO: Ruby < 2.3 doesn't support Binding#receiver. - # Remove "else #eval" clause when Ruby < 2.3 support is dropped. - # NOTE: Modifying the "main" object as we do here is (as far as I know) irreversible. During tests, this change - # will stick around even if we otherwise stub `Process` and `Kernel`. - modules << (TOPLEVEL_BINDING.respond_to?(:receiver) ? TOPLEVEL_BINDING.receiver : TOPLEVEL_BINDING.eval('self')) - - # Patch top-level binding, Kernel, Process. - # NOTE: We could instead do Kernel.module_eval { def fork; ... end } - # however, this method rewrite is more invasive and irreversible. - # It could also have collisions with other libraries that patch. - # Opt to modify the inheritance of each relevant target instead. - modules.each do |mod| - clazz = if mod.class <= Module - mod.singleton_class - else - mod.class - end - - clazz.prepend(Kernel) - end + [ + ::Process.singleton_class, # Process.fork + ::Kernel.singleton_class, # Kernel.fork + ::Object, # fork without explicit receiver (it's defined as a method in ::Kernel) + # Note: Modifying Object as we do here is irreversible. During tests, this + # change will stick around even if we otherwise stub `Process` and `Kernel` + ].each { |target| target.prepend(Kernel) } end # Extensions for kernel From 3e12e1f4fce5b070553c71e74588d747830764de Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 12 Jul 2022 14:01:08 +0100 Subject: [PATCH 0223/2133] Minor cleanups to `profiling/ext/forking_spec.rb` The `TOPLEVEL_BINDING` workaround was only needed for Ruby 2.1. --- spec/datadog/profiling/ext/forking_spec.rb | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/spec/datadog/profiling/ext/forking_spec.rb b/spec/datadog/profiling/ext/forking_spec.rb index 2e3c455abda..8362a51ce94 100644 --- a/spec/datadog/profiling/ext/forking_spec.rb +++ b/spec/datadog/profiling/ext/forking_spec.rb @@ -1,22 +1,16 @@ # typed: false -require 'spec_helper' require 'datadog/profiling/spec_helper' -require 'datadog/profiling' require 'datadog/profiling/ext/forking' RSpec.describe Datadog::Profiling::Ext::Forking do describe '::apply!' do + before { skip_if_profiling_not_supported(self) } + subject(:apply!) { described_class.apply! } - let(:toplevel_receiver) do - if TOPLEVEL_BINDING.respond_to?(:receiver) - TOPLEVEL_BINDING.receiver - else - TOPLEVEL_BINDING.eval('self') - end - end + let(:toplevel_receiver) { TOPLEVEL_BINDING.receiver } context 'when forking is supported' do around do |example| @@ -56,9 +50,6 @@ # The results of this will carry over into other tests... # Just assert that the receiver was patched instead. # Unfortunately means we can't test if "fork" works in main Object. - # expect(toplevel_receiver.class) - # .to receive(:extend) - # .with(described_class::Kernel) apply! From 4d9da71ae63fb626cf9b97db9f5c3d9915485304 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 12 Jul 2022 14:04:25 +0100 Subject: [PATCH 0224/2133] Add TODO for possibly changing patch to hook on newer API --- lib/datadog/profiling/ext/forking.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index ca16889e9da..2a35defc50f 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -23,6 +23,9 @@ def self.apply! end # Extensions for kernel + # + # TODO: Consider hooking into `Process._fork` on Ruby 3.1+ instead, see + # https://github.com/ruby/ruby/pull/5017 and https://bugs.ruby-lang.org/issues/17795 module Kernel FORK_STAGES = [:prepare, :parent, :child].freeze From bf3ea40bca8a7a51849e948d036e8d61d1ae8db3 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 12 Jul 2022 14:08:35 +0100 Subject: [PATCH 0225/2133] Add limitation about usage with `BasicObject`s --- lib/datadog/profiling/ext/forking.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index 2a35defc50f..16708415633 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -5,6 +5,11 @@ module Profiling module Ext # Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore # profiling abilities after the VM forks. + # + # Known limitations: Does not handle `BasicObject`s that include `Kernel` directly; e.g. + # `Class.new(BasicObject) { include(::Kernel); def call; fork { }; end }.new.call`. + # + # This will be fixed once we moved to hooking into `Process._fork` module Forking def self.supported? Process.respond_to?(:fork) From 22dde9198c3df49989033e00598b45fc00bf591f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 12 Jul 2022 11:16:52 +0100 Subject: [PATCH 0226/2133] [PROF-5793] I unleashed the zombie apocalypse when running our test suite *cof* *ahem* now that I got your attention, some of the specs using `Process.detach` really were leaving behind "zombie" forked processes that never terminated. I've reviewed all uses of this API and re-ran the test suite both on Linux as well as macOS to ensure no zombie processes are left behind. P.s.: I could not resist the PR title :) --- spec/datadog/profiling/collectors/old_stack_spec.rb | 9 ++++++--- spec/datadog/profiling/native_extension_spec.rb | 13 ------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/spec/datadog/profiling/collectors/old_stack_spec.rb b/spec/datadog/profiling/collectors/old_stack_spec.rb index 63a81478811..b0ca70272a3 100644 --- a/spec/datadog/profiling/collectors/old_stack_spec.rb +++ b/spec/datadog/profiling/collectors/old_stack_spec.rb @@ -90,7 +90,7 @@ it 'can clean up leftover tracking state on an instance of Process::Waiter without crashing' do expect_in_fork do - expect(thread_api).to receive(:list).and_return([Process.detach(fork { sleep })]) + expect(thread_api).to receive(:list).and_return([Process.detach(0)]) start end @@ -485,9 +485,12 @@ it 'can sample an instance of Process::Waiter without crashing' do expect_in_fork do - process_waiter_thread = Process.detach(fork { sleep }) + forked_process = fork { sleep } + process_waiter_thread = Process.detach(forked_process) expect(collector.collect_thread_event(process_waiter_thread, 0)).to be_truthy + + Process.kill('TERM', forked_process) end end end @@ -728,7 +731,7 @@ describe 'Process::Waiter crash regression tests' do # Related to https://bugs.ruby-lang.org/issues/17807 ; see comments on main class for details - let(:process_waiter_thread) { Process.detach(fork { sleep }) } + let(:process_waiter_thread) { Process.detach(0) } describe 'the crash' do # Let's not get surprised if this shows up in other Ruby versions diff --git a/spec/datadog/profiling/native_extension_spec.rb b/spec/datadog/profiling/native_extension_spec.rb index c0d74d9dcd5..35dc620cc98 100644 --- a/spec/datadog/profiling/native_extension_spec.rb +++ b/spec/datadog/profiling/native_extension_spec.rb @@ -58,19 +58,6 @@ it { is_expected.to be_a_kind_of(Integer) } end - context 'when called with a Process::Waiter instance' do - # In Ruby 2.3 to 2.6, `Process.detach` creates a special `Thread` subclass named `Process::Waiter` - # that is improperly initialized and some operations on it can trigger segfaults, see - # https://bugs.ruby-lang.org/issues/17807. - # - # Thus, let's exercise our code with one of these objects to ensure future changes don't introduce regressions. - let(:thread) { Process.detach(fork { sleep }) } - - it 'is expected to be a kind of Integer' do - expect_in_fork { is_expected.to be_a_kind_of(Integer) } - end - end - context 'when called with a non-thread object' do let(:thread) { :potato } From 843901cdcc47c528392fd4e600c444ddfd91f079 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 13 Jul 2022 09:05:02 +0100 Subject: [PATCH 0227/2133] Simplify profiling `Forking` monkey patch, making it less generic The profiling `Forking` monkey patch only has a single customer: the `Datadog::Profiling::Tasks::Setup` class, which uses it to add an `at_fork(:child)` that takes care of restarting the profiler and fixing up the thread ids after a fork happened. Since the `Forking` monkey patch affects core Ruby classes, I decided to simplify it, as we're not using the added complexity, and I prefer it being as simple as possible. My additional motivation is that I'm working on support for monkey patching `Process.daemon`, and this simplifies the amount of code and tests needed to implement the needed functionality. (We can always undo this if later we find a need for the other callbacks, but in the ~2 years of life of this monkey patch, we haven't needed the extra functionality, so I'll take that as a signal). --- lib/datadog/profiling/ext/forking.rb | 19 +----- spec/datadog/profiling/ext/forking_spec.rb | 71 ++-------------------- 2 files changed, 7 insertions(+), 83 deletions(-) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index 16708415633..c132d75477c 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -32,8 +32,6 @@ def self.apply! # TODO: Consider hooking into `Process._fork` on Ruby 3.1+ instead, see # https://github.com/ruby/ruby/pull/5017 and https://bugs.ruby-lang.org/issues/17795 module Kernel - FORK_STAGES = [:prepare, :parent, :child].freeze - def fork # If a block is provided, it must be wrapped to trigger callbacks. child_block = if block_given? @@ -46,9 +44,6 @@ def fork end end - # Trigger :prepare callback - ddtrace_at_fork_blocks[:prepare].each(&:call) if ddtrace_at_fork_blocks.key?(:prepare) - # Start fork # If a block is provided, use the wrapped version. result = child_block.nil? ? super : super(&child_block) @@ -56,22 +51,14 @@ def fork # Trigger correct callbacks depending on whether we're in the parent or child. # If we're in the fork, result = nil: trigger child callbacks. # If we're in the parent, result = fork PID: trigger parent callbacks. - # rubocop:disable Style/IfInsideElse - if result.nil? - # Trigger :child callback - ddtrace_at_fork_blocks[:child].each(&:call) if ddtrace_at_fork_blocks.key?(:child) - else - # Trigger :parent callback - ddtrace_at_fork_blocks[:parent].each(&:call) if ddtrace_at_fork_blocks.key?(:parent) - end - # rubocop:enable Style/IfInsideElse + ddtrace_at_fork_blocks[:child].each(&:call) if result.nil? && ddtrace_at_fork_blocks.key?(:child) # Return PID from #fork result end - def at_fork(stage = :prepare, &block) - raise ArgumentError, 'Bad \'stage\' for ::at_fork' unless FORK_STAGES.include?(stage) + def at_fork(stage, &block) + raise ArgumentError, 'Bad \'stage\' for ::at_fork' unless stage == :child ddtrace_at_fork_blocks[stage] = [] unless ddtrace_at_fork_blocks.key?(stage) ddtrace_at_fork_blocks[stage] << block diff --git a/spec/datadog/profiling/ext/forking_spec.rb b/spec/datadog/profiling/ext/forking_spec.rb index 8362a51ce94..818ae296d0a 100644 --- a/spec/datadog/profiling/ext/forking_spec.rb +++ b/spec/datadog/profiling/ext/forking_spec.rb @@ -116,14 +116,10 @@ def fork(&block) end shared_context 'at_fork callbacks' do - let(:prepare) { double('prepare') } let(:child) { double('child') } - let(:parent) { double('parent') } before do - fork_class.at_fork(:prepare) { prepare.call } fork_class.at_fork(:child) { child.call } - fork_class.at_fork(:parent) { parent.call } end after do @@ -151,9 +147,7 @@ def fork(&block) let(:fork_result) { rand(100) } it do - expect(prepare).to receive(:call).ordered expect(child).to_not receive(:call) - expect(parent).to receive(:call).ordered is_expected.to be fork_result end @@ -165,9 +159,7 @@ def fork(&block) let(:fork_result) { nil } it do - expect(prepare).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to_not receive(:call) + expect(child).to receive(:call) is_expected.to be nil end @@ -190,9 +182,7 @@ def fork(&block) include_context 'at_fork callbacks' it 'invokes all the callbacks in order' do - expect(prepare).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered + expect(child).to receive(:call) is_expected.to be fork_result end @@ -206,67 +196,18 @@ def fork(&block) let(:callback) { double('callback') } let(:block) { proc { callback.call } } - context 'by default' do - subject(:at_fork) do - fork_class.at_fork(&block) - end - - it 'adds a :prepare callback' do - at_fork - - expect(prepare).to receive(:call).ordered - expect(callback).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered - - fork_class.fork {} - end - end - context 'given a stage' do subject(:at_fork) do fork_class.at_fork(stage, &block) end - context ':prepare' do - let(:stage) { :prepare } - - it 'adds a prepare callback' do - at_fork - - expect(prepare).to receive(:call).ordered - expect(callback).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered - - fork_class.fork {} - end - end - context ':child' do let(:stage) { :child } it 'adds a child callback' do at_fork - expect(prepare).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(callback).to receive(:call).ordered - expect(parent).to receive(:call).ordered - - fork_class.fork {} - end - end - - context ':parent' do - let(:stage) { :parent } - - it 'adds a parent callback' do - at_fork - - expect(prepare).to receive(:call).ordered expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered expect(callback).to receive(:call).ordered fork_class.fork {} @@ -285,17 +226,13 @@ def fork(&block) include_context 'at_fork callbacks' it 'applies the callback to the original class' do - expect(prepare).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered + expect(child).to receive(:call) fork_class.fork {} end it 'applies the callback to the other class' do - expect(prepare).to receive(:call).ordered - expect(child).to receive(:call).ordered - expect(parent).to receive(:call).ordered + expect(child).to receive(:call) other_fork_class.fork {} end From fa216ea23a768df1c79c3a98813017a763357647 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 13 Jul 2022 09:34:26 +0100 Subject: [PATCH 0228/2133] Add log message stating that flush after fork is discarded I vaguely remember this being the case, but still got slightly confused by seeing the log around encoding, so hopefully this clarifies that the log does not mean that a profile would be reported. --- lib/datadog/profiling/scheduler.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/datadog/profiling/scheduler.rb b/lib/datadog/profiling/scheduler.rb index 0ea2d7a5bb1..4c803df3541 100644 --- a/lib/datadog/profiling/scheduler.rb +++ b/lib/datadog/profiling/scheduler.rb @@ -69,6 +69,7 @@ def perform def after_fork # Clear any existing profiling state. # We don't want the child process to report profiling data from its parent. + Datadog.logger.debug('Flushing exporter in child process #after_fork and discarding data') exporter.flush end From 8699e14386ddb7f16a55c65337808813cbb718f2 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 13 Jul 2022 09:55:32 +0100 Subject: [PATCH 0229/2133] [PROF-4756] Fix profiler not restarting on `Process.daemon` When the Ruby VM `fork`s, only the thread that called `fork` survives in the child process. Thus, we have the `Forking` monkey patch which allows us to run callbacks in the child process, including restarting the profiler. But there's a less known API in Ruby that also makes use of forking -- `Process.daemon`. One example of using this API is when calling `rails server -d`; that `-d` makes Rails call this API. Because we were missing monkey patching `Process.daemon`, the profiler would not restart on `Process.daemon`. A customer using exactly `rails server -d` ran into this issue. Easy one-liner to validate that the profiler restarts after becoming a daemon: ``` $ DD_TRACE_DEBUG=true DD_PROFILING_ENABLED=true bundle exec ddtracerb exec ruby -e 'Process.daemon(nil, true); exit!' D, [#38994] (dd-trace-rb/lib/datadog/core/configuration/components.rb:371:in `startup!') Profiling started D, [#38994] (dd-trace-rb/lib/datadog/core/workers/async.rb:133:in `start_worker') Starting thread for: # D, [#38994] (dd-trace-rb/lib/datadog/core/workers/async.rb:133:in `start_worker') Starting thread for: # # <-- notice the PID change here D, [#39013] (dd-trace-rb/lib/datadog/core/workers/async.rb:133:in `start_worker') Starting thread for: # D, [#39013] (dd-trace-rb/lib/datadog/core/workers/async.rb:133:in `start_worker') Starting thread for: # ``` --- lib/datadog/profiling/ext/forking.rb | 18 ++++++++++ spec/datadog/profiling/ext/forking_spec.rb | 41 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/lib/datadog/profiling/ext/forking.rb b/lib/datadog/profiling/ext/forking.rb index c132d75477c..14759ba2244 100644 --- a/lib/datadog/profiling/ext/forking.rb +++ b/lib/datadog/profiling/ext/forking.rb @@ -25,6 +25,8 @@ def self.apply! # Note: Modifying Object as we do here is irreversible. During tests, this # change will stick around even if we otherwise stub `Process` and `Kernel` ].each { |target| target.prepend(Kernel) } + + ::Process.singleton_class.prepend(ProcessDaemonPatch) end # Extensions for kernel @@ -74,6 +76,22 @@ def ddtrace_at_fork_blocks # rubocop:enable Style/ClassVars end end + + # A call to Process.daemon ( https://rubyapi.org/3.1/o/process#method-c-daemon ) forks the current process and + # keeps executing code in the child process, killing off the parent, thus effectively replacing it. + # + # This monkey patch makes the `Kernel#at_fork` mechanism defined above also work in this situation. + module ProcessDaemonPatch + def daemon(*args) + ddtrace_at_fork_blocks = Datadog::Profiling::Ext::Forking::Kernel.ddtrace_at_fork_blocks + + result = super + + ddtrace_at_fork_blocks[:child].each(&:call) if ddtrace_at_fork_blocks.key?(:child) + + result + end + end end end end diff --git a/spec/datadog/profiling/ext/forking_spec.rb b/spec/datadog/profiling/ext/forking_spec.rb index 818ae296d0a..91f19c53128 100644 --- a/spec/datadog/profiling/ext/forking_spec.rb +++ b/spec/datadog/profiling/ext/forking_spec.rb @@ -35,12 +35,14 @@ # Check for leaks (make sure test is properly cleaned up) expect(::Process <= described_class::Kernel).to be nil + expect(::Process <= described_class::ProcessDaemonPatch).to be nil expect(::Kernel <= described_class::Kernel).to be nil # Can't assert this because top level can't be reverted; can't guarantee pristine state. # expect(toplevel_receiver.class.ancestors.include?(described_class::Kernel)).to be false expect(::Process.method(:fork).source_location).to be nil expect(::Kernel.method(:fork).source_location).to be nil + expect(::Process.method(:daemon).source_location).to be nil # Can't assert this because top level can't be reverted; can't guarantee pristine state. # expect(toplevel_receiver.method(:fork).source_location).to be nil end @@ -54,10 +56,12 @@ apply! expect(::Process.ancestors).to include(described_class::Kernel) + expect(::Process.ancestors).to include(described_class::ProcessDaemonPatch) expect(::Kernel.ancestors).to include(described_class::Kernel) expect(toplevel_receiver.class.ancestors).to include(described_class::Kernel) expect(::Process.method(:fork).source_location.first).to match(%r{.*datadog/profiling/ext/forking.rb}) + expect(::Process.method(:daemon).source_location.first).to match(%r{.*datadog/profiling/ext/forking.rb}) expect(::Kernel.method(:fork).source_location.first).to match(%r{.*datadog/profiling/ext/forking.rb}) expect(toplevel_receiver.method(:fork).source_location.first).to match(%r{.*datadog/profiling/ext/forking.rb}) end @@ -239,4 +243,41 @@ def fork(&block) end end end + + describe Datadog::Profiling::Ext::Forking::ProcessDaemonPatch do + let(:process_module) { ::Process.dup } + let(:child_callback) { double('child', call: true) } + + before do + allow(process_module).to receive(:daemon) + + process_module.singleton_class.prepend(Datadog::Profiling::Ext::Forking::Kernel) + process_module.singleton_class.prepend(described_class) + + process_module.at_fork(:child) { child_callback.call } + end + + after do + Datadog::Profiling::Ext::Forking::Kernel.ddtrace_at_fork_blocks.clear + end + + it 'calls the child at_fork callbacks after calling Process.daemon' do + expect(process_module).to receive(:daemon).ordered + expect(child_callback).to receive(:call).ordered + + process_module.daemon + end + + it 'passes any arguments to Process.daemon' do + expect(process_module).to receive(:daemon).with(true, true) + + process_module.daemon(true, true) + end + + it 'returns the result of calling Process.daemon' do + expect(process_module).to receive(:daemon).and_return(:process_daemon_result) + + expect(process_module.daemon).to be :process_daemon_result + end + end end From b36c919188fda51568e74fe14e8a48f2a42c38c6 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 13 Jul 2022 10:54:06 +0100 Subject: [PATCH 0230/2133] Use fake `Process` module in spec Without this, the test fails if the `Forking` patch has been applied by a different spec (due to RSpec not being able to properly setup mocks). --- spec/datadog/profiling/ext/forking_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/profiling/ext/forking_spec.rb b/spec/datadog/profiling/ext/forking_spec.rb index 91f19c53128..40c92139d62 100644 --- a/spec/datadog/profiling/ext/forking_spec.rb +++ b/spec/datadog/profiling/ext/forking_spec.rb @@ -245,7 +245,7 @@ def fork(&block) end describe Datadog::Profiling::Ext::Forking::ProcessDaemonPatch do - let(:process_module) { ::Process.dup } + let(:process_module) { Module.new { def self.daemon(nochdir = nil, noclose = nil); end } } let(:child_callback) { double('child', call: true) } before do From 7b24228b4b974addf913f0e317cc0ccc2b58aea0 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 13 Jul 2022 12:00:06 +0200 Subject: [PATCH 0231/2133] Modular Sinatra --- integration/apps/sinatra/Gemfile | 5 +- integration/apps/sinatra/README.md | 2 +- integration/apps/sinatra/app/acme.rb | 54 ++++++-------------- integration/apps/sinatra/app/basic.rb | 27 ++++++++++ integration/apps/sinatra/app/health.rb | 27 ++++++++++ integration/apps/sinatra/config.ru | 4 +- integration/apps/sinatra/docker-compose.yml | 3 +- integration/apps/sinatra/script/build-images | 2 +- 8 files changed, 78 insertions(+), 46 deletions(-) create mode 100644 integration/apps/sinatra/app/basic.rb create mode 100644 integration/apps/sinatra/app/health.rb diff --git a/integration/apps/sinatra/Gemfile b/integration/apps/sinatra/Gemfile index 8b1a1954cf6..2fa9e91c20b 100644 --- a/integration/apps/sinatra/Gemfile +++ b/integration/apps/sinatra/Gemfile @@ -8,8 +8,10 @@ source 'https://rubygems.org' do gem 'dogstatsd-ruby' # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') + gem 'ddtrace', path: "/vendor/dd-trace-rb", require: 'ddtrace/auto_instrument' + # gem 'rack-parser', :require => 'rack/parser' + gem 'sinatra-router' # Needed for ddtrace profiling google_protobuf_versions = [ '~> 3.0', @@ -31,7 +33,6 @@ source 'https://rubygems.org' do # gem 'pry-stack_explorer', platform: :ruby # gem 'rbtrace' # gem 'ruby-prof' - gem 'rspec' gem 'rspec-wait' gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick diff --git a/integration/apps/sinatra/README.md b/integration/apps/sinatra/README.md index de6f1976b68..50b2e564a28 100644 --- a/integration/apps/sinatra/README.md +++ b/integration/apps/sinatra/README.md @@ -64,7 +64,7 @@ curl -v localhost/health # Basic demo scenarios curl -v localhost/basic/fibonacci -curl -v -XPOST localhost/basic/default +curl -v localhost/basic/default ``` ### Load tester diff --git a/integration/apps/sinatra/app/acme.rb b/integration/apps/sinatra/app/acme.rb index 7bfcf3e8b22..daa6e0015b1 100644 --- a/integration/apps/sinatra/app/acme.rb +++ b/integration/apps/sinatra/app/acme.rb @@ -1,5 +1,7 @@ require 'sinatra/base' +require 'sinatra/router' require 'ddtrace' +# require 'ddtrace/auto_instrument' Datadog.configure do |c| c.service = 'acme-sinatra' @@ -13,8 +15,7 @@ if Datadog::DemoEnv.feature?('appsec') c.appsec.enabled = true - - c.appsec.instrument :rack + c.appsec.instrument :sinatra end if Datadog::DemoEnv.feature?('pprof_to_file') @@ -23,48 +24,23 @@ end end +require_relative './basic' +require_relative './health' + class Acme < Sinatra::Base register Datadog::Tracing::Contrib::Sinatra::Tracer - get '/' do - 'Hello world!' - end - - get '/health' do - 204 - end + # # Use Sinatra App as middleware + # use Health + # use Basic - get '/health/detailed' do - [ - 200, - { 'Content-Type' => 'application/json' }, - JSON.generate( - webserver_process: $PROGRAM_NAME, - profiler_available: Datadog::Profiling.start_if_enabled, - # NOTE: Threads can't be named on Ruby 2.1 and 2.2 - profiler_threads: ((Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }) unless RUBY_VERSION < '2.3') - ) - ] + # # Use Sinatra::Router to mount different modular Sinatra applications + use Sinatra::Router do + mount ::Health + mount ::Basic end - get '/basic/default' do - status 204 - end - - get '/basic/fibonacci' do - n = rand(25..35) - result = fib(n) - - [ - 200, - { 'Content-Type' => 'text/plain' }, - ["Basic: Fibonacci(#{n}): #{result}"] - ] - end - - private - - def fib(n) - n <= 1 ? n : fib(n-1) + fib(n-2) + get '/' do + 'Hello world!' end end diff --git a/integration/apps/sinatra/app/basic.rb b/integration/apps/sinatra/app/basic.rb new file mode 100644 index 00000000000..c6364885249 --- /dev/null +++ b/integration/apps/sinatra/app/basic.rb @@ -0,0 +1,27 @@ +require 'sinatra/base' +require 'ddtrace' + +class Basic < Sinatra::Base + register Datadog::Tracing::Contrib::Sinatra::Tracer + + get '/basic/default' do + status 204 + end + + get '/basic/fibonacci' do + n = rand(25..35) + result = fib(n) + + [ + 200, + { 'Content-Type' => 'text/plain' }, + ["Basic: Fibonacci(#{n}): #{result}"] + ] + end + + private + + def fib(n) + n <= 1 ? n : fib(n - 1) + fib(n - 2) + end +end diff --git a/integration/apps/sinatra/app/health.rb b/integration/apps/sinatra/app/health.rb new file mode 100644 index 00000000000..9403e074543 --- /dev/null +++ b/integration/apps/sinatra/app/health.rb @@ -0,0 +1,27 @@ +require 'sinatra/base' +require 'ddtrace' + +class Health < Sinatra::Base + register Datadog::Tracing::Contrib::Sinatra::Tracer + + get '/health' do + 204 + end + + get '/health/detailed' do + [ + 200, + { 'Content-Type' => 'application/json' }, + JSON.generate( + webserver_process: $PROGRAM_NAME, + profiler_available: Datadog::Profiling.start_if_enabled, + # NOTE: Threads can't be named on Ruby 2.1 and 2.2 + profiler_threads: (unless RUBY_VERSION < '2.3' + (Thread.list.map(&:name).select do |it| + it && it.include?('Profiling') + end) + end) + ) + ] + end +end diff --git a/integration/apps/sinatra/config.ru b/integration/apps/sinatra/config.ru index d46d610d3d3..ff2ebeeeceb 100644 --- a/integration/apps/sinatra/config.ru +++ b/integration/apps/sinatra/config.ru @@ -1,4 +1,6 @@ -require 'datadog/demo_env' +require 'ddtrace' require_relative 'app/acme' +use Datadog::Tracing::Contrib::Rack::TraceMiddleware + run Acme diff --git a/integration/apps/sinatra/docker-compose.yml b/integration/apps/sinatra/docker-compose.yml index 79fbf0cc616..886c149052b 100644 --- a/integration/apps/sinatra/docker-compose.yml +++ b/integration/apps/sinatra/docker-compose.yml @@ -17,8 +17,7 @@ services: - DD_PROFILING_ENABLED=true # Use these to choose what is run - DD_DEMO_ENV_PROCESS=puma - # - DD_DEMO_ENV_FEATURES=tracing,profiling - - DD_DEMO_ENV_FEATURES=tracing + - DD_DEMO_ENV_FEATURES=tracing,profiling # Use this for a local version of ddtrace - DD_DEMO_ENV_GEM_LOCAL_DDTRACE=/vendor/dd-trace-rb # Use these for a specific revision of ddtrace diff --git a/integration/apps/sinatra/script/build-images b/integration/apps/sinatra/script/build-images index d5ebf40b786..6b14114f9b0 100755 --- a/integration/apps/sinatra/script/build-images +++ b/integration/apps/sinatra/script/build-images @@ -23,7 +23,7 @@ done echo "== Building Sinatra images... ==" if [ -v APP_RUBY_VERSION ]; then - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-rack . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-sinatra . else docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-sinatra . docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-sinatra . From 9415d8b446ccf3d8eb442d0d261ad2c282e2e1b4 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 13 Jul 2022 12:25:42 +0200 Subject: [PATCH 0232/2133] Remove redis in CI --- integration/apps/sinatra/docker-compose.ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/integration/apps/sinatra/docker-compose.ci.yml b/integration/apps/sinatra/docker-compose.ci.yml index 14cacbf188a..9c2981e642c 100644 --- a/integration/apps/sinatra/docker-compose.ci.yml +++ b/integration/apps/sinatra/docker-compose.ci.yml @@ -61,7 +61,3 @@ services: # - .:/app # - ../../images/include:/vendor/dd-demo # - ../../..:/vendor/dd-trace-rb - redis: - image: redis:6.2-buster - expose: - - "6379" From 414b7c45f25de3a30b90e14e7cf3072feb7b940f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 13 Jul 2022 14:32:10 +0100 Subject: [PATCH 0233/2133] Ensure all tags are strings when reporting profile A customer reported having their profiles fail with the following issue: > Unable to report profile. Cause: wrong argument type nil (expected String) Location: /var/cache/bundle/ruby/3.0.0/gems/ddtrace-1.2.0/lib/datadog/profiling/http_transport.rb:115:in _native_do_export' Unfortunately there's a bunch of data passed in to that function so just from that information it's not possible to be 100% sure which one was `nil`, but while doing a second pass at the code I noticed one way to trigger this would be to have tags that are `nil`. Thus here's a quick fix to ensure that the tags passed on to profiling are always strings. Issue #2151 --- lib/datadog/profiling/tag_builder.rb | 7 ++++++- spec/datadog/profiling/tag_builder_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/datadog/profiling/tag_builder.rb b/lib/datadog/profiling/tag_builder.rb index 19d82a27128..6b7df6fd43f 100644 --- a/lib/datadog/profiling/tag_builder.rb +++ b/lib/datadog/profiling/tag_builder.rb @@ -1,5 +1,7 @@ # typed: true +require 'datadog/core/utils' + module Datadog module Profiling # Builds a hash of default plus user tags to be included in a profile @@ -41,7 +43,10 @@ def self.call( tags[FORM_FIELD_TAG_SERVICE] = service if service tags[FORM_FIELD_TAG_VERSION] = version if version - user_tags.merge(tags) + # Make sure everything is an utf-8 string, to avoid encoding issues in native code/libddprof/further downstream + user_tags.merge(tags).map do |key, value| + [Datadog::Core::Utils.utf8_encode(key), Datadog::Core::Utils.utf8_encode(value)] + end.to_h end end end diff --git a/spec/datadog/profiling/tag_builder_spec.rb b/spec/datadog/profiling/tag_builder_spec.rb index 9e895caea59..f17a7c55acf 100644 --- a/spec/datadog/profiling/tag_builder_spec.rb +++ b/spec/datadog/profiling/tag_builder_spec.rb @@ -59,5 +59,26 @@ expect(call).to include('foo' => 'bar', 'language' => 'ruby') end end + + context 'when user tag keys and values are not strings' do + it 'encodes them as strings' do + settings.tags = { :symbol_key => :symbol_value, nil => 'nil key', 'nil value' => nil, 12 => 34 } + + expect(call).to include('symbol_key' => 'symbol_value', '' => 'nil key', 'nil value' => '', '12' => '34') + end + end + + context 'when tagging key or value is not utf-8' do + it 'converts them to utf-8' do + settings.tags = { 'ascii-key'.encode(Encoding::ASCII) => 'ascii-value'.encode(Encoding::ASCII) } + + result = call + + result.each do |key, value| + expect([key, value]).to all(have_attributes(encoding: Encoding::UTF_8)) + end + expect(result).to include('ascii-key' => 'ascii-value') + end + end end end From 4f92bc5c3a39514d9a4aeb2f68ae5e2f58633f9a Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 13 Jul 2022 19:03:20 +0200 Subject: [PATCH 0234/2133] Tweak --- integration/apps/sinatra/Gemfile | 6 ++---- integration/apps/sinatra/app/acme.rb | 4 ++-- integration/apps/sinatra/app/basic.rb | 2 +- integration/apps/sinatra/app/health.rb | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/integration/apps/sinatra/Gemfile b/integration/apps/sinatra/Gemfile index 2fa9e91c20b..bc11bd12b29 100644 --- a/integration/apps/sinatra/Gemfile +++ b/integration/apps/sinatra/Gemfile @@ -4,14 +4,12 @@ source 'https://rubygems.org' do gem 'puma' gem 'unicorn' gem 'sinatra' - gem 'rake' + gem 'sinatra-router' gem 'dogstatsd-ruby' # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', path: "/vendor/dd-trace-rb", require: 'ddtrace/auto_instrument' + gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - # gem 'rack-parser', :require => 'rack/parser' - gem 'sinatra-router' # Needed for ddtrace profiling google_protobuf_versions = [ '~> 3.0', diff --git a/integration/apps/sinatra/app/acme.rb b/integration/apps/sinatra/app/acme.rb index daa6e0015b1..9b92fae4f17 100644 --- a/integration/apps/sinatra/app/acme.rb +++ b/integration/apps/sinatra/app/acme.rb @@ -4,7 +4,7 @@ # require 'ddtrace/auto_instrument' Datadog.configure do |c| - c.service = 'acme-sinatra' + c.service = 'acme-sinatra-2-modular' c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics') @@ -28,7 +28,7 @@ require_relative './health' class Acme < Sinatra::Base - register Datadog::Tracing::Contrib::Sinatra::Tracer + # register Datadog::Tracing::Contrib::Sinatra::Tracer # # Use Sinatra App as middleware # use Health diff --git a/integration/apps/sinatra/app/basic.rb b/integration/apps/sinatra/app/basic.rb index c6364885249..6226b3ebe61 100644 --- a/integration/apps/sinatra/app/basic.rb +++ b/integration/apps/sinatra/app/basic.rb @@ -2,7 +2,7 @@ require 'ddtrace' class Basic < Sinatra::Base - register Datadog::Tracing::Contrib::Sinatra::Tracer + # register Datadog::Tracing::Contrib::Sinatra::Tracer get '/basic/default' do status 204 diff --git a/integration/apps/sinatra/app/health.rb b/integration/apps/sinatra/app/health.rb index 9403e074543..c974d837222 100644 --- a/integration/apps/sinatra/app/health.rb +++ b/integration/apps/sinatra/app/health.rb @@ -2,7 +2,7 @@ require 'ddtrace' class Health < Sinatra::Base - register Datadog::Tracing::Contrib::Sinatra::Tracer + # register Datadog::Tracing::Contrib::Sinatra::Tracer get '/health' do 204 From 642d344db850f13ec1ca3c473e7b7174cfdb3c94 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 13 Jul 2022 19:09:37 +0200 Subject: [PATCH 0235/2133] Rename directory --- .../apps/{sinatra => sinatra2_modular}/Dockerfile | 0 .../apps/{sinatra => sinatra2_modular}/Dockerfile-ci | 0 .../apps/{sinatra => sinatra2_modular}/Gemfile | 0 .../apps/{sinatra => sinatra2_modular}/README.md | 0 .../apps/{sinatra => sinatra2_modular}/app/acme.rb | 0 .../apps/{sinatra => sinatra2_modular}/app/basic.rb | 0 .../apps/{sinatra => sinatra2_modular}/app/health.rb | 0 .../apps/{sinatra => sinatra2_modular}/bin/run | 0 .../apps/{sinatra => sinatra2_modular}/bin/setup | 0 .../apps/{sinatra => sinatra2_modular}/bin/test | 0 .../apps/{sinatra => sinatra2_modular}/config.ru | 0 .../{sinatra => sinatra2_modular}/config/puma.rb | 0 .../{sinatra => sinatra2_modular}/config/unicorn.rb | 0 .../docker-compose.ci.yml | 0 .../{sinatra => sinatra2_modular}/docker-compose.yml | 0 .../script/build-images | 12 ++++++------ .../apps/{sinatra => sinatra2_modular}/script/ci | 2 +- .../spec/integration/basic_spec.rb | 0 .../spec/spec_helper.rb | 0 .../spec/support/integration_helper.rb | 0 20 files changed, 7 insertions(+), 7 deletions(-) rename integration/apps/{sinatra => sinatra2_modular}/Dockerfile (100%) rename integration/apps/{sinatra => sinatra2_modular}/Dockerfile-ci (100%) rename integration/apps/{sinatra => sinatra2_modular}/Gemfile (100%) rename integration/apps/{sinatra => sinatra2_modular}/README.md (100%) rename integration/apps/{sinatra => sinatra2_modular}/app/acme.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/app/basic.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/app/health.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/bin/run (100%) rename integration/apps/{sinatra => sinatra2_modular}/bin/setup (100%) rename integration/apps/{sinatra => sinatra2_modular}/bin/test (100%) rename integration/apps/{sinatra => sinatra2_modular}/config.ru (100%) rename integration/apps/{sinatra => sinatra2_modular}/config/puma.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/config/unicorn.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/docker-compose.ci.yml (100%) rename integration/apps/{sinatra => sinatra2_modular}/docker-compose.yml (100%) rename integration/apps/{sinatra => sinatra2_modular}/script/build-images (79%) rename integration/apps/{sinatra => sinatra2_modular}/script/ci (96%) rename integration/apps/{sinatra => sinatra2_modular}/spec/integration/basic_spec.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/spec/spec_helper.rb (100%) rename integration/apps/{sinatra => sinatra2_modular}/spec/support/integration_helper.rb (100%) diff --git a/integration/apps/sinatra/Dockerfile b/integration/apps/sinatra2_modular/Dockerfile similarity index 100% rename from integration/apps/sinatra/Dockerfile rename to integration/apps/sinatra2_modular/Dockerfile diff --git a/integration/apps/sinatra/Dockerfile-ci b/integration/apps/sinatra2_modular/Dockerfile-ci similarity index 100% rename from integration/apps/sinatra/Dockerfile-ci rename to integration/apps/sinatra2_modular/Dockerfile-ci diff --git a/integration/apps/sinatra/Gemfile b/integration/apps/sinatra2_modular/Gemfile similarity index 100% rename from integration/apps/sinatra/Gemfile rename to integration/apps/sinatra2_modular/Gemfile diff --git a/integration/apps/sinatra/README.md b/integration/apps/sinatra2_modular/README.md similarity index 100% rename from integration/apps/sinatra/README.md rename to integration/apps/sinatra2_modular/README.md diff --git a/integration/apps/sinatra/app/acme.rb b/integration/apps/sinatra2_modular/app/acme.rb similarity index 100% rename from integration/apps/sinatra/app/acme.rb rename to integration/apps/sinatra2_modular/app/acme.rb diff --git a/integration/apps/sinatra/app/basic.rb b/integration/apps/sinatra2_modular/app/basic.rb similarity index 100% rename from integration/apps/sinatra/app/basic.rb rename to integration/apps/sinatra2_modular/app/basic.rb diff --git a/integration/apps/sinatra/app/health.rb b/integration/apps/sinatra2_modular/app/health.rb similarity index 100% rename from integration/apps/sinatra/app/health.rb rename to integration/apps/sinatra2_modular/app/health.rb diff --git a/integration/apps/sinatra/bin/run b/integration/apps/sinatra2_modular/bin/run similarity index 100% rename from integration/apps/sinatra/bin/run rename to integration/apps/sinatra2_modular/bin/run diff --git a/integration/apps/sinatra/bin/setup b/integration/apps/sinatra2_modular/bin/setup similarity index 100% rename from integration/apps/sinatra/bin/setup rename to integration/apps/sinatra2_modular/bin/setup diff --git a/integration/apps/sinatra/bin/test b/integration/apps/sinatra2_modular/bin/test similarity index 100% rename from integration/apps/sinatra/bin/test rename to integration/apps/sinatra2_modular/bin/test diff --git a/integration/apps/sinatra/config.ru b/integration/apps/sinatra2_modular/config.ru similarity index 100% rename from integration/apps/sinatra/config.ru rename to integration/apps/sinatra2_modular/config.ru diff --git a/integration/apps/sinatra/config/puma.rb b/integration/apps/sinatra2_modular/config/puma.rb similarity index 100% rename from integration/apps/sinatra/config/puma.rb rename to integration/apps/sinatra2_modular/config/puma.rb diff --git a/integration/apps/sinatra/config/unicorn.rb b/integration/apps/sinatra2_modular/config/unicorn.rb similarity index 100% rename from integration/apps/sinatra/config/unicorn.rb rename to integration/apps/sinatra2_modular/config/unicorn.rb diff --git a/integration/apps/sinatra/docker-compose.ci.yml b/integration/apps/sinatra2_modular/docker-compose.ci.yml similarity index 100% rename from integration/apps/sinatra/docker-compose.ci.yml rename to integration/apps/sinatra2_modular/docker-compose.ci.yml diff --git a/integration/apps/sinatra/docker-compose.yml b/integration/apps/sinatra2_modular/docker-compose.yml similarity index 100% rename from integration/apps/sinatra/docker-compose.yml rename to integration/apps/sinatra2_modular/docker-compose.yml diff --git a/integration/apps/sinatra/script/build-images b/integration/apps/sinatra2_modular/script/build-images similarity index 79% rename from integration/apps/sinatra/script/build-images rename to integration/apps/sinatra2_modular/script/build-images index 6b14114f9b0..e444664f85f 100755 --- a/integration/apps/sinatra/script/build-images +++ b/integration/apps/sinatra2_modular/script/build-images @@ -23,13 +23,13 @@ done echo "== Building Sinatra images... ==" if [ -v APP_RUBY_VERSION ]; then - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-sinatra2-modular . else - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-sinatra . - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-sinatra . - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.0 -t datadog/dd-apm-demo:rb-3.0-sinatra . - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.1 -t datadog/dd-apm-demo:rb-3.1-sinatra . - docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.2 -t datadog/dd-apm-demo:rb-3.2-sinatra . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-sinatra2-modular . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-sinatra2-modular . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.0 -t datadog/dd-apm-demo:rb-3.0-sinatra2-modular . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.1 -t datadog/dd-apm-demo:rb-3.1-sinatra2-modular . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.2 -t datadog/dd-apm-demo:rb-3.2-sinatra2-modular . # ADD NEW RUBIES HERE fi echo "== Done building Sinatra images. ==" diff --git a/integration/apps/sinatra/script/ci b/integration/apps/sinatra2_modular/script/ci similarity index 96% rename from integration/apps/sinatra/script/ci rename to integration/apps/sinatra2_modular/script/ci index 33695feb04d..9d45a82d1cb 100755 --- a/integration/apps/sinatra/script/ci +++ b/integration/apps/sinatra2_modular/script/ci @@ -30,7 +30,7 @@ fi # Set configuration APP_BASE_IMAGE=${APP_BASE_IMAGE:-datadog/dd-apm-demo:rb-$APP_RUBY_VERSION} -APP_IMAGE=${APP_IMAGE:-$APP_BASE_IMAGE-sinatra} +APP_IMAGE=${APP_IMAGE:-$APP_BASE_IMAGE-sinatra2-modular} APP_COMPOSE_FILES="-f docker-compose.ci.yml" echo "== Running integration tests... ==" diff --git a/integration/apps/sinatra/spec/integration/basic_spec.rb b/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb similarity index 100% rename from integration/apps/sinatra/spec/integration/basic_spec.rb rename to integration/apps/sinatra2_modular/spec/integration/basic_spec.rb diff --git a/integration/apps/sinatra/spec/spec_helper.rb b/integration/apps/sinatra2_modular/spec/spec_helper.rb similarity index 100% rename from integration/apps/sinatra/spec/spec_helper.rb rename to integration/apps/sinatra2_modular/spec/spec_helper.rb diff --git a/integration/apps/sinatra/spec/support/integration_helper.rb b/integration/apps/sinatra2_modular/spec/support/integration_helper.rb similarity index 100% rename from integration/apps/sinatra/spec/support/integration_helper.rb rename to integration/apps/sinatra2_modular/spec/support/integration_helper.rb From c232ebc0186bc868a4b07365388de84ee1b21151 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 13 Jul 2022 20:53:45 +0200 Subject: [PATCH 0236/2133] Sinatra classic --- integration/apps/sinatra2_classic/Dockerfile | 25 +++++ .../apps/sinatra2_classic/Dockerfile-ci | 13 +++ integration/apps/sinatra2_classic/Gemfile | 36 ++++++++ integration/apps/sinatra2_classic/README.md | 91 +++++++++++++++++++ integration/apps/sinatra2_classic/app/acme.rb | 69 ++++++++++++++ integration/apps/sinatra2_classic/bin/run | 24 +++++ integration/apps/sinatra2_classic/bin/setup | 17 ++++ integration/apps/sinatra2_classic/bin/test | 24 +++++ integration/apps/sinatra2_classic/config.ru | 3 + .../apps/sinatra2_classic/config/puma.rb | 14 +++ .../apps/sinatra2_classic/config/unicorn.rb | 23 +++++ .../sinatra2_classic/docker-compose.ci.yml | 63 +++++++++++++ .../apps/sinatra2_classic/docker-compose.yml | 80 ++++++++++++++++ .../apps/sinatra2_classic/script/build-images | 35 +++++++ integration/apps/sinatra2_classic/script/ci | 58 ++++++++++++ .../spec/integration/basic_spec.rb | 13 +++ .../apps/sinatra2_classic/spec/spec_helper.rb | 16 ++++ .../spec/support/integration_helper.rb | 27 ++++++ 18 files changed, 631 insertions(+) create mode 100644 integration/apps/sinatra2_classic/Dockerfile create mode 100644 integration/apps/sinatra2_classic/Dockerfile-ci create mode 100644 integration/apps/sinatra2_classic/Gemfile create mode 100644 integration/apps/sinatra2_classic/README.md create mode 100644 integration/apps/sinatra2_classic/app/acme.rb create mode 100755 integration/apps/sinatra2_classic/bin/run create mode 100755 integration/apps/sinatra2_classic/bin/setup create mode 100755 integration/apps/sinatra2_classic/bin/test create mode 100644 integration/apps/sinatra2_classic/config.ru create mode 100644 integration/apps/sinatra2_classic/config/puma.rb create mode 100644 integration/apps/sinatra2_classic/config/unicorn.rb create mode 100644 integration/apps/sinatra2_classic/docker-compose.ci.yml create mode 100644 integration/apps/sinatra2_classic/docker-compose.yml create mode 100755 integration/apps/sinatra2_classic/script/build-images create mode 100755 integration/apps/sinatra2_classic/script/ci create mode 100644 integration/apps/sinatra2_classic/spec/integration/basic_spec.rb create mode 100644 integration/apps/sinatra2_classic/spec/spec_helper.rb create mode 100644 integration/apps/sinatra2_classic/spec/support/integration_helper.rb diff --git a/integration/apps/sinatra2_classic/Dockerfile b/integration/apps/sinatra2_classic/Dockerfile new file mode 100644 index 00000000000..201df0e5c3f --- /dev/null +++ b/integration/apps/sinatra2_classic/Dockerfile @@ -0,0 +1,25 @@ +# Select base image +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +# Setup directory +RUN mkdir /app +WORKDIR /app + +# Setup specific version of ddtrace, if specified. +ARG ddtrace_git +ENV DD_DEMO_ENV_GEM_GIT_DDTRACE ${ddtrace_git} + +ARG ddtrace_ref +ENV DD_DEMO_ENV_GEM_REF_DDTRACE ${ddtrace_ref} + +# Install dependencies +COPY Gemfile /app/Gemfile +RUN bundle install + +# Add files +COPY . /app + +# Set entrypoint +ENTRYPOINT ["/bin/bash", "-c"] +CMD ["bin/setup && bin/run"] diff --git a/integration/apps/sinatra2_classic/Dockerfile-ci b/integration/apps/sinatra2_classic/Dockerfile-ci new file mode 100644 index 00000000000..7eb3d041256 --- /dev/null +++ b/integration/apps/sinatra2_classic/Dockerfile-ci @@ -0,0 +1,13 @@ +# Select base image +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +# Add gem +COPY . /vendor/dd-trace-rb + +# Install dependencies +ENV DD_DEMO_ENV_GEM_LOCAL_DDTRACE /vendor/dd-trace-rb + +RUN /vendor/dd-demo/build_ddtrace_profiling_native_extension.rb + +RUN bundle install diff --git a/integration/apps/sinatra2_classic/Gemfile b/integration/apps/sinatra2_classic/Gemfile new file mode 100644 index 00000000000..83ec8703af8 --- /dev/null +++ b/integration/apps/sinatra2_classic/Gemfile @@ -0,0 +1,36 @@ +require 'datadog/demo_env' + +source 'https://rubygems.org' do + gem 'puma' + gem 'unicorn' + gem 'sinatra' + + gem 'dogstatsd-ruby' + # Choose correct specs for 'ddtrace' demo environment + gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') + + # Needed for ddtrace profiling + google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' + ] + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions + else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' + end + + # Development + gem 'pry-byebug' + # gem 'pry-stack_explorer', platform: :ruby + # gem 'rbtrace' + # gem 'ruby-prof' + gem 'rspec' + gem 'rspec-wait' + gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick +end diff --git a/integration/apps/sinatra2_classic/README.md b/integration/apps/sinatra2_classic/README.md new file mode 100644 index 00000000000..50b2e564a28 --- /dev/null +++ b/integration/apps/sinatra2_classic/README.md @@ -0,0 +1,91 @@ +# Sinatra: Demo application for Datadog APM + +A generic Sinatra web application with some common use scenarios. + +For generating Datadog APM traces and profiles. + +## Installation + +Install [direnv](https://github.com/direnv/direnv) for applying local settings. + +1. `cp .envrc.sample .envrc` and add your Datadog API key. +2. `direnv allow` to load the env var. +4. `docker-compose run --rm app bin/setup` + +## Running the application + +### To monitor performance of Docker containers with Datadog + +```sh +docker run --rm --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e API_KEY=$DD_API_KEY datadog/docker-dd-agent:latest +``` + +### Starting the web server + +Run `docker-compose up` to auto-start the webserver. It should bind to `localhost:80`. + +Alternatively, you can run it manually with: + +```sh +docker-compose run --rm -p 80:80 app "bin/run " +``` + +The `` argument is optional, and will default to `DD_DEMO_ENV_PROCESS` if not provided. See [Processes](#processes) for more details. + +##### Processes + +Within the container, run `bin/run ` where `` is one of the following values: + + - `puma`: Puma web server + - `unicorn`: Unicorn web server + - `webrick`: WEBrick web server + - `irb`: IRB session + + Alternatively, set `DD_DEMO_ENV_PROCESS` to run a particular process by default when `bin/run` is run. + +##### Features + +Set `DD_DEMO_ENV_FEATURES` to a comma-delimited list of any of the following values to activate the feature: + + - `tracing`: Tracing instrumentation + - `profiling`: Profiling (NOTE: Must also set `DD_PROFILING_ENABLED` to match.) + - `debug`: Enable diagnostic debug mode + - `analytics`: Enable trace analytics + - `runtime_metrics`: Enable runtime metrics + - `pprof_to_file`: Dump profiling pprof to file instead of agent. + +e.g. `DD_DEMO_ENV_FEATURES=tracing,profiling` + +##### Routes + +```sh +# Health check +curl -v localhost/health + +# Basic demo scenarios +curl -v localhost/basic/fibonacci +curl -v localhost/basic/default +``` + +### Load tester + +Docker configuration automatically creates and runs [Wrk](https://github.com/wg/wrk) load testing containers. By default it runs the `basic/default` scenario described in the `wrk` image to give a baseload. + +You can modify the `load-tester` container in `docker-compose.yml` to change the load type or scenario run. Set the container's `command` to any set of arguments `wrk` accepts. + +You can also define your own custom scenario by creating a LUA file, mounting it into the container, and passing it as an argument via `command`. + +### Running integration tests + +You can run integration tests using the following and substituting for the Ruby major and minor version (e.g. `2.7`) + +```sh +./script/build-images -v +./script/ci -v +``` + +Or inside a running container: + +```sh +./bin/test +``` diff --git a/integration/apps/sinatra2_classic/app/acme.rb b/integration/apps/sinatra2_classic/app/acme.rb new file mode 100644 index 00000000000..c1010ae10ae --- /dev/null +++ b/integration/apps/sinatra2_classic/app/acme.rb @@ -0,0 +1,69 @@ +require 'sinatra' +require 'ddtrace' + +Datadog.configure do |c| + c.service = 'acme-sinatra-2-classic' + c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') + c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics') + + if Datadog::DemoEnv.feature?('tracing') + c.tracing.analytics.enabled = true if Datadog::DemoEnv.feature?('analytics') + c.tracing.instrument :sinatra + end + + if Datadog::DemoEnv.feature?('appsec') + c.appsec.enabled = true + c.appsec.instrument :sinatra + end + + if Datadog::DemoEnv.feature?('pprof_to_file') + # Reconfigure transport to write pprof to file + c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport + end +end + +get '/' do + 'Hello world!' +end + +get '/health' do + 204 +end + +get '/health/detailed' do + [ + 200, + { 'Content-Type' => 'application/json' }, + JSON.generate( + webserver_process: $PROGRAM_NAME, + profiler_available: Datadog::Profiling.start_if_enabled, + # NOTE: Threads can't be named on Ruby 2.1 and 2.2 + profiler_threads: (unless RUBY_VERSION < '2.3' + (Thread.list.map(&:name).select do |it| + it && it.include?('Profiling') + end) + end) + ) + ] +end + +get '/basic/default' do + status 204 +end + +get '/basic/fibonacci' do + n = rand(25..35) + result = fib(n) + + [ + 200, + { 'Content-Type' => 'text/plain' }, + ["Basic: Fibonacci(#{n}): #{result}"] + ] +end + + private + +def fib(n) + n <= 1 ? n : fib(n - 1) + fib(n - 2) +end diff --git a/integration/apps/sinatra2_classic/bin/run b/integration/apps/sinatra2_classic/bin/run new file mode 100755 index 00000000000..c12a0769980 --- /dev/null +++ b/integration/apps/sinatra2_classic/bin/run @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' + +puts "\n== Starting application process ==" + +process = (ARGV[0] || Datadog::DemoEnv.process) +command = case process + when 'puma' + "bundle exec ddtracerb exec puma -C /app/config/puma.rb /app/config.ru" + when 'unicorn' + "bundle exec ddtracerb exec unicorn --port 80 -c /app/config/unicorn.rb /app/config.ru" + when 'webrick' + "bundle exec ddtracerb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" + when 'irb' + "bundle exec ddtracerb exec irb" + when nil, '' + abort("\n== ERROR: Must specify a application process! ==") + else + abort("\n== ERROR: Unknown application process '#{process}' ==") + end + +puts "Run: #{command}" +Kernel.exec(command) diff --git a/integration/apps/sinatra2_classic/bin/setup b/integration/apps/sinatra2_classic/bin/setup new file mode 100755 index 00000000000..1d18191decd --- /dev/null +++ b/integration/apps/sinatra2_classic/bin/setup @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + puts "Run: #{args.join(' ')}" + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + puts "\n== Installing dependencies ==" + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') +end diff --git a/integration/apps/sinatra2_classic/bin/test b/integration/apps/sinatra2_classic/bin/test new file mode 100755 index 00000000000..d227d2c2ed5 --- /dev/null +++ b/integration/apps/sinatra2_classic/bin/test @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + puts "Run: #{args.join(' ')}" + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + puts "\n== Performing setup ==" + system!('./bin/setup') + + if ENV['TEST_INTEGRATION'] + puts "\n== Wait for healthy HTTP server... ==" + system!('bash /vendor/dd-demo/http-health-check') + end + + puts "\n== Run test suite ==" + system!('rspec') +end diff --git a/integration/apps/sinatra2_classic/config.ru b/integration/apps/sinatra2_classic/config.ru new file mode 100644 index 00000000000..851cc39524e --- /dev/null +++ b/integration/apps/sinatra2_classic/config.ru @@ -0,0 +1,3 @@ +require_relative 'app/acme' + +run Sinatra::Application diff --git a/integration/apps/sinatra2_classic/config/puma.rb b/integration/apps/sinatra2_classic/config/puma.rb new file mode 100644 index 00000000000..39caa82a4b5 --- /dev/null +++ b/integration/apps/sinatra2_classic/config/puma.rb @@ -0,0 +1,14 @@ +require 'datadog/demo_env' + +Datadog::DemoEnv.print_env('Puma master environment') + +workers Integer(ENV["WEB_CONCURRENCY"] || 1) +threads 2, Integer(ENV['WEB_MAX_THREADS'] || 24) + +preload_app! + +bind 'tcp://0.0.0.0:80' + +on_worker_boot do + Datadog::DemoEnv.print_env('Puma worker environment') +end diff --git a/integration/apps/sinatra2_classic/config/unicorn.rb b/integration/apps/sinatra2_classic/config/unicorn.rb new file mode 100644 index 00000000000..4644b64b9c2 --- /dev/null +++ b/integration/apps/sinatra2_classic/config/unicorn.rb @@ -0,0 +1,23 @@ +require 'datadog/demo_env' + +# config/unicorn.rb +worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) +timeout 15 +preload_app true + +Datadog::DemoEnv.print_env('Unicorn master environment') + +before_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn master intercepting TERM and sending myself QUIT instead' + Process.kill 'QUIT', Process.pid + end +end + +after_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' + end + + Datadog::DemoEnv.print_env('Unicorn worker environment') +end diff --git a/integration/apps/sinatra2_classic/docker-compose.ci.yml b/integration/apps/sinatra2_classic/docker-compose.ci.yml new file mode 100644 index 00000000000..9c2981e642c --- /dev/null +++ b/integration/apps/sinatra2_classic/docker-compose.ci.yml @@ -0,0 +1,63 @@ +version: '3.4' +services: + app: + # Build at dd-trace-rb level to copy in current code + # and use it as the `ddtrace` gem. + build: + context: ../../.. + dockerfile: integration/apps/sinatra/Dockerfile-ci + args: + BASE_IMAGE: ${APP_IMAGE} + depends_on: + - ddagent + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - DD_METRIC_AGENT_PORT=8125 + - DD_TRACE_AGENT_PORT=8126 + - DD_HEALTH_METRICS_ENABLED=true + - DD_SERVICE=acme-sinatra + - DD_PROFILING_ENABLED=true + # Use these to choose what is run + - DD_DEMO_ENV_PROCESS # needs to be specified, see README for available options + - DD_DEMO_ENV_FEATURES=tracing + expose: + - "80" + stdin_open: true + tty: true + ddagent: + image: datadog/dd-apm-demo:agent + environment: + - DD_APM_ENABLED=true + - DD_PROCESS_AGENT_ENABLED=false + - DD_BIND_HOST=0.0.0.0 + - DD_API_KEY=00000000000000000000000000000000 + - LOG_LEVEL=DEBUG + - DD_LOGS_STDOUT=yes + - DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true + expose: + - "8125/udp" + - "8126" + # Build at dd-trace-rb level to copy in current code + # and use it as the `ddtrace` gem. + integration-tester: + build: + context: ../../.. + dockerfile: integration/apps/sinatra/Dockerfile-ci + args: + BASE_IMAGE: ${APP_IMAGE} + command: bin/test + depends_on: + - app + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - TEST_HOSTNAME=app + - TEST_PORT=80 + - TEST_INTEGRATION=true + - HEALTH_CHECK_URL=http://app/health + - HEALTH_CHECK_INTERVAL=1 + - HEALTH_CHECK_MAX_ATTEMPTS=30 + # volumes: + # - .:/app + # - ../../images/include:/vendor/dd-demo + # - ../../..:/vendor/dd-trace-rb diff --git a/integration/apps/sinatra2_classic/docker-compose.yml b/integration/apps/sinatra2_classic/docker-compose.yml new file mode 100644 index 00000000000..886c149052b --- /dev/null +++ b/integration/apps/sinatra2_classic/docker-compose.yml @@ -0,0 +1,80 @@ +version: '3.4' +services: + app: + build: + context: . + args: + BASE_IMAGE: datadog/dd-apm-demo:rb-2.7 + depends_on: + - ddagent + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - DD_METRIC_AGENT_PORT=8125 + - DD_TRACE_AGENT_PORT=8126 + - DD_HEALTH_METRICS_ENABLED=true + - DD_SERVICE=acme-sinatra + - DD_PROFILING_ENABLED=true + # Use these to choose what is run + - DD_DEMO_ENV_PROCESS=puma + - DD_DEMO_ENV_FEATURES=tracing,profiling + # Use this for a local version of ddtrace + - DD_DEMO_ENV_GEM_LOCAL_DDTRACE=/vendor/dd-trace-rb + # Use these for a specific revision of ddtrace + # - DD_DEMO_ENV_GEM_GIT_DDTRACE=https://github.com/DataDog/dd-trace-rb.git + # - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a + # Enable building the profiling native extension + # - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + expose: + - "80" + stdin_open: true + tty: true + volumes: + - .:/app + - ./data/app:/data/app + - bundle:/usr/local/bundle + - ../../images/include:/vendor/dd-demo + - ../../..:/vendor/dd-trace-rb + ddagent: + image: datadog/dd-apm-demo:agent + environment: + - DD_APM_ENABLED=true + - DD_PROCESS_AGENT_ENABLED=false + - DD_BIND_HOST=0.0.0.0 + - DD_API_KEY + - LOG_LEVEL=DEBUG + - DD_LOGS_STDOUT=yes + - DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true + expose: + - "8125/udp" + - "8126" + volumes: + - ../../images/agent/agent.yaml:/etc/datadog-agent/datadog.yaml + # For monitoring performance of containers (e.g. CPU, Memory, etc...) + # - type: bind + # source: ../../images/agent/agent.yaml + # target: /etc/datadog-agent/datadog.yaml + # - type: bind + # source: /var/run/docker.sock + # target: /var/run/docker.sock:ro + # - type: bind + # source: /proc/ + # target: /host/proc/:ro + # - type: bind + # source: /sys/fs/cgroup/ + # target: /host/sys/fs/cgroup:ro + load-tester: + build: + context: ../../images + dockerfile: wrk/Dockerfile + command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/fibonacci + depends_on: + - app + environment: + - HEALTH_CHECK_URL=http://app/health + - HEALTH_CHECK_INTERVAL=1 + - HEALTH_CHECK_MAX_ATTEMPTS=60 + volumes: + - ../../images/wrk/scripts:/scripts +volumes: + bundle: diff --git a/integration/apps/sinatra2_classic/script/build-images b/integration/apps/sinatra2_classic/script/build-images new file mode 100755 index 00000000000..f2a3078d705 --- /dev/null +++ b/integration/apps/sinatra2_classic/script/build-images @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +APP_DIR=${APP_SCRIPT_DIR%/script} +cd $APP_DIR + +while getopts ":v:" opt; do + case $opt in + v) + APP_RUBY_VERSION=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +echo "== Building Sinatra images... ==" +if [ -v APP_RUBY_VERSION ]; then + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-sinatra2-classic . +else + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-sinatra2-classic . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-sinatra2-classic . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.0 -t datadog/dd-apm-demo:rb-3.0-sinatra2-classic . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.1 -t datadog/dd-apm-demo:rb-3.1-sinatra2-classic . + docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.2 -t datadog/dd-apm-demo:rb-3.2-sinatra2-classic . + # ADD NEW RUBIES HERE +fi +echo "== Done building Sinatra images. ==" diff --git a/integration/apps/sinatra2_classic/script/ci b/integration/apps/sinatra2_classic/script/ci new file mode 100755 index 00000000000..c4820150335 --- /dev/null +++ b/integration/apps/sinatra2_classic/script/ci @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +APP_DIR=${APP_SCRIPT_DIR%/script} +cd $APP_DIR + +# Parse options +while getopts "v:" opt; do + case $opt in + v) + APP_RUBY_VERSION=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +# Validate options +if [ -z ${APP_RUBY_VERSION+x} ]; then + echo "You must specify a Ruby version with -v. (e.g. 2.7)" >&2 + exit 1 +fi + +# Set configuration +APP_BASE_IMAGE=${APP_BASE_IMAGE:-datadog/dd-apm-demo:rb-$APP_RUBY_VERSION} +APP_IMAGE=${APP_IMAGE:-$APP_BASE_IMAGE-sinatra2-classic} +APP_COMPOSE_FILES="-f docker-compose.ci.yml" + +echo "== Running integration tests... ==" +echo " - App: Sinatra" +echo " - Ruby version: $APP_RUBY_VERSION" +echo " - Base image: $APP_BASE_IMAGE" +echo " - App image: $APP_IMAGE" +echo "" + +# Pull/build any missing images +APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES build + +# Run the test suite with the different web servers +for DD_DEMO_ENV_PROCESS in puma unicorn webrick +do + echo -e "\n== Running with $DD_DEMO_ENV_PROCESS ================================================\n" + + export DD_DEMO_ENV_PROCESS + + APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES run integration-tester || \ + (APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES logs && exit -1) # Print container logs on `run` failure + + # Cleanup + APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES down -t 0 --remove-orphans +done diff --git a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb new file mode 100644 index 00000000000..8469487a8f8 --- /dev/null +++ b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' +require 'rspec/wait' +require 'securerandom' +require 'json' + +RSpec.describe 'Basic scenarios' do + include_context 'integration test' + + context 'default' do + subject { get('basic/default') } + it { is_expected.to be_a_kind_of(Net::HTTPOK) } + end +end diff --git a/integration/apps/sinatra2_classic/spec/spec_helper.rb b/integration/apps/sinatra2_classic/spec/spec_helper.rb new file mode 100644 index 00000000000..a77dd7398c6 --- /dev/null +++ b/integration/apps/sinatra2_classic/spec/spec_helper.rb @@ -0,0 +1,16 @@ +require 'byebug' +require 'support/integration_helper' + +RSpec.configure do |config| + config.include IntegrationHelper + + config.expect_with :rspec do |expectations| + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true + end + + config.shared_context_metadata_behavior = :apply_to_host_groups +end diff --git a/integration/apps/sinatra2_classic/spec/support/integration_helper.rb b/integration/apps/sinatra2_classic/spec/support/integration_helper.rb new file mode 100644 index 00000000000..76d4b297bfa --- /dev/null +++ b/integration/apps/sinatra2_classic/spec/support/integration_helper.rb @@ -0,0 +1,27 @@ +require 'net/http' + +module IntegrationHelper + shared_context 'integration test' do + before do + skip 'Integration tests not enabled.' unless ENV['TEST_INTEGRATION'] + end + + def hostname + ENV['TEST_HOSTNAME'] + end + + def port + ENV['TEST_PORT'] + end + + def get(path) + uri = URI("http://#{hostname}:#{port}/#{path}") + Net::HTTP.get_response(uri) + end + + def post(path, arguments) + uri = URI("http://#{hostname}:#{port}/#{path}") + Net::HTTP.post_form(uri, arguments) + end + end +end From bbcef4e2fa64778071dff4e8de2353d98798389f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 14 Jul 2022 10:09:10 +0100 Subject: [PATCH 0237/2133] [PROF-5808] Add `ENFORCE_TYPE` as user-friendly alternative to `Check_Type` While investigating #2151, I realized that `Check_Type`'s error message: `TypeError: wrong argument type nil (expected String)` is very hard to debug in functions that do many `Check_Type` verifications (such as `_native_do_export`). To fix this, I've created a new `ENFORCE_TYPE` helper which behaves similarly, but generates error messages such as: ``` TypeError: wrong argument nil for 'pprof_file_name' (expected a RUBY_T_STRING) at ../../../../ext/ddtrace_profiling_native_extension/http_transport.c:280:in `_native_do_export' ``` Hopefully this message will help us get to the bottom of the issue. I've modified every other use of `Check_Type` in the profiling native extension to use this new helper, in case we need to debug similar issues in the future. Issue #2151 --- .../NativeExtensionDesign.md | 2 +- .../collectors_stack.c | 5 ++- .../http_transport.c | 42 +++++++++---------- .../libddprof_helpers.h | 3 +- .../ruby_helpers.c | 25 +++++++++++ .../ruby_helpers.h | 19 +++++++++ 6 files changed, 71 insertions(+), 25 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/ruby_helpers.c diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md index 8eabf9546ed..af38092a19d 100644 --- a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md @@ -49,7 +49,7 @@ We avoid issues using a combination of: Non-exhaustive list of APIs that cause exceptions to be raised: -* `Check_TypedStruct`, `Check_Type` +* `Check_TypedStruct`, `Check_Type`, `ENFORCE_TYPE` * `rb_funcall` * `rb_thread_call_without_gvl`, `rb_thread_call_without_gvl2` * [Numeric conversion APIs, e.g. `NUM2LONG`, `NUM2INT`, etc.](https://silverhammermba.github.io/emberb/c/?#translation) diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index f70353ddcf3..86433a55f8b 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -2,6 +2,7 @@ #include #include "extconf.h" #include "libddprof_helpers.h" +#include "ruby_helpers.h" #include "private_vm_api_access.h" #include "stack_recorder.h" #include "collectors_stack.h" @@ -41,8 +42,8 @@ void collectors_stack_init(VALUE profiling_module) { // This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. // It SHOULD NOT be used for other purposes. static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames) { - Check_Type(metric_values_hash, T_HASH); - Check_Type(labels_array, T_ARRAY); + ENFORCE_TYPE(metric_values_hash, T_HASH); + ENFORCE_TYPE(labels_array, T_ARRAY); if (RHASH_SIZE(metric_values_hash) != ENABLED_VALUE_TYPES_COUNT) { rb_raise( diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 98bdab2cebc..10028842191 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -63,13 +63,13 @@ void http_transport_init(VALUE profiling_module) { } inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { - Check_Type(string, T_STRING); + ENFORCE_TYPE(string, T_STRING); ddprof_ffi_ByteSlice byte_slice = {.ptr = (uint8_t *) StringValuePtr(string), .len = RSTRING_LEN(string)}; return byte_slice; } static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) { - Check_Type(exporter_configuration, T_ARRAY); + ENFORCE_TYPE(exporter_configuration, T_ARRAY); ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, rb_ary_new()); VALUE failure_tuple = handle_exporter_failure(exporter_result); @@ -83,8 +83,8 @@ static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) } static ddprof_ffi_NewProfileExporterV3Result create_exporter(VALUE exporter_configuration, VALUE tags_as_array) { - Check_Type(exporter_configuration, T_ARRAY); - Check_Type(tags_as_array, T_ARRAY); + ENFORCE_TYPE(exporter_configuration, T_ARRAY); + ENFORCE_TYPE(tags_as_array, T_ARRAY); // This needs to be called BEFORE convert_tags since it can raise an exception and thus cause the ddprof_ffi_Vec_tag // to be leaked. @@ -111,7 +111,7 @@ static VALUE handle_exporter_failure(ddprof_ffi_NewProfileExporterV3Result expor } static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { - Check_Type(exporter_configuration, T_ARRAY); + ENFORCE_TYPE(exporter_configuration, T_ARRAY); ID working_mode = SYM2ID(rb_ary_entry(exporter_configuration, 0)); // SYM2ID verifies its input so we can do this safely @@ -122,13 +122,13 @@ static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { if (working_mode == agentless_id) { VALUE site = rb_ary_entry(exporter_configuration, 1); VALUE api_key = rb_ary_entry(exporter_configuration, 2); - Check_Type(site, T_STRING); - Check_Type(api_key, T_STRING); + ENFORCE_TYPE(site, T_STRING); + ENFORCE_TYPE(api_key, T_STRING); return ddprof_ffi_EndpointV3_agentless(char_slice_from_ruby_string(site), char_slice_from_ruby_string(api_key)); } else { // agent_id VALUE base_url = rb_ary_entry(exporter_configuration, 1); - Check_Type(base_url, T_STRING); + ENFORCE_TYPE(base_url, T_STRING); return ddprof_ffi_EndpointV3_agent(char_slice_from_ruby_string(base_url)); } @@ -136,7 +136,7 @@ static ddprof_ffi_EndpointV3 endpoint_from(VALUE exporter_configuration) { __attribute__((warn_unused_result)) static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { - Check_Type(tags_as_array, T_ARRAY); + ENFORCE_TYPE(tags_as_array, T_ARRAY); long tags_count = RARRAY_LEN(tags_as_array); ddprof_ffi_Vec_tag tags = ddprof_ffi_Vec_tag_new(); @@ -146,7 +146,7 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { if (!RB_TYPE_P(name_value_pair, T_ARRAY)) { ddprof_ffi_Vec_tag_drop(tags); - Check_Type(name_value_pair, T_ARRAY); + ENFORCE_TYPE(name_value_pair, T_ARRAY); } // Note: We can index the array without checking its size first because rb_ary_entry returns Qnil if out of bounds @@ -155,8 +155,8 @@ static ddprof_ffi_Vec_tag convert_tags(VALUE tags_as_array) { if (!(RB_TYPE_P(tag_name, T_STRING) && RB_TYPE_P(tag_value, T_STRING))) { ddprof_ffi_Vec_tag_drop(tags); - Check_Type(tag_name, T_STRING); - Check_Type(tag_value, T_STRING); + ENFORCE_TYPE(tag_name, T_STRING); + ENFORCE_TYPE(tag_value, T_STRING); } ddprof_ffi_PushTagResult push_result = @@ -272,18 +272,18 @@ static VALUE _native_do_export( VALUE code_provenance_data, VALUE tags_as_array ) { - Check_Type(upload_timeout_milliseconds, T_FIXNUM); - Check_Type(start_timespec_seconds, T_FIXNUM); - Check_Type(start_timespec_nanoseconds, T_FIXNUM); - Check_Type(finish_timespec_seconds, T_FIXNUM); - Check_Type(finish_timespec_nanoseconds, T_FIXNUM); - Check_Type(pprof_file_name, T_STRING); - Check_Type(pprof_data, T_STRING); - Check_Type(code_provenance_file_name, T_STRING); + ENFORCE_TYPE(upload_timeout_milliseconds, T_FIXNUM); + ENFORCE_TYPE(start_timespec_seconds, T_FIXNUM); + ENFORCE_TYPE(start_timespec_nanoseconds, T_FIXNUM); + ENFORCE_TYPE(finish_timespec_seconds, T_FIXNUM); + ENFORCE_TYPE(finish_timespec_nanoseconds, T_FIXNUM); + ENFORCE_TYPE(pprof_file_name, T_STRING); + ENFORCE_TYPE(pprof_data, T_STRING); + ENFORCE_TYPE(code_provenance_file_name, T_STRING); // Code provenance can be disabled and in that case will be set to nil bool have_code_provenance = !NIL_P(code_provenance_data); - if (have_code_provenance) Check_Type(code_provenance_data, T_STRING); + if (have_code_provenance) ENFORCE_TYPE(code_provenance_data, T_STRING); uint64_t timeout_milliseconds = NUM2ULONG(upload_timeout_milliseconds); diff --git a/ext/ddtrace_profiling_native_extension/libddprof_helpers.h b/ext/ddtrace_profiling_native_extension/libddprof_helpers.h index 4e9f113b223..a75eb9cd31b 100644 --- a/ext/ddtrace_profiling_native_extension/libddprof_helpers.h +++ b/ext/ddtrace_profiling_native_extension/libddprof_helpers.h @@ -1,9 +1,10 @@ #pragma once #include +#include "ruby_helpers.h" inline static ddprof_ffi_CharSlice char_slice_from_ruby_string(VALUE string) { - Check_Type(string, T_STRING); + ENFORCE_TYPE(string, T_STRING); ddprof_ffi_CharSlice char_slice = {.ptr = StringValuePtr(string), .len = RSTRING_LEN(string)}; return char_slice; } diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.c b/ext/ddtrace_profiling_native_extension/ruby_helpers.c new file mode 100644 index 00000000000..78e4923eced --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.c @@ -0,0 +1,25 @@ +#include "ruby_helpers.h" + +void raise_unexpected_type( + VALUE value, + enum ruby_value_type type, + const char *value_name, + const char *type_name, + const char *file, + int line, + const char* function_name +) { + rb_exc_raise( + rb_exc_new_str( + rb_eTypeError, + rb_sprintf("wrong argument %"PRIsVALUE" for '%s' (expected a %s) at %s:%d:in `%s'", + rb_inspect(value), + value_name, + type_name, + file, + line, + function_name + ) + ) + ); +} diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index d70a76c37a5..a958e4de95f 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -31,3 +31,22 @@ static inline int check_if_pending_exception(void) { rb_protect(process_pending_interruptions, Qnil, &pending_exception); return pending_exception; } + +#define ADD_QUOTES_HELPER(x) #x +#define ADD_QUOTES(x) ADD_QUOTES_HELPER(x) + +// Ruby has a Check_Type(value, type) that is roughly equivalent to this BUT Ruby's version is rather cryptic when it fails +// e.g. "wrong argument type nil (expected String)". This is a replacement that prints more information to help debugging. +#define ENFORCE_TYPE(value, type) \ + { if (RB_UNLIKELY(!RB_TYPE_P(value, type))) raise_unexpected_type(value, type, ADD_QUOTES(value), ADD_QUOTES(type), __FILE__, __LINE__, __func__); } + +// Called by ENFORCE_TYPE; should not be used directly +void raise_unexpected_type( + VALUE value, + enum ruby_value_type type, + const char *value_name, + const char *type_name, + const char *file, + int line, + const char* function_name +); From 90075de6cbbd8fd5a6799ba0d0a325b34c5595d3 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 14 Jul 2022 10:24:37 +0100 Subject: [PATCH 0238/2133] Add workaround for missing RB_UNLIKELY on Ruby 2.2 and 2.3 --- ext/ddtrace_profiling_native_extension/ruby_helpers.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index a958e4de95f..7275b2bd02e 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -9,6 +9,11 @@ static inline VALUE process_pending_interruptions(VALUE _unused) { return Qnil; } +// RB_UNLIKELY is not supported on Ruby 2.2 and 2.3 +#ifndef RB_UNLIKELY + #define RB_UNLIKELY(x) x +#endif + // Calls process_pending_interruptions BUT "rescues" any exceptions to be raised, returning them instead as // a non-zero `pending_exception`. // From 2d95a0c58369a518871680de8e12f9015a92ac53 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Tue, 28 May 2019 16:41:14 -0400 Subject: [PATCH 0239/2133] Fix redis integration not to create an invalid span in case of an empty pipeline --- .../tracing/contrib/redis/instrumentation.rb | 2 +- .../tracing/contrib/redis/redis_spec.rb | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/datadog/tracing/contrib/redis/instrumentation.rb b/lib/datadog/tracing/contrib/redis/instrumentation.rb index 611be5574fb..d49536d4a03 100644 --- a/lib/datadog/tracing/contrib/redis/instrumentation.rb +++ b/lib/datadog/tracing/contrib/redis/instrumentation.rb @@ -39,7 +39,7 @@ def call_pipeline(*args, &block) span.service = Datadog.configuration_for(self, :service_name) || datadog_configuration[:service_name] span.span_type = Contrib::Redis::Ext::TYPE commands = get_pipeline_commands(args) - span.resource = commands.join("\n") + span.resource = commands.any? ? commands.join("\n") : '(none)' span.set_metric Contrib::Redis::Ext::METRIC_PIPELINE_LEN, commands.length Contrib::Redis::Tags.set_common_tags(self, span) diff --git a/spec/datadog/tracing/contrib/redis/redis_spec.rb b/spec/datadog/tracing/contrib/redis/redis_spec.rb index 6f95ea4c115..6368600d2d9 100644 --- a/spec/datadog/tracing/contrib/redis/redis_spec.rb +++ b/spec/datadog/tracing/contrib/redis/redis_spec.rb @@ -195,6 +195,33 @@ end end + context 'empty pipeline' do + before(:each) do + responses.push(*redis.pipelined {}) + end + + let(:responses) { [] } + + it do + expect(responses).to eq([]) + expect(all_spans).to have(1).items + end + + describe 'span' do + subject(:span) { all_spans[-1] } + + it do + expect(span.get_metric('redis.pipeline_length')).to eq(0) + expect(span.name).to eq('redis.command') + expect(span.service).to eq('redis') + expect(span.resource).to eq('(none)') + expect(span.get_tag('redis.raw_command')).to eq('(none)') + end + + it_behaves_like 'a span with common tags' + end + end + context 'error' do subject(:bad_call) do redis.call 'THIS_IS_NOT_A_REDIS_FUNC', 'THIS_IS_NOT_A_VALID_ARG' From a3781c551193009c00b15d58963f4953780fd21c Mon Sep 17 00:00:00 2001 From: David Elner Date: Thu, 9 Jun 2022 12:56:10 -0400 Subject: [PATCH 0240/2133] Changed: SpanFilter drops child spans based on child-to-parent ordering. --- lib/datadog/tracing/pipeline/span_filter.rb | 14 +++-- .../tracing/pipeline/span_filter_spec.rb | 53 ++++++++++++++----- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/lib/datadog/tracing/pipeline/span_filter.rb b/lib/datadog/tracing/pipeline/span_filter.rb index e7a6bd54f7b..8e7bb019233 100644 --- a/lib/datadog/tracing/pipeline/span_filter.rb +++ b/lib/datadog/tracing/pipeline/span_filter.rb @@ -15,17 +15,21 @@ module Pipeline # # @public_api class SpanFilter < SpanProcessor - # NOTE: this SpanFilter implementation only handles traces in which child spans appear - # after parent spans in the trace array. If in the future child spans can be before + # NOTE: This SpanFilter implementation only handles traces in which child spans appear + # before parent spans in the trace array. If in the future child spans can be after # parent spans, then the code below will need to be updated. # @!visibility private def call(trace) deleted = Set.new - trace.spans.delete_if do |span| + span_count = trace.spans.length + trace.spans.reverse_each.with_index do |span, i| should_delete = deleted.include?(span.parent_id) || drop_it?(span) - deleted << span.id if should_delete - should_delete + + if should_delete + deleted << span.id + trace.spans.delete_at(span_count - 1 - i) + end end trace diff --git a/spec/datadog/tracing/pipeline/span_filter_spec.rb b/spec/datadog/tracing/pipeline/span_filter_spec.rb index 8d65e39b667..3043c1ed815 100644 --- a/spec/datadog/tracing/pipeline/span_filter_spec.rb +++ b/spec/datadog/tracing/pipeline/span_filter_spec.rb @@ -9,7 +9,8 @@ RSpec.describe Datadog::Tracing::Pipeline::SpanFilter do include PipelineHelpers - let(:trace) { Datadog::Tracing::TraceSegment.new([span_a, span_b, span_c]) } + let(:trace) { Datadog::Tracing::TraceSegment.new(trace_spans) } + let(:trace_spans) { [span_a, span_b, span_c] } let(:span_a) { generate_span('a') } let(:span_b) { generate_span('b') } let(:span_c) { generate_span('c') } @@ -35,28 +36,54 @@ end context 'with spans that have a parent' do - let(:trace) { Datadog::Tracing::TraceSegment.new([span_a, span_b, span_c, span_d]) } - let(:filter_regex) { /a/ } let(:span_b) { generate_span('b', span_a) } let(:span_c) { generate_span('c', span_b) } let(:span_d) { generate_span('d') } - it 'filters out any child spans of a span that matches the criteria' do - expect { span_filter.call(trace) } - .to change { trace.spans } - .from([span_a, span_b, span_c, span_d]) - .to([span_d]) + context 'in grandchild-to-grandparent order' do + let(:trace_spans) { [span_d, span_c, span_b, span_a] } + + it 'filters out any child spans of a span that matches the criteria' do + expect { span_filter.call(trace) } + .to change { trace.spans } + .from(trace_spans) + .to([span_d]) + end + + context 'with spans that have a parent span that doesnt match filtering criteria' do + let(:filter_regex) { /b/ } + + it 'does not filter out parent spans of child spans that matches the criteria' do + expect { span_filter.call(trace) } + .to change { trace.spans } + .from(trace_spans) + .to([span_d, span_a]) + end + end end - context 'with spans that have a parent span that doesnt match filtering criteria' do - let(:filter_regex) { /b/ } + context 'in grandparent-to-grandchild order' do + let(:trace_spans) { [span_a, span_b, span_c, span_d] } + + before { skip('Parent-to-child order filtering not supported.') } - it 'does not filter out parent spans of child spans that matches the criteria' do + it 'filters out any child spans of a span that matches the criteria' do expect { span_filter.call(trace) } .to change { trace.spans } - .from([span_a, span_b, span_c, span_d]) - .to([span_a, span_d]) + .from(trace_spans) + .to([span_d]) + end + + context 'with spans that have a parent span that doesnt match filtering criteria' do + let(:filter_regex) { /b/ } + + it 'does not filter out parent spans of child spans that matches the criteria' do + expect { span_filter.call(trace) } + .to change { trace.spans } + .from(trace_spans) + .to([span_a, span_d]) + end end end end From 41acadb4c4be5ab04bb70bf54bbcb2a7c3a8c586 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 14 Jul 2022 14:49:27 -0700 Subject: [PATCH 0241/2133] Update redis_spec.rb --- spec/datadog/tracing/contrib/redis/redis_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/tracing/contrib/redis/redis_spec.rb b/spec/datadog/tracing/contrib/redis/redis_spec.rb index 6368600d2d9..f8fec0ae9e7 100644 --- a/spec/datadog/tracing/contrib/redis/redis_spec.rb +++ b/spec/datadog/tracing/contrib/redis/redis_spec.rb @@ -204,11 +204,11 @@ it do expect(responses).to eq([]) - expect(all_spans).to have(1).items + expect(spans).to have(1).items end describe 'span' do - subject(:span) { all_spans[-1] } + subject(:span) { spans[-1] } it do expect(span.get_metric('redis.pipeline_length')).to eq(0) From fc9135af4797411334bc5e6bd56842cac0486f69 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Fri, 15 Jul 2022 10:22:17 +0300 Subject: [PATCH 0242/2133] Fix linting offense --- spec/datadog/tracing/contrib/redis/redis_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/tracing/contrib/redis/redis_spec.rb b/spec/datadog/tracing/contrib/redis/redis_spec.rb index f8fec0ae9e7..56eb0739898 100644 --- a/spec/datadog/tracing/contrib/redis/redis_spec.rb +++ b/spec/datadog/tracing/contrib/redis/redis_spec.rb @@ -196,7 +196,7 @@ end context 'empty pipeline' do - before(:each) do + before do responses.push(*redis.pipelined {}) end From 923b3f6bb304bca0de1dd3fbddaea4f67801dd20 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 15 Jul 2022 09:32:08 +0100 Subject: [PATCH 0243/2133] Add unit to `Time#measure` helper --- lib/datadog/core/utils/time.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datadog/core/utils/time.rb b/lib/datadog/core/utils/time.rb index 15ea1d3f801..00f979d20b9 100644 --- a/lib/datadog/core/utils/time.rb +++ b/lib/datadog/core/utils/time.rb @@ -36,10 +36,10 @@ def now_provider=(block) define_singleton_method(:now, &block) end - def measure - before = get_time + def measure(unit = :float_second) + before = get_time(unit) yield - after = get_time + after = get_time(unit) after - before end From 429dc66b4e42b36b6020a8d29a4f5af45dc5f422 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 15 Jul 2022 09:33:17 +0100 Subject: [PATCH 0244/2133] Minor: Remove old TODO We've had this TODO for a long time and never decided to go for this, so let's remove it. --- lib/datadog/core/configuration/components.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 7fb23802548..9acd8522ce4 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -305,8 +305,6 @@ def build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) old_recorder, trace_identifiers_helper: trace_identifiers_helper, max_frames: settings.profiling.advanced.max_frames - # TODO: Provide proc that identifies Datadog worker threads? - # ignore_thread: settings.profiling.ignore_profiler ) ] end From 51cdf4e6b592bef9dba0a79c6bf5b0807ac5bd60 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 15 Jul 2022 10:37:27 +0100 Subject: [PATCH 0245/2133] Add `samples_from_pprof` to profiling spec helper There's quite a few specs where we need to take a pprof output and assert on its contents, which are in a really awkward format for most assertions we want. So rather than repeating the conversion code everywhere, I've added a nice helper that can be used accross multiple specs (and that is quite useful when debugging stuff too). --- .../collectors/cpu_and_wall_time_spec.rb | 23 ++++++++-------- .../profiling/collectors/stack_spec.rb | 17 +++--------- spec/datadog/profiling/spec_helper.rb | 26 +++++++++++++++++++ spec/datadog/profiling/stack_recorder_spec.rb | 19 ++++---------- 4 files changed, 45 insertions(+), 40 deletions(-) diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 0685d2508d6..eff2e2f6779 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -43,22 +43,22 @@ end describe '#sample' do - it 'samples all threads' do - all_threads = Thread.list - - decoded_profile = sample_and_decode + let(:pprof_result) do + serialization_result = recorder.serialize + raise 'Unexpected: Serialization failed' unless serialization_result - expect(decoded_profile.sample.size).to be all_threads.size + serialization_result.last end + let(:samples) { samples_from_pprof(pprof_result) } - def sample_and_decode - cpu_and_wall_time_collector.sample + it 'samples all threads' do + all_threads = Thread.list - serialization_result = recorder.serialize - raise 'Unexpected: Serialization failed' unless serialization_result + cpu_and_wall_time_collector.sample + samples = samples_from_pprof(pprof_result) - pprof_data = serialization_result.last - ::Perftools::Profiles::Profile.decode(pprof_data) + expect(Thread.list).to eq(all_threads), 'Threads finished during this spec, causing flakiness!' + expect(samples.size).to be all_threads.size end end @@ -68,7 +68,6 @@ def sample_and_decode end end - # Validate that we correctly clean up and don't leak per_thread_context describe '#per_thread_context' do context 'before sampling' do it do diff --git a/spec/datadog/profiling/collectors/stack_spec.rb b/spec/datadog/profiling/collectors/stack_spec.rb index b6ad93c29e0..1d02b144f40 100644 --- a/spec/datadog/profiling/collectors/stack_spec.rb +++ b/spec/datadog/profiling/collectors/stack_spec.rb @@ -343,22 +343,11 @@ def sample_and_decode(thread, max_frames: 400, recorder: Datadog::Profiling::Sta raise 'Unexpected: Serialization failed' unless serialization_result pprof_data = serialization_result.last - decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) - expect(decoded_profile.sample.size).to be 1 - sample = decoded_profile.sample.first + samples = samples_from_pprof(pprof_data) - sample.location_id.map { |location_id| decode_frame(decoded_profile, location_id) } - end - - def decode_frame(decoded_profile, location_id) - strings = decoded_profile.string_table - location = decoded_profile.location.find { |loc| loc.id == location_id } - expect(location.line.size).to be 1 - line_entry = location.line.first - function = decoded_profile.function.find { |func| func.id == line_entry.function_id } - - { base_label: strings[function.name], path: strings[function.filename], lineno: line_entry.line } + expect(samples.size).to be 1 + samples.first.fetch(:locations) end end diff --git a/spec/datadog/profiling/spec_helper.rb b/spec/datadog/profiling/spec_helper.rb index f31b217195d..900ff9fc204 100644 --- a/spec/datadog/profiling/spec_helper.rb +++ b/spec/datadog/profiling/spec_helper.rb @@ -51,6 +51,32 @@ def skip_if_profiling_not_supported(testcase) raise "Profiling does not seem to be available: #{Datadog::Profiling.unsupported_reason}. " \ 'Try running `bundle exec rake compile` before running this test.' end + + def samples_from_pprof(pprof_data) + decoded_profile = ::Perftools::Profiles::Profile.decode(pprof_data) + + string_table = decoded_profile.string_table + pretty_sample_types = decoded_profile.sample_type.map { |it| string_table[it.type].to_sym } + + decoded_profile.sample.map do |sample| + { + locations: sample.location_id.map { |location_id| decode_frame_from_pprof(decoded_profile, location_id) }, + values: pretty_sample_types.zip(sample.value).to_h, + labels: sample.label.map { |it| [string_table[it.key].to_sym, it.str != 0 ? string_table[it.str] : it.num] }.to_h, + } + end + end + + def decode_frame_from_pprof(decoded_profile, location_id) + strings = decoded_profile.string_table + location = decoded_profile.location.find { |loc| loc.id == location_id } + raise 'Unexpected: Multiple lines for location' unless location.line.size == 1 + + line_entry = location.line.first + function = decoded_profile.function.find { |func| func.id == line_entry.function_id } + + { base_label: strings[function.name], path: strings[function.filename], lineno: line_entry.line } + end end RSpec.configure do |config| diff --git a/spec/datadog/profiling/stack_recorder_spec.rb b/spec/datadog/profiling/stack_recorder_spec.rb index 687cc8d04cd..120c96d2a69 100644 --- a/spec/datadog/profiling/stack_recorder_spec.rb +++ b/spec/datadog/profiling/stack_recorder_spec.rb @@ -79,28 +79,19 @@ def sample_types_from(decoded_profile) let(:metric_values) { { 'cpu-time' => 123, 'cpu-samples' => 456, 'wall-time' => 789 } } let(:labels) { { 'label_a' => 'value_a', 'label_b' => 'value_b' }.to_a } + let(:samples) { samples_from_pprof(encoded_pprof) } + before do collectors_stack.sample(Thread.current, stack_recorder, metric_values, labels) - expect(decoded_profile.sample.size).to be 1 + expect(samples.size).to be 1 end it 'encodes the sample with the metrics provided' do - sample = decoded_profile.sample.first - strings = decoded_profile.string_table - - decoded_metric_values = - sample.value.map.with_index { |value, index| [strings[decoded_profile.sample_type[index].type], value] }.to_h - - expect(decoded_metric_values).to eq metric_values + expect(samples.first).to include(values: { 'cpu-time': 123, 'cpu-samples': 456, 'wall-time': 789 }) end it 'encodes the sample with the labels provided' do - sample = decoded_profile.sample.first - strings = decoded_profile.string_table - - decoded_labels = sample.label.map { |label| [strings[label.key], strings[label.str]] } - - expect(decoded_labels).to eq labels + expect(samples.first).to include(labels: { label_a: 'value_a', label_b: 'value_b' }) end it 'encodes a single empty mapping' do From 39a146870f58ea108082a8ae0a305fc5be9194c9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 15 Jul 2022 10:45:44 +0100 Subject: [PATCH 0246/2133] [PROF-4902] Include 'thread id' label when sampling threads In a previous PR, we added a `per_thread_context` structure that can store information for each thread being sampled. The first bit of information being stored there is the `thread id`, which we will also use to tag all samples with the thread they came from. This behavior is the same as currently implemented by the `OldStack` sampler. --- .../collectors_cpu_and_wall_time.c | 37 +++++++++++++++++-- lib/datadog/profiling/ext.rb | 1 + .../collectors/cpu_and_wall_time_spec.rb | 15 ++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index af61b382d2b..a2ddd115b7f 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -25,7 +25,7 @@ struct cpu_and_wall_time_collector_state { // Tracks per-thread state struct per_thread_context { - int dummy_placeholder_will_be_removed_in_next_pr; + long thread_id; }; static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); @@ -38,12 +38,14 @@ static VALUE _native_sample(VALUE self, VALUE collector_instance); static void sample(VALUE collector_instance); static VALUE _native_thread_list(VALUE self); static struct per_thread_context *get_or_create_context_for(VALUE thread, struct cpu_and_wall_time_collector_state *state); +static void initialize_context(VALUE thread, struct per_thread_context *thread_context); static VALUE _native_inspect(VALUE self, VALUE collector_instance); static VALUE per_thread_context_st_table_as_ruby_hash(struct cpu_and_wall_time_collector_state *state); static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value_context, st_data_t result_hash); static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_state *state); static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument); static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance); +static long thread_id_for(VALUE thread); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -176,12 +178,16 @@ static void sample(VALUE collector_instance) { metric_values[CPU_SAMPLES_VALUE_POS] = 34; metric_values[WALL_TIME_VALUE_POS] = 56; + ddprof_ffi_Label labels[] = { + {.key = DDPROF_FFI_CHARSLICE_C("thread id"), .num = thread_context->thread_id} + }; + sample_thread( thread, state->sampling_buffer, state->recorder_instance, (ddprof_ffi_Slice_i64) {.ptr = metric_values, .len = ENABLED_VALUE_TYPES_COUNT}, - (ddprof_ffi_Slice_label) {.ptr = NULL, .len = 0} // FIXME: TODO we need to gather the expected labels + (ddprof_ffi_Slice_label) {.ptr = labels, .len = 1} ); } @@ -206,12 +212,17 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct thread_context = (struct per_thread_context*) value_context; } else { thread_context = ruby_xcalloc(1, sizeof(struct per_thread_context)); + initialize_context(thread, thread_context); st_insert(state->hash_map_per_thread_context, (st_data_t) thread, (st_data_t) thread_context); } return thread_context; } +static void initialize_context(VALUE thread, struct per_thread_context *thread_context) { + thread_context->thread_id = thread_id_for(thread); +} + static VALUE _native_inspect(VALUE self, VALUE collector_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); @@ -236,11 +247,14 @@ static VALUE per_thread_context_st_table_as_ruby_hash(struct cpu_and_wall_time_c static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value_context, st_data_t result_hash) { VALUE thread = (VALUE) key_thread; + struct per_thread_context *thread_context = (struct per_thread_context*) value_context; VALUE result = (VALUE) result_hash; VALUE context_as_hash = rb_hash_new(); rb_hash_aset(result, thread, context_as_hash); - VALUE arguments[] = {}; + VALUE arguments[] = { + ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id) + }; for (long unsigned int i = 0; i < VALUE_COUNT(arguments); i += 2) rb_hash_aset(context_as_hash, arguments[i], arguments[i+1]); return ST_CONTINUE; @@ -267,3 +281,20 @@ static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance) { return per_thread_context_st_table_as_ruby_hash(state); } + +static long thread_id_for(VALUE thread) { + VALUE object_id = rb_obj_id(thread); + + // The API docs for Ruby state that `rb_obj_id` COULD be a BIGNUM and that if you want to be really sure you don't + // get a BIGNUM, then you should use `rb_memory_id`. But `rb_memory_id` is less interesting because it's less visible + // at the user level than the result of calling `#object_id`. + // + // It also seems uncommon to me that we'd ever get a BIGNUM; on old Ruby versions (pre-GC compaction), the object id + // was the pointer to the object, so that's not going to be a BIGNUM; on modern Ruby versions, Ruby keeps + // a counter, and only increments it for objects for which `#object_id`/`rb_obj_id` is called (e.g. most objects + // won't actually have an object id allocated). + // + // So, for now, let's simplify: we only support FIXNUMs, and we won't break if we get a BIGNUM; we just won't + // record the thread_id (but samples will still be collected). + return FIXNUM_P(object_id) ? FIX2LONG(object_id) : -1; +} diff --git a/lib/datadog/profiling/ext.rb b/lib/datadog/profiling/ext.rb index 3c0f05feffc..c53927a6633 100644 --- a/lib/datadog/profiling/ext.rb +++ b/lib/datadog/profiling/ext.rb @@ -9,6 +9,7 @@ module Ext ENV_AGENTLESS = 'DD_PROFILING_AGENTLESS'.freeze ENV_ENDPOINT_COLLECTION_ENABLED = 'DD_PROFILING_ENDPOINT_COLLECTION_ENABLED'.freeze + # TODO: Consider removing this once the Ruby-based pprof encoding is removed and replaced by libdatadog module Pprof LABEL_KEY_LOCAL_ROOT_SPAN_ID = 'local root span id'.freeze LABEL_KEY_SPAN_ID = 'span id'.freeze diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index eff2e2f6779..d51cdda2289 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -60,6 +60,15 @@ expect(Thread.list).to eq(all_threads), 'Threads finished during this spec, causing flakiness!' expect(samples.size).to be all_threads.size end + + it 'tags the samples with the object ids of the Threads they belong to' do + cpu_and_wall_time_collector.sample + + samples = samples_from_pprof(pprof_result) + + expect(samples.map { |it| it.fetch(:labels).fetch(:'thread id') }) + .to include(*[Thread.main, t1, t2, t3].map(&:object_id)) + end end describe '#thread_list' do @@ -83,6 +92,12 @@ it 'contains all the sampled threads' do expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t2, t3) end + + it 'contains the thread ids (object_ids) of all sampled threads' do + cpu_and_wall_time_collector.per_thread_context.each do |thread, context| + expect(context.fetch(:thread_id)).to eq thread.object_id + end + end end context 'after sampling multiple times' do From decb800913d201b68a76492037735defeb2fd154 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 15 Jul 2022 10:54:49 +0100 Subject: [PATCH 0247/2133] Fix using Ruby 2.2 syntax Sigh... --- spec/datadog/profiling/stack_recorder_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/profiling/stack_recorder_spec.rb b/spec/datadog/profiling/stack_recorder_spec.rb index 120c96d2a69..b37a1ebbd73 100644 --- a/spec/datadog/profiling/stack_recorder_spec.rb +++ b/spec/datadog/profiling/stack_recorder_spec.rb @@ -87,7 +87,7 @@ def sample_types_from(decoded_profile) end it 'encodes the sample with the metrics provided' do - expect(samples.first).to include(values: { 'cpu-time': 123, 'cpu-samples': 456, 'wall-time': 789 }) + expect(samples.first).to include(values: { :'cpu-time' => 123, :'cpu-samples' => 456, :'wall-time' => 789 }) end it 'encodes the sample with the labels provided' do From 6daa406fe5ed86b5cbf3de5a00e1450a6b5c3621 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 15 Jul 2022 16:49:54 -0700 Subject: [PATCH 0248/2133] Lint:ddtrace.gemspec --- .rubocop.yml | 8 +++++++- ddtrace.gemspec | 28 +++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0bbb27fd642..e5a59a09f8e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,7 +16,6 @@ AllCops: - 'Rakefile' Exclude: - 'Appraisals' - - '*.gemspec' - 'lib/ddtrace/**/vendor/**/*.rb' - 'lib/datadog/**/vendor/**/*.rb' - 'integration/apps/*/bin/*' @@ -392,3 +391,10 @@ Style/TrailingCommaInHashLiteral: Naming/VariableNumber: Enabled: false + +# Requires that the Rubocop linter should be configured to +# match the same version as `spec.required_rubygems_version` in our gemspec file. +# This is not currently possible, as we'd like to use updated versions of Rubocop +# that have already dropped support for our minimum supported Ruby version. +Gemspec/RequiredRubyVersion: + Enabled: false diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 277f8494359..a3de7296b8b 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -1,23 +1,24 @@ -# coding: utf-8 +# frozen_string_literal: true -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ddtrace/version' Gem::Specification.new do |spec| spec.name = 'ddtrace' spec.version = DDTrace::VERSION::STRING - spec.required_ruby_version = [">= #{DDTrace::VERSION::MINIMUM_RUBY_VERSION}", "< #{DDTrace::VERSION::MAXIMUM_RUBY_VERSION}"] + spec.required_ruby_version = [">= #{DDTrace::VERSION::MINIMUM_RUBY_VERSION}", + "< #{DDTrace::VERSION::MAXIMUM_RUBY_VERSION}"] spec.required_rubygems_version = '>= 2.0.0' spec.authors = ['Datadog, Inc.'] spec.email = ['dev@datadoghq.com'] spec.summary = 'Datadog tracing code for your Ruby applications' - spec.description = <<-EOS.gsub(/^[\s]+/, '') + spec.description = <<-DESC.gsub(/^\s+/, '') ddtrace is Datadog’s tracing client for Ruby. It is used to trace requests as they flow across web servers, databases and microservices so that developers have great visiblity into bottlenecks and troublesome requests. - EOS + DESC spec.homepage = 'https://github.com/DataDog/dd-trace-rb' spec.license = 'BSD-3-Clause' @@ -28,6 +29,8 @@ Gem::Specification.new do |spec| raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' end + # rubocop:disable all + # DEV: `spec.files` is more problematic than a simple Rubocop pass. spec.files = `git ls-files -z` .split("\x0") @@ -36,21 +39,12 @@ Gem::Specification.new do |spec| ['.dockerignore', '.env', '.gitattributes', '.gitlab-ci.yml', '.rspec', '.rubocop.yml', '.rubocop_todo.yml', '.simplecov', 'Appraisals', 'Gemfile', 'Rakefile', 'docker-compose.yml', '.pryrc', '.yardopts'].include?(f) end + # rubocop:enable all spec.executables = ['ddtracerb'] spec.require_paths = ['lib'] - # Important note: This `if` ONLY works for development. When packaging up the gem, Ruby runs this code, and hardcodes - # the output in the `.gem` file that gets uploaded to rubygems. So the decision here gets hardcoded, we don't actually - # pick a version depending on the Ruby customers are running, as it may appear. - # For more context, see the discussion in - # * https://github.com/DataDog/dd-trace-rb/pull/1739 - # * https://github.com/DataDog/dd-trace-rb/pull/1336 - if RUBY_VERSION >= '2.2.0' - spec.add_dependency 'msgpack' - else - # msgpack 1.4 fails for Ruby 2.1: https://github.com/msgpack/msgpack-ruby/issues/205 - spec.add_dependency 'msgpack', '< 1.4' - end + # Used to serialize traces to send them to the Datadog Agent. + spec.add_dependency 'msgpack' # Used by the profiler native extension to support older Rubies (see NativeExtensionDesign.md for notes) # From 0f99249a7aee1a1706e2205a2977e89d4028f83b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 18 Jul 2022 11:37:23 +0100 Subject: [PATCH 0249/2133] [PROF-4902] Gather thread name during sampling I've wanted to support this extra tiny feature for quite a while now: gathering the thread names, not just their IDs. We already have this feature for the Java and Python profilers, and I like it quite a lot. (Note: Since this feature is only being added on the profiling native extension, it won't show up for customers for now since we haven't wired it up for use yet.) --- .../collectors_cpu_and_wall_time.c | 21 +++++++++++---- .../extconf.rb | 2 ++ .../private_vm_api_access.c | 8 ++++++ .../private_vm_api_access.h | 1 + .../collectors/cpu_and_wall_time_spec.rb | 27 ++++++++++++++++--- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index a2ddd115b7f..de83fae9f1d 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,7 +1,8 @@ #include #include "collectors_stack.h" -#include "stack_recorder.h" +#include "libddprof_helpers.h" #include "private_vm_api_access.h" +#include "stack_recorder.h" // Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class @@ -178,16 +179,26 @@ static void sample(VALUE collector_instance) { metric_values[CPU_SAMPLES_VALUE_POS] = 34; metric_values[WALL_TIME_VALUE_POS] = 56; - ddprof_ffi_Label labels[] = { - {.key = DDPROF_FFI_CHARSLICE_C("thread id"), .num = thread_context->thread_id} - }; + VALUE thread_name = thread_name_for(thread); + bool have_thread_name = thread_name != Qnil; + + int label_count = 1 + (have_thread_name ? 1 : 0); + ddprof_ffi_Label labels[label_count]; + + labels[0] = (ddprof_ffi_Label) {.key = DDPROF_FFI_CHARSLICE_C("thread id"), .num = thread_context->thread_id}; + if (have_thread_name) { + labels[1] = (ddprof_ffi_Label) { + .key = DDPROF_FFI_CHARSLICE_C("thread name"), + .str = char_slice_from_ruby_string(thread_name) + }; + } sample_thread( thread, state->sampling_buffer, state->recorder_instance, (ddprof_ffi_Slice_i64) {.ptr = metric_values, .len = ENABLED_VALUE_TYPES_COUNT}, - (ddprof_ffi_Slice_label) {.ptr = labels, .len = 1} + (ddprof_ffi_Slice_label) {.ptr = labels, .len = label_count} ); } diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 6763abcb1be..fd7396e7a74 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -133,6 +133,8 @@ def add_compiler_flag(flag) $defs << '-DNO_RB_TIME_TIMESPEC_NEW' # ...the VM changed enough that we need an alternative legacy rb_profile_frames $defs << '-DUSE_LEGACY_RB_PROFILE_FRAMES' + # ... you couldn't name threads + $defs << '-DNO_THREAD_NAMES' end # If we got here, libdatadog is available and loaded diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 688378d6bdb..07541f18581 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -107,6 +107,14 @@ bool is_thread_alive(VALUE thread) { return thread_struct_from_object(thread)->status != THREAD_KILLED; } +VALUE thread_name_for(VALUE thread) { + #ifdef NO_THREAD_NAMES + return Qnil; + #else + return thread_struct_from_object(thread)->name; + #endif +} + // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. // Each function is annotated with its origin, why we imported it, and the changes made. diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h index 8e92868cbb6..fcd4e7b4b8f 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.h @@ -15,6 +15,7 @@ rb_nativethread_id_t pthread_id_for(VALUE thread); ptrdiff_t stack_depth_for(VALUE thread); VALUE ddtrace_thread_list(void); bool is_thread_alive(VALUE thread); +VALUE thread_name_for(VALUE thread); int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, int *lines, bool* is_ruby_frame); diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index d51cdda2289..02686ec27f0 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -55,7 +55,6 @@ all_threads = Thread.list cpu_and_wall_time_collector.sample - samples = samples_from_pprof(pprof_result) expect(Thread.list).to eq(all_threads), 'Threads finished during this spec, causing flakiness!' expect(samples.size).to be all_threads.size @@ -64,11 +63,33 @@ it 'tags the samples with the object ids of the Threads they belong to' do cpu_and_wall_time_collector.sample - samples = samples_from_pprof(pprof_result) - expect(samples.map { |it| it.fetch(:labels).fetch(:'thread id') }) .to include(*[Thread.main, t1, t2, t3].map(&:object_id)) end + + it 'includes the thread names, if available' do + skip 'Thread names not available on Ruby 2.2' if RUBY_VERSION < '2.3' + + t1.name = 'thread t1' + t2.name = nil + t3.name = 'thread t3' + + cpu_and_wall_time_collector.sample + + t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } + t2_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t2.object_id } + t3_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t3.object_id } + + expect(t1_sample).to include(labels: include(:'thread name' => 'thread t1')) + expect(t2_sample.fetch(:labels).keys).to_not include(:'thread name') + expect(t3_sample).to include(labels: include(:'thread name' => 'thread t3')) + end + + it 'does not include thread names on Ruby 2.2' do + skip 'Testcase only applies to Ruby 2.2' if RUBY_VERSION >= '2.3' + + expect(samples.flat_map { |it| it.fetch(:labels).keys }).to_not include(':thread name') + end end describe '#thread_list' do From d33255c07f8b0ae0ca51a253785bf74588a077f6 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 18 Jul 2022 14:23:23 +0100 Subject: [PATCH 0250/2133] [PROF-4902] Track passage of wall-clock time between samples One of the main responsibilities of the `CpuAndWallTime` collector is tracking the amount of wall-clock time (aka real world time) that elapses between samples. It works by tracking the timestamp of when a thread was sampled (in `wall_time_at_previous_sample_ns` inside the `per_thread_context`), and then tagging samples with the elapsed time between the current and the previous sample. (The first time a thread is sampled, the elapsed time is set to 0). This allows users to tell what their threads are spending time, even when they're not actually spending CPU (e.g. when they're waiting on a database query). Tracking of cpu-time is still missing, and will be added in a separate commit/PR. --- .../collectors_cpu_and_wall_time.c | 39 +++++++++++++++++-- .../collectors/cpu_and_wall_time_spec.rb | 26 +++++++++++++ 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index de83fae9f1d..1451b97a141 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -8,6 +8,7 @@ // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class static VALUE collectors_cpu_and_wall_time_class = Qnil; +#define INVALID_TIME -1 // Contains state for a single CpuAndWallTime instance struct cpu_and_wall_time_collector_state { @@ -27,6 +28,7 @@ struct cpu_and_wall_time_collector_state { // Tracks per-thread state struct per_thread_context { long thread_id; + long wall_time_at_previous_sample_ns; // Can be INVALID_TIME until initialized }; static void cpu_and_wall_time_collector_typed_data_mark(void *state_ptr); @@ -46,6 +48,8 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_state *state); static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument); static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance); +static long update_time_since_previous_sample(long *time_at_previous_sample_ns, long current_time_ns); +static long wall_time_now_ns(struct cpu_and_wall_time_collector_state *state); static long thread_id_for(VALUE thread); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { @@ -166,18 +170,23 @@ static void sample(VALUE collector_instance) { TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); VALUE threads = ddtrace_thread_list(); + long current_wall_time_ns = wall_time_now_ns(state); const long thread_count = RARRAY_LEN(threads); for (long i = 0; i < thread_count; i++) { VALUE thread = RARRAY_AREF(threads, i); struct per_thread_context *thread_context = get_or_create_context_for(thread, state); + long wall_time_elapsed_ns = + update_time_since_previous_sample(&thread_context->wall_time_at_previous_sample_ns, current_wall_time_ns); + int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; // FIXME: TODO These are just dummy values for now - metric_values[CPU_TIME_VALUE_POS] = 12; - metric_values[CPU_SAMPLES_VALUE_POS] = 34; - metric_values[WALL_TIME_VALUE_POS] = 56; + metric_values[CPU_TIME_VALUE_POS] = 12; // FIXME: Placeholder until actually implemented/tested + metric_values[CPU_SAMPLES_VALUE_POS] = 34; // FIXME: Placeholder until actually implemented/tested + + metric_values[WALL_TIME_VALUE_POS] = wall_time_elapsed_ns; VALUE thread_name = thread_name_for(thread); bool have_thread_name = thread_name != Qnil; @@ -232,6 +241,9 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct static void initialize_context(VALUE thread, struct per_thread_context *thread_context) { thread_context->thread_id = thread_id_for(thread); + + // These will get initialized during actual sampling + thread_context->wall_time_at_previous_sample_ns = INVALID_TIME; } static VALUE _native_inspect(VALUE self, VALUE collector_instance) { @@ -264,7 +276,8 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value rb_hash_aset(result, thread, context_as_hash); VALUE arguments[] = { - ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id) + ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id), + ID2SYM(rb_intern("wall_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->wall_time_at_previous_sample_ns) }; for (long unsigned int i = 0; i < VALUE_COUNT(arguments); i += 2) rb_hash_aset(context_as_hash, arguments[i], arguments[i+1]); @@ -293,6 +306,24 @@ static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance) { return per_thread_context_st_table_as_ruby_hash(state); } +static long update_time_since_previous_sample(long *time_at_previous_sample_ns, long current_time_ns) { + // If we didn't have a time for the previous sample, we use the current one + if (*time_at_previous_sample_ns == INVALID_TIME) *time_at_previous_sample_ns = current_time_ns; + + long elapsed_time_ns = current_time_ns - *time_at_previous_sample_ns; + *time_at_previous_sample_ns = current_time_ns; + + return elapsed_time_ns >= 0 ? elapsed_time_ns : 0 /* In case something really weird happened */; +} + +static long wall_time_now_ns(struct cpu_and_wall_time_collector_state *state) { + struct timespec current_monotonic; + + if (clock_gettime(CLOCK_MONOTONIC, ¤t_monotonic) != 0) rb_sys_fail("Failed to read CLOCK_MONOTONIC"); + + return current_monotonic.tv_nsec + (current_monotonic.tv_sec * 1000 * 1000 * 1000); +} + static long thread_id_for(VALUE thread) { VALUE object_id = rb_obj_id(thread); diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 02686ec27f0..e9f05c9f78e 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -90,6 +90,24 @@ expect(samples.flat_map { |it| it.fetch(:labels).keys }).to_not include(':thread name') end + + it 'includes the wall time elapsed between samples' do + cpu_and_wall_time_collector.sample + wall_time_at_first_sample = + cpu_and_wall_time_collector.per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) + + cpu_and_wall_time_collector.sample + wall_time_at_second_sample = + cpu_and_wall_time_collector.per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) + + t1_samples = samples.select { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } + wall_time = t1_samples.first.fetch(:values).fetch(:'wall-time') + + expect(t1_samples.size) + .to be(1), "Expected thread t1 to always have same stack trace (because it's sleeping), got #{t1_samples.inspect}" + + expect(wall_time).to be(wall_time_at_second_sample - wall_time_at_first_sample) + end end describe '#thread_list' do @@ -107,7 +125,9 @@ context 'after sampling' do before do + @wall_time_before_sample_ns = Datadog::Core::Utils::Time.get_time(:nanosecond) cpu_and_wall_time_collector.sample + @wall_time_after_sample_ns = Datadog::Core::Utils::Time.get_time(:nanosecond) end it 'contains all the sampled threads' do @@ -119,6 +139,12 @@ expect(context.fetch(:thread_id)).to eq thread.object_id end end + + it 'sets the wall_time_at_previous_sample_ns to the current wall clock value' do + expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + include(wall_time_at_previous_sample_ns: be_between(@wall_time_before_sample_ns, @wall_time_after_sample_ns)) + ) + end end context 'after sampling multiple times' do From 8b851072bba61ca9063137ba840b66c749ccc86d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 19 Jul 2022 16:39:48 +0100 Subject: [PATCH 0251/2133] Fix "function might be candidate for attribute noreturn" warning The `raise_unexpected_type` function always raises an exception. When compiling on Linux, I was getting this very helpful warning: ``` ../../../../ext/ddtrace_profiling_native_extension/ruby_helpers.c: In function 'raise_unexpected_type': ../../../../ext/ddtrace_profiling_native_extension/ruby_helpers.c:3:6: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn] 3 | void raise_unexpected_type( | ^~~~~~~~~~~~~~~~~~~~~ ``` So to fix this warning, and make it clear to the compiler that the function never returns, I've wrapped it with the `NORETURN` macro that Ruby defines in the VM headers. --- ext/ddtrace_profiling_native_extension/ruby_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index 7275b2bd02e..214adaf24c8 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -46,7 +46,7 @@ static inline int check_if_pending_exception(void) { { if (RB_UNLIKELY(!RB_TYPE_P(value, type))) raise_unexpected_type(value, type, ADD_QUOTES(value), ADD_QUOTES(type), __FILE__, __LINE__, __func__); } // Called by ENFORCE_TYPE; should not be used directly -void raise_unexpected_type( +NORETURN(void raise_unexpected_type( VALUE value, enum ruby_value_type type, const char *value_name, @@ -54,4 +54,4 @@ void raise_unexpected_type( const char *file, int line, const char* function_name -); +)); From 372f7c20696e30f319cf20622758f7f0ef585875 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 19 Jul 2022 16:20:32 -0700 Subject: [PATCH 0252/2133] Lint:Ensure multi-line arguments align close to left margin --- .rubocop.yml | 9 ++++ Rakefile | 2 +- lib/datadog/appsec/contrib/rails/patcher.rb | 6 +-- lib/datadog/appsec/contrib/sinatra/patcher.rb | 8 ++-- lib/datadog/appsec/reactive/operation.rb | 4 +- lib/datadog/ci/ext/environment.rb | 4 +- .../configuration/agent_settings_resolver.rb | 6 +-- .../core/diagnostics/environment_logger.rb | 2 +- lib/datadog/profiling/transport/http.rb | 6 +-- .../active_support/cache/instrumentation.rb | 12 ++--- lib/datadog/tracing/contrib/extensions.rb | 4 +- .../core/configuration/settings_spec.rb | 10 ++--- spec/datadog/core/runtime/metrics_spec.rb | 8 ++-- .../profiling/collectors/old_stack_spec.rb | 4 +- spec/datadog/profiling/pprof/builder_spec.rb | 8 ++-- .../tracing/contrib/action_mailer/helpers.rb | 8 ++-- .../configuration/resolver_spec.rb | 8 ++-- .../contrib/active_record/tracer_spec.rb | 4 +- .../contrib/elasticsearch/integration_spec.rb | 12 ++--- .../contrib/elasticsearch/quantize_spec.rb | 44 +++++++++---------- .../tracing/contrib/rails/support/rails3.rb | 2 +- .../redis/configuration/resolver_spec.rb | 30 ++++++------- .../tracing/contrib/sinatra/tracer_spec.rb | 6 +-- .../tracing/contrib/support/matchers.rb | 6 +-- .../tracing/distributed/headers/b3_spec.rb | 8 ++-- .../distributed/headers/datadog_spec.rb | 16 +++---- .../tracing/distributed/metadata/b3_spec.rb | 8 ++-- .../distributed/metadata/datadog_spec.rb | 16 +++---- spec/datadog/tracing/propagation/http_spec.rb | 24 +++++----- spec/datadog/tracing/writer_spec.rb | 22 +++++----- 30 files changed, 158 insertions(+), 149 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0bbb27fd642..1470c7d9cb6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -373,6 +373,15 @@ Naming/FileName: Style/OptionalBooleanParameter: Enabled: false +Layout/ArgumentAlignment: + EnforcedStyle: with_fixed_indentation + +Layout/MultilineMethodCallIndentation: + EnforcedStyle: indented + +Layout/MultilineOperationIndentation: + EnforcedStyle: indented + Lint/UnusedBlockArgument: # Required keyword arguments normally cannot be omitted or renamed: # Example: in `proc{|unused:|}`, `unused` cannot be renamed to `_unused`. diff --git a/Rakefile b/Rakefile index f90b195eaf4..622dc2aaeb0 100644 --- a/Rakefile +++ b/Rakefile @@ -364,7 +364,7 @@ namespace :coverage do require 'simplecov' resultset_files = Dir["#{ENV.fetch('COVERAGE_DIR', 'coverage')}/.resultset.json"] + - Dir["#{ENV.fetch('COVERAGE_DIR', 'coverage')}/versions/**/.resultset.json"] + Dir["#{ENV.fetch('COVERAGE_DIR', 'coverage')}/versions/**/.resultset.json"] SimpleCov.collate resultset_files do coverage_dir "#{ENV.fetch('COVERAGE_DIR', 'coverage')}/report" diff --git a/lib/datadog/appsec/contrib/rails/patcher.rb b/lib/datadog/appsec/contrib/rails/patcher.rb index 3c4c3b1a985..11244fe0ae0 100644 --- a/lib/datadog/appsec/contrib/rails/patcher.rb +++ b/lib/datadog/appsec/contrib/rails/patcher.rb @@ -59,7 +59,7 @@ def add_middleware(app) # Add trace middleware if include_middleware?(Datadog::Tracing::Contrib::Rack::TraceMiddleware, app) app.middleware.insert_after(Datadog::Tracing::Contrib::Rack::TraceMiddleware, - Datadog::AppSec::Contrib::Rack::RequestMiddleware) + Datadog::AppSec::Contrib::Rack::RequestMiddleware) else app.middleware.insert_before(0, Datadog::AppSec::Contrib::Rack::RequestMiddleware) end @@ -82,8 +82,8 @@ def process_action(*args) if request_response && request_response.any? { |action, _event| action == :block } @_response = ::ActionDispatch::Response.new(403, - { 'Content-Type' => 'text/html' }, - [Datadog::AppSec::Assets.blocked]) + { 'Content-Type' => 'text/html' }, + [Datadog::AppSec::Assets.blocked]) request_return = @_response.body end diff --git a/lib/datadog/appsec/contrib/sinatra/patcher.rb b/lib/datadog/appsec/contrib/sinatra/patcher.rb index c6b5b801029..9e6b199c509 100644 --- a/lib/datadog/appsec/contrib/sinatra/patcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/patcher.rb @@ -32,8 +32,8 @@ def setup_middleware(*args, &block) if tracing_sinatra_framework.include_middleware?(tracing_middleware, builder) tracing_sinatra_framework.add_middleware_after(tracing_middleware, - Datadog::AppSec::Contrib::Rack::RequestMiddleware, - builder) + Datadog::AppSec::Contrib::Rack::RequestMiddleware, + builder) else tracing_sinatra_framework.add_middleware(Datadog::AppSec::Contrib::Rack::RequestMiddleware, builder) end @@ -60,8 +60,8 @@ def dispatch! if request_response && request_response.any? { |action, _event| action == :block } self.response = ::Sinatra::Response.new([Datadog::AppSec::Assets.blocked], - 403, - { 'Content-Type' => 'text/html' }) + 403, + { 'Content-Type' => 'text/html' }) request_return = nil end diff --git a/lib/datadog/appsec/reactive/operation.rb b/lib/datadog/appsec/reactive/operation.rb index de7eb5bc7ca..9e2e7d0000e 100644 --- a/lib/datadog/appsec/reactive/operation.rb +++ b/lib/datadog/appsec/reactive/operation.rb @@ -8,8 +8,8 @@ module Reactive # Reactive Engine nested operation tracking class Operation attr_reader :reactive, - :parent, - :name + :parent, + :name def initialize(name, parent = nil, reactive_engine = nil) Datadog.logger.debug { "operation: #{name} initialize" } diff --git a/lib/datadog/ci/ext/environment.rb b/lib/datadog/ci/ext/environment.rb index 01f0b812e08..e2be5c221ad 100644 --- a/lib/datadog/ci/ext/environment.rb +++ b/lib/datadog/ci/ext/environment.rb @@ -119,8 +119,8 @@ def extract_azure_pipelines(env) build_id = env['BUILD_BUILDID'] if build_id && - (team_foundation_server_uri = env['SYSTEM_TEAMFOUNDATIONSERVERURI']) && - (team_project_id = env['SYSTEM_TEAMPROJECTID']) + (team_foundation_server_uri = env['SYSTEM_TEAMFOUNDATIONSERVERURI']) && + (team_project_id = env['SYSTEM_TEAMPROJECTID']) pipeline_url = "#{team_foundation_server_uri}#{team_project_id}/_build/results?buildId=#{build_id}" diff --git a/lib/datadog/core/configuration/agent_settings_resolver.rb b/lib/datadog/core/configuration/agent_settings_resolver.rb index 202b4e7f2a9..d629da2eff4 100644 --- a/lib/datadog/core/configuration/agent_settings_resolver.rb +++ b/lib/datadog/core/configuration/agent_settings_resolver.rb @@ -221,9 +221,9 @@ def uds_fallback @uds_fallback = if configured_hostname.nil? && - configured_port.nil? && - deprecated_for_removal_transport_configuration_proc.nil? && - File.exist?(Transport::Ext::UnixSocket::DEFAULT_PATH) + configured_port.nil? && + deprecated_for_removal_transport_configuration_proc.nil? && + File.exist?(Transport::Ext::UnixSocket::DEFAULT_PATH) Transport::Ext::UnixSocket::DEFAULT_PATH end diff --git a/lib/datadog/core/diagnostics/environment_logger.rb b/lib/datadog/core/diagnostics/environment_logger.rb index eb722935fb2..bc188804fcd 100644 --- a/lib/datadog/core/diagnostics/environment_logger.rb +++ b/lib/datadog/core/diagnostics/environment_logger.rb @@ -151,7 +151,7 @@ def sample_rate def sampling_rules sampler = Datadog.configuration.tracing.sampler return nil unless sampler.is_a?(Tracing::Sampling::PrioritySampler) && - sampler.priority_sampler.is_a?(Tracing::Sampling::RuleSampler) + sampler.priority_sampler.is_a?(Tracing::Sampling::RuleSampler) sampler.priority_sampler.rules.map do |rule| next unless rule.is_a?(Tracing::Sampling::SimpleRule) diff --git a/lib/datadog/profiling/transport/http.rb b/lib/datadog/profiling/transport/http.rb index eadc36ad295..05da95659cd 100644 --- a/lib/datadog/profiling/transport/http.rb +++ b/lib/datadog/profiling/transport/http.rb @@ -101,11 +101,11 @@ def self.default_headers # Add adapters to registry Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Net, - Datadog::Transport::Ext::HTTP::ADAPTER) + Datadog::Transport::Ext::HTTP::ADAPTER) Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Test, - Datadog::Transport::Ext::Test::ADAPTER) + Datadog::Transport::Ext::Test::ADAPTER) Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::UnixSocket, - Datadog::Transport::Ext::UnixSocket::ADAPTER) + Datadog::Transport::Ext::UnixSocket::ADAPTER) end end end diff --git a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb index e0e799ca047..e1a454bf350 100644 --- a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +++ b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb @@ -22,12 +22,12 @@ def start_trace_cache(payload) # to avoid any kind of issue. current_span = Tracing.active_span return if current_span.try(:name) == Ext::SPAN_CACHE && - ( - payload[:action] == Ext::RESOURCE_CACHE_GET && - current_span.try(:resource) == Ext::RESOURCE_CACHE_GET || - payload[:action] == Ext::RESOURCE_CACHE_MGET && - current_span.try(:resource) == Ext::RESOURCE_CACHE_MGET - ) + ( + payload[:action] == Ext::RESOURCE_CACHE_GET && + current_span.try(:resource) == Ext::RESOURCE_CACHE_GET || + payload[:action] == Ext::RESOURCE_CACHE_MGET && + current_span.try(:resource) == Ext::RESOURCE_CACHE_MGET + ) tracing_context = payload.fetch(:tracing_context) diff --git a/lib/datadog/tracing/contrib/extensions.rb b/lib/datadog/tracing/contrib/extensions.rb index eb92e1e3060..715a879c455 100644 --- a/lib/datadog/tracing/contrib/extensions.rb +++ b/lib/datadog/tracing/contrib/extensions.rb @@ -86,8 +86,8 @@ def configure(&block) # if patching failed, only log output if verbosity is unset # or if patching failure is due to compatibility or integration specific reasons next unless !ignore_integration_load_errors || - ((patch_results[:available] && patch_results[:loaded]) && - (!patch_results[:compatible] || !patch_results[:patchable])) + ((patch_results[:available] && patch_results[:loaded]) && + (!patch_results[:compatible] || !patch_results[:patchable])) desc = "Available?: #{patch_results[:available]}" desc += ", Loaded? #{patch_results[:loaded]}" diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index cd887254db7..5db866e0cf1 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -240,11 +240,11 @@ describe '#instance=' do let(:logger) do double(:logger, - debug: true, - info: true, - warn: true, - error: true, - level: true) + debug: true, + info: true, + warn: true, + error: true, + level: true) end it 'updates the #instance setting' do diff --git a/spec/datadog/core/runtime/metrics_spec.rb b/spec/datadog/core/runtime/metrics_spec.rb index 18302fbfab1..fa959de33d4 100644 --- a/spec/datadog/core/runtime/metrics_spec.rb +++ b/spec/datadog/core/runtime/metrics_spec.rb @@ -118,14 +118,14 @@ shared_examples_for 'a flush of all runtime metrics' do context 'including ClassCount' do it_behaves_like 'runtime metric flush', - Datadog::Core::Environment::ClassCount, - Datadog::Core::Runtime::Ext::Metrics::METRIC_CLASS_COUNT + Datadog::Core::Environment::ClassCount, + Datadog::Core::Runtime::Ext::Metrics::METRIC_CLASS_COUNT end context 'including ThreadCount' do it_behaves_like 'runtime metric flush', - Datadog::Core::Environment::ThreadCount, - Datadog::Core::Runtime::Ext::Metrics::METRIC_THREAD_COUNT + Datadog::Core::Environment::ThreadCount, + Datadog::Core::Runtime::Ext::Metrics::METRIC_THREAD_COUNT end context 'including GC stats' do diff --git a/spec/datadog/profiling/collectors/old_stack_spec.rb b/spec/datadog/profiling/collectors/old_stack_spec.rb index b0ca70272a3..c96e24408f8 100644 --- a/spec/datadog/profiling/collectors/old_stack_spec.rb +++ b/spec/datadog/profiling/collectors/old_stack_spec.rb @@ -738,7 +738,7 @@ it 'does not affect Ruby < 2.3 nor Ruby >= 2.7' do unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3') || - Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') + Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') skip 'Test case only applies to Ruby < 2.3 or Ruby >= 2.7' end @@ -749,7 +749,7 @@ it 'affects Ruby >= 2.3 and < 2.7' do unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.3') && - Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7') + Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7') skip 'Test case only applies to Ruby >= 2.3 and < 2.7' end diff --git a/spec/datadog/profiling/pprof/builder_spec.rb b/spec/datadog/profiling/pprof/builder_spec.rb index bec8a421fcd..d0087e964dc 100644 --- a/spec/datadog/profiling/pprof/builder_spec.rb +++ b/spec/datadog/profiling/pprof/builder_spec.rb @@ -141,13 +141,13 @@ def string_id_for(string) expect(Perftools::Profiles::Function) .to receive(:new).with(hash_including(filename: string_id_for(filename), name: string_id_for(function_name))) - .and_return(function) + .and_return(function) expect(build_location).to be_a_kind_of(Perftools::Profiles::Location) expect(build_location.to_h).to match(hash_including(id: location_id, - line: [{ - function_id: function.id, line: line_number - }])) + line: [{ + function_id: function.id, line: line_number + }])) end end diff --git a/spec/datadog/tracing/contrib/action_mailer/helpers.rb b/spec/datadog/tracing/contrib/action_mailer/helpers.rb index d27454d93ae..42a1acf53d9 100644 --- a/spec/datadog/tracing/contrib/action_mailer/helpers.rb +++ b/spec/datadog/tracing/contrib/action_mailer/helpers.rb @@ -21,10 +21,10 @@ def test_mail(_arg) mail(to: 'test@example.com', - body: 'sk test', - subject: 'miniswan', - bcc: 'test_a@example.com,test_b@example.com', - cc: ['test_c@example.com', 'test_d@example.com']) + body: 'sk test', + subject: 'miniswan', + bcc: 'test_a@example.com,test_b@example.com', + cc: ['test_c@example.com', 'test_d@example.com']) end end ) diff --git a/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb b/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb index 0b4d39797ce..dcb32fe2bf3 100644 --- a/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb +++ b/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb @@ -32,10 +32,10 @@ expect(resolver.configurations) .to eq({ - adapter: 'adapter', - host: 'host', - port: 123 - } => config) + adapter: 'adapter', + host: 'host', + port: 123 + } => config) end end diff --git a/spec/datadog/tracing/contrib/active_record/tracer_spec.rb b/spec/datadog/tracing/contrib/active_record/tracer_spec.rb index 3a3004a69b4..8f65da5189f 100644 --- a/spec/datadog/tracing/contrib/active_record/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/active_record/tracer_spec.rb @@ -105,9 +105,9 @@ Datadog.configure do |c| c.tracing.instrument :active_record, service_name: 'bad-no-match' c.tracing.instrument :active_record, describes: { makara_role: primary_role }, - service_name: primary_service_name + service_name: primary_service_name c.tracing.instrument :active_record, describes: { makara_role: secondary_role }, - service_name: secondary_service_name + service_name: secondary_service_name end end diff --git a/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb b/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb index 628b6e59759..3061a9b1140 100644 --- a/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb +++ b/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb @@ -59,13 +59,13 @@ context 'when "elastic-transport" gem is loaded with a version' do context 'that is less than the minimum' do include_context 'loaded gems', :'elastic-transport' => decrement_gem_version(described_class::MINIMUM_VERSION), - :'elasticsearch-transport' => nil + :'elasticsearch-transport' => nil it { is_expected.to be false } end context 'that meets the minimum version' do include_context 'loaded gems', :'elastic-transport' => described_class::MINIMUM_VERSION, - :'elasticsearch-transport' => nil + :'elasticsearch-transport' => nil it { is_expected.to be true } end end @@ -73,15 +73,15 @@ context 'when "elasticsearch-transport" gem is loaded with a version' do context 'that is less than the minimum' do include_context 'loaded gems', - :'elastic-transport' => nil, - :'elasticsearch-transport' => decrement_gem_version(described_class::MINIMUM_VERSION) + :'elastic-transport' => nil, + :'elasticsearch-transport' => decrement_gem_version(described_class::MINIMUM_VERSION) it { is_expected.to be false } end context 'that meets the minimum version' do include_context 'loaded gems', - :'elastic-transport' => nil, - :'elasticsearch-transport' => described_class::MINIMUM_VERSION + :'elastic-transport' => nil, + :'elasticsearch-transport' => described_class::MINIMUM_VERSION it { is_expected.to be true } end diff --git a/spec/datadog/tracing/contrib/elasticsearch/quantize_spec.rb b/spec/datadog/tracing/contrib/elasticsearch/quantize_spec.rb index 3cc5744cfd8..344f4491087 100644 --- a/spec/datadog/tracing/contrib/elasticsearch/quantize_spec.rb +++ b/spec/datadog/tracing/contrib/elasticsearch/quantize_spec.rb @@ -27,11 +27,11 @@ it_behaves_like 'a quantized URL', '/my/thing/1two3/abc/', '/my/thing/?/abc/' it_behaves_like 'a quantized URL', '/my/thing231/1two3/abc/', '/my/thing?/?/abc/' it_behaves_like 'a quantized URL', - '/my/thing/1447990c-811a-4a83-b7e2-c3e8a4a6ff54/_termvector', - '/my/thing/?/_termvector' + '/my/thing/1447990c-811a-4a83-b7e2-c3e8a4a6ff54/_termvector', + '/my/thing/?/_termvector' it_behaves_like 'a quantized URL', - 'app_prod/user/1fff2c9dc2f3e/_termvector', - 'app_prod/user/?/_termvector' + 'app_prod/user/1fff2c9dc2f3e/_termvector', + 'app_prod/user/?/_termvector' end context 'when the URL looks like an index' do @@ -60,22 +60,22 @@ let(:options) { { show: [:title] } } it_behaves_like 'a quantized body', - '{"query":{"match":{"title":"test","subtitle":"test"}}}', - '{"query":{"match":{"title":"test","subtitle":"?"}}}' + '{"query":{"match":{"title":"test","subtitle":"test"}}}', + '{"query":{"match":{"title":"test","subtitle":"?"}}}' end context ':all' do let(:options) { { show: :all } } it_behaves_like 'a quantized body', - '{"query":{"match":{"title":"test","subtitle":"test"}}}', - '{"query":{"match":{"title":"test","subtitle":"test"}}}' + '{"query":{"match":{"title":"test","subtitle":"test"}}}', + '{"query":{"match":{"title":"test","subtitle":"test"}}}' it_behaves_like 'a quantized body', - '[{"foo":"foo"},{"bar":"bar"}]', - '[{"foo":"foo"},{"bar":"bar"}]' + '[{"foo":"foo"},{"bar":"bar"}]', + '[{"foo":"foo"},{"bar":"bar"}]' it_behaves_like 'a quantized body', - '["foo","bar"]', - '["foo","bar"]' + '["foo","bar"]', + '["foo","bar"]' end end @@ -84,8 +84,8 @@ let(:options) { { exclude: [:title] } } it_behaves_like 'a quantized body', - '{"query":{"match":{"title":"test","subtitle":"test"}}}', - '{"query":{"match":{"subtitle":"?"}}}' + '{"query":{"match":{"title":"test","subtitle":"test"}}}', + '{"query":{"match":{"subtitle":"?"}}}' end end end @@ -94,27 +94,27 @@ context 'is in a format for' do describe 'MGet' do it_behaves_like 'a quantized body', - '{"ids":["1","2","3"]}', - '{"ids":["?"]}' + '{"ids":["1","2","3"]}', + '{"ids":["?"]}' end describe 'Search' do it_behaves_like 'a quantized body', - '{"query":{"match":{"title":"test"}}}', - '{"query":{"match":{"title":"?"}}}' + '{"query":{"match":{"title":"test"}}}', + '{"query":{"match":{"title":"?"}}}' end # rubocop:disable Layout/LineLength describe 'MSearch' do it_behaves_like 'a quantized body', - "{}\n{\"query\":{\"match_all\":{}}}\n{\"index\":\"myindex\",\"type\":\"mytype\"}\n{\"query\":{\"query_string\":{\"query\":\"\\\"test\\\"\"}}}\n{\"search_type\":\"count\"}\n{\"aggregations\":{\"published\":{\"terms\":{\"field\":\"published\"}}}}\n", - "{}\n{\"query\":{\"match_all\":{}}}\n{\"index\":\"?\",\"type\":\"?\"}\n{\"query\":{\"query_string\":{\"query\":\"?\"}}}\n{\"search_type\":\"?\"}\n{\"aggregations\":{\"published\":{\"terms\":{\"field\":\"?\"}}}}" + "{}\n{\"query\":{\"match_all\":{}}}\n{\"index\":\"myindex\",\"type\":\"mytype\"}\n{\"query\":{\"query_string\":{\"query\":\"\\\"test\\\"\"}}}\n{\"search_type\":\"count\"}\n{\"aggregations\":{\"published\":{\"terms\":{\"field\":\"published\"}}}}\n", + "{}\n{\"query\":{\"match_all\":{}}}\n{\"index\":\"?\",\"type\":\"?\"}\n{\"query\":{\"query_string\":{\"query\":\"?\"}}}\n{\"search_type\":\"?\"}\n{\"aggregations\":{\"published\":{\"terms\":{\"field\":\"?\"}}}}" end describe 'Bulk' do it_behaves_like 'a quantized body', - "{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":1}}\n{\"title\":\"foo\"}\n{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":2}}\n{\"title\":\"foo\"}\n", - "{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":1}}\n{\"title\":\"?\"}\n{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":2}}\n{\"title\":\"?\"}" + "{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":1}}\n{\"title\":\"foo\"}\n{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":2}}\n{\"title\":\"foo\"}\n", + "{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":1}}\n{\"title\":\"?\"}\n{\"index\":{\"_index\":\"myindex\",\"_type\":\"mytype\",\"_id\":2}}\n{\"title\":\"?\"}" end end end diff --git a/spec/datadog/tracing/contrib/rails/support/rails3.rb b/spec/datadog/tracing/contrib/rails/support/rails3.rb index 4d6d22445a0..3b1ab8ab165 100644 --- a/spec/datadog/tracing/contrib/rails/support/rails3.rb +++ b/spec/datadog/tracing/contrib/rails/support/rails3.rb @@ -117,7 +117,7 @@ def after_rails_application_creation allow(Rails.application.config.action_view).to receive(:delete).with(:stylesheet_expansions).and_return({}) allow(Rails.application.config.action_view) .to receive(:delete).with(:javascript_expansions) - .and_return(defaults: %w[prototype effects dragdrop controls rails]) + .and_return(defaults: %w[prototype effects dragdrop controls rails]) allow(Rails.application.config.action_view).to receive(:delete) .with(:embed_authenticity_token_in_remote_forms).and_return(true) end diff --git a/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb b/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb index 9bb289334a9..1f949801acc 100644 --- a/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb +++ b/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb @@ -33,9 +33,9 @@ it do expect(parsed_key).to eq(host: '127.0.0.1', - port: 6379, - db: 0, - scheme: 'redis') + port: 6379, + db: 0, + scheme: 'redis') end end @@ -44,9 +44,9 @@ it do expect(parsed_key).to eq(host: '127.0.0.1', - port: 6379, - db: 0, - scheme: 'redis') + port: 6379, + db: 0, + scheme: 'redis') end end end @@ -63,9 +63,9 @@ it do expect(parsed_key).to eq(host: '127.0.0.1', - port: 6379, - db: 0, - scheme: 'redis') + port: 6379, + db: 0, + scheme: 'redis') end end @@ -80,9 +80,9 @@ it do expect(parsed_key).to eq(host: '127.0.0.1', - port: 6379, - db: 0, - scheme: 'redis') + port: 6379, + db: 0, + scheme: 'redis') end end @@ -96,9 +96,9 @@ it do expect(parsed_key).to eq(host: '127.0.0.1', - port: 6379, - db: 0, - scheme: 'redis') + port: 6379, + db: 0, + scheme: 'redis') end end end diff --git a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb index 6a373a1e251..ac19e357090 100644 --- a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb @@ -608,9 +608,9 @@ expect(trace.resource).to eq(resource) expect(top_span).to be_request_span resource: 'GET', - app_name: top_app_name, - matching_app: false, - parent: top_rack_span + app_name: top_app_name, + matching_app: false, + parent: top_rack_span expect(top_rack_span).not_to be_nil expect(top_rack_span).to be_root_span expect(top_rack_span.resource).to eq('GET') diff --git a/spec/datadog/tracing/contrib/support/matchers.rb b/spec/datadog/tracing/contrib/support/matchers.rb index 6e3a30e2309..ab87b10b8fc 100644 --- a/spec/datadog/tracing/contrib/support/matchers.rb +++ b/spec/datadog/tracing/contrib/support/matchers.rb @@ -11,9 +11,9 @@ RSpec::Matchers.define :match_normalized_sql do |expected| match do |actual| @actual = actual - .gsub(/[`"]/, '') # Remove all query token quotations. String quotations are left untouched. - .gsub(/\$\d+/, '?') # Convert Postgres placeholder '$1' to '?' - .gsub(/:\w+/, '?') # Convert Sqlite placeholder ':value' to '?' + .gsub(/[`"]/, '') # Remove all query token quotations. String quotations are left untouched. + .gsub(/\$\d+/, '?') # Convert Postgres placeholder '$1' to '?' + .gsub(/:\w+/, '?') # Convert Sqlite placeholder ':value' to '?' values_match?(expected, @actual) end diff --git a/spec/datadog/tracing/distributed/headers/b3_spec.rb b/spec/datadog/tracing/distributed/headers/b3_spec.rb index 4a3d6e36705..8ca0ba296df 100644 --- a/spec/datadog/tracing/distributed/headers/b3_spec.rb +++ b/spec/datadog/tracing/distributed/headers/b3_spec.rb @@ -31,7 +31,7 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) end [ @@ -51,8 +51,8 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) end end end @@ -68,7 +68,7 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) end end end diff --git a/spec/datadog/tracing/distributed/headers/datadog_spec.rb b/spec/datadog/tracing/distributed/headers/datadog_spec.rb index 5611bda2505..ae1f24a053d 100644 --- a/spec/datadog/tracing/distributed/headers/datadog_spec.rb +++ b/spec/datadog/tracing/distributed/headers/datadog_spec.rb @@ -31,7 +31,7 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '10000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '20000') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '20000') end context 'with sampling priority' do @@ -45,8 +45,8 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '50000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '60000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '60000', + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1') end context 'with origin' do @@ -61,9 +61,9 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '70000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '80000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '80000', + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1', + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') end end end @@ -79,8 +79,8 @@ def env_header(name) it do expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '90000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '100000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '100000', + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') end end end diff --git a/spec/datadog/tracing/distributed/metadata/b3_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_spec.rb index 473463968d6..50dc7416ed6 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_spec.rb @@ -26,7 +26,7 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) end [ @@ -46,8 +46,8 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) end end end @@ -63,7 +63,7 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) end end end diff --git a/spec/datadog/tracing/distributed/metadata/datadog_spec.rb b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb index 0c28d9a57ef..5ba43d535fd 100644 --- a/spec/datadog/tracing/distributed/metadata/datadog_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb @@ -26,7 +26,7 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000') end context 'with sampling priority' do @@ -40,8 +40,8 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '50000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '60000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '60000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1') end context 'with origin' do @@ -56,9 +56,9 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '70000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '80000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '80000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') end end end @@ -74,8 +74,8 @@ it do expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '90000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '100000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '100000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') end end end diff --git a/spec/datadog/tracing/propagation/http_spec.rb b/spec/datadog/tracing/propagation/http_spec.rb index 1d3bcc07e71..b432f56d086 100644 --- a/spec/datadog/tracing/propagation/http_spec.rb +++ b/spec/datadog/tracing/propagation/http_spec.rb @@ -21,8 +21,8 @@ it do inject! expect(env).to eq('something' => 'alien', - 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-trace-id' => '1000', + 'x-datadog-parent-id' => '2000') end end @@ -34,9 +34,9 @@ it do expect(env).to eq('something' => 'alien', - 'x-datadog-sampling-priority' => '0', - 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-sampling-priority' => '0', + 'x-datadog-trace-id' => '1000', + 'x-datadog-parent-id' => '2000') end end @@ -45,8 +45,8 @@ it do expect(env).to eq('something' => 'alien', - 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-trace-id' => '1000', + 'x-datadog-parent-id' => '2000') end end end @@ -59,9 +59,9 @@ it do expect(env).to eq('something' => 'alien', - 'x-datadog-origin' => 'synthetics', - 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-origin' => 'synthetics', + 'x-datadog-trace-id' => '1000', + 'x-datadog-parent-id' => '2000') end end @@ -70,8 +70,8 @@ it do expect(env).to eq('something' => 'alien', - 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-trace-id' => '1000', + 'x-datadog-parent-id' => '2000') end end end diff --git a/spec/datadog/tracing/writer_spec.rb b/spec/datadog/tracing/writer_spec.rb index 0ee15cd7576..691a77d1544 100644 --- a/spec/datadog/tracing/writer_spec.rb +++ b/spec/datadog/tracing/writer_spec.rb @@ -127,17 +127,17 @@ context 'with multiple responses' do let(:response1) do instance_double(Datadog::Transport::HTTP::Traces::Response, - internal_error?: false, - server_error?: false, - ok?: true, - trace_count: 10) + internal_error?: false, + server_error?: false, + ok?: true, + trace_count: 10) end let(:response2) do instance_double(Datadog::Transport::HTTP::Traces::Response, - internal_error?: false, - server_error?: false, - ok?: true, - trace_count: 20) + internal_error?: false, + server_error?: false, + ok?: true, + trace_count: 20) end let(:responses) { [response1, response2] } @@ -145,9 +145,9 @@ context 'and at least one being server error' do let(:response2) do instance_double(Datadog::Transport::HTTP::Traces::Response, - internal_error?: false, - server_error?: true, - ok?: false) + internal_error?: false, + server_error?: true, + ok?: false) end it do From 6e8ae58d320d6a48f6c1d21db894d414bdf140b2 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 19 Jul 2022 16:58:43 -0700 Subject: [PATCH 0253/2133] Lint:first multi-line argument has line break --- .rubocop.yml | 15 + Rakefile | 6 +- .../extconf.rb | 6 +- lib/datadog/appsec/contrib/rails/patcher.rb | 12 +- lib/datadog/appsec/contrib/sinatra/patcher.rb | 12 +- lib/datadog/ci/ext/environment.rb | 8 +- lib/datadog/core/configuration/settings.rb | 6 +- lib/datadog/opentracer/tracer.rb | 30 +- lib/datadog/profiling/http_transport.rb | 5 +- lib/datadog/profiling/transport/http.rb | 18 +- lib/datadog/tracing/contrib/rack/patcher.rb | 6 +- .../agent_settings_resolver_spec.rb | 10 +- .../core/configuration/components_spec.rb | 6 +- .../core/configuration/settings_spec.rb | 6 +- spec/datadog/core/configuration_spec.rb | 10 +- spec/datadog/core/error_spec.rb | 18 +- spec/datadog/opentracer/propagator_spec.rb | 9 +- .../profiling/collectors/stack_spec.rb | 15 +- spec/datadog/profiling/pprof/builder_spec.rb | 12 +- .../transport/http/api/endpoint_spec.rb | 8 +- .../contrib/action_cable/patcher_spec.rb | 24 +- .../tracing/contrib/action_mailer/helpers.rb | 6 +- .../active_model_serializers/helpers.rb | 65 +++-- .../configuration/resolver_spec.rb | 17 +- .../contrib/active_record/multi_db_spec.rb | 9 +- .../contrib/active_record/tracer_spec.rb | 6 +- .../contrib/delayed_job/plugin_spec.rb | 39 ++- .../contrib/elasticsearch/integration_spec.rb | 6 +- .../contrib/elasticsearch/transport_spec.rb | 11 +- .../tracing/contrib/extensions_spec.rb | 24 +- .../tracing/contrib/grape/tracer_spec.rb | 126 ++++---- .../tracing/contrib/graphql/test_types.rb | 34 ++- .../tracing/contrib/http/request_spec.rb | 44 +-- spec/datadog/tracing/contrib/patcher_spec.rb | 275 +++++++++++------- .../tracing/contrib/que/tracer_spec.rb | 20 +- .../contrib/rack/integration_test_spec.rb | 121 ++++---- .../contrib/rack/resource_name_spec.rb | 34 ++- .../contrib/rails/action_controller_spec.rb | 22 +- .../tracing/contrib/rails/analytics_spec.rb | 11 +- .../tracing/contrib/rails/disable_env_spec.rb | 11 +- .../tracing/contrib/rails/middleware_spec.rb | 115 +++++--- .../tracing/contrib/rails/rack_spec.rb | 146 +++++----- .../contrib/rails/rails_active_job_spec.rb | 37 ++- .../rails/rails_log_auto_injection_spec.rb | 26 +- ...ils_semantic_logger_auto_injection_spec.rb | 13 +- .../tracing/contrib/rails/railtie_spec.rb | 11 +- .../contrib/rails/support/middleware.rb | 25 +- .../tracing/contrib/rails/support/models.rb | 9 +- .../redis/configuration/resolver_spec.rb | 30 +- .../tracing/contrib/shoryuken/tracer_spec.rb | 13 +- .../contrib/sidekiq/client_tracer_spec.rb | 9 +- .../contrib/sidekiq/server_tracer_spec.rb | 37 ++- .../tracing/contrib/sidekiq/support/helper.rb | 11 +- .../contrib/sidekiq/tracer_configure_spec.rb | 15 +- .../tracing/contrib/sinatra/tracer_spec.rb | 39 ++- .../tracing/distributed/headers/b3_spec.rb | 18 +- .../distributed/headers/datadog_spec.rb | 24 +- .../tracing/distributed/metadata/b3_spec.rb | 18 +- .../distributed/metadata/datadog_spec.rb | 24 +- spec/datadog/tracing/propagation/http_spec.rb | 30 +- .../tracing/sampling/rule_sampler_spec.rb | 11 +- spec/datadog/tracing/writer_spec.rb | 18 +- spec/ddtrace/transport/io/traces_spec.rb | 4 +- spec/support/spy_transport.rb | 3 +- 64 files changed, 1088 insertions(+), 721 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1470c7d9cb6..4a66b2bc0a7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -376,6 +376,21 @@ Style/OptionalBooleanParameter: Layout/ArgumentAlignment: EnforcedStyle: with_fixed_indentation +Layout/BlockAlignment: + EnforcedStyleAlignWith: start_of_block + +Layout/FirstArgumentIndentation: + EnforcedStyle: consistent + +Layout/FirstMethodArgumentLineBreak: + Enabled: true + +Layout/FirstMethodParameterLineBreak: + Enabled: true + +Layout/MultilineMethodArgumentLineBreaks: + Enabled: true + Layout/MultilineMethodCallIndentation: EnforcedStyle: indented diff --git a/Rakefile b/Rakefile index 622dc2aaeb0..ed0e694c752 100644 --- a/Rakefile +++ b/Rakefile @@ -370,8 +370,10 @@ namespace :coverage do coverage_dir "#{ENV.fetch('COVERAGE_DIR', 'coverage')}/report" if ENV['CI'] == 'true' require 'codecov' - formatter SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Codecov]) + formatter SimpleCov::Formatter::MultiFormatter.new( + [SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::Codecov] + ) else formatter SimpleCov::Formatter::HTMLFormatter end diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index fd7396e7a74..299272b313b 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -42,7 +42,8 @@ def skip_building_extension!(reason) skip_building_extension!(Datadog::Profiling::NativeExtensionHelpers::Supported.unsupported_reason) end -$stderr.puts(%( +$stderr.puts( + %( +------------------------------------------------------------------------------+ | ** Preparing to build the ddtrace profiling native extension... ** | | | @@ -59,7 +60,8 @@ def skip_building_extension!(reason) | Thanks for using ddtrace! You rock! | +------------------------------------------------------------------------------+ -)) +) +) # NOTE: we MUST NOT require 'mkmf' before we check the #skip_building_extension? because the require triggers checks # that may fail on an environment not properly setup for building Ruby extensions. diff --git a/lib/datadog/appsec/contrib/rails/patcher.rb b/lib/datadog/appsec/contrib/rails/patcher.rb index 11244fe0ae0..a45d4b8a382 100644 --- a/lib/datadog/appsec/contrib/rails/patcher.rb +++ b/lib/datadog/appsec/contrib/rails/patcher.rb @@ -58,8 +58,10 @@ def before_intialize(app) def add_middleware(app) # Add trace middleware if include_middleware?(Datadog::Tracing::Contrib::Rack::TraceMiddleware, app) - app.middleware.insert_after(Datadog::Tracing::Contrib::Rack::TraceMiddleware, - Datadog::AppSec::Contrib::Rack::RequestMiddleware) + app.middleware.insert_after( + Datadog::Tracing::Contrib::Rack::TraceMiddleware, + Datadog::AppSec::Contrib::Rack::RequestMiddleware + ) else app.middleware.insert_before(0, Datadog::AppSec::Contrib::Rack::RequestMiddleware) end @@ -81,9 +83,11 @@ def process_action(*args) end if request_response && request_response.any? { |action, _event| action == :block } - @_response = ::ActionDispatch::Response.new(403, + @_response = ::ActionDispatch::Response.new( + 403, { 'Content-Type' => 'text/html' }, - [Datadog::AppSec::Assets.blocked]) + [Datadog::AppSec::Assets.blocked] + ) request_return = @_response.body end diff --git a/lib/datadog/appsec/contrib/sinatra/patcher.rb b/lib/datadog/appsec/contrib/sinatra/patcher.rb index 9e6b199c509..ffc94d7f5ba 100644 --- a/lib/datadog/appsec/contrib/sinatra/patcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/patcher.rb @@ -31,9 +31,11 @@ def setup_middleware(*args, &block) tracing_middleware = Datadog::Tracing::Contrib::Rack::TraceMiddleware if tracing_sinatra_framework.include_middleware?(tracing_middleware, builder) - tracing_sinatra_framework.add_middleware_after(tracing_middleware, + tracing_sinatra_framework.add_middleware_after( + tracing_middleware, Datadog::AppSec::Contrib::Rack::RequestMiddleware, - builder) + builder + ) else tracing_sinatra_framework.add_middleware(Datadog::AppSec::Contrib::Rack::RequestMiddleware, builder) end @@ -59,9 +61,11 @@ def dispatch! end if request_response && request_response.any? { |action, _event| action == :block } - self.response = ::Sinatra::Response.new([Datadog::AppSec::Assets.blocked], + self.response = ::Sinatra::Response.new( + [Datadog::AppSec::Assets.blocked], 403, - { 'Content-Type' => 'text/html' }) + { 'Content-Type' => 'text/html' } + ) request_return = nil end diff --git a/lib/datadog/ci/ext/environment.rb b/lib/datadog/ci/ext/environment.rb index e2be5c221ad..094938b3a8f 100644 --- a/lib/datadog/ci/ext/environment.rb +++ b/lib/datadog/ci/ext/environment.rb @@ -127,9 +127,11 @@ def extract_azure_pipelines(env) job_url = "#{pipeline_url}&view=logs&j=#{env['SYSTEM_JOBID']}&t=#{env['SYSTEM_TASKINSTANCEID']}" end - branch, tag = branch_or_tag(env['SYSTEM_PULLREQUEST_SOURCEBRANCH'] || - env['BUILD_SOURCEBRANCH'] || - env['BUILD_SOURCEBRANCHNAME']) + branch, tag = branch_or_tag( + env['SYSTEM_PULLREQUEST_SOURCEBRANCH'] || + env['BUILD_SOURCEBRANCH'] || + env['BUILD_SOURCEBRANCHNAME'] + ) { TAG_PROVIDER_NAME => 'azurepipelines', diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 9c6a0df5515..148321d25b0 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -419,7 +419,8 @@ def initialize(*_) Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG, Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3, Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - ], comma_separated_only: true + ], + comma_separated_only: true ) end @@ -437,7 +438,8 @@ def initialize(*_) o.default do env_to_list( Tracing::Configuration::Ext::Distributed::ENV_PROPAGATION_STYLE_INJECT, - [Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG], comma_separated_only: true # Only inject Datadog headers by default + [Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG], + comma_separated_only: true # Only inject Datadog headers by default ) end diff --git a/lib/datadog/opentracer/tracer.rb b/lib/datadog/opentracer/tracer.rb index e65b98c706c..43ba9a3b063 100644 --- a/lib/datadog/opentracer/tracer.rb +++ b/lib/datadog/opentracer/tracer.rb @@ -52,13 +52,15 @@ def scope_manager # yield the newly-started Scope. If `finish_on_close` is true then the # Span will be finished automatically after the block is executed. # @return [Scope] The newly-started and activated Scope - def start_active_span(operation_name, - child_of: nil, - references: nil, - start_time: Time.now, - tags: nil, - ignore_active_scope: false, - finish_on_close: true) + def start_active_span( + operation_name, + child_of: nil, + references: nil, + start_time: Time.now, + tags: nil, + ignore_active_scope: false, + finish_on_close: true + ) # When meant to automatically determine the parent, # Use the active scope first, otherwise fall back to any @@ -124,12 +126,14 @@ def start_active_span(operation_name, # References#CHILD_OF reference to the ScopeManager#active. # @return [Span] the newly-started Span instance, which has not been # automatically registered via the ScopeManager - def start_span(operation_name, - child_of: nil, - references: nil, - start_time: Time.now, - tags: nil, - ignore_active_scope: false) + def start_span( + operation_name, + child_of: nil, + references: nil, + start_time: Time.now, + tags: nil, + ignore_active_scope: false + ) # Derive the OpenTracer::SpanContext to inherit from. parent_span_context = inherited_span_context(child_of, ignore_active_scope: ignore_active_scope) diff --git a/lib/datadog/profiling/http_transport.rb b/lib/datadog/profiling/http_transport.rb index c838fa6755f..7b54976ec57 100644 --- a/lib/datadog/profiling/http_transport.rb +++ b/lib/datadog/profiling/http_transport.rb @@ -80,8 +80,9 @@ def base_url_from(agent_settings) def validate_agent_settings(agent_settings) supported_adapters = [Datadog::Transport::Ext::HTTP::ADAPTER, Datadog::Transport::Ext::UnixSocket::ADAPTER] unless supported_adapters.include?(agent_settings.adapter) - raise ArgumentError, "Unsupported transport configuration for profiling: Adapter #{agent_settings.adapter} " \ - ' is not supported' + raise ArgumentError, + "Unsupported transport configuration for profiling: Adapter #{agent_settings.adapter} " \ + ' is not supported' end if agent_settings.deprecated_for_removal_transport_configuration_proc diff --git a/lib/datadog/profiling/transport/http.rb b/lib/datadog/profiling/transport/http.rb index 05da95659cd..d20c7aea574 100644 --- a/lib/datadog/profiling/transport/http.rb +++ b/lib/datadog/profiling/transport/http.rb @@ -100,12 +100,18 @@ def self.default_headers end # Add adapters to registry - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Net, - Datadog::Transport::Ext::HTTP::ADAPTER) - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::Test, - Datadog::Transport::Ext::Test::ADAPTER) - Datadog::Transport::HTTP::Builder::REGISTRY.set(Datadog::Transport::HTTP::Adapters::UnixSocket, - Datadog::Transport::Ext::UnixSocket::ADAPTER) + Datadog::Transport::HTTP::Builder::REGISTRY.set( + Datadog::Transport::HTTP::Adapters::Net, + Datadog::Transport::Ext::HTTP::ADAPTER + ) + Datadog::Transport::HTTP::Builder::REGISTRY.set( + Datadog::Transport::HTTP::Adapters::Test, + Datadog::Transport::Ext::Test::ADAPTER + ) + Datadog::Transport::HTTP::Builder::REGISTRY.set( + Datadog::Transport::HTTP::Adapters::UnixSocket, + Datadog::Transport::Ext::UnixSocket::ADAPTER + ) end end end diff --git a/lib/datadog/tracing/contrib/rack/patcher.rb b/lib/datadog/tracing/contrib/rack/patcher.rb index 947e635e0f2..b02977c6f21 100644 --- a/lib/datadog/tracing/contrib/rack/patcher.rb +++ b/lib/datadog/tracing/contrib/rack/patcher.rb @@ -91,10 +91,12 @@ def patch if get_option(:application) MiddlewareNamePatcher.patch else - Datadog.logger.warn(%( + Datadog.logger.warn( + %( Rack :middleware_names requires you to also pass :application. Middleware names have NOT been patched; please provide :application. - e.g. use: :rack, middleware_names: true, application: my_rack_app).freeze) + e.g. use: :rack, middleware_names: true, application: my_rack_app).freeze + ) end end end diff --git a/spec/datadog/core/configuration/agent_settings_resolver_spec.rb b/spec/datadog/core/configuration/agent_settings_resolver_spec.rb index 4e85e04fbe7..09ebcf5fbef 100644 --- a/spec/datadog/core/configuration/agent_settings_resolver_spec.rb +++ b/spec/datadog/core/configuration/agent_settings_resolver_spec.rb @@ -545,11 +545,11 @@ it 'includes the given proc in the resolved settings as the ' \ 'deprecated_for_removal_transport_configuration_proc and falls back to the defaults' do - expect(resolver).to have_attributes( - **settings, - deprecated_for_removal_transport_configuration_proc: transport_options - ) - end + expect(resolver).to have_attributes( + **settings, + deprecated_for_removal_transport_configuration_proc: transport_options + ) + end it 'logs a debug message' do expect(logger).to receive(:debug) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 628d68e9e64..3896893cc21 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -440,8 +440,10 @@ expect(writer.events.after_send).to receive(:subscribe) do |&block| expect(block) - .to be(Datadog::Core::Configuration::Components - .singleton_class::WRITER_RECORD_ENVIRONMENT_INFORMATION_CALLBACK) + .to be( + Datadog::Core::Configuration::Components + .singleton_class::WRITER_RECORD_ENVIRONMENT_INFORMATION_CALLBACK + ) end expect(writer.events.after_send).to receive(:subscribe) do |&block| diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index 5db866e0cf1..cc44712d74b 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -239,12 +239,14 @@ describe '#instance=' do let(:logger) do - double(:logger, + double( + :logger, debug: true, info: true, warn: true, error: true, - level: true) + level: true + ) end it 'updates the #instance setting' do diff --git a/spec/datadog/core/configuration_spec.rb b/spec/datadog/core/configuration_spec.rb index 6f37dcaf8ca..557b17ec593 100644 --- a/spec/datadog/core/configuration_spec.rb +++ b/spec/datadog/core/configuration_spec.rb @@ -21,11 +21,11 @@ before do allow(Datadog::Core::Configuration::Components).to receive(:new) .and_wrap_original do |m, *args| - new_components = m.call(*args) - allow(new_components).to receive(:shutdown!) - allow(new_components).to receive(:startup!) - new_components - end + new_components = m.call(*args) + allow(new_components).to receive(:shutdown!) + allow(new_components).to receive(:startup!) + new_components + end end context 'and components have been initialized' do diff --git a/spec/datadog/core/error_spec.rb b/spec/datadog/core/error_spec.rb index be44d104464..628d053be6c 100644 --- a/spec/datadog/core/error_spec.rb +++ b/spec/datadog/core/error_spec.rb @@ -99,14 +99,16 @@ def call root_caller = /from.*in `middle'/ expect(error.backtrace) - .to match(/ - #{wrapper_error_message}.* - #{wrapper_caller}.* - #{middle_error_message}.* - #{middle_caller}.* - #{root_error_message}.* - #{root_caller}.* - /mx) + .to match( + / + #{wrapper_error_message}.* + #{wrapper_caller}.* + #{middle_error_message}.* + #{middle_caller}.* + #{root_error_message}.* + #{root_caller}.* + /mx + ) # Expect 2 "first-class" exception lines: 'root cause' and 'wrapper layer'. expect(error.backtrace.each_line.reject { |l| l.start_with?("\tfrom") }).to have(3).items diff --git a/spec/datadog/opentracer/propagator_spec.rb b/spec/datadog/opentracer/propagator_spec.rb index 57534229cf4..885581451f8 100644 --- a/spec/datadog/opentracer/propagator_spec.rb +++ b/spec/datadog/opentracer/propagator_spec.rb @@ -7,9 +7,12 @@ RSpec.describe Datadog::OpenTracer::Propagator do describe 'implemented class behavior' do subject(:propagator_class) do - stub_const('TestPropagator', Class.new.tap do |klass| - klass.extend(described_class) - end) + stub_const( + 'TestPropagator', + Class.new.tap do |klass| + klass.extend(described_class) + end + ) end describe '#inject' do diff --git a/spec/datadog/profiling/collectors/stack_spec.rb b/spec/datadog/profiling/collectors/stack_spec.rb index 1d02b144f40..452b9fd5820 100644 --- a/spec/datadog/profiling/collectors/stack_spec.rb +++ b/spec/datadog/profiling/collectors/stack_spec.rb @@ -93,10 +93,12 @@ context 'when sampling a top-level eval' do let(:do_in_background_thread) do proc do - eval(%( + eval( + %( ready_queue << true sleep - )) + ) + ) end end @@ -382,7 +384,8 @@ def define_methods(target_depth) next if respond_to?(:"deep_stack_#{depth}") # rubocop:disable Security/Eval - eval(%( + eval( + %( def deep_stack_#{depth} # def deep_stack_1 if Thread.current.backtrace.size < @target_depth # if Thread.current.backtrace.size < @target_depth deep_stack_#{depth + 1} # deep_stack_2 @@ -391,7 +394,11 @@ def deep_stack_#{depth} # def deep_stack_1 sleep # sleep end # end end # end - ), binding, __FILE__, __LINE__ - 9) + ), + binding, + __FILE__, + __LINE__ - 12 + ) # rubocop:enable Security/Eval end end diff --git a/spec/datadog/profiling/pprof/builder_spec.rb b/spec/datadog/profiling/pprof/builder_spec.rb index d0087e964dc..eac240d83bc 100644 --- a/spec/datadog/profiling/pprof/builder_spec.rb +++ b/spec/datadog/profiling/pprof/builder_spec.rb @@ -144,10 +144,14 @@ def string_id_for(string) .and_return(function) expect(build_location).to be_a_kind_of(Perftools::Profiles::Location) - expect(build_location.to_h).to match(hash_including(id: location_id, - line: [{ - function_id: function.id, line: line_number - }])) + expect(build_location.to_h).to match( + hash_including( + id: location_id, + line: [{ + function_id: function.id, line: line_number + }] + ) + ) end end diff --git a/spec/datadog/profiling/transport/http/api/endpoint_spec.rb b/spec/datadog/profiling/transport/http/api/endpoint_spec.rb index 12090a5743d..b78db862abe 100644 --- a/spec/datadog/profiling/transport/http/api/endpoint_spec.rb +++ b/spec/datadog/profiling/transport/http/api/endpoint_spec.rb @@ -104,9 +104,11 @@ def get_flush_tag(tag) it 'reports the additional tags as part of the tags field' do call - expect(env.form).to include('tags' => array_including( - 'test_tag_key:test_tag_value', 'another_tag_key:another_tag_value' - )) + expect(env.form).to include( + 'tags' => array_including( + 'test_tag_key:test_tag_value', 'another_tag_key:another_tag_value' + ) + ) end end end diff --git a/spec/datadog/tracing/contrib/action_cable/patcher_spec.rb b/spec/datadog/tracing/contrib/action_cable/patcher_spec.rb index 3202340bf55..6b2f2e97f8f 100644 --- a/spec/datadog/tracing/contrib/action_cable/patcher_spec.rb +++ b/spec/datadog/tracing/contrib/action_cable/patcher_spec.rb @@ -94,13 +94,16 @@ context 'with channel' do let(:channel_class) do - stub_const('ChatChannel', Class.new(ActionCable::Channel::Base) do - def subscribed; end + stub_const( + 'ChatChannel', + Class.new(ActionCable::Channel::Base) do + def subscribed; end - def unsubscribed; end + def unsubscribed; end - def foo(_data); end - end) + def foo(_data); end + end + ) end let(:channel_instance) { channel_class.new(connection, '{id: 1}', id: 1) } @@ -202,11 +205,14 @@ def foo(_data); end let(:data) { { 'action' => 'foo', 'extra' => 'data' } } let(:channel_class) do - stub_const('ChatChannel', Class.new(ActionCable::Channel::Base) do - def foo(_data) - transmit({ mock: 'data' }, via: 'streamed from chat_channel') + stub_const( + 'ChatChannel', + Class.new(ActionCable::Channel::Base) do + def foo(_data) + transmit({ mock: 'data' }, via: 'streamed from chat_channel') + end end - end) + ) end let(:span) { spans.last } # Skip 'perform_action' span diff --git a/spec/datadog/tracing/contrib/action_mailer/helpers.rb b/spec/datadog/tracing/contrib/action_mailer/helpers.rb index 42a1acf53d9..721419e47c9 100644 --- a/spec/datadog/tracing/contrib/action_mailer/helpers.rb +++ b/spec/datadog/tracing/contrib/action_mailer/helpers.rb @@ -20,11 +20,13 @@ default from: 'test@example.com' def test_mail(_arg) - mail(to: 'test@example.com', + mail( + to: 'test@example.com', body: 'sk test', subject: 'miniswan', bcc: 'test_a@example.com,test_b@example.com', - cc: ['test_c@example.com', 'test_d@example.com']) + cc: ['test_c@example.com', 'test_d@example.com'] + ) end end ) diff --git a/spec/datadog/tracing/contrib/active_model_serializers/helpers.rb b/spec/datadog/tracing/contrib/active_model_serializers/helpers.rb index 683ab496063..da52a0fe6b9 100644 --- a/spec/datadog/tracing/contrib/active_model_serializers/helpers.rb +++ b/spec/datadog/tracing/contrib/active_model_serializers/helpers.rb @@ -19,43 +19,58 @@ def disable_logging if ActiveModelSerializersHelpers.ams_0_10_or_newer? before do - stub_const('Model', Class.new(ActiveModelSerializers::Model) do - attr_writer :id - end) + stub_const( + 'Model', + Class.new(ActiveModelSerializers::Model) do + attr_writer :id + end + ) - stub_const('TestModel', Class.new(Model) do - attributes :name - end) + stub_const( + 'TestModel', + Class.new(Model) do + attributes :name + end + ) - stub_const('TestModelSerializer', Class.new(ActiveModel::Serializer) do - attributes :name - end) + stub_const( + 'TestModelSerializer', + Class.new(ActiveModel::Serializer) do + attributes :name + end + ) end else before do - stub_const('Model', Class.new do - attr_writer :id + stub_const( + 'Model', + Class.new do + attr_writer :id - def initialize(hash = {}) - @attributes = hash - end + def initialize(hash = {}) + @attributes = hash + end - def read_attribute_for_serialization(name) - if [:id, 'id'].include?(name) - object_id - elsif respond_to?(name) - send name - else - @attributes[name] + def read_attribute_for_serialization(name) + if [:id, 'id'].include?(name) + object_id + elsif respond_to?(name) + send name + else + @attributes[name] + end end end - end) + ) stub_const('TestModel', Class.new(Model)) - stub_const('TestModelSerializer', Class.new(ActiveModel::Serializer) do - attributes :name - end) + stub_const( + 'TestModelSerializer', + Class.new(ActiveModel::Serializer) do + attributes :name + end + ) end end end diff --git a/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb b/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb index dcb32fe2bf3..2aa39269e5a 100644 --- a/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb +++ b/spec/datadog/tracing/contrib/active_record/configuration/resolver_spec.rb @@ -31,11 +31,13 @@ add expect(resolver.configurations) - .to eq({ - adapter: 'adapter', - host: 'host', - port: 123 - } => config) + .to eq( + { + adapter: 'adapter', + host: 'host', + port: 123 + } => config + ) end end @@ -119,8 +121,9 @@ unless matcher == match_all expect(resolver.resolve({ host: Object.new })) - .to be_nil, "Expected pattern to match only the input, but it's matching everything. "\ - 'Unless you explicitly wanted to match all patterns, this is unlikely to be desired.' + .to be_nil, + "Expected pattern to match only the input, but it's matching everything. "\ + 'Unless you explicitly wanted to match all patterns, this is unlikely to be desired.' end end end diff --git a/spec/datadog/tracing/contrib/active_record/multi_db_spec.rb b/spec/datadog/tracing/contrib/active_record/multi_db_spec.rb index 8982c82dd1d..58e40278bfe 100644 --- a/spec/datadog/tracing/contrib/active_record/multi_db_spec.rb +++ b/spec/datadog/tracing/contrib/active_record/multi_db_spec.rb @@ -18,9 +18,12 @@ RSpec.describe 'ActiveRecord multi-database implementation' do let(:configuration_options) { { service_name: default_db_service_name } } let(:application_record) do - stub_const('ApplicationRecord', Class.new(ActiveRecord::Base) do - self.abstract_class = true - end) + stub_const( + 'ApplicationRecord', + Class.new(ActiveRecord::Base) do + self.abstract_class = true + end + ) end let!(:gadget_class) do stub_const('Gadget', Class.new(application_record)).tap do |klass| diff --git a/spec/datadog/tracing/contrib/active_record/tracer_spec.rb b/spec/datadog/tracing/contrib/active_record/tracer_spec.rb index 8f65da5189f..318ddf73a28 100644 --- a/spec/datadog/tracing/contrib/active_record/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/active_record/tracer_spec.rb @@ -104,9 +104,11 @@ Datadog.configure do |c| c.tracing.instrument :active_record, service_name: 'bad-no-match' - c.tracing.instrument :active_record, describes: { makara_role: primary_role }, + c.tracing.instrument :active_record, + describes: { makara_role: primary_role }, service_name: primary_service_name - c.tracing.instrument :active_record, describes: { makara_role: secondary_role }, + c.tracing.instrument :active_record, + describes: { makara_role: secondary_role }, service_name: secondary_service_name end end diff --git a/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb b/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb index a737db38769..e3716549797 100644 --- a/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb +++ b/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb @@ -12,20 +12,26 @@ RSpec.describe Datadog::Tracing::Contrib::DelayedJob::Plugin, :delayed_job_active_record do let(:sample_job_object) do - stub_const('SampleJob', Class.new do - def perform; end - end) + stub_const( + 'SampleJob', + Class.new do + def perform; end + end + ) end let(:active_job_sample_job_object) do - stub_const('ActiveJobSampleJob', Class.new do - def perform; end - - def job_data - { - 'job_class' => 'UnderlyingJobClass' - } + stub_const( + 'ActiveJobSampleJob', + Class.new do + def perform; end + + def job_data + { + 'job_class' => 'UnderlyingJobClass' + } + end end - end) + ) end let(:configuration_options) { {} } @@ -89,11 +95,14 @@ def job_data let(:error_handler) { proc { @error_handler_called = true } } let(:sample_job_object) do - stub_const('SampleJob', Class.new do - def perform - raise ZeroDivisionError, 'job error' + stub_const( + 'SampleJob', + Class.new do + def perform + raise ZeroDivisionError, 'job error' + end end - end) + ) end it 'uses custom error handler' do diff --git a/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb b/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb index 3061a9b1140..3652b4634c5 100644 --- a/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb +++ b/spec/datadog/tracing/contrib/elasticsearch/integration_spec.rb @@ -58,13 +58,15 @@ context 'when "elastic-transport" gem is loaded with a version' do context 'that is less than the minimum' do - include_context 'loaded gems', :'elastic-transport' => decrement_gem_version(described_class::MINIMUM_VERSION), + include_context 'loaded gems', + :'elastic-transport' => decrement_gem_version(described_class::MINIMUM_VERSION), :'elasticsearch-transport' => nil it { is_expected.to be false } end context 'that meets the minimum version' do - include_context 'loaded gems', :'elastic-transport' => described_class::MINIMUM_VERSION, + include_context 'loaded gems', + :'elastic-transport' => described_class::MINIMUM_VERSION, :'elasticsearch-transport' => nil it { is_expected.to be true } end diff --git a/spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb b/spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb index 7d3a18f9130..8a5b696acb7 100644 --- a/spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb +++ b/spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb @@ -56,11 +56,14 @@ end let(:middleware) do - stub_const('MyFaradayMiddleware', Class.new(Faraday::Middleware) do - def call(env) - @app.call(env) + stub_const( + 'MyFaradayMiddleware', + Class.new(Faraday::Middleware) do + def call(env) + @app.call(env) + end end - end) + ) end describe 'the handlers' do diff --git a/spec/datadog/tracing/contrib/extensions_spec.rb b/spec/datadog/tracing/contrib/extensions_spec.rb index 4b44909c096..fdce5015553 100644 --- a/spec/datadog/tracing/contrib/extensions_spec.rb +++ b/spec/datadog/tracing/contrib/extensions_spec.rb @@ -17,9 +17,12 @@ end let(:configurable_module) do - stub_const('Configurable', Module.new do - include Datadog::Tracing::Contrib::Configurable - end) + stub_const( + 'Configurable', + Module.new do + include Datadog::Tracing::Contrib::Configurable + end + ) end before { registry.add(integration_name, integration) } @@ -154,13 +157,16 @@ def patcher end let(:patcher_module) do - stub_const('Patcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - true + stub_const( + 'Patcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + true + end end - end) + ) end end diff --git a/spec/datadog/tracing/contrib/grape/tracer_spec.rb b/spec/datadog/tracing/contrib/grape/tracer_spec.rb index dabcc25f394..00420719785 100644 --- a/spec/datadog/tracing/contrib/grape/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/grape/tracer_spec.rb @@ -22,95 +22,101 @@ # patch Grape before the application Datadog::Tracing::Contrib::Grape::Patcher.patch - stub_const('TestingAPI', Class.new(Grape::API) do - namespace :base do - desc 'Returns a success message' - get :success do - 'OK' - end - - desc 'Returns an error' - get :hard_failure do - raise StandardError, 'Ouch!' - end - end - - namespace :filtered do - before do - sleep(0.01) - end + stub_const( + 'TestingAPI', + Class.new(Grape::API) do + namespace :base do + desc 'Returns a success message' + get :success do + 'OK' + end - after do - sleep(0.01) + desc 'Returns an error' + get :hard_failure do + raise StandardError, 'Ouch!' + end end - desc 'Returns a success message before and after filter processing' - get :before_after do - 'OK' - end - end + namespace :filtered do + before do + sleep(0.01) + end - namespace :filtered_exception do - before do - raise StandardError, 'Ouch!' - end + after do + sleep(0.01) + end - desc 'Returns an error in the filter' - get :before do - 'OK' + desc 'Returns a success message before and after filter processing' + get :before_after do + 'OK' + end end - end - resource :widgets do - desc 'Returns a list of widgets' - get do - '[]' - end + namespace :filtered_exception do + before do + raise StandardError, 'Ouch!' + end - desc 'creates a widget' - post do - '{}' + desc 'Returns an error in the filter' + get :before do + 'OK' + end end - end - namespace :nested do resource :widgets do desc 'Returns a list of widgets' get do '[]' end + + desc 'creates a widget' + post do + '{}' + end end - end - resource :span_resource do - get :span_resource do - 'OK' + namespace :nested do + resource :widgets do + desc 'Returns a list of widgets' + get do + '[]' + end + end + end + + resource :span_resource do + get :span_resource do + 'OK' + end end end - end) + ) end let(:rack_testing_api) do # patch Grape before the application Datadog::Tracing::Contrib::Grape::Patcher.patch - stub_const('RackTestingAPI', Class.new(Grape::API) do - desc 'Returns a success message' - get :success do - 'OK' - end + stub_const( + 'RackTestingAPI', + Class.new(Grape::API) do + desc 'Returns a success message' + get :success do + 'OK' + end - desc 'Returns an error' - get :hard_failure do - raise StandardError, 'Ouch!' - end + desc 'Returns an error' + get :hard_failure do + raise StandardError, 'Ouch!' + end - resource :span_resource_rack do - get :span_resource do - 'OK' + resource :span_resource_rack do + get :span_resource do + 'OK' + end end end - end) + ) # create a custom Rack application with the Rack middleware and a Grape API Rack::Builder.new do diff --git a/spec/datadog/tracing/contrib/graphql/test_types.rb b/spec/datadog/tracing/contrib/graphql/test_types.rb index 1fdf2f862c8..9029fcfe467 100644 --- a/spec/datadog/tracing/contrib/graphql/test_types.rb +++ b/spec/datadog/tracing/contrib/graphql/test_types.rb @@ -34,26 +34,32 @@ def initialize(id, name = 'bar') ot = object_type oc = object_class - stub_const(qtn, Class.new(::GraphQL::Schema::Object) do - field ot.graphql_name.downcase, ot, null: false, description: 'Find an object by ID' do - argument :id, ::GraphQL::Types::ID, required: true + stub_const( + qtn, + Class.new(::GraphQL::Schema::Object) do + field ot.graphql_name.downcase, ot, null: false, description: 'Find an object by ID' do + argument :id, ::GraphQL::Types::ID, required: true + end + + define_method ot.graphql_name.downcase do |args| + oc.new(args[:id]) + end end - - define_method ot.graphql_name.downcase do |args| - oc.new(args[:id]) - end - end) + ) end let(:object_type) do otn = object_type_name - stub_const(otn, Class.new(::GraphQL::Schema::Object) do - field :id, ::GraphQL::Types::ID, null: false - field :name, ::GraphQL::Types::String, null: true - field :created_at, ::GraphQL::Types::String, null: false - field :updated_at, ::GraphQL::Types::String, null: false - end) + stub_const( + otn, + Class.new(::GraphQL::Schema::Object) do + field :id, ::GraphQL::Types::ID, null: false + field :name, ::GraphQL::Types::String, null: true + field :created_at, ::GraphQL::Types::String, null: false + field :updated_at, ::GraphQL::Types::String, null: false + end + ) end end diff --git a/spec/datadog/tracing/contrib/http/request_spec.rb b/spec/datadog/tracing/contrib/http/request_spec.rb index 86c272315ef..eb2ceeaa3e8 100644 --- a/spec/datadog/tracing/contrib/http/request_spec.rb +++ b/spec/datadog/tracing/contrib/http/request_spec.rb @@ -274,15 +274,17 @@ def expect_request_without_distributed_headers # rubocop:disable Style/BlockDelimiters - expect(WebMock).to(have_requested(:get, "#{uri}#{path}").with { |req| - [ - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID, - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID, - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY - ].none? do |header| - req.headers.key?(header.split('-').map(&:capitalize).join('-')) - end - }) + expect(WebMock).to( + have_requested(:get, "#{uri}#{path}").with { |req| + [ + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID, + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID, + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY + ].none? do |header| + req.headers.key?(header.split('-').map(&:capitalize).join('-')) + end + } + ) end context 'by default' do @@ -309,11 +311,13 @@ def expect_request_without_distributed_headers # The block syntax only works with Ruby < 2.3 and the hash syntax # only works with Ruby >= 2.3, so we need to support both. if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') - expect(WebMock).to(have_requested(:get, "#{uri}#{path}").with { |req| - distributed_tracing_headers.all? do |(header, value)| - req.headers[header.split('-').map(&:capitalize).join('-')] == value.to_s - end - }) + expect(WebMock).to( + have_requested(:get, "#{uri}#{path}").with { |req| + distributed_tracing_headers.all? do |(header, value)| + req.headers[header.split('-').map(&:capitalize).join('-')] == value.to_s + end + } + ) else expect(WebMock).to have_requested(:get, "#{uri}#{path}").with(headers: distributed_tracing_headers) end @@ -353,11 +357,13 @@ def expect_request_without_distributed_headers # The block syntax only works with Ruby < 2.3 and the hash syntax # only works with Ruby >= 2.3, so we need to support both. if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') - expect(WebMock).to(have_requested(:get, "#{uri}#{path}").with { |req| - distributed_tracing_headers.all? do |(header, value)| - req.headers[header.split('-').map(&:capitalize).join('-')] == value.to_s - end - }) + expect(WebMock).to( + have_requested(:get, "#{uri}#{path}").with { |req| + distributed_tracing_headers.all? do |(header, value)| + req.headers[header.split('-').map(&:capitalize).join('-')] == value.to_s + end + } + ) else expect(WebMock).to have_requested(:get, "#{uri}#{path}").with(headers: distributed_tracing_headers) end diff --git a/spec/datadog/tracing/contrib/patcher_spec.rb b/spec/datadog/tracing/contrib/patcher_spec.rb index 05eea6eddad..aeecbe57d49 100644 --- a/spec/datadog/tracing/contrib/patcher_spec.rb +++ b/spec/datadog/tracing/contrib/patcher_spec.rb @@ -24,9 +24,12 @@ context 'when patcher does not define .patch' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - end) + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + end + ) end it { expect(patch).to be nil } @@ -35,13 +38,16 @@ context 'when patcher defines .patch' do context 'and .target_version is not defined' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - :patched + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + :patched + end end - end) + ) end it do @@ -53,17 +59,20 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - :patched + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + :patched + end + + def self.target_version + Gem::Version.new(1.0) + end end - - def self.target_version - Gem::Version.new(1.0) - end - end) + ) end it do @@ -81,13 +90,16 @@ def self.target_version context 'and .target_version is not defined' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - raise StandardError, 'Patch error!' + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + raise StandardError, 'Patch error!' + end end - end) + ) end it 'handles the error' do @@ -101,17 +113,20 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - raise StandardError, 'Patch error!' - end - - def self.target_version - Gem::Version.new(1.0) + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + raise StandardError, 'Patch error!' + end + + def self.target_version + Gem::Version.new(1.0) + end end - end) + ) end it 'handles the error' do @@ -130,9 +145,12 @@ def self.target_version context 'when patcher does not define .patch' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - end) + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + end + ) end context 'and patch has not been applied' do @@ -148,13 +166,16 @@ def self.target_version context 'when patcher defines .patch' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher - def self.patch - :patched + def self.patch + :patched + end end - end) + ) end context 'and patch has not been applied' do @@ -196,13 +217,16 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher - def self.target_version - Gem::Version.new(1.0) + def self.target_version + Gem::Version.new(1.0) + end end - end) + ) end it 'handles the error' do @@ -220,9 +244,12 @@ def self.target_version subject(:patcher) { patcher_class.new } let(:patcher_class) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher - end) + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher + end + ) end describe '#patch' do @@ -234,13 +261,16 @@ def self.target_version context 'when patcher defines #patch' do let(:patcher_class) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher - def patch - :patched + def patch + :patched + end end - end) + ) end it { expect(patch).to be :patched } @@ -274,13 +304,16 @@ def patch context 'and .target_version is defined' do let(:patcher_class) do - stub_const('TestPatcher', Class.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Class.new do + include Datadog::Tracing::Contrib::Patcher - def target_version - Gem::Version.new(1.0) + def target_version + Gem::Version.new(1.0) + end end - end) + ) end it 'handles the error' do @@ -304,9 +337,12 @@ def target_version context 'when patcher does not define .patch' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - end) + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + end + ) end it { expect(patch).to be nil } @@ -315,13 +351,16 @@ def target_version context 'when patcher defines .patch' do context 'and .target_version is not defined' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - :patched + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + :patched + end end - end) + ) end it do @@ -333,17 +372,20 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - :patched + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + :patched + end + + def self.target_version + Gem::Version.new(1.0) + end end - - def self.target_version - Gem::Version.new(1.0) - end - end) + ) end it do @@ -361,13 +403,16 @@ def self.target_version context 'and .target_version is not defined' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - raise StandardError, 'Patch error!' + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + raise StandardError, 'Patch error!' + end end - end) + ) end it 'handles the error' do @@ -381,17 +426,20 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - - def self.patch - raise StandardError, 'Patch error!' + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + + def self.patch + raise StandardError, 'Patch error!' + end + + def self.target_version + Gem::Version.new(1.0) + end end - - def self.target_version - Gem::Version.new(1.0) - end - end) + ) end it 'handles the error' do @@ -410,9 +458,12 @@ def self.target_version context 'when patcher does not define .patch' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher - end) + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher + end + ) end context 'and patch has not been applied' do @@ -428,13 +479,16 @@ def self.target_version context 'when patcher defines .patch' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher - def self.patch - :patched + def self.patch + :patched + end end - end) + ) end context 'and patch has not been applied' do @@ -476,13 +530,16 @@ def self.patch context 'and .target_version is defined' do let(:patcher) do - stub_const('TestPatcher', Module.new do - include Datadog::Tracing::Contrib::Patcher + stub_const( + 'TestPatcher', + Module.new do + include Datadog::Tracing::Contrib::Patcher - def self.target_version - Gem::Version.new(1.0) + def self.target_version + Gem::Version.new(1.0) + end end - end) + ) end it 'handles the error' do diff --git a/spec/datadog/tracing/contrib/que/tracer_spec.rb b/spec/datadog/tracing/contrib/que/tracer_spec.rb index de16c74a076..e28bf5f98f5 100644 --- a/spec/datadog/tracing/contrib/que/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/que/tracer_spec.rb @@ -15,16 +15,22 @@ } end let(:job_class) do - stub_const('TestJobClass', Class.new(::Que::Job) do - def run(*args); end - end) + stub_const( + 'TestJobClass', + Class.new(::Que::Job) do + def run(*args); end + end + ) end let(:error_job_class) do - stub_const('ErrorJobClass', Class.new(::Que::Job) do - def run(*_args) - raise StandardError, 'with some error' + stub_const( + 'ErrorJobClass', + Class.new(::Que::Job) do + def run(*_args) + raise StandardError, 'with some error' + end end - end) + ) end before do diff --git a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb index 2ca70deea13..f1a356f771d 100644 --- a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb +++ b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb @@ -354,17 +354,19 @@ let(:routes) do proc do map '/app/' do - run(proc do |env| - # This should be considered a web framework that can alter - # the request span after routing / controller processing - request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] - request_span.resource = 'GET /app/' - request_span.set_tag('http.method', 'GET_V2') - request_span.set_tag('http.status_code', 201) - request_span.set_tag('http.url', '/app/static/') - - [200, { 'Content-Type' => 'text/html' }, ['OK']] - end) + run( + proc do |env| + # This should be considered a web framework that can alter + # the request span after routing / controller processing + request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] + request_span.resource = 'GET /app/' + request_span.set_tag('http.method', 'GET_V2') + request_span.set_tag('http.status_code', 201) + request_span.set_tag('http.url', '/app/static/') + + [200, { 'Content-Type' => 'text/html' }, ['OK']] + end + ) end end end @@ -410,15 +412,17 @@ let(:routes) do proc do map '/app/500/' do - run(proc do |env| - # this should be considered a web framework that can alter - # the request span after routing / controller processing - request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] - request_span.status = 1 - request_span.set_tag('error.stack', 'Handled exception') - - [500, { 'Content-Type' => 'text/html' }, ['OK']] - end) + run( + proc do |env| + # this should be considered a web framework that can alter + # the request span after routing / controller processing + request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] + request_span.status = 1 + request_span.set_tag('error.stack', 'Handled exception') + + [500, { 'Content-Type' => 'text/html' }, ['OK']] + end + ) end end end @@ -450,14 +454,16 @@ let(:routes) do proc do map '/app/500/' do - run(proc do |env| - # this should be considered a web framework that can alter - # the request span after routing / controller processing - request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] - request_span.set_tag('error.stack', 'Handled exception') - - [500, { 'Content-Type' => 'text/html' }, ['OK']] - end) + run( + proc do |env| + # this should be considered a web framework that can alter + # the request span after routing / controller processing + request_span = env[Datadog::Tracing::Contrib::Rack::Ext::RACK_ENV_REQUEST_SPAN] + request_span.set_tag('error.stack', 'Handled exception') + + [500, { 'Content-Type' => 'text/html' }, ['OK']] + end + ) end end end @@ -530,18 +536,20 @@ let(:routes) do proc do map '/headers/' do - run(proc do |_env| - response_headers = { - 'Content-Type' => 'text/html', - 'Cache-Control' => 'max-age=3600', - 'ETag' => '"737060cd8c284d8af7ad3082f209582d"', - 'Expires' => 'Thu, 01 Dec 1994 16:00:00 GMT', - 'Last-Modified' => 'Tue, 15 Nov 1994 12:45:26 GMT', - 'X-Request-ID' => 'f058ebd6-02f7-4d3f-942e-904344e8cde5', - 'X-Fake-Response' => 'Don\'t tag me.' - } - [200, response_headers, ['OK']] - end) + run( + proc do |_env| + response_headers = { + 'Content-Type' => 'text/html', + 'Cache-Control' => 'max-age=3600', + 'ETag' => '"737060cd8c284d8af7ad3082f209582d"', + 'Expires' => 'Thu, 01 Dec 1994 16:00:00 GMT', + 'Last-Modified' => 'Tue, 15 Nov 1994 12:45:26 GMT', + 'X-Request-ID' => 'f058ebd6-02f7-4d3f-942e-904344e8cde5', + 'X-Fake-Response' => 'Don\'t tag me.' + } + [200, response_headers, ['OK']] + end + ) end end end @@ -549,22 +557,23 @@ context 'when configured to tag headers' do before do Datadog.configure do |c| - c.tracing.instrument :rack, headers: { - request: [ - 'Cache-Control' - ], - response: [ - 'Content-Type', - 'Cache-Control', - 'Content-Type', - 'ETag', - 'Expires', - 'Last-Modified', - # This lowercase 'Id' header doesn't match. - # Ensure middleware allows for case-insensitive matching. - 'X-Request-Id' - ] - } + c.tracing.instrument :rack, + headers: { + request: [ + 'Cache-Control' + ], + response: [ + 'Content-Type', + 'Cache-Control', + 'Content-Type', + 'ETag', + 'Expires', + 'Last-Modified', + # This lowercase 'Id' header doesn't match. + # Ensure middleware allows for case-insensitive matching. + 'X-Request-Id' + ] + } end end diff --git a/spec/datadog/tracing/contrib/rack/resource_name_spec.rb b/spec/datadog/tracing/contrib/rack/resource_name_spec.rb index 84248b6e373..4eeb616cc51 100644 --- a/spec/datadog/tracing/contrib/rack/resource_name_spec.rb +++ b/spec/datadog/tracing/contrib/rack/resource_name_spec.rb @@ -45,25 +45,31 @@ end let(:auth_middleware) do - stub_const('AuthMiddleware', Class.new do - def initialize(app) - @app = app + stub_const( + 'AuthMiddleware', + Class.new do + def initialize(app) + @app = app + end + + def call(env) + return [401, {}, []] if env['HTTP_AUTH_TOKEN'] != '1234' + + @app.call(env) + end end - - def call(env) - return [401, {}, []] if env['HTTP_AUTH_TOKEN'] != '1234' - - @app.call(env) - end - end) + ) end let(:bottom_middleware) do - stub_const('BottomMiddleware', Class.new do - def call(_) - [200, {}, []] + stub_const( + 'BottomMiddleware', + Class.new do + def call(_) + [200, {}, []] + end end - end) + ) end end diff --git a/spec/datadog/tracing/contrib/rails/action_controller_spec.rb b/spec/datadog/tracing/contrib/rails/action_controller_spec.rb index 6f05661e5ea..94dc23aea46 100644 --- a/spec/datadog/tracing/contrib/rails/action_controller_spec.rb +++ b/spec/datadog/tracing/contrib/rails/action_controller_spec.rb @@ -5,11 +5,14 @@ RSpec.describe 'Rails ActionController' do let(:rails_options) { {} } let(:controller) do - stub_const('TestController', Class.new(base_class) do - def index - # Do nothing + stub_const( + 'TestController', + Class.new(base_class) do + def index + # Do nothing + end end - end) + ) end let(:name) { :index } let(:base_class) { ActionController::Base } @@ -110,11 +113,14 @@ def index let(:observed) { {} } let(:controller) do observed = self.observed - stub_const('TestController', Class.new(base_class) do - define_method(:index) do - observed[:active_span_resource] = Datadog::Tracing.active_span.resource + stub_const( + 'TestController', + Class.new(base_class) do + define_method(:index) do + observed[:active_span_resource] = Datadog::Tracing.active_span.resource + end end - end) + ) end it 'sets the span resource before calling the controller' do diff --git a/spec/datadog/tracing/contrib/rails/analytics_spec.rb b/spec/datadog/tracing/contrib/rails/analytics_spec.rb index 40f94f316cb..7a5b9697780 100644 --- a/spec/datadog/tracing/contrib/rails/analytics_spec.rb +++ b/spec/datadog/tracing/contrib/rails/analytics_spec.rb @@ -30,11 +30,14 @@ subject(:result) { action.call(env) } let(:controller) do - stub_const('TestController', Class.new(base_class) do - def index - # Do nothing + stub_const( + 'TestController', + Class.new(base_class) do + def index + # Do nothing + end end - end) + ) end let(:name) { :index } let(:base_class) { ActionController::Metal } diff --git a/spec/datadog/tracing/contrib/rails/disable_env_spec.rb b/spec/datadog/tracing/contrib/rails/disable_env_spec.rb index 143d491121c..f282b9a3b53 100644 --- a/spec/datadog/tracing/contrib/rails/disable_env_spec.rb +++ b/spec/datadog/tracing/contrib/rails/disable_env_spec.rb @@ -30,11 +30,14 @@ let(:controllers) { [controller] } let(:controller) do - stub_const('TestController', Class.new(ActionController::Base) do - def index - head :ok + stub_const( + 'TestController', + Class.new(ActionController::Base) do + def index + head :ok + end end - end) + ) end it 'does not instrument' do diff --git a/spec/datadog/tracing/contrib/rails/middleware_spec.rb b/spec/datadog/tracing/contrib/rails/middleware_spec.rb index a9d3579d89d..7b77e40b8b7 100644 --- a/spec/datadog/tracing/contrib/rails/middleware_spec.rb +++ b/spec/datadog/tracing/contrib/rails/middleware_spec.rb @@ -12,11 +12,14 @@ let(:controllers) { [controller] } let(:controller) do - stub_const('TestController', Class.new(ActionController::Base) do - def index - head :ok + stub_const( + 'TestController', + Class.new(ActionController::Base) do + def index + head :ok + end end - end) + ) end RSpec::Matchers.define :have_kind_of_middleware do |expected| @@ -40,15 +43,18 @@ def index context 'with middleware' do context 'that does nothing' do let(:middleware) do - stub_const('PassthroughMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'PassthroughMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - @app.call(env) + def call(env) + @app.call(env) + end end - end) + ) end context 'and added after tracing is enabled' do @@ -72,17 +78,20 @@ def call(env) context 'that itself creates a span' do let(:middleware) do - stub_const('CustomSpanMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'CustomSpanMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - Datadog::Tracing.trace('custom.test') do - @app.call(env) + def call(env) + Datadog::Tracing.trace('custom.test') do + @app.call(env) + end end end - end) + ) end context 'and added after tracing is enabled' do @@ -115,16 +124,19 @@ def call(env) let(:rails_middleware) { [middleware] } let(:middleware) do - stub_const('RaiseExceptionMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'RaiseExceptionMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - @app.call(env) - raise NotImplementedError + def call(env) + @app.call(env) + raise NotImplementedError + end end - end) + ) end it do @@ -158,16 +170,19 @@ def call(env) let(:rails_middleware) { [middleware] } let(:middleware) do - stub_const('RaiseNotFoundMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'RaiseNotFoundMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - @app.call(env) - raise ActionController::RoutingError, '/missing_route' + def call(env) + @app.call(env) + raise ActionController::RoutingError, '/missing_route' + end end - end) + ) end it do @@ -202,27 +217,33 @@ def call(env) let(:rails_middleware) { [middleware] } let(:error_class) do - stub_const('CustomError', Class.new(StandardError) do - def message - 'Custom error message!' + stub_const( + 'CustomError', + Class.new(StandardError) do + def message + 'Custom error message!' + end end - end) + ) end let(:middleware) do # Run this to define the error class error_class - stub_const('RaiseCustomErrorMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'RaiseCustomErrorMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - @app.call(env) - raise CustomError + def call(env) + @app.call(env) + raise CustomError + end end - end) + ) end it do diff --git a/spec/datadog/tracing/contrib/rails/rack_spec.rb b/spec/datadog/tracing/contrib/rails/rack_spec.rb index 86ed0046e22..0d849204002 100644 --- a/spec/datadog/tracing/contrib/rails/rack_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rack_spec.rb @@ -29,96 +29,102 @@ let(:controllers) { [controller, errors_controller] } let(:controller) do layout_ = layout - stub_const('TestController', Class.new(ActionController::Base) do - include ::Rails.application.routes.url_helpers - - layout layout_ - - self.view_paths = [ActionView::FixtureResolver.new( - 'layouts/application.html.erb' => '<%= yield %>', - 'test/full.html.erb' => 'Test template content', - 'test/template_with_partial.html.erb' => 'Template with <%= render "test/outer_partial" %>', - 'test/partial_does_not_exist.html.erb' => '<%= render "test/no_partial_here" %>', - 'test/_outer_partial.html.erb' => 'a partial inside <%= render "test/inner_partial" %>', - 'test/_inner_partial.html.erb' => 'a partial', - 'test/error_template.html.erb' => '<%= 1/0 %>', - 'test/error_partial.html.erb' => 'Oops <%= render "test/inner_error" %>', - 'test/_inner_error.html.erb' => '<%= 1/0 %>' - )] - - def full - @value = ::Rails.cache.write('empty-key', 50) - render 'full' - end + stub_const( + 'TestController', + Class.new(ActionController::Base) do + include ::Rails.application.routes.url_helpers + + layout layout_ + + self.view_paths = [ActionView::FixtureResolver.new( + 'layouts/application.html.erb' => '<%= yield %>', + 'test/full.html.erb' => 'Test template content', + 'test/template_with_partial.html.erb' => 'Template with <%= render "test/outer_partial" %>', + 'test/partial_does_not_exist.html.erb' => '<%= render "test/no_partial_here" %>', + 'test/_outer_partial.html.erb' => 'a partial inside <%= render "test/inner_partial" %>', + 'test/_inner_partial.html.erb' => 'a partial', + 'test/error_template.html.erb' => '<%= 1/0 %>', + 'test/error_partial.html.erb' => 'Oops <%= render "test/inner_error" %>', + 'test/_inner_error.html.erb' => '<%= 1/0 %>' + )] + + def full + @value = ::Rails.cache.write('empty-key', 50) + render 'full' + end - def partial - render 'template_with_partial' - end + def partial + render 'template_with_partial' + end - def nonexistent_template - render 'does_not_exist' - end + def nonexistent_template + render 'does_not_exist' + end - def nonexistent_partial - render 'partial_does_not_exist' - end + def nonexistent_partial + render 'partial_does_not_exist' + end - def error - 1 / 0 - end + def error + 1 / 0 + end - def sub_error - error - end + def sub_error + error + end - def soft_error - if Rails::VERSION::MAJOR.to_i >= 5 - head 520 - else - render nothing: true, status: 520 + def soft_error + if Rails::VERSION::MAJOR.to_i >= 5 + head 520 + else + render nothing: true, status: 520 + end end - end - RescuableError = Class.new(StandardError) + RescuableError = Class.new(StandardError) - def error_handled_by_rescue_from - raise RescuableError - end + def error_handled_by_rescue_from + raise RescuableError + end - rescue_from 'RescuableError' do - render 'full' - end + rescue_from 'RescuableError' do + render 'full' + end - def error_template - render 'error_template' - end + def error_template + render 'error_template' + end - def error_partial - render 'error_partial' - end + def error_partial + render 'error_partial' + end - define_method(:span_resource) do - head :ok - end + define_method(:span_resource) do + head :ok + end - def custom_span_resource - Datadog::Tracing.active_span.resource = 'CustomSpanResource' + def custom_span_resource + Datadog::Tracing.active_span.resource = 'CustomSpanResource' - head :ok - end + head :ok + end - # Users can decide late in the request that a 404 is the desired outcome. - def explicitly_not_found - raise ActionController::RoutingError, :not_found + # Users can decide late in the request that a 404 is the desired outcome. + def explicitly_not_found + raise ActionController::RoutingError, :not_found + end end - end) + ) end let(:errors_controller) do - stub_const('ErrorsController', Class.new(ActionController::Base) do - def internal_server_error - head :internal_server_error + stub_const( + 'ErrorsController', + Class.new(ActionController::Base) do + def internal_server_error + head :internal_server_error + end end - end) + ) end context 'with a full request' do diff --git a/spec/datadog/tracing/contrib/rails/rails_active_job_spec.rb b/spec/datadog/tracing/contrib/rails/rails_active_job_spec.rb index 20b33a7aa51..1bfe333f437 100644 --- a/spec/datadog/tracing/contrib/rails/rails_active_job_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rails_active_job_spec.rb @@ -30,14 +30,17 @@ stub_const('JobDiscardError', Class.new(StandardError)) stub_const('JobRetryError', Class.new(StandardError)) - stub_const('ExampleJob', Class.new(ActiveJob::Base) do - def perform(test_retry: false, test_discard: false) - ActiveJob::Base.logger.info 'MINASWAN' - JOB_EXECUTIONS.increment - raise JobRetryError if test_retry - raise JobDiscardError if test_discard + stub_const( + 'ExampleJob', + Class.new(ActiveJob::Base) do + def perform(test_retry: false, test_discard: false) + ActiveJob::Base.logger.info 'MINASWAN' + JOB_EXECUTIONS.increment + raise JobRetryError if test_retry + raise JobDiscardError if test_discard + end end - end) + ) ExampleJob.discard_on(JobDiscardError) if ExampleJob.respond_to?(:discard_on) ExampleJob.retry_on(JobRetryError, attempts: 2, wait: 2) { nil } if ExampleJob.respond_to?(:retry_on) @@ -228,11 +231,14 @@ def perform(test_retry: false, test_discard: false) context 'with a Sidekiq::Worker' do subject(:worker) do - stub_const('EmptyWorker', Class.new do - include Sidekiq::Worker + stub_const( + 'EmptyWorker', + Class.new do + include Sidekiq::Worker - def perform; end - end) + def perform; end + end + ) end it 'has correct Sidekiq span' do @@ -249,9 +255,12 @@ def perform; end context 'with an ActiveJob' do subject(:worker) do - stub_const('EmptyJob', Class.new(ActiveJob::Base) do - def perform; end - end) + stub_const( + 'EmptyJob', + Class.new(ActiveJob::Base) do + def perform; end + end + ) end it 'has correct Sidekiq span' do diff --git a/spec/datadog/tracing/contrib/rails/rails_log_auto_injection_spec.rb b/spec/datadog/tracing/contrib/rails/rails_log_auto_injection_spec.rb index 391382b654f..e6923791a87 100644 --- a/spec/datadog/tracing/contrib/rails/rails_log_auto_injection_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rails_log_auto_injection_spec.rb @@ -21,21 +21,27 @@ end let(:tagged_logging_controller) do - stub_const('TaggedLoggingTestController', Class.new(ActionController::Base) do - def index - Rails.logger.info('MINASWAN') - render inline: '
Hello from index
' + stub_const( + 'TaggedLoggingTestController', + Class.new(ActionController::Base) do + def index + Rails.logger.info('MINASWAN') + render inline: '
Hello from index
' + end end - end) + ) end let(:lograge_controller) do - stub_const('LogrageTestController', Class.new(ActionController::Base) do - def index - Rails.logger.info('MINASWAN') - render inline: '
Hello from index
' + stub_const( + 'LogrageTestController', + Class.new(ActionController::Base) do + def index + Rails.logger.info('MINASWAN') + render inline: '
Hello from index
' + end end - end) + ) end before do diff --git a/spec/datadog/tracing/contrib/rails/rails_semantic_logger_auto_injection_spec.rb b/spec/datadog/tracing/contrib/rails/rails_semantic_logger_auto_injection_spec.rb index c87d72bb620..f788de08bfd 100644 --- a/spec/datadog/tracing/contrib/rails/rails_semantic_logger_auto_injection_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rails_semantic_logger_auto_injection_spec.rb @@ -19,12 +19,15 @@ end let(:semantic_logger_controller) do - stub_const('SemanticLoggerTestController', Class.new(ActionController::Base) do - def index - Rails.logger.info('MINASWAN') - render inline: '
Hello from index
' + stub_const( + 'SemanticLoggerTestController', + Class.new(ActionController::Base) do + def index + Rails.logger.info('MINASWAN') + render inline: '
Hello from index
' + end end - end) + ) end before do diff --git a/spec/datadog/tracing/contrib/rails/railtie_spec.rb b/spec/datadog/tracing/contrib/rails/railtie_spec.rb index 20a8bbbe1a3..2fed49f0fee 100644 --- a/spec/datadog/tracing/contrib/rails/railtie_spec.rb +++ b/spec/datadog/tracing/contrib/rails/railtie_spec.rb @@ -15,11 +15,14 @@ let(:controllers) { [controller] } let(:controller) do - stub_const('TestController', Class.new(ActionController::Base) do - def index - head :ok + stub_const( + 'TestController', + Class.new(ActionController::Base) do + def index + head :ok + end end - end) + ) end RSpec::Matchers.define :have_kind_of_middleware do |expected| diff --git a/spec/datadog/tracing/contrib/rails/support/middleware.rb b/spec/datadog/tracing/contrib/rails/support/middleware.rb index 8bf3f75d3ea..4d3b032e022 100644 --- a/spec/datadog/tracing/contrib/rails/support/middleware.rb +++ b/spec/datadog/tracing/contrib/rails/support/middleware.rb @@ -4,18 +4,21 @@ let(:rails_middleware) { [] } let(:debug_middleware) do - stub_const('DebugMiddleware', Class.new do - def initialize(app) - @app = app - end + stub_const( + 'DebugMiddleware', + Class.new do + def initialize(app) + @app = app + end - def call(env) - @app.call(env) - # rubocop:disable Lint/RescueException - rescue Exception => _e - raise - # ruboco:enable Lint/RescueException + def call(env) + @app.call(env) + # rubocop:disable Lint/RescueException + rescue Exception => _e + raise + # ruboco:enable Lint/RescueException + end end - end) + ) end end diff --git a/spec/datadog/tracing/contrib/rails/support/models.rb b/spec/datadog/tracing/contrib/rails/support/models.rb index f9094ce00dc..a4132a643a6 100644 --- a/spec/datadog/tracing/contrib/rails/support/models.rb +++ b/spec/datadog/tracing/contrib/rails/support/models.rb @@ -2,8 +2,11 @@ RSpec.shared_context 'Rails models' do let(:application_record) do - stub_const('ApplicationRecord', Class.new(ActiveRecord::Base) do - self.abstract_class = true - end) + stub_const( + 'ApplicationRecord', + Class.new(ActiveRecord::Base) do + self.abstract_class = true + end + ) end end diff --git a/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb b/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb index 1f949801acc..fd3472c14d7 100644 --- a/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb +++ b/spec/datadog/tracing/contrib/redis/configuration/resolver_spec.rb @@ -32,10 +32,12 @@ let(:matcher) { 'redis://127.0.0.1:6379/0' } it do - expect(parsed_key).to eq(host: '127.0.0.1', + expect(parsed_key).to eq( + host: '127.0.0.1', port: 6379, db: 0, - scheme: 'redis') + scheme: 'redis' + ) end end @@ -43,10 +45,12 @@ let(:matcher) { { url: 'redis://127.0.0.1:6379/0' } } it do - expect(parsed_key).to eq(host: '127.0.0.1', + expect(parsed_key).to eq( + host: '127.0.0.1', port: 6379, db: 0, - scheme: 'redis') + scheme: 'redis' + ) end end end @@ -62,10 +66,12 @@ end it do - expect(parsed_key).to eq(host: '127.0.0.1', + expect(parsed_key).to eq( + host: '127.0.0.1', port: 6379, db: 0, - scheme: 'redis') + scheme: 'redis' + ) end end @@ -79,10 +85,12 @@ end it do - expect(parsed_key).to eq(host: '127.0.0.1', + expect(parsed_key).to eq( + host: '127.0.0.1', port: 6379, db: 0, - scheme: 'redis') + scheme: 'redis' + ) end end @@ -95,10 +103,12 @@ end it do - expect(parsed_key).to eq(host: '127.0.0.1', + expect(parsed_key).to eq( + host: '127.0.0.1', port: 6379, db: 0, - scheme: 'redis') + scheme: 'redis' + ) end end end diff --git a/spec/datadog/tracing/contrib/shoryuken/tracer_spec.rb b/spec/datadog/tracing/contrib/shoryuken/tracer_spec.rb index 2f6250e09ba..d06cc039eb3 100644 --- a/spec/datadog/tracing/contrib/shoryuken/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/shoryuken/tracer_spec.rb @@ -28,11 +28,14 @@ shared_context 'Shoryuken::Worker' do let(:worker_class) do qn = queue_name - stub_const('TestWorker', Class.new do - include Shoryuken::Worker - shoryuken_options queue: qn - def perform(sqs_msg, body); end - end) + stub_const( + 'TestWorker', + Class.new do + include Shoryuken::Worker + shoryuken_options queue: qn + def perform(sqs_msg, body); end + end + ) end let(:worker) { worker_class.new } let(:queue_name) { 'default' } diff --git a/spec/datadog/tracing/contrib/sidekiq/client_tracer_spec.rb b/spec/datadog/tracing/contrib/sidekiq/client_tracer_spec.rb index 68d7b9498ad..65d95e1519c 100644 --- a/spec/datadog/tracing/contrib/sidekiq/client_tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/client_tracer_spec.rb @@ -66,9 +66,12 @@ pending 'Broken in Ruby 3.1.0-preview1, see https://github.com/mperham/sidekiq/issues/5064' end - stub_const('DelayableClass', Class.new do - def self.do_work; end - end) + stub_const( + 'DelayableClass', + Class.new do + def self.do_work; end + end + ) end it 'traces with correct resource' do diff --git a/spec/datadog/tracing/contrib/sidekiq/server_tracer_spec.rb b/spec/datadog/tracing/contrib/sidekiq/server_tracer_spec.rb index 5cb519464ca..8c0ffefc0e0 100644 --- a/spec/datadog/tracing/contrib/sidekiq/server_tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/server_tracer_spec.rb @@ -42,13 +42,16 @@ let(:job_class) { ErrorWorker } before do - stub_const('ErrorWorker', Class.new do - include Sidekiq::Worker - - def perform - raise ZeroDivisionError, 'job error' + stub_const( + 'ErrorWorker', + Class.new do + include Sidekiq::Worker + + def perform + raise ZeroDivisionError, 'job error' + end end - end) + ) end it 'traces async job run' do @@ -73,11 +76,14 @@ def perform before do allow(Datadog.configuration.tracing).to receive(:[]).with(:sidekiq).and_return(sidekiq_options) - stub_const('CustomWorker', Class.new do - include Sidekiq::Worker + stub_const( + 'CustomWorker', + Class.new do + include Sidekiq::Worker - def perform(id) end - end) + def perform(id) end + end + ) end it 'traces async job run' do @@ -172,11 +178,14 @@ def perform(id) end pending 'Broken in Ruby 3.1.0-preview1, see https://github.com/mperham/sidekiq/issues/5064' end - stub_const('DelayableClass', Class.new do - def self.do_work - puts 'a' + stub_const( + 'DelayableClass', + Class.new do + def self.do_work + puts 'a' + end end - end) + ) end it 'traces with correct resource' do diff --git a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb index 8dc9c3768ac..8a1f1e7c729 100644 --- a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb +++ b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb @@ -12,10 +12,13 @@ before { configure_sidekiq } let!(:empty_worker) do - stub_const('EmptyWorker', Class.new do - include Sidekiq::Worker - def perform; end - end) + stub_const( + 'EmptyWorker', + Class.new do + include Sidekiq::Worker + def perform; end + end + ) end end diff --git a/spec/datadog/tracing/contrib/sidekiq/tracer_configure_spec.rb b/spec/datadog/tracing/contrib/sidekiq/tracer_configure_spec.rb index bad86236203..ed0eea08d0a 100644 --- a/spec/datadog/tracing/contrib/sidekiq/tracer_configure_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/tracer_configure_spec.rb @@ -36,13 +36,16 @@ let(:error_handler) { proc { @error_handler_called = true } } before do - stub_const('ErrorWorker', Class.new do - include Sidekiq::Worker - - def perform - raise ZeroDivisionError, 'job error' + stub_const( + 'ErrorWorker', + Class.new do + include Sidekiq::Worker + + def perform + raise ZeroDivisionError, 'job error' + end end - end) + ) end it 'uses custom error handler' do diff --git a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb index ac19e357090..6efe346568a 100644 --- a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb @@ -524,22 +524,28 @@ context 'with modular app' do let(:sinatra_app) do mount_nested_app = self.mount_nested_app - stub_const('NestedApp', Class.new(Sinatra::Base) do - register Datadog::Tracing::Contrib::Sinatra::Tracer - - get '/nested' do - headers['X-Request-ID'] = 'test id' - 'nested ok' + stub_const( + 'NestedApp', + Class.new(Sinatra::Base) do + register Datadog::Tracing::Contrib::Sinatra::Tracer + + get '/nested' do + headers['X-Request-ID'] = 'test id' + 'nested ok' + end end - end) + ) sinatra_routes = self.sinatra_routes - stub_const('App', Class.new(Sinatra::Base) do - register Datadog::Tracing::Contrib::Sinatra::Tracer - use NestedApp if mount_nested_app + stub_const( + 'App', + Class.new(Sinatra::Base) do + register Datadog::Tracing::Contrib::Sinatra::Tracer + use NestedApp if mount_nested_app - instance_exec(&sinatra_routes) - end) + instance_exec(&sinatra_routes) + end + ) end let(:app_name) { top_app_name } @@ -630,9 +636,12 @@ let(:sinatra_app) do sinatra_routes = self.sinatra_routes - stub_const('App', Class.new(Sinatra::Base) do - instance_exec(&sinatra_routes) - end) + stub_const( + 'App', + Class.new(Sinatra::Base) do + instance_exec(&sinatra_routes) + end + ) end subject(:response) { get url } diff --git a/spec/datadog/tracing/distributed/headers/b3_spec.rb b/spec/datadog/tracing/distributed/headers/b3_spec.rb index 8ca0ba296df..edd75807d9b 100644 --- a/spec/datadog/tracing/distributed/headers/b3_spec.rb +++ b/spec/datadog/tracing/distributed/headers/b3_spec.rb @@ -30,8 +30,10 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16) + ) end [ @@ -50,9 +52,11 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s + ) end end end @@ -67,8 +71,10 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16) + ) end end end diff --git a/spec/datadog/tracing/distributed/headers/datadog_spec.rb b/spec/datadog/tracing/distributed/headers/datadog_spec.rb index ae1f24a053d..649bcb537c0 100644 --- a/spec/datadog/tracing/distributed/headers/datadog_spec.rb +++ b/spec/datadog/tracing/distributed/headers/datadog_spec.rb @@ -30,8 +30,10 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '10000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '20000') + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '20000' + ) end context 'with sampling priority' do @@ -44,9 +46,11 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '50000', + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '50000', Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '60000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1' + ) end context 'with origin' do @@ -60,10 +64,12 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '70000', + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '70000', Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '80000', Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY => '1', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics' + ) end end end @@ -78,9 +84,11 @@ def env_header(name) end it do - expect(env).to eq(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '90000', + expect(env).to eq( + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID => '90000', Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_PARENT_ID => '100000', - Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN => 'synthetics' + ) end end end diff --git a/spec/datadog/tracing/distributed/metadata/b3_spec.rb b/spec/datadog/tracing/distributed/metadata/b3_spec.rb index 50dc7416ed6..aac22b66154 100644 --- a/spec/datadog/tracing/distributed/metadata/b3_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/b3_spec.rb @@ -25,8 +25,10 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16)) + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 10000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 20000.to_s(16) + ) end [ @@ -45,9 +47,11 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 50000.to_s(16), Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 60000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s) + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SAMPLED => expected.to_s + ) end end end @@ -62,8 +66,10 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), - Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16)) + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_TRACE_ID => 90000.to_s(16), + Datadog::Tracing::Distributed::Headers::Ext::B3_HEADER_SPAN_ID => 100000.to_s(16) + ) end end end diff --git a/spec/datadog/tracing/distributed/metadata/datadog_spec.rb b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb index 5ba43d535fd..6921ee66404 100644 --- a/spec/datadog/tracing/distributed/metadata/datadog_spec.rb +++ b/spec/datadog/tracing/distributed/metadata/datadog_spec.rb @@ -25,8 +25,10 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000') + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '10000', + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '20000' + ) end context 'with sampling priority' do @@ -39,9 +41,11 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '50000', + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '50000', Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '60000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1' + ) end context 'with origin' do @@ -55,10 +59,12 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '70000', + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '70000', Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '80000', Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_SAMPLING_PRIORITY => '1', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' + ) end end end @@ -73,9 +79,11 @@ end it do - expect(metadata).to eq(Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '90000', + expect(metadata).to eq( + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_TRACE_ID => '90000', Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_PARENT_ID => '100000', - Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics') + Datadog::Tracing::Distributed::Headers::Ext::GRPC_METADATA_ORIGIN => 'synthetics' + ) end end end diff --git a/spec/datadog/tracing/propagation/http_spec.rb b/spec/datadog/tracing/propagation/http_spec.rb index b432f56d086..c3c44fe5a8f 100644 --- a/spec/datadog/tracing/propagation/http_spec.rb +++ b/spec/datadog/tracing/propagation/http_spec.rb @@ -20,9 +20,11 @@ context 'without any explicit sampling priority or origin' do it do inject! - expect(env).to eq('something' => 'alien', + expect(env).to eq( + 'something' => 'alien', 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-parent-id' => '2000' + ) end end @@ -33,10 +35,12 @@ let(:trace_attrs) { { trace_id: 1000, span_id: 2000, trace_sampling_priority: 0 } } it do - expect(env).to eq('something' => 'alien', + expect(env).to eq( + 'something' => 'alien', 'x-datadog-sampling-priority' => '0', 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-parent-id' => '2000' + ) end end @@ -44,9 +48,11 @@ let(:trace_attrs) { { trace_id: 1000, span_id: 2000, trace_sampling_priority: nil } } it do - expect(env).to eq('something' => 'alien', + expect(env).to eq( + 'something' => 'alien', 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-parent-id' => '2000' + ) end end end @@ -58,10 +64,12 @@ let(:trace_attrs) { { trace_id: 1000, span_id: 2000, trace_origin: 'synthetics' } } it do - expect(env).to eq('something' => 'alien', + expect(env).to eq( + 'something' => 'alien', 'x-datadog-origin' => 'synthetics', 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-parent-id' => '2000' + ) end end @@ -69,9 +77,11 @@ let(:trace_attrs) { { trace_id: 1000, span_id: 2000, trace_origin: nil } } it do - expect(env).to eq('something' => 'alien', + expect(env).to eq( + 'something' => 'alien', 'x-datadog-trace-id' => '1000', - 'x-datadog-parent-id' => '2000') + 'x-datadog-parent-id' => '2000' + ) end end end diff --git a/spec/datadog/tracing/sampling/rule_sampler_spec.rb b/spec/datadog/tracing/sampling/rule_sampler_spec.rb index 385672588a0..d56c53bb6f1 100644 --- a/spec/datadog/tracing/sampling/rule_sampler_spec.rb +++ b/spec/datadog/tracing/sampling/rule_sampler_spec.rb @@ -202,11 +202,14 @@ context 'that responds to #update' do let(:default_sampler) { sampler_class.new } let(:sampler_class) do - stub_const('TestSampler', Class.new(Datadog::Tracing::Sampling::Sampler) do - def update(rates) - rates + stub_const( + 'TestSampler', + Class.new(Datadog::Tracing::Sampling::Sampler) do + def update(rates) + rates + end end - end) + ) end before do diff --git a/spec/datadog/tracing/writer_spec.rb b/spec/datadog/tracing/writer_spec.rb index 691a77d1544..9258a79acc3 100644 --- a/spec/datadog/tracing/writer_spec.rb +++ b/spec/datadog/tracing/writer_spec.rb @@ -126,28 +126,34 @@ context 'with multiple responses' do let(:response1) do - instance_double(Datadog::Transport::HTTP::Traces::Response, + instance_double( + Datadog::Transport::HTTP::Traces::Response, internal_error?: false, server_error?: false, ok?: true, - trace_count: 10) + trace_count: 10 + ) end let(:response2) do - instance_double(Datadog::Transport::HTTP::Traces::Response, + instance_double( + Datadog::Transport::HTTP::Traces::Response, internal_error?: false, server_error?: false, ok?: true, - trace_count: 20) + trace_count: 20 + ) end let(:responses) { [response1, response2] } context 'and at least one being server error' do let(:response2) do - instance_double(Datadog::Transport::HTTP::Traces::Response, + instance_double( + Datadog::Transport::HTTP::Traces::Response, internal_error?: false, server_error?: true, - ok?: false) + ok?: false + ) end it do diff --git a/spec/ddtrace/transport/io/traces_spec.rb b/spec/ddtrace/transport/io/traces_spec.rb index 740ebd5ba84..d8000106604 100644 --- a/spec/ddtrace/transport/io/traces_spec.rb +++ b/spec/ddtrace/transport/io/traces_spec.rb @@ -150,8 +150,8 @@ def compare_arrays(left = [], right = []) trace.spans.each do |span| allow(span).to receive(:to_hash) .and_wrap_original do |m, *_args| - m.call.tap { |h| h.delete(missing_id) } - end + m.call.tap { |h| h.delete(missing_id) } + end end end end diff --git a/spec/support/spy_transport.rb b/spec/support/spy_transport.rb index 92ce3b16a7b..1caa4a641cd 100644 --- a/spec/support/spy_transport.rb +++ b/spec/support/spy_transport.rb @@ -66,7 +66,8 @@ def build_trace_response(code) Datadog::Transport::HTTP::Traces::Response.new( Datadog::Transport::HTTP::Adapters::Net::Response.new( Net::HTTPResponse.new(1.0, code, code.to_s) - ), trace_count: 1 + ), + trace_count: 1 ) end end From b18e0ab2b204b8d185b70ce1ad0102f299dfdb5b Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 19 Jul 2022 17:28:11 -0700 Subject: [PATCH 0254/2133] Add Ruby 2.1 msgpack restriction --- ddtrace.gemspec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index a3de7296b8b..bed1fcf7517 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -44,6 +44,12 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] # Used to serialize traces to send them to the Datadog Agent. + # + # msgpack 1.4 fails for Ruby 2.1 (see https://github.com/msgpack/msgpack-ruby/issues/205) + # so a restriction needs to be manually added for the `Gemfile`. + # + # We can't add a restriction here, since there's no way to add it only for older + # rubies, see #1739 and #1336 for an extended discussion about this spec.add_dependency 'msgpack' # Used by the profiler native extension to support older Rubies (see NativeExtensionDesign.md for notes) From 7254109c962bffb87045066d1fad26c14ecfdd58 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 15 Jul 2022 17:44:12 -0700 Subject: [PATCH 0255/2133] Lint:Add Rubocop Packaging extension --- .rubocop.yml | 1 + Gemfile | 1 + ddtrace.gemspec | 23 +++++++++++++---------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e5a59a09f8e..9a25233be23 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,7 @@ inherit_from: .rubocop_todo.yml require: + - rubocop-packaging - rubocop-performance - rubocop-rspec diff --git a/Gemfile b/Gemfile index 9b254df9cd6..07e5d7e7a65 100644 --- a/Gemfile +++ b/Gemfile @@ -58,6 +58,7 @@ gem 'yard', '~> 0.9' if RUBY_VERSION >= '2.4.0' gem 'rubocop', '~> 1.10', require: false + gem 'rubocop-packaging', '~> 0.5', require: false gem 'rubocop-performance', '~> 1.9', require: false gem 'rubocop-rspec', '~> 2.2', require: false end diff --git a/ddtrace.gemspec b/ddtrace.gemspec index bed1fcf7517..ae2f4bb55fc 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -29,17 +29,20 @@ Gem::Specification.new do |spec| raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' end - # rubocop:disable all - # DEV: `spec.files` is more problematic than a simple Rubocop pass. spec.files = - `git ls-files -z` - .split("\x0") - .reject { |f| f.match(%r{^(test|spec|features|[.]circleci|[.]github|[.]dd-ci|benchmarks|gemfiles|integration|tasks|sorbet|yard)/}) } - .reject do |f| - ['.dockerignore', '.env', '.gitattributes', '.gitlab-ci.yml', '.rspec', '.rubocop.yml', - '.rubocop_todo.yml', '.simplecov', 'Appraisals', 'Gemfile', 'Rakefile', 'docker-compose.yml', '.pryrc', '.yardopts'].include?(f) - end - # rubocop:enable all + Dir[*%w[ + CHANGELOG.md + LICENSE* + NOTICE + README.md + bin/**/* + docs/**/*.md + ext/**/* + lib/**/* + ]] + .select { |fn| File.file?(fn) } # We don't want directories, only files + .reject { |fn| fn.end_with?('.so', '.bundle') } # Exclude local profiler binary artifacts + spec.executables = ['ddtracerb'] spec.require_paths = ['lib'] From 963ba0dd203b6d3fd8bc092e0315e4633fb03d8b Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 19 Jul 2022 18:05:32 -0700 Subject: [PATCH 0256/2133] Add test for gemspec.files --- spec/ddtrace/release_gem_spec.rb | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 spec/ddtrace/release_gem_spec.rb diff --git a/spec/ddtrace/release_gem_spec.rb b/spec/ddtrace/release_gem_spec.rb new file mode 100644 index 00000000000..4d76d5849c8 --- /dev/null +++ b/spec/ddtrace/release_gem_spec.rb @@ -0,0 +1,41 @@ +RSpec.describe 'gem release process' do + context 'ddtrace.gemspec' do + context 'files' do + subject(:files) { Gem::Specification.load('ddtrace.gemspec').files } + + # It's easy to forget to ship new files, especially when a new paradigm is + # introduced (e.g. introducing native files requires the inclusion `ext/`) + it 'includes all important files' do + single_files_excluded = %w[ + .dockerignore + .editorconfig + .env + .gitattributes + .gitignore + .gitlab-ci.yml + .pryrc + .rspec + .rubocop.yml + .rubocop_todo.yml + .simplecov + .yardopts + Appraisals + CONTRIBUTING.md + Gemfile + Rakefile + ddtrace.gemspec + docker-compose.yml + ] + + expect(files) + .to match_array( + `git ls-files -z` + .split("\x0") + .reject { |f| f.match(%r{^(spec|\.circleci|\.github|benchmarks|gemfiles|integration|tasks|sorbet|yard)/}) } + .reject { |f| f.match(%r{^docs/.*\.png}) } + .reject { |f| single_files_excluded.include?(f) } + ) + end + end + end +end From b2ea9e4ef02b63aeac8665991e5afb1566a2b0c0 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 20 Jul 2022 09:49:56 +0200 Subject: [PATCH 0257/2133] Remove non-utf8 character --- ddtrace.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index bed1fcf7517..64d62ffd4b4 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.summary = 'Datadog tracing code for your Ruby applications' spec.description = <<-DESC.gsub(/^\s+/, '') - ddtrace is Datadog’s tracing client for Ruby. It is used to trace requests + ddtrace is Datadog's tracing client for Ruby. It is used to trace requests as they flow across web servers, databases and microservices so that developers have great visiblity into bottlenecks and troublesome requests. DESC From db132eed147a025b9776ad632724cfd98a25d615 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 20 Jul 2022 10:58:20 +0200 Subject: [PATCH 0258/2133] Add nginx to rails-seven --- integration/apps/rails-seven/bin/setup | 3 +-- .../rails-seven/config/initializers/datadog.rb | 10 ++++------ integration/apps/rails-seven/docker-compose.yml | 16 +++++++++++++--- integration/apps/rails-seven/nginx.conf | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 integration/apps/rails-seven/nginx.conf diff --git a/integration/apps/rails-seven/bin/setup b/integration/apps/rails-seven/bin/setup index 3700b052a25..b63d2208651 100755 --- a/integration/apps/rails-seven/bin/setup +++ b/integration/apps/rails-seven/bin/setup @@ -19,8 +19,7 @@ chdir APP_ROOT do puts "\n== Preparing database ==" database_uri = URI(ENV['DATABASE_URL']) system! 'until wget mysql:3306 > /dev/null 2>&1; do : sleep 1; done' - system! 'bin/rails db:create' - system! 'bin/rails db:migrate' + system! 'bin/rails db:prepare' puts "\n== Removing old logs and tempfiles ==" system! 'bin/rails log:clear tmp:clear' diff --git a/integration/apps/rails-seven/config/initializers/datadog.rb b/integration/apps/rails-seven/config/initializers/datadog.rb index 6613b5de114..6ae2019eb52 100644 --- a/integration/apps/rails-seven/config/initializers/datadog.rb +++ b/integration/apps/rails-seven/config/initializers/datadog.rb @@ -11,7 +11,7 @@ if Datadog::DemoEnv.feature?('tracing') c.tracing.analytics.enabled = true if Datadog::DemoEnv.feature?('analytics') - c.tracing.instrument :rails + c.tracing.instrument :rails, request_queuing: true c.tracing.instrument :redis, service_name: 'acme-redis' c.tracing.instrument :resque end @@ -22,10 +22,8 @@ c.appsec.instrument :rails end - if Datadog::DemoEnv.feature?('profiling') - if Datadog::DemoEnv.feature?('pprof_to_file') - # Reconfigure transport to write pprof to file - c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport - end + if Datadog::DemoEnv.feature?('profiling') && Datadog::DemoEnv.feature?('pprof_to_file') + # Reconfigure transport to write pprof to file + c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport end end diff --git a/integration/apps/rails-seven/docker-compose.yml b/integration/apps/rails-seven/docker-compose.yml index f9a27dd453d..ffb0e34adca 100644 --- a/integration/apps/rails-seven/docker-compose.yml +++ b/integration/apps/rails-seven/docker-compose.yml @@ -1,5 +1,15 @@ version: '3.4' services: + nginx: + image: nginx:stable + depends_on: + - app + expose: + - "80" + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf app: build: context: . @@ -94,13 +104,13 @@ services: build: context: ../../images dockerfile: wrk/Dockerfile - command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default + command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://nginx/basic/default depends_on: - app environment: - - HEALTH_CHECK_URL=http://app/health + - HEALTH_CHECK_URL=http://nginx/health - HEALTH_CHECK_INTERVAL=1 - - HEALTH_CHECK_MAX_ATTEMPTS=60 + - HEALTH_CHECK_MAX_ATTEMPTS=120 volumes: - ./data/wrk:/data - ../../images/wrk/scripts:/scripts diff --git a/integration/apps/rails-seven/nginx.conf b/integration/apps/rails-seven/nginx.conf new file mode 100644 index 00000000000..671d30b96ad --- /dev/null +++ b/integration/apps/rails-seven/nginx.conf @@ -0,0 +1,15 @@ +events { + +} + +http { + server { + listen *:80; + server_name localhost; + + location / { + proxy_set_header X-Request-Start "t=${msec}"; + proxy_pass http://app; + } + } +} From 3ea79129b9f2ada84ccc42bc05a8667afa3ff41e Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 11:22:28 +0100 Subject: [PATCH 0259/2133] Move `DDTRACE_EXPORT` to new `helpers.h` file --- ext/ddtrace_profiling_native_extension/helpers.h | 5 +++++ ext/ddtrace_profiling_native_extension/profiling.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/helpers.h diff --git a/ext/ddtrace_profiling_native_extension/helpers.h b/ext/ddtrace_profiling_native_extension/helpers.h new file mode 100644 index 00000000000..372f98be997 --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/helpers.h @@ -0,0 +1,5 @@ +#pragma once + +// Used to mark symbols to be exported to the outside of the extension. +// Consider very carefully before tagging a function with this. +#define DDTRACE_EXPORT __attribute__ ((visibility ("default"))) diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index 45bfdcfdc66..3de72e6e327 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -1,6 +1,7 @@ #include #include "clock_id.h" +#include "helpers.h" // Each class/module here is implemented in their separate file void collectors_cpu_and_wall_time_init(VALUE profiling_module); @@ -10,8 +11,6 @@ void stack_recorder_init(VALUE profiling_module); static VALUE native_working_p(VALUE self); -#define DDTRACE_EXPORT __attribute__ ((visibility ("default"))) - void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { VALUE datadog_module = rb_define_module("Datadog"); VALUE profiling_module = rb_define_module_under(datadog_module, "Profiling"); From f6f3c6aeb1d6217d7f1c9ecdde2435e7716da023 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 11:44:29 +0100 Subject: [PATCH 0260/2133] Enable warnings for unused arguments + mark ones deliberately left unused --- .../clock_id_from_pthread.c | 3 ++- .../clock_id_noop.c | 3 ++- .../collectors_cpu_and_wall_time.c | 17 +++++++++-------- .../collectors_stack.c | 3 ++- .../extconf.rb | 3 +++ .../helpers.h | 7 +++++++ .../http_transport.c | 5 +++-- .../profiling.c | 2 +- .../ruby_helpers.h | 4 +++- .../stack_recorder.c | 3 ++- 10 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c index 40839c1b571..8a721481165 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c @@ -9,6 +9,7 @@ #include #include +#include "helpers.h" #include "private_vm_api_access.h" #include "clock_id.h" @@ -20,7 +21,7 @@ void self_test_clock_id(void) { if (expected_pthread_id != actual_pthread_id) rb_raise(rb_eRuntimeError, "pthread_id_for() self-test failed"); } -VALUE clock_id_for(VALUE self, VALUE thread) { +VALUE clock_id_for(DDTRACE_UNUSED VALUE _self, VALUE thread) { rb_nativethread_id_t thread_id = pthread_id_for(thread); clockid_t clock_id; diff --git a/ext/ddtrace_profiling_native_extension/clock_id_noop.c b/ext/ddtrace_profiling_native_extension/clock_id_noop.c index 043677ed054..509edf6a6a5 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_noop.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_noop.c @@ -7,8 +7,9 @@ #include #include "clock_id.h" +#include "helpers.h" void self_test_clock_id(void) { } // Nothing to check -VALUE clock_id_for(VALUE self, VALUE thread) { return Qnil; } // Nothing to return +VALUE clock_id_for(DDTRACE_UNUSED VALUE _self, DDTRACE_UNUSED VALUE _thread) { return Qnil; } // Nothing to return #endif diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 1451b97a141..42abc74967e 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,4 +1,5 @@ #include +#include "helpers.h" #include "collectors_stack.h" #include "libddprof_helpers.h" #include "private_vm_api_access.h" @@ -114,14 +115,14 @@ static void cpu_and_wall_time_collector_typed_data_free(void *state_ptr) { } // Mark Ruby thread references we keep as keys in hash_map_per_thread_context -static int hash_map_per_thread_context_mark(st_data_t key_thread, st_data_t _value, st_data_t _argument) { +static int hash_map_per_thread_context_mark(st_data_t key_thread, DDTRACE_UNUSED st_data_t _value, DDTRACE_UNUSED st_data_t _argument) { VALUE thread = (VALUE) key_thread; rb_gc_mark(thread); return ST_CONTINUE; } // Used to clear each of the per_thread_contexts inside the hash_map_per_thread_context -static int hash_map_per_thread_context_free_values(st_data_t _thread, st_data_t value_per_thread_context, st_data_t _argument) { +static int hash_map_per_thread_context_free_values(DDTRACE_UNUSED st_data_t _thread, st_data_t value_per_thread_context, DDTRACE_UNUSED st_data_t _argument) { struct per_thread_context *per_thread_context = (struct per_thread_context*) value_per_thread_context; ruby_xfree(per_thread_context); return ST_CONTINUE; @@ -141,7 +142,7 @@ static VALUE _native_new(VALUE klass) { return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); } -static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames) { +static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames) { enforce_recorder_instance(recorder_instance); struct cpu_and_wall_time_collector_state *state; @@ -160,7 +161,7 @@ static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE reco // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. // It SHOULD NOT be used for other purposes. -static VALUE _native_sample(VALUE self, VALUE collector_instance) { +static VALUE _native_sample(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) { sample(collector_instance); return Qtrue; } @@ -220,7 +221,7 @@ static void sample(VALUE collector_instance) { // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. // It SHOULD NOT be used for other purposes. -static VALUE _native_thread_list(VALUE self) { +static VALUE _native_thread_list(DDTRACE_UNUSED VALUE _self) { return ddtrace_thread_list(); } @@ -246,7 +247,7 @@ static void initialize_context(VALUE thread, struct per_thread_context *thread_c thread_context->wall_time_at_previous_sample_ns = INVALID_TIME; } -static VALUE _native_inspect(VALUE self, VALUE collector_instance) { +static VALUE _native_inspect(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); @@ -288,7 +289,7 @@ static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_s st_foreach(state->hash_map_per_thread_context, remove_if_dead_thread, 0 /* unused */); } -static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument) { +static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, DDTRACE_UNUSED st_data_t _argument) { VALUE thread = (VALUE) key_thread; struct per_thread_context* thread_context = (struct per_thread_context*) value_context; @@ -299,7 +300,7 @@ static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, } // Returns the whole contents of the per_thread_context structs being tracked, for debugging/testing -static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance) { +static VALUE _native_per_thread_context(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 86433a55f8b..0f0b13252bd 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -1,6 +1,7 @@ #include #include #include "extconf.h" +#include "helpers.h" #include "libddprof_helpers.h" #include "ruby_helpers.h" #include "private_vm_api_access.h" @@ -41,7 +42,7 @@ void collectors_stack_init(VALUE profiling_module) { // This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. // It SHOULD NOT be used for other purposes. -static VALUE _native_sample(VALUE self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames) { +static VALUE _native_sample(DDTRACE_UNUSED VALUE _self, VALUE thread, VALUE recorder_instance, VALUE metric_values_hash, VALUE labels_array, VALUE max_frames) { ENFORCE_TYPE(metric_values_hash, T_HASH); ENFORCE_TYPE(labels_array, T_ARRAY); diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index fd7396e7a74..f01f32cbb85 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -91,6 +91,9 @@ def add_compiler_flag(flag) # cause a segfault later. Let's ensure that never happens. add_compiler_flag '-Werror-implicit-function-declaration' +# Warn on unused parameters to functions. Use `DDTRACE_UNUSED` to mark things as known-to-not-be-used. +add_compiler_flag '-Wunused-parameter' + # The native extension is not intended to expose any symbols/functions for other native libraries to use; # the sole exception being `Init_ddtrace_profiling_native_extension` which needs to be visible for Ruby to call it when # it `dlopen`s the library. diff --git a/ext/ddtrace_profiling_native_extension/helpers.h b/ext/ddtrace_profiling_native_extension/helpers.h index 372f98be997..2d117669b31 100644 --- a/ext/ddtrace_profiling_native_extension/helpers.h +++ b/ext/ddtrace_profiling_native_extension/helpers.h @@ -3,3 +3,10 @@ // Used to mark symbols to be exported to the outside of the extension. // Consider very carefully before tagging a function with this. #define DDTRACE_EXPORT __attribute__ ((visibility ("default"))) + +// Used to mark function arguments that are deliberately left unused +#ifdef __GNUC__ + #define DDTRACE_UNUSED __attribute__((unused)) +#else + #define DDTRACE_UNUSED +#endif diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 10028842191..1a3333ee7b1 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -1,6 +1,7 @@ #include #include #include +#include "helpers.h" #include "libddprof_helpers.h" #include "ruby_helpers.h" @@ -68,7 +69,7 @@ inline static ddprof_ffi_ByteSlice byte_slice_from_ruby_string(VALUE string) { return byte_slice; } -static VALUE _native_validate_exporter(VALUE self, VALUE exporter_configuration) { +static VALUE _native_validate_exporter(DDTRACE_UNUSED VALUE _self, VALUE exporter_configuration) { ENFORCE_TYPE(exporter_configuration, T_ARRAY); ddprof_ffi_NewProfileExporterV3Result exporter_result = create_exporter(exporter_configuration, rb_ary_new()); @@ -259,7 +260,7 @@ static VALUE perform_export( } static VALUE _native_do_export( - VALUE self, + DDTRACE_UNUSED VALUE _self, VALUE exporter_configuration, VALUE upload_timeout_milliseconds, VALUE start_timespec_seconds, diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index 3de72e6e327..36549f6ed57 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -27,7 +27,7 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { stack_recorder_init(profiling_module); } -static VALUE native_working_p(VALUE self) { +static VALUE native_working_p(DDTRACE_UNUSED VALUE _self) { self_test_clock_id(); return Qtrue; diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index 214adaf24c8..b83eda96bd7 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -2,9 +2,11 @@ #include +#include "helpers.h" + // Processes any pending interruptions, including exceptions to be raised. // If there's an exception to be raised, it raises it. In that case, this function does not return. -static inline VALUE process_pending_interruptions(VALUE _unused) { +static inline VALUE process_pending_interruptions(DDTRACE_UNUSED VALUE _) { rb_thread_check_ints(); return Qnil; } diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index be214f20be5..88ac677b6fc 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -1,5 +1,6 @@ #include #include +#include "helpers.h" #include "stack_recorder.h" #include "libddprof_helpers.h" #include "ruby_helpers.h" @@ -70,7 +71,7 @@ static void stack_recorder_typed_data_free(void *data) { ddprof_ffi_Profile_free((ddprof_ffi_Profile *) data); } -static VALUE _native_serialize(VALUE self, VALUE recorder_instance) { +static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance) { ddprof_ffi_Profile *profile; TypedData_Get_Struct(recorder_instance, ddprof_ffi_Profile, &stack_recorder_typed_data, profile); From d7f9291e0c2d63c777108c812d74d16fe1feb5a9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 11:49:27 +0100 Subject: [PATCH 0261/2133] Silence false-positive warning for unused variable --- .../private_vm_api_access.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 07541f18581..32bffc8056a 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -157,7 +157,14 @@ VALUE thread_name_for(VALUE thread) { // to support our custom rb_profile_frames (see below) // Modifications: None inline static int -calc_pos(const rb_iseq_t *iseq, const VALUE *pc, int *lineno, int *node_id) +calc_pos(const rb_iseq_t *iseq, const VALUE *pc, int *lineno, +// `node_id` gets used depending on Ruby VM compilation settings (USE_ISEQ_NODE_ID being defined). +// To avoid getting false "unused argument" warnings in setups where it's not used, we need to do this weird dance +// with diagnostic stuff. See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + int *node_id) +#pragma GCC diagnostic pop { VM_ASSERT(iseq); VM_ASSERT(ISEQ_BODY(iseq)); From 8970ac8595577a9b00a6dec3edf9945ddbc81633 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 11:54:00 +0100 Subject: [PATCH 0262/2133] Fix wrong class used when calling TypedData_Wrap_Struct The reason we receive `klass` as an argument to the function registed with `rb_define_alloc_func` is so that the correct class can get created, even when someone subclasses us. Because we were ignoring that argument and always using `collectors_cpu_and_wall_time_class`, we broke any attempts to subclass our class. Interestingly, Ruby actually detected and complained about this: ```ruby [4] pry(main)> class Foo < Datadog::Profiling::Collectors::CpuAndWallTime; end => nil [5] pry(main)> Foo.new TypeError: wrong instance allocation ``` NOT that we ever expect `CpuAndWallTime` to be subclassed, but it may come handy for some future experiementation or specs AND it's helpful to have this correct because in the future we may copy-paste it as an example of using `TypeddData_Wrap_Struct`, and I don't like leaving a wrong example in. (Curiously enough, this is the second time I make this mistake; the first time being 4ab6bef88d for the `StackRecorder` class) --- .../collectors_cpu_and_wall_time.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 42abc74967e..043329cc810 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -8,7 +8,6 @@ // Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class -static VALUE collectors_cpu_and_wall_time_class = Qnil; #define INVALID_TIME -1 // Contains state for a single CpuAndWallTime instance @@ -55,7 +54,7 @@ static long thread_id_for(VALUE thread); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); - collectors_cpu_and_wall_time_class = rb_define_class_under(collectors_module, "CpuAndWallTime", rb_cObject); + VALUE collectors_cpu_and_wall_time_class = rb_define_class_under(collectors_module, "CpuAndWallTime", rb_cObject); // Instances of the CpuAndWallTime class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. @@ -139,7 +138,7 @@ static VALUE _native_new(VALUE klass) { state->recorder_instance = Qnil; state->sample_count = 0; - return TypedData_Wrap_Struct(collectors_cpu_and_wall_time_class, &cpu_and_wall_time_collector_typed_data, state); + return TypedData_Wrap_Struct(klass, &cpu_and_wall_time_collector_typed_data, state); } static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames) { From e9ee31e50f71e570f70de47262a41e92b65868bb Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 12:10:22 +0100 Subject: [PATCH 0263/2133] Remove unused argument from `wall_time_now_ns` At some point I was thinking of having something inside `state` that flagged that something had gone wrong (for instance with `clock_gettime`), but then I decided against it and forgot to remove the unused argument. --- .../collectors_cpu_and_wall_time.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 043329cc810..b48cfaa1d0d 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -49,7 +49,7 @@ static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_s static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument); static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance); static long update_time_since_previous_sample(long *time_at_previous_sample_ns, long current_time_ns); -static long wall_time_now_ns(struct cpu_and_wall_time_collector_state *state); +static long wall_time_now_ns(); static long thread_id_for(VALUE thread); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { @@ -170,7 +170,7 @@ static void sample(VALUE collector_instance) { TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); VALUE threads = ddtrace_thread_list(); - long current_wall_time_ns = wall_time_now_ns(state); + long current_wall_time_ns = wall_time_now_ns(); const long thread_count = RARRAY_LEN(threads); for (long i = 0; i < thread_count; i++) { @@ -316,7 +316,7 @@ static long update_time_since_previous_sample(long *time_at_previous_sample_ns, return elapsed_time_ns >= 0 ? elapsed_time_ns : 0 /* In case something really weird happened */; } -static long wall_time_now_ns(struct cpu_and_wall_time_collector_state *state) { +static long wall_time_now_ns() { struct timespec current_monotonic; if (clock_gettime(CLOCK_MONOTONIC, ¤t_monotonic) != 0) rb_sys_fail("Failed to read CLOCK_MONOTONIC"); From 3ece7d7284a99dfa7403ff96566ce5292662d68a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 12:12:41 +0100 Subject: [PATCH 0264/2133] Minor: Fix compiler warning by marking argument deliberately left unused Instead of `type` we're only using `type_name`. --- ext/ddtrace_profiling_native_extension/ruby_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.c b/ext/ddtrace_profiling_native_extension/ruby_helpers.c index 78e4923eced..0ef02d53578 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.c +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.c @@ -2,7 +2,7 @@ void raise_unexpected_type( VALUE value, - enum ruby_value_type type, + DDTRACE_UNUSED enum ruby_value_type _type, const char *value_name, const char *type_name, const char *file, From ed49fe407aaa386a8a28e54f341e25fb88a116fd Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 12:14:53 +0100 Subject: [PATCH 0265/2133] Rename `libddprof_helpers.h` to `libdatadog_helpers.h` One more step towards the rename of libddprof to libdatadog. --- .../collectors_cpu_and_wall_time.c | 2 +- ext/ddtrace_profiling_native_extension/collectors_stack.c | 2 +- ext/ddtrace_profiling_native_extension/http_transport.c | 2 +- .../{libddprof_helpers.h => libdatadog_helpers.h} | 0 ext/ddtrace_profiling_native_extension/stack_recorder.c | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename ext/ddtrace_profiling_native_extension/{libddprof_helpers.h => libdatadog_helpers.h} (100%) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index b48cfaa1d0d..56f6efce395 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,7 +1,7 @@ #include #include "helpers.h" #include "collectors_stack.h" -#include "libddprof_helpers.h" +#include "libdatadog_helpers.h" #include "private_vm_api_access.h" #include "stack_recorder.h" diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 0f0b13252bd..94478f93ed4 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -2,7 +2,7 @@ #include #include "extconf.h" #include "helpers.h" -#include "libddprof_helpers.h" +#include "libdatadog_helpers.h" #include "ruby_helpers.h" #include "private_vm_api_access.h" #include "stack_recorder.h" diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/ddtrace_profiling_native_extension/http_transport.c index 1a3333ee7b1..83a8fed64b6 100644 --- a/ext/ddtrace_profiling_native_extension/http_transport.c +++ b/ext/ddtrace_profiling_native_extension/http_transport.c @@ -2,7 +2,7 @@ #include #include #include "helpers.h" -#include "libddprof_helpers.h" +#include "libdatadog_helpers.h" #include "ruby_helpers.h" // Used to report profiling data to Datadog. diff --git a/ext/ddtrace_profiling_native_extension/libddprof_helpers.h b/ext/ddtrace_profiling_native_extension/libdatadog_helpers.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/libddprof_helpers.h rename to ext/ddtrace_profiling_native_extension/libdatadog_helpers.h diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 88ac677b6fc..929be08abcd 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -2,7 +2,7 @@ #include #include "helpers.h" #include "stack_recorder.h" -#include "libddprof_helpers.h" +#include "libdatadog_helpers.h" #include "ruby_helpers.h" // Used to wrap a ddprof_ffi_Profile in a Ruby object and expose Ruby-level serialization APIs From d082b846f3ee14d058f206c68cdb8e7cacbe1b9b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 12:21:22 +0100 Subject: [PATCH 0266/2133] Avoid unused argument warning on Ruby 2.2 --- .../private_vm_api_access.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 32bffc8056a..587177790b8 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -107,7 +107,14 @@ bool is_thread_alive(VALUE thread) { return thread_struct_from_object(thread)->status != THREAD_KILLED; } +// `thread` gets used on all Rubies except 2.2 +// To avoid getting false "unused argument" warnings in setups where it's not used, we need to do this weird dance +// with diagnostic stuff. See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" VALUE thread_name_for(VALUE thread) { +#pragma GCC diagnostic pop + #ifdef NO_THREAD_NAMES return Qnil; #else From 293074ae894dad83f73269519f23fe2a2900de9f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 12:23:31 +0100 Subject: [PATCH 0267/2133] Avoid unused argument warning when including VM headers --- .../private_vm_api_access.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 587177790b8..95d99453801 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -13,7 +13,13 @@ #include RUBY_MJIT_HEADER #else // On older Rubies, use a copy of the VM internal headers shipped in the debase-ruby_core_source gem - #include + + // We can't do anything about warnings in VM headers, so we just use this technique to surpress them. + // See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-parameter" + #include + #pragma GCC diagnostic pop #include #endif From b2a477a8fe933ac96d1f38331246d7edeaed1725 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 13:55:22 +0100 Subject: [PATCH 0268/2133] Move some of the #pragma workarounds to make GCC happy It looks like clang is a little more flexible than GCC on where these get placed. --- .../private_vm_api_access.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 95d99453801..996647c3cbb 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -119,14 +119,13 @@ bool is_thread_alive(VALUE thread) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" VALUE thread_name_for(VALUE thread) { -#pragma GCC diagnostic pop - #ifdef NO_THREAD_NAMES return Qnil; #else return thread_struct_from_object(thread)->name; #endif } +#pragma GCC diagnostic pop // ----------------------------------------------------------------------------- // The sources below are modified versions of code extracted from the Ruby project. @@ -169,15 +168,14 @@ VALUE thread_name_for(VALUE thread) { // Copyright (C) 1993-2012 Yukihiro Matsumoto // to support our custom rb_profile_frames (see below) // Modifications: None -inline static int -calc_pos(const rb_iseq_t *iseq, const VALUE *pc, int *lineno, +// // `node_id` gets used depending on Ruby VM compilation settings (USE_ISEQ_NODE_ID being defined). // To avoid getting false "unused argument" warnings in setups where it's not used, we need to do this weird dance // with diagnostic stuff. See https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/#d11e364 for details. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" - int *node_id) -#pragma GCC diagnostic pop +inline static int +calc_pos(const rb_iseq_t *iseq, const VALUE *pc, int *lineno, int *node_id) { VM_ASSERT(iseq); VM_ASSERT(ISEQ_BODY(iseq)); @@ -219,6 +217,7 @@ calc_pos(const rb_iseq_t *iseq, const VALUE *pc, int *lineno, return 1; } } +#pragma GCC diagnostic pop // Taken from upstream vm_backtrace.c at commit 5f10bd634fb6ae8f74a4ea730176233b0ca96954 (March 2022, Ruby 3.2 trunk) // Copyright (C) 1993-2012 Yukihiro Matsumoto From 95d0e1e787ce95536d4e54019863f1393745681c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 13:55:59 +0100 Subject: [PATCH 0269/2133] Turn on all warnings during compilation This should help us spot more issues in the codebase. --- ext/ddtrace_profiling_native_extension/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index f01f32cbb85..6df6546ce43 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -102,6 +102,10 @@ def add_compiler_flag(flag) # For more details see https://gcc.gnu.org/wiki/Visibility add_compiler_flag '-fvisibility=hidden' +# Enable all other compiler warnings +add_compiler_flag '-Wall' +add_compiler_flag '-Wextra' + if RUBY_PLATFORM.include?('linux') # Supposedly, the correct way to do this is # ``` From 49d58792ca0e2432e51c483daa806a3ce42d72a9 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 20 Jul 2022 15:52:41 -0700 Subject: [PATCH 0270/2133] Ignore lint commits on blame --- .git-blame-ignore-revs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000000..2a54e1e5fcb --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,5 @@ +# .git-blame-ignore-revs +# Ensure multi-line arguments align close to left margin +372f7c20696e30f319cf20622758f7f0ef585875 +# First multi-line argument has line break +6e8ae58d320d6a48f6c1d21db894d414bdf140b2 From 560d8909aa88eb0125fbc61875146272c4d9e26a Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 20 Jul 2022 16:26:27 -0700 Subject: [PATCH 0271/2133] Add pre-check tests on "rake build" --- tasks/release_gem.rake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/release_gem.rake b/tasks/release_gem.rake index 3a19ba273d9..ce10ff5ad77 100644 --- a/tasks/release_gem.rake +++ b/tasks/release_gem.rake @@ -1,4 +1,13 @@ -desc 'create a new indexed repository' +Rake::Task["build"].enhance(["build:pre_check"]) + +desc 'Checks executed before gem is built' +task :'build:pre_check' do + require 'rspec' + ret = RSpec::Core::Runner.run(['spec/ddtrace/release_gem_spec.rb']) + raise "Release tests failed! See error output above." if ret != 0 +end + +desc 'Create a new indexed repository' task :'release:gem' do raise 'Missing environment variable S3_DIR' if !S3_DIR || S3_DIR.empty? # load existing deployed gems From c8a479aa60c91ef008e682b476a006441ec0ff58 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 20 Jul 2022 16:27:41 -0700 Subject: [PATCH 0272/2133] Remove docs from package --- ddtrace.gemspec | 1 - spec/ddtrace/release_gem_spec.rb | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 45d83998539..24d501a1b36 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -36,7 +36,6 @@ Gem::Specification.new do |spec| NOTICE README.md bin/**/* - docs/**/*.md ext/**/* lib/**/* ]] diff --git a/spec/ddtrace/release_gem_spec.rb b/spec/ddtrace/release_gem_spec.rb index 4d76d5849c8..21377980a55 100644 --- a/spec/ddtrace/release_gem_spec.rb +++ b/spec/ddtrace/release_gem_spec.rb @@ -10,6 +10,7 @@ .dockerignore .editorconfig .env + .git-blame-ignore-revs .gitattributes .gitignore .gitlab-ci.yml @@ -27,12 +28,13 @@ docker-compose.yml ] + directories_excluded = %r{^(spec|docs|\.circleci|\.github|benchmarks|gemfiles|integration|tasks|sorbet|yard)/} + expect(files) .to match_array( `git ls-files -z` .split("\x0") - .reject { |f| f.match(%r{^(spec|\.circleci|\.github|benchmarks|gemfiles|integration|tasks|sorbet|yard)/}) } - .reject { |f| f.match(%r{^docs/.*\.png}) } + .reject { |f| f.match(directories_excluded) } .reject { |f| single_files_excluded.include?(f) } ) end From f8de148fe5523c14735239e1d973b92a9c5409b3 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 16:03:49 +0100 Subject: [PATCH 0273/2133] Tweak docker-compose setup for arm64 machines I've been pairing with @TonyCTHsu on getting our docker-compose to a state where it can run and pass the entire test suite when run on an arm64 machine. The following configuration is an improvement on the status quo (as far as we know, only mongodb seems to be failing on arm64 at the moment), and still happily runs on x86-64, as well still being green in CI. Note for anyone running stuff on arm64: docker-compose/docker only consider the `platform` setting when first downloading an image, so you'll probably need to delete the existing linux/x86_64 images for docker to realize it can download arm64 images instead. --- docker-compose.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7108c394914..10c78026e21 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -542,7 +542,6 @@ services: - "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}" ddagent: image: datadog/agent - platform: linux/x86_64 environment: - DD_APM_ENABLED=true - DD_BIND_HOST=0.0.0.0 @@ -558,7 +557,6 @@ services: - ddagent_var_run:/var/run/datadog elasticsearch: image: elasticsearch:8.1.3 - platform: linux/x86_64 expose: - "9200" - "9300" @@ -569,17 +567,15 @@ services: # Ensure production cluster requirements are not enforced - discovery.type=single-node - xpack.security.enabled=false - - ES_JAVA_OPTS="-Xms750m -Xmx750m" + - ES_JAVA_OPTS=-Xmx750m memcached: image: memcached:1.5-alpine - platform: linux/x86_64 expose: - "11211" ports: - "${TEST_MEMCACHED_PORT}:11211" mongodb: - image: mongo:3.5 - platform: linux/x86_64 + image: mongo:3.6 expose: - "27017" ports: @@ -598,7 +594,6 @@ services: - "${TEST_MYSQL_PORT}:3306" postgres: image: postgres:9.6 - platform: linux/x86_64 environment: - POSTGRES_PASSWORD=$TEST_POSTGRES_PASSWORD - POSTGRES_USER=$TEST_POSTGRES_USER @@ -616,8 +611,7 @@ services: ports: - "${TEST_PRESTO_PORT}:8080" redis: - image: redis:3.0 - platform: linux/x86_64 + image: redis:3.2 expose: - "6379" ports: From 755eb06a05403b0c7d94f86b06734da396e8c5cf Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 20 Jul 2022 14:20:09 +0100 Subject: [PATCH 0274/2133] Correctly set number of samples taken This feature is quite trivial, but did not exist in the `OldStack` profiler. --- .../collectors_cpu_and_wall_time.c | 2 +- .../profiling/collectors/cpu_and_wall_time_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 56f6efce395..e390a6bbaab 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -184,8 +184,8 @@ static void sample(VALUE collector_instance) { // FIXME: TODO These are just dummy values for now metric_values[CPU_TIME_VALUE_POS] = 12; // FIXME: Placeholder until actually implemented/tested - metric_values[CPU_SAMPLES_VALUE_POS] = 34; // FIXME: Placeholder until actually implemented/tested + metric_values[CPU_SAMPLES_VALUE_POS] = 1; metric_values[WALL_TIME_VALUE_POS] = wall_time_elapsed_ns; VALUE thread_name = thread_name_for(thread); diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index e9f05c9f78e..7fb9230e0b3 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -108,6 +108,14 @@ expect(wall_time).to be(wall_time_at_second_sample - wall_time_at_first_sample) end + + it 'tags samples with how many times they were seen' do + 5.times { cpu_and_wall_time_collector.sample } + + t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } + + expect(t1_sample).to include(values: include(:'cpu-samples' => 5)) + end end describe '#thread_list' do From 8b58a29da737f4282ae8b91537ab8a4a01c6ddd5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 21 Jul 2022 13:10:10 +0200 Subject: [PATCH 0275/2133] build native extension in `bin/setup` --- integration/apps/rack/bin/setup | 1 + integration/apps/rails-five/bin/setup | 1 + integration/apps/rails-seven/bin/setup | 1 + integration/apps/rails-six/bin/setup | 1 + integration/apps/rspec/bin/setup | 1 + integration/apps/ruby/bin/setup | 1 + integration/apps/sinatra2_modular/bin/setup | 1 + 7 files changed, 7 insertions(+) diff --git a/integration/apps/rack/bin/setup b/integration/apps/rack/bin/setup index 1d18191decd..d69003c04c8 100755 --- a/integration/apps/rack/bin/setup +++ b/integration/apps/rack/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') end diff --git a/integration/apps/rails-five/bin/setup b/integration/apps/rails-five/bin/setup index 3700b052a25..7a7ad4ec933 100755 --- a/integration/apps/rails-five/bin/setup +++ b/integration/apps/rails-five/bin/setup @@ -13,6 +13,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') diff --git a/integration/apps/rails-seven/bin/setup b/integration/apps/rails-seven/bin/setup index b63d2208651..f5985a0c97c 100755 --- a/integration/apps/rails-seven/bin/setup +++ b/integration/apps/rails-seven/bin/setup @@ -13,6 +13,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') diff --git a/integration/apps/rails-six/bin/setup b/integration/apps/rails-six/bin/setup index 3700b052a25..7a7ad4ec933 100755 --- a/integration/apps/rails-six/bin/setup +++ b/integration/apps/rails-six/bin/setup @@ -13,6 +13,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') diff --git a/integration/apps/rspec/bin/setup b/integration/apps/rspec/bin/setup index 4d895098122..37196be6078 100755 --- a/integration/apps/rspec/bin/setup +++ b/integration/apps/rspec/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') diff --git a/integration/apps/ruby/bin/setup b/integration/apps/ruby/bin/setup index 1d18191decd..d69003c04c8 100755 --- a/integration/apps/ruby/bin/setup +++ b/integration/apps/ruby/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') end diff --git a/integration/apps/sinatra2_modular/bin/setup b/integration/apps/sinatra2_modular/bin/setup index 1d18191decd..d69003c04c8 100755 --- a/integration/apps/sinatra2_modular/bin/setup +++ b/integration/apps/sinatra2_modular/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') end From 26ac04c06f87918eae773692dd428491bf8a11a4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 21 Jul 2022 12:56:28 +0100 Subject: [PATCH 0276/2133] [PROF-4902] Track passage of CPU-time between samples In #2163 we added tracking of wall-clock time, and this commit adds CPU-time, which is needed to produce CPU profiles aka to figure out how much time different parts of the code spent executing on CPU. Like for the old profiler, we only support getting CPU-time on Linux. I've added a fallback code path so that we can still easily develop and test the profiler on macOS (even though we don't officially support its use). The way this works is similar to wall-clock time: on every sample we get the current value from the OS, and we calculate the elapsed CPU time from the previous sample (which is stored in `cpu_time_at_previous_sample_ns`). (The first time a thread is sampled, the elapsed time is set to 0). --- .rubocop.yml | 6 +- .../clock_id.h | 20 +++++ .../clock_id_from_pthread.c | 28 +++++++ .../clock_id_noop.c | 8 ++ .../collectors_cpu_and_wall_time.c | 28 ++++++- .../collectors/cpu_and_wall_time_spec.rb | 82 +++++++++++++++++++ 6 files changed, 167 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 90accd2bb02..dfe113a6cb0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -182,8 +182,6 @@ Performance/Squeeze: # (new in 1.7) Enabled: true Performance/StringInclude: # (new in 1.7) Enabled: true -Performance/Sum: # (new in 1.8) - Enabled: true # Requires Ruby 2.2 Style/HashSyntax: @@ -213,6 +211,10 @@ Style/CollectionCompact: Performance/RegexpMatch: Enabled: false +# Requires Ruby 2.4 +Performance/Sum: + Enabled: false + # Requires Ruby 2.5 Style/RedundantBegin: Enabled: false diff --git a/ext/ddtrace_profiling_native_extension/clock_id.h b/ext/ddtrace_profiling_native_extension/clock_id.h index 5b98a53bf79..1e19f307b56 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id.h +++ b/ext/ddtrace_profiling_native_extension/clock_id.h @@ -1,4 +1,24 @@ #pragma once +#include +#include + +// Contains the operating-system specific identifier needed to fetch CPU-time, and a flag to indicate if we failed to fetch it +typedef struct thread_cpu_time_id { + bool valid; + clockid_t clock_id; +} thread_cpu_time_id; + +// Contains the current cpu time, and a flag to indicate if we failed to fetch it +typedef struct thread_cpu_time { + bool valid; + long result_ns; +} thread_cpu_time; + void self_test_clock_id(void); + +// TODO: Remove this after the OldStack profiler gets removed VALUE clock_id_for(VALUE self, VALUE thread); + +thread_cpu_time_id thread_cpu_time_id_for(VALUE thread); +thread_cpu_time thread_cpu_time_for(thread_cpu_time_id thread_cpu_time_id); diff --git a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c index 8a721481165..090255305f0 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c @@ -21,6 +21,7 @@ void self_test_clock_id(void) { if (expected_pthread_id != actual_pthread_id) rb_raise(rb_eRuntimeError, "pthread_id_for() self-test failed"); } +// TODO: Remove this after the OldStack profiler gets removed VALUE clock_id_for(DDTRACE_UNUSED VALUE _self, VALUE thread) { rb_nativethread_id_t thread_id = pthread_id_for(thread); @@ -42,4 +43,31 @@ VALUE clock_id_for(DDTRACE_UNUSED VALUE _self, VALUE thread) { } } +thread_cpu_time_id thread_cpu_time_id_for(VALUE thread) { + rb_nativethread_id_t thread_id = pthread_id_for(thread); + clockid_t clock_id; + + int error = pthread_getcpuclockid(thread_id, &clock_id); + + if (error == 0) { + return (thread_cpu_time_id) {.valid = true, .clock_id = clock_id}; + } else { + // TODO: Include the error code in some way in the output? + return (thread_cpu_time_id) {.valid = false}; + } +} + +thread_cpu_time thread_cpu_time_for(thread_cpu_time_id thread_cpu_time_id) { + thread_cpu_time error = (thread_cpu_time) {.valid = false}; + + if (!thread_cpu_time_id.valid) { return error; } + + struct timespec current_cpu; + + // TODO: Include the error code in some way in the output? + if (clock_gettime(thread_cpu_time_id.clock_id, ¤t_cpu) != 0) return error; + + return (thread_cpu_time) {.valid = true, .result_ns = current_cpu.tv_nsec + (current_cpu.tv_sec * 1000 * 1000 * 1000)}; +} + #endif diff --git a/ext/ddtrace_profiling_native_extension/clock_id_noop.c b/ext/ddtrace_profiling_native_extension/clock_id_noop.c index 509edf6a6a5..27f5f6e592f 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_noop.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_noop.c @@ -12,4 +12,12 @@ void self_test_clock_id(void) { } // Nothing to check VALUE clock_id_for(DDTRACE_UNUSED VALUE _self, DDTRACE_UNUSED VALUE _thread) { return Qnil; } // Nothing to return +thread_cpu_time_id thread_cpu_time_id_for(DDTRACE_UNUSED VALUE _thread) { + return (thread_cpu_time_id) {.valid = false}; +} + +thread_cpu_time thread_cpu_time_for(DDTRACE_UNUSED thread_cpu_time_id _thread_cpu_time_id) { + return (thread_cpu_time) {.valid = false}; +} + #endif diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index e390a6bbaab..f29beee620f 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -1,5 +1,6 @@ #include #include "helpers.h" +#include "clock_id.h" #include "collectors_stack.h" #include "libdatadog_helpers.h" #include "private_vm_api_access.h" @@ -28,6 +29,8 @@ struct cpu_and_wall_time_collector_state { // Tracks per-thread state struct per_thread_context { long thread_id; + thread_cpu_time_id thread_cpu_time_id; + long cpu_time_at_previous_sample_ns; // Can be INVALID_TIME until initialized or if getting it fails for another reason long wall_time_at_previous_sample_ns; // Can be INVALID_TIME until initialized }; @@ -49,6 +52,7 @@ static void remove_context_for_dead_threads(struct cpu_and_wall_time_collector_s static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, st_data_t _argument); static VALUE _native_per_thread_context(VALUE self, VALUE collector_instance); static long update_time_since_previous_sample(long *time_at_previous_sample_ns, long current_time_ns); +static long cpu_time_now_ns(struct per_thread_context *thread_context); static long wall_time_now_ns(); static long thread_id_for(VALUE thread); @@ -177,14 +181,16 @@ static void sample(VALUE collector_instance) { VALUE thread = RARRAY_AREF(threads, i); struct per_thread_context *thread_context = get_or_create_context_for(thread, state); + long current_cpu_time_ns = cpu_time_now_ns(thread_context); + + long cpu_time_elapsed_ns = + update_time_since_previous_sample(&thread_context->cpu_time_at_previous_sample_ns, current_cpu_time_ns); long wall_time_elapsed_ns = update_time_since_previous_sample(&thread_context->wall_time_at_previous_sample_ns, current_wall_time_ns); int64_t metric_values[ENABLED_VALUE_TYPES_COUNT] = {0}; - // FIXME: TODO These are just dummy values for now - metric_values[CPU_TIME_VALUE_POS] = 12; // FIXME: Placeholder until actually implemented/tested - + metric_values[CPU_TIME_VALUE_POS] = cpu_time_elapsed_ns; metric_values[CPU_SAMPLES_VALUE_POS] = 1; metric_values[WALL_TIME_VALUE_POS] = wall_time_elapsed_ns; @@ -241,8 +247,10 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct static void initialize_context(VALUE thread, struct per_thread_context *thread_context) { thread_context->thread_id = thread_id_for(thread); + thread_context->thread_cpu_time_id = thread_cpu_time_id_for(thread); // These will get initialized during actual sampling + thread_context->cpu_time_at_previous_sample_ns = INVALID_TIME; thread_context->wall_time_at_previous_sample_ns = INVALID_TIME; } @@ -277,6 +285,7 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value VALUE arguments[] = { ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id), + ID2SYM(rb_intern("cpu_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->cpu_time_at_previous_sample_ns), ID2SYM(rb_intern("wall_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->wall_time_at_previous_sample_ns) }; for (long unsigned int i = 0; i < VALUE_COUNT(arguments); i += 2) rb_hash_aset(context_as_hash, arguments[i], arguments[i+1]); @@ -324,6 +333,19 @@ static long wall_time_now_ns() { return current_monotonic.tv_nsec + (current_monotonic.tv_sec * 1000 * 1000 * 1000); } +static long cpu_time_now_ns(struct per_thread_context *thread_context) { + thread_cpu_time cpu_time = thread_cpu_time_for(thread_context->thread_cpu_time_id); + + if (!cpu_time.valid) { + // Invalidate previous state of the counter (if any), it's no longer accurate. We need to get two good reads + // in a row to have an accurate delta. + thread_context->cpu_time_at_previous_sample_ns = INVALID_TIME; + return 0; + } + + return cpu_time.result_ns; +} + static long thread_id_for(VALUE thread) { VALUE object_id = rb_obj_id(thread); diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 7fb9230e0b3..31c1a582cbc 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -116,6 +116,46 @@ expect(t1_sample).to include(values: include(:'cpu-samples' => 5)) end + + context 'cpu time behavior' do + context 'when not on Linux' do + before do + skip 'The fallback behavior only applies when not on Linux' if PlatformHelpers.linux? + end + + it 'sets the cpu-time on every sample to zero' do + 5.times { cpu_and_wall_time_collector.sample } + + expect(samples).to all include(values: include(:'cpu-time' => 0)) + end + end + + context 'on Linux' do + before do + skip 'Test only runs on Linux' unless PlatformHelpers.linux? + end + + it 'includes the cpu-time for the samples' do + rspec_thread_spent_time = Datadog::Core::Utils::Time.measure(:nanosecond) do + 5.times { cpu_and_wall_time_collector.sample } + samples # to trigger serialization + end + + # The only thread we're guaranteed has spent some time on cpu is the rspec thread, so let's check we have + # some data for it + total_cpu_for_rspec_thread = + samples + .select { |it| it.fetch(:labels).fetch(:'thread id') == Thread.current.object_id } + .map { |it| it.fetch(:values).fetch(:'cpu-time') } + .reduce(:+) + + # The **wall-clock time** spent by the rspec thread is going to be an upper bound for the cpu time spent, + # e.g. if it took 5 real world seconds to run the test, then at most the rspec thread spent those 5 seconds + # running on CPU, but possibly it spent slightly less. + expect(total_cpu_for_rspec_thread).to be_between(1, rspec_thread_spent_time) + end + end + end end describe '#thread_list' do @@ -153,6 +193,48 @@ include(wall_time_at_previous_sample_ns: be_between(@wall_time_before_sample_ns, @wall_time_after_sample_ns)) ) end + + context 'cpu time behavior' do + context 'when not on Linux' do + before do + skip 'The fallback behavior only applies when not on Linux' if PlatformHelpers.linux? + end + + it 'sets the cpu_time_at_previous_sample_ns to zero' do + expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + include(cpu_time_at_previous_sample_ns: 0) + ) + end + end + + context 'on Linux' do + before do + skip 'Test only runs on Linux' unless PlatformHelpers.linux? + end + + it 'sets the cpu_time_at_previous_sample_ns to the current cpu clock value' do + # It's somewhat difficult to validate the actual value since this is an operating system-specific value + # which should only be assessed in relation to other values for the same thread, not in absolute + expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + include(cpu_time_at_previous_sample_ns: not_be(0)) + ) + end + + it 'returns a bigger value for each sample' do + sample_values = [] + + 3.times do + cpu_and_wall_time_collector.sample + + sample_values << + cpu_and_wall_time_collector.per_thread_context[Thread.main].fetch(:cpu_time_at_previous_sample_ns) + end + + expect(sample_values.uniq.size).to be(3), 'Every sample is expected to have a differ cpu time value' + expect(sample_values).to eq(sample_values.sort), 'Samples are expected to be in ascending order' + end + end + end end context 'after sampling multiple times' do From bcba1aed5ce3424917ec9000da245d92c339560b Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 21 Jul 2022 13:59:17 +0200 Subject: [PATCH 0277/2133] Test --- .circleci/config.yml | 8 +-- integration/apps/sinatra2_classic/app/acme.rb | 4 +- integration/apps/sinatra2_classic/bin/setup | 1 + .../apps/sinatra2_classic/docker-compose.yml | 6 +- .../spec/integration/basic_spec.rb | 66 +++++++++++++++++++ .../apps/sinatra2_modular/app/basic.rb | 2 +- integration/apps/sinatra2_modular/bin/setup | 1 + .../spec/integration/basic_spec.rb | 66 +++++++++++++++++++ 8 files changed, 143 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f9741c163ce..065e358f036 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -611,22 +611,22 @@ workflows: <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.6 - integration_apps: 'rack rails-five rails-six' + integration_apps: 'rack rails-five rails-six sinatra2-classic sinatra2-modular' ruby_version: '2.6' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.7 - integration_apps: 'rack rails-five rails-six rails-seven' + integration_apps: 'rack rails-five rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '2.7' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.0 - integration_apps: 'rack rails-six rails-seven' + integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '3.0' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.1 - integration_apps: 'rack rails-six rails-seven' + integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '3.1' <<: *filters_all_branches_and_tags # TODO: Re-enable once 3.2 testing is green! diff --git a/integration/apps/sinatra2_classic/app/acme.rb b/integration/apps/sinatra2_classic/app/acme.rb index c1010ae10ae..7522c0d7fc1 100644 --- a/integration/apps/sinatra2_classic/app/acme.rb +++ b/integration/apps/sinatra2_classic/app/acme.rb @@ -48,7 +48,7 @@ end get '/basic/default' do - status 204 + 204 end get '/basic/fibonacci' do @@ -62,8 +62,6 @@ ] end - private - def fib(n) n <= 1 ? n : fib(n - 1) + fib(n - 2) end diff --git a/integration/apps/sinatra2_classic/bin/setup b/integration/apps/sinatra2_classic/bin/setup index 1d18191decd..d69003c04c8 100755 --- a/integration/apps/sinatra2_classic/bin/setup +++ b/integration/apps/sinatra2_classic/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') end diff --git a/integration/apps/sinatra2_classic/docker-compose.yml b/integration/apps/sinatra2_classic/docker-compose.yml index 886c149052b..c2848bb6f1d 100644 --- a/integration/apps/sinatra2_classic/docker-compose.yml +++ b/integration/apps/sinatra2_classic/docker-compose.yml @@ -13,7 +13,7 @@ services: - DD_METRIC_AGENT_PORT=8125 - DD_TRACE_AGENT_PORT=8126 - DD_HEALTH_METRICS_ENABLED=true - - DD_SERVICE=acme-sinatra + - DD_SERVICE=acme-sinatra2-classic - DD_PROFILING_ENABLED=true # Use these to choose what is run - DD_DEMO_ENV_PROCESS=puma @@ -24,7 +24,7 @@ services: # - DD_DEMO_ENV_GEM_GIT_DDTRACE=https://github.com/DataDog/dd-trace-rb.git # - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a # Enable building the profiling native extension - # - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true expose: - "80" stdin_open: true @@ -67,7 +67,7 @@ services: build: context: ../../images dockerfile: wrk/Dockerfile - command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/fibonacci + command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default depends_on: - app environment: diff --git a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb index 8469487a8f8..ffc57de99e7 100644 --- a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb @@ -10,4 +10,70 @@ subject { get('basic/default') } it { is_expected.to be_a_kind_of(Net::HTTPOK) } end + + let(:expected_profiler_available) { RUBY_VERSION >= '2.2' } + + let(:expected_profiler_threads) do + # NOTE: Threads can't be named on Ruby 2.2 + contain_exactly('Datadog::Profiling::Collectors::OldStack', 'Datadog::Profiling::Scheduler') unless RUBY_VERSION < '2.3' + end + + context 'component checks' do + subject { get('health/detailed') } + + let(:json_result) { JSON.parse(subject.body, symbolize_names: true) } + + it { is_expected.to be_a_kind_of(Net::HTTPOK) } + + it 'should be profiling' do + expect(json_result).to include( + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + + it 'webserver sanity checking' do + puts " Webserver: #{json_result.fetch(:webserver_process)}" + end + end + + context 'resque usage' do + let(:key) { SecureRandom.uuid } + + before do + post('background_jobs/write_resque', key: key, value: 'it works!') + end + + it 'runs a test task, with profiling enabled' do + body = nil + wait_for { body = get("background_jobs/read_resque?key=#{key}").body.to_s }.to include('it works!') + + expect(JSON.parse(body, symbolize_names: true)).to include( + key: key, + resque_process: match(/resque/), + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + end + + context 'sidekiq usage' do + let(:key) { SecureRandom.uuid } + + before do + post('background_jobs/write_sidekiq', key: key, value: 'it works!') + end + + it 'runs a test task, with profiling enabled' do + body = nil + wait_for { body = get("background_jobs/read_sidekiq?key=#{key}").body.to_s }.to include('it works!') + + expect(JSON.parse(body, symbolize_names: true)).to include( + key: key, + sidekiq_process: match(/sidekiq/), + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + end end diff --git a/integration/apps/sinatra2_modular/app/basic.rb b/integration/apps/sinatra2_modular/app/basic.rb index 6226b3ebe61..4bd30fd4d7c 100644 --- a/integration/apps/sinatra2_modular/app/basic.rb +++ b/integration/apps/sinatra2_modular/app/basic.rb @@ -5,7 +5,7 @@ class Basic < Sinatra::Base # register Datadog::Tracing::Contrib::Sinatra::Tracer get '/basic/default' do - status 204 + 204 end get '/basic/fibonacci' do diff --git a/integration/apps/sinatra2_modular/bin/setup b/integration/apps/sinatra2_modular/bin/setup index 1d18191decd..d69003c04c8 100755 --- a/integration/apps/sinatra2_modular/bin/setup +++ b/integration/apps/sinatra2_modular/bin/setup @@ -12,6 +12,7 @@ end chdir APP_ROOT do puts "\n== Installing dependencies ==" + require '/vendor/dd-demo/build_ddtrace_profiling_native_extension' if ENV['DD_DEMO_ENV_BUILD_PROFILING_EXTENSION'] == 'true' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') end diff --git a/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb b/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb index 8469487a8f8..ffc57de99e7 100644 --- a/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb @@ -10,4 +10,70 @@ subject { get('basic/default') } it { is_expected.to be_a_kind_of(Net::HTTPOK) } end + + let(:expected_profiler_available) { RUBY_VERSION >= '2.2' } + + let(:expected_profiler_threads) do + # NOTE: Threads can't be named on Ruby 2.2 + contain_exactly('Datadog::Profiling::Collectors::OldStack', 'Datadog::Profiling::Scheduler') unless RUBY_VERSION < '2.3' + end + + context 'component checks' do + subject { get('health/detailed') } + + let(:json_result) { JSON.parse(subject.body, symbolize_names: true) } + + it { is_expected.to be_a_kind_of(Net::HTTPOK) } + + it 'should be profiling' do + expect(json_result).to include( + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + + it 'webserver sanity checking' do + puts " Webserver: #{json_result.fetch(:webserver_process)}" + end + end + + context 'resque usage' do + let(:key) { SecureRandom.uuid } + + before do + post('background_jobs/write_resque', key: key, value: 'it works!') + end + + it 'runs a test task, with profiling enabled' do + body = nil + wait_for { body = get("background_jobs/read_resque?key=#{key}").body.to_s }.to include('it works!') + + expect(JSON.parse(body, symbolize_names: true)).to include( + key: key, + resque_process: match(/resque/), + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + end + + context 'sidekiq usage' do + let(:key) { SecureRandom.uuid } + + before do + post('background_jobs/write_sidekiq', key: key, value: 'it works!') + end + + it 'runs a test task, with profiling enabled' do + body = nil + wait_for { body = get("background_jobs/read_sidekiq?key=#{key}").body.to_s }.to include('it works!') + + expect(JSON.parse(body, symbolize_names: true)).to include( + key: key, + sidekiq_process: match(/sidekiq/), + profiler_available: expected_profiler_available, + profiler_threads: expected_profiler_threads, + ) + end + end end From 6abacb30624acf6ca07d97230eed2bee6d3b0767 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 21 Jul 2022 13:13:31 +0100 Subject: [PATCH 0278/2133] Improve debugging/testing of `thread_cpu_time_id` --- .../collectors_cpu_and_wall_time.c | 4 +++- .../profiling/collectors/cpu_and_wall_time_spec.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index f29beee620f..a8e5921f865 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -284,7 +284,9 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value rb_hash_aset(result, thread, context_as_hash); VALUE arguments[] = { - ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id), + ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id), + ID2SYM(rb_intern("thread_cpu_time_id_valid?")), /* => */ thread_context->thread_cpu_time_id.valid ? Qtrue : Qfalse, + ID2SYM(rb_intern("thread_cpu_time_id")), /* => */ CLOCKID2NUM(thread_context->thread_cpu_time_id.clock_id), ID2SYM(rb_intern("cpu_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->cpu_time_at_previous_sample_ns), ID2SYM(rb_intern("wall_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->wall_time_at_previous_sample_ns) }; diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 31c1a582cbc..2231dc1c788 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -205,6 +205,12 @@ include(cpu_time_at_previous_sample_ns: 0) ) end + + it 'marks the thread_cpu_time_ids as not valid' do + expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + include(thread_cpu_time_id_valid?: false) + ) + end end context 'on Linux' do @@ -233,6 +239,12 @@ expect(sample_values.uniq.size).to be(3), 'Every sample is expected to have a differ cpu time value' expect(sample_values).to eq(sample_values.sort), 'Samples are expected to be in ascending order' end + + it 'marks the thread_cpu_time_ids as valid' do + expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + include(thread_cpu_time_id_valid?: true) + ) + end end end end From a455be37bd51bd708a0431e66c5536098c86eb57 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 21 Jul 2022 16:04:39 +0200 Subject: [PATCH 0279/2133] Fix CI image --- .circleci/config.yml | 8 ++-- integration/apps/sinatra2_classic/app/acme.rb | 2 +- .../sinatra2_classic/docker-compose.ci.yml | 8 ++-- .../spec/integration/basic_spec.rb | 40 ------------------- .../apps/sinatra2_modular/app/basic.rb | 2 +- .../sinatra2_modular/docker-compose.ci.yml | 6 +-- .../spec/integration/basic_spec.rb | 40 ------------------- 7 files changed, 13 insertions(+), 93 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 065e358f036..c5f145aaf4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -611,22 +611,22 @@ workflows: <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.6 - integration_apps: 'rack rails-five rails-six sinatra2-classic sinatra2-modular' + integration_apps: 'rack rails-five rails-six sinatra2_classic sinatra2_modular' ruby_version: '2.6' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.7 - integration_apps: 'rack rails-five rails-six rails-seven sinatra2-classic sinatra2-modular' + integration_apps: 'rack rails-five rails-six rails-seven sinatra2_classic sinatra2_modular' ruby_version: '2.7' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.0 - integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' + integration_apps: 'rack rails-six rails-seven sinatra2_classic sinatra2_modular' ruby_version: '3.0' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.1 - integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' + integration_apps: 'rack rails-six rails-seven sinatra2_classic sinatra2_modular' ruby_version: '3.1' <<: *filters_all_branches_and_tags # TODO: Re-enable once 3.2 testing is green! diff --git a/integration/apps/sinatra2_classic/app/acme.rb b/integration/apps/sinatra2_classic/app/acme.rb index 7522c0d7fc1..def86f444f1 100644 --- a/integration/apps/sinatra2_classic/app/acme.rb +++ b/integration/apps/sinatra2_classic/app/acme.rb @@ -48,7 +48,7 @@ end get '/basic/default' do - 204 + 200 end get '/basic/fibonacci' do diff --git a/integration/apps/sinatra2_classic/docker-compose.ci.yml b/integration/apps/sinatra2_classic/docker-compose.ci.yml index 9c2981e642c..553cdbc6f0c 100644 --- a/integration/apps/sinatra2_classic/docker-compose.ci.yml +++ b/integration/apps/sinatra2_classic/docker-compose.ci.yml @@ -5,7 +5,7 @@ services: # and use it as the `ddtrace` gem. build: context: ../../.. - dockerfile: integration/apps/sinatra/Dockerfile-ci + dockerfile: integration/apps/sinatra2_classic/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} depends_on: @@ -16,11 +16,11 @@ services: - DD_METRIC_AGENT_PORT=8125 - DD_TRACE_AGENT_PORT=8126 - DD_HEALTH_METRICS_ENABLED=true - - DD_SERVICE=acme-sinatra + - DD_SERVICE=acme-sinatra2-classic - DD_PROFILING_ENABLED=true # Use these to choose what is run - DD_DEMO_ENV_PROCESS # needs to be specified, see README for available options - - DD_DEMO_ENV_FEATURES=tracing + - DD_DEMO_ENV_FEATURES=tracing,profiling expose: - "80" stdin_open: true @@ -43,7 +43,7 @@ services: integration-tester: build: context: ../../.. - dockerfile: integration/apps/sinatra/Dockerfile-ci + dockerfile: integration/apps/sinatra2_classic/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} command: bin/test diff --git a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb index ffc57de99e7..1de15eb55c9 100644 --- a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb @@ -36,44 +36,4 @@ puts " Webserver: #{json_result.fetch(:webserver_process)}" end end - - context 'resque usage' do - let(:key) { SecureRandom.uuid } - - before do - post('background_jobs/write_resque', key: key, value: 'it works!') - end - - it 'runs a test task, with profiling enabled' do - body = nil - wait_for { body = get("background_jobs/read_resque?key=#{key}").body.to_s }.to include('it works!') - - expect(JSON.parse(body, symbolize_names: true)).to include( - key: key, - resque_process: match(/resque/), - profiler_available: expected_profiler_available, - profiler_threads: expected_profiler_threads, - ) - end - end - - context 'sidekiq usage' do - let(:key) { SecureRandom.uuid } - - before do - post('background_jobs/write_sidekiq', key: key, value: 'it works!') - end - - it 'runs a test task, with profiling enabled' do - body = nil - wait_for { body = get("background_jobs/read_sidekiq?key=#{key}").body.to_s }.to include('it works!') - - expect(JSON.parse(body, symbolize_names: true)).to include( - key: key, - sidekiq_process: match(/sidekiq/), - profiler_available: expected_profiler_available, - profiler_threads: expected_profiler_threads, - ) - end - end end diff --git a/integration/apps/sinatra2_modular/app/basic.rb b/integration/apps/sinatra2_modular/app/basic.rb index 4bd30fd4d7c..ea6f09af75b 100644 --- a/integration/apps/sinatra2_modular/app/basic.rb +++ b/integration/apps/sinatra2_modular/app/basic.rb @@ -5,7 +5,7 @@ class Basic < Sinatra::Base # register Datadog::Tracing::Contrib::Sinatra::Tracer get '/basic/default' do - 204 + 200 end get '/basic/fibonacci' do diff --git a/integration/apps/sinatra2_modular/docker-compose.ci.yml b/integration/apps/sinatra2_modular/docker-compose.ci.yml index 9c2981e642c..4e1ff17cb29 100644 --- a/integration/apps/sinatra2_modular/docker-compose.ci.yml +++ b/integration/apps/sinatra2_modular/docker-compose.ci.yml @@ -5,7 +5,7 @@ services: # and use it as the `ddtrace` gem. build: context: ../../.. - dockerfile: integration/apps/sinatra/Dockerfile-ci + dockerfile: integration/apps/sinatra2-modular/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} depends_on: @@ -20,7 +20,7 @@ services: - DD_PROFILING_ENABLED=true # Use these to choose what is run - DD_DEMO_ENV_PROCESS # needs to be specified, see README for available options - - DD_DEMO_ENV_FEATURES=tracing + - DD_DEMO_ENV_FEATURES=tracing,profiling expose: - "80" stdin_open: true @@ -43,7 +43,7 @@ services: integration-tester: build: context: ../../.. - dockerfile: integration/apps/sinatra/Dockerfile-ci + dockerfile: integration/apps/sinatra2-modular/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} command: bin/test diff --git a/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb b/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb index ffc57de99e7..1de15eb55c9 100644 --- a/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb +++ b/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb @@ -36,44 +36,4 @@ puts " Webserver: #{json_result.fetch(:webserver_process)}" end end - - context 'resque usage' do - let(:key) { SecureRandom.uuid } - - before do - post('background_jobs/write_resque', key: key, value: 'it works!') - end - - it 'runs a test task, with profiling enabled' do - body = nil - wait_for { body = get("background_jobs/read_resque?key=#{key}").body.to_s }.to include('it works!') - - expect(JSON.parse(body, symbolize_names: true)).to include( - key: key, - resque_process: match(/resque/), - profiler_available: expected_profiler_available, - profiler_threads: expected_profiler_threads, - ) - end - end - - context 'sidekiq usage' do - let(:key) { SecureRandom.uuid } - - before do - post('background_jobs/write_sidekiq', key: key, value: 'it works!') - end - - it 'runs a test task, with profiling enabled' do - body = nil - wait_for { body = get("background_jobs/read_sidekiq?key=#{key}").body.to_s }.to include('it works!') - - expect(JSON.parse(body, symbolize_names: true)).to include( - key: key, - sidekiq_process: match(/sidekiq/), - profiler_available: expected_profiler_available, - profiler_threads: expected_profiler_threads, - ) - end - end end From 2f039126358c5a2a941b286d0e77fb2e73641683 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 21 Jul 2022 17:15:45 +0200 Subject: [PATCH 0280/2133] Rename directory --- .circleci/config.yml | 8 ++++---- .../{sinatra2_classic => sinatra2-classic}/Dockerfile | 0 .../{sinatra2_classic => sinatra2-classic}/Dockerfile-ci | 0 .../apps/{sinatra2_classic => sinatra2-classic}/Gemfile | 0 .../apps/{sinatra2_classic => sinatra2-classic}/README.md | 0 .../{sinatra2_classic => sinatra2-classic}/app/acme.rb | 2 +- .../apps/{sinatra2_classic => sinatra2-classic}/bin/run | 0 .../apps/{sinatra2_classic => sinatra2-classic}/bin/setup | 0 .../apps/{sinatra2_classic => sinatra2-classic}/bin/test | 0 .../apps/{sinatra2_classic => sinatra2-classic}/config.ru | 0 .../{sinatra2_classic => sinatra2-classic}/config/puma.rb | 0 .../config/unicorn.rb | 0 .../docker-compose.ci.yml | 4 ++-- .../docker-compose.yml | 0 .../script/build-images | 0 .../apps/{sinatra2_classic => sinatra2-classic}/script/ci | 0 .../spec/integration/basic_spec.rb | 0 .../spec/spec_helper.rb | 0 .../spec/support/integration_helper.rb | 0 .../{sinatra2_modular => sinatra2-modular}/Dockerfile | 0 .../{sinatra2_modular => sinatra2-modular}/Dockerfile-ci | 0 .../apps/{sinatra2_modular => sinatra2-modular}/Gemfile | 0 .../apps/{sinatra2_modular => sinatra2-modular}/README.md | 0 .../{sinatra2_modular => sinatra2-modular}/app/acme.rb | 2 +- .../{sinatra2_modular => sinatra2-modular}/app/basic.rb | 0 .../{sinatra2_modular => sinatra2-modular}/app/health.rb | 0 .../apps/{sinatra2_modular => sinatra2-modular}/bin/run | 0 .../apps/{sinatra2_modular => sinatra2-modular}/bin/setup | 0 .../apps/{sinatra2_modular => sinatra2-modular}/bin/test | 0 .../apps/{sinatra2_modular => sinatra2-modular}/config.ru | 0 .../{sinatra2_modular => sinatra2-modular}/config/puma.rb | 0 .../config/unicorn.rb | 0 .../docker-compose.ci.yml | 0 .../docker-compose.yml | 0 .../script/build-images | 0 .../apps/{sinatra2_modular => sinatra2-modular}/script/ci | 0 .../spec/integration/basic_spec.rb | 0 .../spec/spec_helper.rb | 0 .../spec/support/integration_helper.rb | 0 39 files changed, 8 insertions(+), 8 deletions(-) rename integration/apps/{sinatra2_classic => sinatra2-classic}/Dockerfile (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/Dockerfile-ci (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/Gemfile (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/README.md (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/app/acme.rb (97%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/bin/run (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/bin/setup (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/bin/test (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/config.ru (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/config/puma.rb (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/config/unicorn.rb (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/docker-compose.ci.yml (92%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/docker-compose.yml (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/script/build-images (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/script/ci (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/spec/integration/basic_spec.rb (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/spec/spec_helper.rb (100%) rename integration/apps/{sinatra2_classic => sinatra2-classic}/spec/support/integration_helper.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/Dockerfile (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/Dockerfile-ci (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/Gemfile (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/README.md (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/app/acme.rb (96%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/app/basic.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/app/health.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/bin/run (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/bin/setup (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/bin/test (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/config.ru (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/config/puma.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/config/unicorn.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/docker-compose.ci.yml (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/docker-compose.yml (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/script/build-images (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/script/ci (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/spec/integration/basic_spec.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/spec/spec_helper.rb (100%) rename integration/apps/{sinatra2_modular => sinatra2-modular}/spec/support/integration_helper.rb (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index c5f145aaf4d..065e358f036 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -611,22 +611,22 @@ workflows: <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.6 - integration_apps: 'rack rails-five rails-six sinatra2_classic sinatra2_modular' + integration_apps: 'rack rails-five rails-six sinatra2-classic sinatra2-modular' ruby_version: '2.6' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-2.7 - integration_apps: 'rack rails-five rails-six rails-seven sinatra2_classic sinatra2_modular' + integration_apps: 'rack rails-five rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '2.7' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.0 - integration_apps: 'rack rails-six rails-seven sinatra2_classic sinatra2_modular' + integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '3.0' <<: *filters_all_branches_and_tags - orb/build_and_test_integration: name: build_and_test_integration-3.1 - integration_apps: 'rack rails-six rails-seven sinatra2_classic sinatra2_modular' + integration_apps: 'rack rails-six rails-seven sinatra2-classic sinatra2-modular' ruby_version: '3.1' <<: *filters_all_branches_and_tags # TODO: Re-enable once 3.2 testing is green! diff --git a/integration/apps/sinatra2_classic/Dockerfile b/integration/apps/sinatra2-classic/Dockerfile similarity index 100% rename from integration/apps/sinatra2_classic/Dockerfile rename to integration/apps/sinatra2-classic/Dockerfile diff --git a/integration/apps/sinatra2_classic/Dockerfile-ci b/integration/apps/sinatra2-classic/Dockerfile-ci similarity index 100% rename from integration/apps/sinatra2_classic/Dockerfile-ci rename to integration/apps/sinatra2-classic/Dockerfile-ci diff --git a/integration/apps/sinatra2_classic/Gemfile b/integration/apps/sinatra2-classic/Gemfile similarity index 100% rename from integration/apps/sinatra2_classic/Gemfile rename to integration/apps/sinatra2-classic/Gemfile diff --git a/integration/apps/sinatra2_classic/README.md b/integration/apps/sinatra2-classic/README.md similarity index 100% rename from integration/apps/sinatra2_classic/README.md rename to integration/apps/sinatra2-classic/README.md diff --git a/integration/apps/sinatra2_classic/app/acme.rb b/integration/apps/sinatra2-classic/app/acme.rb similarity index 97% rename from integration/apps/sinatra2_classic/app/acme.rb rename to integration/apps/sinatra2-classic/app/acme.rb index def86f444f1..3e5a8d889ab 100644 --- a/integration/apps/sinatra2_classic/app/acme.rb +++ b/integration/apps/sinatra2-classic/app/acme.rb @@ -2,7 +2,7 @@ require 'ddtrace' Datadog.configure do |c| - c.service = 'acme-sinatra-2-classic' + c.service = 'acme-sinatra2-classic' c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics') diff --git a/integration/apps/sinatra2_classic/bin/run b/integration/apps/sinatra2-classic/bin/run similarity index 100% rename from integration/apps/sinatra2_classic/bin/run rename to integration/apps/sinatra2-classic/bin/run diff --git a/integration/apps/sinatra2_classic/bin/setup b/integration/apps/sinatra2-classic/bin/setup similarity index 100% rename from integration/apps/sinatra2_classic/bin/setup rename to integration/apps/sinatra2-classic/bin/setup diff --git a/integration/apps/sinatra2_classic/bin/test b/integration/apps/sinatra2-classic/bin/test similarity index 100% rename from integration/apps/sinatra2_classic/bin/test rename to integration/apps/sinatra2-classic/bin/test diff --git a/integration/apps/sinatra2_classic/config.ru b/integration/apps/sinatra2-classic/config.ru similarity index 100% rename from integration/apps/sinatra2_classic/config.ru rename to integration/apps/sinatra2-classic/config.ru diff --git a/integration/apps/sinatra2_classic/config/puma.rb b/integration/apps/sinatra2-classic/config/puma.rb similarity index 100% rename from integration/apps/sinatra2_classic/config/puma.rb rename to integration/apps/sinatra2-classic/config/puma.rb diff --git a/integration/apps/sinatra2_classic/config/unicorn.rb b/integration/apps/sinatra2-classic/config/unicorn.rb similarity index 100% rename from integration/apps/sinatra2_classic/config/unicorn.rb rename to integration/apps/sinatra2-classic/config/unicorn.rb diff --git a/integration/apps/sinatra2_classic/docker-compose.ci.yml b/integration/apps/sinatra2-classic/docker-compose.ci.yml similarity index 92% rename from integration/apps/sinatra2_classic/docker-compose.ci.yml rename to integration/apps/sinatra2-classic/docker-compose.ci.yml index 553cdbc6f0c..cb356ecfba5 100644 --- a/integration/apps/sinatra2_classic/docker-compose.ci.yml +++ b/integration/apps/sinatra2-classic/docker-compose.ci.yml @@ -5,7 +5,7 @@ services: # and use it as the `ddtrace` gem. build: context: ../../.. - dockerfile: integration/apps/sinatra2_classic/Dockerfile-ci + dockerfile: integration/apps/sinatra2-classic/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} depends_on: @@ -43,7 +43,7 @@ services: integration-tester: build: context: ../../.. - dockerfile: integration/apps/sinatra2_classic/Dockerfile-ci + dockerfile: integration/apps/sinatra2-classic/Dockerfile-ci args: BASE_IMAGE: ${APP_IMAGE} command: bin/test diff --git a/integration/apps/sinatra2_classic/docker-compose.yml b/integration/apps/sinatra2-classic/docker-compose.yml similarity index 100% rename from integration/apps/sinatra2_classic/docker-compose.yml rename to integration/apps/sinatra2-classic/docker-compose.yml diff --git a/integration/apps/sinatra2_classic/script/build-images b/integration/apps/sinatra2-classic/script/build-images similarity index 100% rename from integration/apps/sinatra2_classic/script/build-images rename to integration/apps/sinatra2-classic/script/build-images diff --git a/integration/apps/sinatra2_classic/script/ci b/integration/apps/sinatra2-classic/script/ci similarity index 100% rename from integration/apps/sinatra2_classic/script/ci rename to integration/apps/sinatra2-classic/script/ci diff --git a/integration/apps/sinatra2_classic/spec/integration/basic_spec.rb b/integration/apps/sinatra2-classic/spec/integration/basic_spec.rb similarity index 100% rename from integration/apps/sinatra2_classic/spec/integration/basic_spec.rb rename to integration/apps/sinatra2-classic/spec/integration/basic_spec.rb diff --git a/integration/apps/sinatra2_classic/spec/spec_helper.rb b/integration/apps/sinatra2-classic/spec/spec_helper.rb similarity index 100% rename from integration/apps/sinatra2_classic/spec/spec_helper.rb rename to integration/apps/sinatra2-classic/spec/spec_helper.rb diff --git a/integration/apps/sinatra2_classic/spec/support/integration_helper.rb b/integration/apps/sinatra2-classic/spec/support/integration_helper.rb similarity index 100% rename from integration/apps/sinatra2_classic/spec/support/integration_helper.rb rename to integration/apps/sinatra2-classic/spec/support/integration_helper.rb diff --git a/integration/apps/sinatra2_modular/Dockerfile b/integration/apps/sinatra2-modular/Dockerfile similarity index 100% rename from integration/apps/sinatra2_modular/Dockerfile rename to integration/apps/sinatra2-modular/Dockerfile diff --git a/integration/apps/sinatra2_modular/Dockerfile-ci b/integration/apps/sinatra2-modular/Dockerfile-ci similarity index 100% rename from integration/apps/sinatra2_modular/Dockerfile-ci rename to integration/apps/sinatra2-modular/Dockerfile-ci diff --git a/integration/apps/sinatra2_modular/Gemfile b/integration/apps/sinatra2-modular/Gemfile similarity index 100% rename from integration/apps/sinatra2_modular/Gemfile rename to integration/apps/sinatra2-modular/Gemfile diff --git a/integration/apps/sinatra2_modular/README.md b/integration/apps/sinatra2-modular/README.md similarity index 100% rename from integration/apps/sinatra2_modular/README.md rename to integration/apps/sinatra2-modular/README.md diff --git a/integration/apps/sinatra2_modular/app/acme.rb b/integration/apps/sinatra2-modular/app/acme.rb similarity index 96% rename from integration/apps/sinatra2_modular/app/acme.rb rename to integration/apps/sinatra2-modular/app/acme.rb index 9b92fae4f17..68546b99cbf 100644 --- a/integration/apps/sinatra2_modular/app/acme.rb +++ b/integration/apps/sinatra2-modular/app/acme.rb @@ -4,7 +4,7 @@ # require 'ddtrace/auto_instrument' Datadog.configure do |c| - c.service = 'acme-sinatra-2-modular' + c.service = 'acme-sinatra2-modular' c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics') diff --git a/integration/apps/sinatra2_modular/app/basic.rb b/integration/apps/sinatra2-modular/app/basic.rb similarity index 100% rename from integration/apps/sinatra2_modular/app/basic.rb rename to integration/apps/sinatra2-modular/app/basic.rb diff --git a/integration/apps/sinatra2_modular/app/health.rb b/integration/apps/sinatra2-modular/app/health.rb similarity index 100% rename from integration/apps/sinatra2_modular/app/health.rb rename to integration/apps/sinatra2-modular/app/health.rb diff --git a/integration/apps/sinatra2_modular/bin/run b/integration/apps/sinatra2-modular/bin/run similarity index 100% rename from integration/apps/sinatra2_modular/bin/run rename to integration/apps/sinatra2-modular/bin/run diff --git a/integration/apps/sinatra2_modular/bin/setup b/integration/apps/sinatra2-modular/bin/setup similarity index 100% rename from integration/apps/sinatra2_modular/bin/setup rename to integration/apps/sinatra2-modular/bin/setup diff --git a/integration/apps/sinatra2_modular/bin/test b/integration/apps/sinatra2-modular/bin/test similarity index 100% rename from integration/apps/sinatra2_modular/bin/test rename to integration/apps/sinatra2-modular/bin/test diff --git a/integration/apps/sinatra2_modular/config.ru b/integration/apps/sinatra2-modular/config.ru similarity index 100% rename from integration/apps/sinatra2_modular/config.ru rename to integration/apps/sinatra2-modular/config.ru diff --git a/integration/apps/sinatra2_modular/config/puma.rb b/integration/apps/sinatra2-modular/config/puma.rb similarity index 100% rename from integration/apps/sinatra2_modular/config/puma.rb rename to integration/apps/sinatra2-modular/config/puma.rb diff --git a/integration/apps/sinatra2_modular/config/unicorn.rb b/integration/apps/sinatra2-modular/config/unicorn.rb similarity index 100% rename from integration/apps/sinatra2_modular/config/unicorn.rb rename to integration/apps/sinatra2-modular/config/unicorn.rb diff --git a/integration/apps/sinatra2_modular/docker-compose.ci.yml b/integration/apps/sinatra2-modular/docker-compose.ci.yml similarity index 100% rename from integration/apps/sinatra2_modular/docker-compose.ci.yml rename to integration/apps/sinatra2-modular/docker-compose.ci.yml diff --git a/integration/apps/sinatra2_modular/docker-compose.yml b/integration/apps/sinatra2-modular/docker-compose.yml similarity index 100% rename from integration/apps/sinatra2_modular/docker-compose.yml rename to integration/apps/sinatra2-modular/docker-compose.yml diff --git a/integration/apps/sinatra2_modular/script/build-images b/integration/apps/sinatra2-modular/script/build-images similarity index 100% rename from integration/apps/sinatra2_modular/script/build-images rename to integration/apps/sinatra2-modular/script/build-images diff --git a/integration/apps/sinatra2_modular/script/ci b/integration/apps/sinatra2-modular/script/ci similarity index 100% rename from integration/apps/sinatra2_modular/script/ci rename to integration/apps/sinatra2-modular/script/ci diff --git a/integration/apps/sinatra2_modular/spec/integration/basic_spec.rb b/integration/apps/sinatra2-modular/spec/integration/basic_spec.rb similarity index 100% rename from integration/apps/sinatra2_modular/spec/integration/basic_spec.rb rename to integration/apps/sinatra2-modular/spec/integration/basic_spec.rb diff --git a/integration/apps/sinatra2_modular/spec/spec_helper.rb b/integration/apps/sinatra2-modular/spec/spec_helper.rb similarity index 100% rename from integration/apps/sinatra2_modular/spec/spec_helper.rb rename to integration/apps/sinatra2-modular/spec/spec_helper.rb diff --git a/integration/apps/sinatra2_modular/spec/support/integration_helper.rb b/integration/apps/sinatra2-modular/spec/support/integration_helper.rb similarity index 100% rename from integration/apps/sinatra2_modular/spec/support/integration_helper.rb rename to integration/apps/sinatra2-modular/spec/support/integration_helper.rb From 2a54b556acc30e740ae632a9ae369c1b0946d2f5 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 21 Jul 2022 14:53:28 -0700 Subject: [PATCH 0281/2133] Rake:Require instrumented task list --- docs/GettingStarted.md | 11 +++++-- .../contrib/rake/configuration/settings.rb | 15 +++++++++ .../tracing/contrib/rake/instrumentation.rb | 10 ++++-- .../contrib/rake/instrumentation_spec.rb | 33 +++++++++++++++++-- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 677e25ece82..ffc72bd4f80 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1600,7 +1600,13 @@ Where `options` is an optional `Hash` that accepts the following parameters: ### Rake -You can add instrumentation around your Rake tasks by activating the `rake` integration. Each task and its subsequent subtasks will be traced. +You can add instrumentation around your Rake tasks by activating the `rake` integration and +providing a list of what Rake tasks need to be instrumented. + +**Avoid instrumenting long-running Rake tasks, as such tasks can aggregate large traces in +memory that are never flushed until the task finishes.** + +For long-running tasks, use [Manual instrumentation](#manual-instrumentation) around recurring code paths. To activate Rake task tracing, add the following to your `Rakefile`: @@ -1610,7 +1616,7 @@ require 'rake' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :rake, options + c.tracing.instrument :rake, tasks: ['my_task'], **options end task :my_task do @@ -1627,6 +1633,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | `enabled` | Defines whether Rake tasks should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` | | `quantize` | Hash containing options for quantization of task arguments. See below for more details and examples. | `{}` | | `service_name` | Service name used for `rake` instrumentation | `'rake'` | +| `tasks` | Names of the Rake tasks to instrument | `[]` | **Configuring task quantization behavior** diff --git a/lib/datadog/tracing/contrib/rake/configuration/settings.rb b/lib/datadog/tracing/contrib/rake/configuration/settings.rb index 76f315427d1..c80e18f984c 100644 --- a/lib/datadog/tracing/contrib/rake/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rake/configuration/settings.rb @@ -1,5 +1,7 @@ # typed: false +require 'set' + require 'datadog/tracing/contrib/configuration/settings' require 'datadog/tracing/contrib/rake/ext' @@ -28,6 +30,19 @@ class Settings < Contrib::Configuration::Settings option :quantize, default: {} option :service_name + + # A list of rake tasks, using their string names, to be instrumented. + # An empty list, or not setting this option means no task is instrumented. + # Automatically instrumenting all Rake tasks can lead to long-running tasks + # causing undue memory accumulation, as the trace for such tasks is never flushed. + option :tasks do |o| + o.default { [] } + o.lazy + o.on_set do |value| + # DEV: It should be possible to modify the value after it's set. E.g. for normalization. + options[:tasks].instance_variable_set(:@value, value.map(&:to_s).to_set) + end + end end end end diff --git a/lib/datadog/tracing/contrib/rake/instrumentation.rb b/lib/datadog/tracing/contrib/rake/instrumentation.rb index d7bc168bd69..2b504a9497a 100644 --- a/lib/datadog/tracing/contrib/rake/instrumentation.rb +++ b/lib/datadog/tracing/contrib/rake/instrumentation.rb @@ -19,7 +19,7 @@ def self.included(base) # Instance methods for Rake instrumentation module InstanceMethods def invoke(*args) - return super unless enabled? + return super if !enabled? || !instrumented_task? Tracing.trace(Ext::SPAN_INVOKE, **span_options) do |span| annotate_invoke!(span, args) @@ -30,7 +30,7 @@ def invoke(*args) end def execute(args = nil) - return super unless enabled? + return super if !enabled? || !instrumented_task? Tracing.trace(Ext::SPAN_EXECUTE, **span_options) do |span| annotate_execute!(span, args) @@ -42,6 +42,12 @@ def execute(args = nil) private + # Task names are verified dynamically, in order to be agnostic of + # when tracing is configured in relation to Rake task declaration. + def instrumented_task? + configuration[:tasks].include?(name) + end + def shutdown_tracer! Tracing.shutdown! if Tracing.active_span.nil? && ::Rake.application.top_level_tasks.include?(name) end diff --git a/spec/datadog/tracing/contrib/rake/instrumentation_spec.rb b/spec/datadog/tracing/contrib/rake/instrumentation_spec.rb index 1d02d2e89dc..23db786657a 100644 --- a/spec/datadog/tracing/contrib/rake/instrumentation_spec.rb +++ b/spec/datadog/tracing/contrib/rake/instrumentation_spec.rb @@ -10,8 +10,9 @@ require 'datadog/tracing/contrib/rake/patcher' RSpec.describe Datadog::Tracing::Contrib::Rake::Instrumentation do - let(:configuration_options) { { enabled: true } } + let(:configuration_options) { { enabled: true, tasks: instrumented_task_names } } let(:task_name) { :test_rake_instrumentation } + let(:instrumented_task_names) { [task_name] } let(:task_body) { proc { |task, args| spy.call(task, args) } } let(:task_arg_names) { [] } let(:task_class) do @@ -65,7 +66,7 @@ def reset_task!(task_name) before do ::Rake.application.instance_variable_set(:@top_level_tasks, [task_name.to_s]) - expect(tracer).to receive(:shutdown!).with(no_args).once.and_call_original + expect(Datadog::Tracing).to receive(:shutdown!).once.and_call_original end let(:invoke_span) { spans.find { |s| s.name == Datadog::Tracing::Contrib::Rake::Ext::SPAN_INVOKE } } @@ -273,6 +274,7 @@ def reset_task!(task_name) context 'with a prerequisite task' do let(:prerequisite_task_name) { :test_rake_instrumentation_prerequisite } + let(:instrumented_task_names) { [task_name, prerequisite_task_name] } let(:prerequisite_task_execute_span) do spans.find do |s| s.name == Datadog::Tracing::Contrib::Rake::Ext::SPAN_EXECUTE \ @@ -391,9 +393,36 @@ def reset_task!(task_name) Datadog.configure { |c| c.tracing.enabled = false } expect(Datadog.logger).to_not receive(:error) expect(Datadog::Tracing).to_not receive(:trace) + expect(Datadog::Tracing).to receive(:shutdown!).once.and_call_original expect(spy).to receive(:call) end + it 'returns task return value' do + allow(spy).to receive(:call) + expect(invoke).to contain_exactly(task_body) + end + + it 'runs the task without tracing' do + expect { invoke }.to_not raise_error + expect(spans.length).to eq(0) + end + end + + context 'with no instrumented tasks configured' do + let(:instrumented_task_names) { [] } + + before do + expect(Datadog.logger).to_not receive(:error) + expect(Datadog::Tracing).to_not receive(:trace) + expect(Datadog::Tracing).to receive(:shutdown!).once.and_call_original + expect(spy).to receive(:call) + end + + it 'returns task return value' do + allow(spy).to receive(:call) + expect(invoke).to contain_exactly(task_body) + end + it 'runs the task without tracing' do expect { invoke }.to_not raise_error expect(spans.length).to eq(0) From 8ddac5c7ac038b056b380e6ff8550152c4ff053b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 22 Jul 2022 08:30:15 +0100 Subject: [PATCH 0282/2133] Bump mysql image used for testing for improved arm64 compatibility This is a follow-up to #2171. According to @TonyCTHsu this version works well on arm64, and it still seems to work fine on all Ruby versions in CI, so this is more of a "why not" change. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 10c78026e21..4effb8bfb7a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -581,7 +581,7 @@ services: ports: - "${TEST_MONGODB_PORT}:27017" mysql: - image: mysql:5.6 + image: mysql:8 platform: linux/x86_64 environment: - MYSQL_DATABASE=$TEST_MYSQL_DB From 8a12f865083f83aba3d39e822232902bbebee8d8 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 22 Jul 2022 09:36:46 +0100 Subject: [PATCH 0283/2133] Remove forced platform definition on mysql mongo image This image supports both x86-64 as well as arm64, so we don't need the platform definition since emulation is not required. --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4effb8bfb7a..f5c36a75f46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -582,7 +582,6 @@ services: - "${TEST_MONGODB_PORT}:27017" mysql: image: mysql:8 - platform: linux/x86_64 environment: - MYSQL_DATABASE=$TEST_MYSQL_DB - MYSQL_ROOT_PASSWORD=$TEST_MYSQL_ROOT_PASSWORD From 711eba6d06ffbc02a75774bbc548db62214d2027 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Fri, 22 Jul 2022 09:46:19 -0400 Subject: [PATCH 0284/2133] Add internal tracing to Sidekiq / DelayedJob (#2170) * Add additional internal tracing for sidekiq redis_info, scheduled_poller_wait, stop * Check for stop span after execution * Add tracing for dj server internals * fixup! Add tracing for dj server internals * Modify tests for sidekiq * Call launcher stop in sidekiq test helper --- .../tracing/contrib/delayed_job/ext.rb | 2 + .../tracing/contrib/delayed_job/patcher.rb | 6 +++ .../server_internal_tracer/worker.rb | 32 +++++++++++ lib/datadog/tracing/contrib/sidekiq/ext.rb | 6 +++ .../tracing/contrib/sidekiq/patcher.rb | 11 +++- .../server_internal_tracer/heartbeat.rb | 20 ++++++- .../{scheduled_push.rb => redis_info.rb} | 11 ++-- .../scheduled_poller.rb | 53 +++++++++++++++++++ .../contrib/delayed_job/plugin_spec.rb | 28 ++++++++++ .../tracing/contrib/sidekiq/patcher_spec.rb | 1 + .../server_internal_tracer/heartbeat_spec.rb | 22 +++++++- .../server_internal_tracer/job_fetch_spec.rb | 2 +- .../server_internal_tracer/redis_info_spec.rb | 30 +++++++++++ ...duled_push_spec.rb => scheduled_poller.rb} | 16 +++++- .../tracing/contrib/sidekiq/support/helper.rb | 18 +++++++ 15 files changed, 245 insertions(+), 13 deletions(-) create mode 100644 lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb rename lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/{scheduled_push.rb => redis_info.rb} (67%) create mode 100644 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb create mode 100644 spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info_spec.rb rename spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/{scheduled_push_spec.rb => scheduled_poller.rb} (63%) diff --git a/lib/datadog/tracing/contrib/delayed_job/ext.rb b/lib/datadog/tracing/contrib/delayed_job/ext.rb index 58af84fc309..69894c321f4 100644 --- a/lib/datadog/tracing/contrib/delayed_job/ext.rb +++ b/lib/datadog/tracing/contrib/delayed_job/ext.rb @@ -12,6 +12,7 @@ module Ext ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze SPAN_JOB = 'delayed_job'.freeze SPAN_ENQUEUE = 'delayed_job.enqueue'.freeze + SPAN_RESERVE_JOB = 'delayed_job.reserve_job'.freeze TAG_ATTEMPTS = 'delayed_job.attempts'.freeze TAG_ID = 'delayed_job.id'.freeze TAG_PRIORITY = 'delayed_job.priority'.freeze @@ -19,6 +20,7 @@ module Ext TAG_COMPONENT = 'delayed_job'.freeze TAG_OPERATION_ENQUEUE = 'enqueue'.freeze TAG_OPERATION_JOB = 'job'.freeze + TAG_OPERATION_RESERVE_JOB = 'reserve_job'.freeze end end end diff --git a/lib/datadog/tracing/contrib/delayed_job/patcher.rb b/lib/datadog/tracing/contrib/delayed_job/patcher.rb index 8ba48436ae6..5292776461a 100644 --- a/lib/datadog/tracing/contrib/delayed_job/patcher.rb +++ b/lib/datadog/tracing/contrib/delayed_job/patcher.rb @@ -19,11 +19,17 @@ def target_version def patch require 'datadog/tracing/contrib/delayed_job/plugin' add_instrumentation(::Delayed::Worker) + patch_server_internals end def add_instrumentation(klass) klass.plugins << Plugin end + + def patch_server_internals + require 'datadog/tracing/contrib/delayed_job/server_internal_tracer/worker' + ::Delayed::Worker.prepend(ServerInternalTracer::Worker) + end end end end diff --git a/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb b/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb new file mode 100644 index 00000000000..d97d088bc59 --- /dev/null +++ b/lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb @@ -0,0 +1,32 @@ +# typed: true + +module Datadog + module Tracing + module Contrib + module DelayedJob + module ServerInternalTracer + # Trace when DelayedJob looks for a new job to work on + module Worker + def reserve_job + configuration = Datadog.configuration.tracing[:delayed_job] + + Datadog::Tracing.trace(Ext::SPAN_RESERVE_JOB, service: configuration[:service_name]) do |span| + span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER + + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_RESERVE_JOB) + + # Set analytics sample rate + if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) + end + + super + end + end + end + end + end + end + end +end diff --git a/lib/datadog/tracing/contrib/sidekiq/ext.rb b/lib/datadog/tracing/contrib/sidekiq/ext.rb index db1261c8000..1cdb0e7a774 100644 --- a/lib/datadog/tracing/contrib/sidekiq/ext.rb +++ b/lib/datadog/tracing/contrib/sidekiq/ext.rb @@ -16,8 +16,11 @@ module Ext SPAN_PUSH = 'sidekiq.push'.freeze SPAN_JOB = 'sidekiq.job'.freeze SPAN_JOB_FETCH = 'sidekiq.job_fetch'.freeze + SPAN_REDIS_INFO = 'sidekiq.redis_info'.freeze SPAN_HEARTBEAT = 'sidekiq.heartbeat'.freeze SPAN_SCHEDULED_PUSH = 'sidekiq.scheduled_push'.freeze + SPAN_SCHEDULED_WAIT = 'sidekiq.scheduled_poller_wait'.freeze + SPAN_STOP = 'sidekiq.stop'.freeze TAG_JOB_DELAY = 'sidekiq.job.delay'.freeze TAG_JOB_ID = 'sidekiq.job.id'.freeze TAG_JOB_QUEUE = 'sidekiq.job.queue'.freeze @@ -29,8 +32,11 @@ module Ext TAG_OPERATION_PUSH = 'push'.freeze TAG_OPERATION_JOB = 'job'.freeze TAG_OPERATION_JOB_FETCH = 'job_fetch'.freeze + TAG_OPERATION_REDIS_INFO = 'redis_info'.freeze TAG_OPERATION_HEARTBEAT = 'heartbeat'.freeze TAG_OPERATION_SCHEDULED_PUSH = 'scheduled_push'.freeze + TAG_OPERATION_SCHEDULED_WAIT = 'scheduled_poller_wait'.freeze + TAG_OPERATION_STOP = 'stop'.freeze end end end diff --git a/lib/datadog/tracing/contrib/sidekiq/patcher.rb b/lib/datadog/tracing/contrib/sidekiq/patcher.rb index 80611a46b60..3df410605b7 100644 --- a/lib/datadog/tracing/contrib/sidekiq/patcher.rb +++ b/lib/datadog/tracing/contrib/sidekiq/patcher.rb @@ -45,6 +45,7 @@ def patch_server_internals patch_server_heartbeat patch_server_job_fetch patch_server_scheduled_push + patch_redis_info end def patch_server_heartbeat @@ -60,9 +61,15 @@ def patch_server_job_fetch end def patch_server_scheduled_push - require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push' + require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller' - ::Sidekiq::Scheduled::Poller.prepend(ServerInternalTracer::ScheduledPush) + ::Sidekiq::Scheduled::Poller.prepend(ServerInternalTracer::ScheduledPoller) + end + + def patch_redis_info + require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info' + + ::Sidekiq.singleton_class.prepend(ServerInternalTracer::RedisInfo) end end end diff --git a/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb index 96112718d00..02f06d93a4f 100644 --- a/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb +++ b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb @@ -7,9 +7,27 @@ module Sidekiq module ServerInternalTracer # Trace when a Sidekiq process has a heartbeat module Heartbeat + def stop + configuration = Datadog.configuration.tracing[:sidekiq] + + Datadog::Tracing.trace(Ext::SPAN_STOP, service: configuration[:service_name]) do |span| + span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER + + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_STOP) + + # Set analytics sample rate + if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) + end + + super + end + end + private - def ❤ # rubocop:disable Naming/AsciiIdentifiers, Naming/MethodName + def heartbeat configuration = Datadog.configuration.tracing[:sidekiq] Datadog::Tracing.trace(Ext::SPAN_HEARTBEAT, service: configuration[:service_name]) do |span| diff --git a/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push.rb b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb similarity index 67% rename from lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push.rb rename to lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb index 28da6d1fcac..2a43947323e 100644 --- a/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push.rb +++ b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb @@ -5,17 +5,16 @@ module Tracing module Contrib module Sidekiq module ServerInternalTracer - # Trace when Sidekiq checks to see if there are scheduled jobs that need to be worked - # https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs - module ScheduledPush - def enqueue + # Trace when Sidekiq gets Redis info on startup + module RedisInfo + def redis_info configuration = Datadog.configuration.tracing[:sidekiq] - Datadog::Tracing.trace(Ext::SPAN_SCHEDULED_PUSH, service: configuration[:service_name]) do |span| + Datadog::Tracing.trace(Ext::SPAN_REDIS_INFO, service: configuration[:service_name]) do |span| span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) - span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_SCHEDULED_PUSH) + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REDIS_INFO) # Set analytics sample rate if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) diff --git a/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb new file mode 100644 index 00000000000..b3d0d0c062c --- /dev/null +++ b/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb @@ -0,0 +1,53 @@ +# typed: true + +module Datadog + module Tracing + module Contrib + module Sidekiq + module ServerInternalTracer + # Trace when Sidekiq checks to see if there are scheduled jobs that need to be worked + # https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs + module ScheduledPoller + def enqueue + configuration = Datadog.configuration.tracing[:sidekiq] + + Datadog::Tracing.trace(Ext::SPAN_SCHEDULED_PUSH, service: configuration[:service_name]) do |span| + span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER + + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_SCHEDULED_PUSH) + + # Set analytics sample rate + if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) + end + + super + end + end + + private + + def wait + configuration = Datadog.configuration.tracing[:sidekiq] + + Datadog::Tracing.trace(Ext::SPAN_SCHEDULED_WAIT, service: configuration[:service_name]) do |span| + span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER + + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) + span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_SCHEDULED_WAIT) + + # Set analytics sample rate + if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) + Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) + end + + super + end + end + end + end + end + end + end +end diff --git a/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb b/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb index e3716549797..ba9828fd148 100644 --- a/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb +++ b/spec/datadog/tracing/contrib/delayed_job/plugin_spec.rb @@ -212,5 +212,33 @@ def perform .to eq(Datadog::Tracing::Contrib::DelayedJob::Ext::TAG_OPERATION_ENQUEUE) end end + + describe 'reserve_job span' do + subject(:span) { fetch_spans.first } + let(:worker) { Delayed::Worker.new } + + before do + worker.send(:reserve_job) + end + + it_behaves_like 'analytics for integration' do + let(:analytics_enabled_var) { Datadog::Tracing::Contrib::DelayedJob::Ext::ENV_ANALYTICS_ENABLED } + let(:analytics_sample_rate_var) { Datadog::Tracing::Contrib::DelayedJob::Ext::ENV_ANALYTICS_SAMPLE_RATE } + end + + it_behaves_like 'measured span for integration', false + + it 'has default service name' do + expect(span.service).to eq(tracer.default_service) + end + + it 'has reserve job components and operation tags' do + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) + .to eq(Datadog::Tracing::Contrib::DelayedJob::Ext::TAG_COMPONENT) + + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) + .to eq(Datadog::Tracing::Contrib::DelayedJob::Ext::TAG_OPERATION_RESERVE_JOB) + end + end end end diff --git a/spec/datadog/tracing/contrib/sidekiq/patcher_spec.rb b/spec/datadog/tracing/contrib/sidekiq/patcher_spec.rb index 95b5b6a0d99..c1671a17a12 100644 --- a/spec/datadog/tracing/contrib/sidekiq/patcher_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/patcher_spec.rb @@ -19,6 +19,7 @@ stub_const('Sidekiq::Launcher', Class.new) stub_const('Sidekiq::Processor', Class.new) stub_const('Sidekiq::Scheduled::Poller', Class.new) + stub_const('Sidekiq::ServerInternalTracer::RedisInfo', Class.new) # NB: This is needed because we want to patch multiple times. if described_class.instance_variable_get(:@patch_only_once) diff --git a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat_spec.rb b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat_spec.rb index 3074a22332b..78cf8fef29d 100644 --- a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat_spec.rb @@ -3,12 +3,12 @@ require 'datadog/tracing/contrib/support/spec_helper' require_relative '../support/helper' -RSpec.describe 'Server internal tracer' do +RSpec.describe 'Server internal tracer heartbeat' do include SidekiqServerExpectations before do unless Datadog::Tracing::Contrib::Sidekiq::Integration.compatible_with_server_internal_tracing? - skip 'Sidekiq internal server tracing is not support on this version.' + skip 'Sidekiq internal server tracing is not supported on this version.' end skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) @@ -27,4 +27,22 @@ expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('heartbeat') end end + + context 'traces the stop command' do + before do + run_sidekiq_server + end + + it do + span = spans.find { |s| s.name == 'sidekiq.stop' } + + expect(span.service).to eq(tracer.default_service) + expect(span.name).to eq('sidekiq.stop') + expect(span.span_type).to eq('worker') + expect(span.resource).to eq('sidekiq.stop') + expect(span).to_not have_error + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('sidekiq') + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('stop') + end + end end diff --git a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch_spec.rb b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch_spec.rb index ebcf28de0ab..e3091e0c875 100644 --- a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch_spec.rb @@ -8,7 +8,7 @@ before do unless Datadog::Tracing::Contrib::Sidekiq::Integration.compatible_with_server_internal_tracing? - skip 'Sidekiq internal server tracing is not support on this version.' + skip 'Sidekiq internal server tracing is not supported on this version.' end skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) diff --git a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info_spec.rb b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info_spec.rb new file mode 100644 index 00000000000..fadbb445f68 --- /dev/null +++ b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info_spec.rb @@ -0,0 +1,30 @@ +# typed: ignore + +require 'datadog/tracing/contrib/support/spec_helper' +require_relative '../support/helper' + +RSpec.describe 'Server internal tracer' do + include SidekiqServerExpectations + + before do + unless Datadog::Tracing::Contrib::Sidekiq::Integration.compatible_with_server_internal_tracing? + skip 'Sidekiq internal server tracing is not supported on this version.' + end + + skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) + end + + it 'traces the redis info command' do + expect_in_sidekiq_server do + span = spans.find { |s| s.service == tracer.default_service && s.name == 'sidekiq.redis_info' } + + expect(span.service).to eq(tracer.default_service) + expect(span.name).to eq('sidekiq.redis_info') + expect(span.span_type).to eq('worker') + expect(span.resource).to eq('sidekiq.redis_info') + expect(span).to_not have_error + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('sidekiq') + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('redis_info') + end + end +end diff --git a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push_spec.rb b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb similarity index 63% rename from spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push_spec.rb rename to spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb index 40897ebc27b..6b3b75a3ee8 100644 --- a/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push_spec.rb +++ b/spec/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb @@ -8,7 +8,7 @@ before do unless Datadog::Tracing::Contrib::Sidekiq::Integration.compatible_with_server_internal_tracing? - skip 'Sidekiq internal server tracing is not support on this version.' + skip 'Sidekiq internal server tracing is not supported on this version.' end skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) @@ -36,4 +36,18 @@ expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('scheduled_push') end end + + it 'traces the looping scheduled wait' do + expect_in_sidekiq_server(duration: 6) do + span = spans.find { |s| s.service == tracer.default_service && s.name == 'sidekiq.scheduled_poller_wait' } + + expect(span.service).to eq(tracer.default_service) + expect(span.name).to eq('sidekiq.scheduled_poller_wait') + expect(span.span_type).to eq('worker') + expect(span.resource).to eq('sidekiq.scheduled_poller_wait') + expect(span).to_not have_error + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('sidekiq') + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('scheduled_poller_wait') + end + end end diff --git a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb index 8a1f1e7c729..a08bcda07f7 100644 --- a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb +++ b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb @@ -92,4 +92,22 @@ def expect_in_sidekiq_server(duration: 2, &expectations) app_tempfile.close app_tempfile.unlink end + + def run_sidekiq_server + app_tempfile = Tempfile.new(['sidekiq-server-app', '.rb']) + + require 'sidekiq/cli' + + configure_sidekiq + # binding.pry + + cli = Sidekiq::CLI.instance + cli.parse(['--require', app_tempfile.path]) # boot the "app" + launcher = Sidekiq::Launcher.new(cli.send(:options)) + launcher.stop + exit + ensure + app_tempfile.close + app_tempfile.unlink + end end From f41adb26a670bd46f9f63f595a952c9df35dfa3d Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:55:43 -0400 Subject: [PATCH 0285/2133] Remove cache_service, database_service from rails options --- docs/GettingStarted.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 677e25ece82..132bdd2e8dc 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1577,8 +1577,6 @@ Where `options` is an optional `Hash` that accepts the following parameters: | Key | Description | Default | | --- | ----------- | ------- | -| `cache_service` | Cache service name used when tracing cache activity | `'-cache'` | -| `database_service` | Database service name used when tracing database activity | `'-'` | | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` | | `request_queuing` | Track HTTP request time spent in the queue of the frontend server. See [HTTP request queuing](#http-request-queuing) for setup details. Set to `true` to enable. | `false` | | `exception_controller` | Class or Module which identifies a custom exception controller class. Tracer provides improved error behavior when it can identify custom exception controllers. By default, without this option, it 'guesses' what a custom exception controller looks like. Providing this option aids this identification. | `nil` | From 509e07442f2b09df436be2263cc3da516e5e2f1d Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 22 Jul 2022 17:44:03 -0700 Subject: [PATCH 0286/2133] Convert require to require_relative in lib --- lib/datadog/appsec.rb | 10 +- lib/datadog/appsec/autoload.rb | 4 +- lib/datadog/appsec/configuration.rb | 2 +- lib/datadog/appsec/contrib/auto_instrument.rb | 2 +- .../appsec/contrib/configuration/settings.rb | 2 +- .../contrib/rack/configuration/settings.rb | 4 +- .../appsec/contrib/rack/gateway/watcher.rb | 12 +-- .../appsec/contrib/rack/integration.rb | 10 +- lib/datadog/appsec/contrib/rack/patcher.rb | 4 +- .../appsec/contrib/rack/reactive/request.rb | 2 +- .../contrib/rack/reactive/request_body.rb | 2 +- .../appsec/contrib/rack/reactive/response.rb | 2 +- .../contrib/rack/request_body_middleware.rb | 4 +- .../appsec/contrib/rack/request_middleware.rb | 6 +- .../contrib/rails/configuration/settings.rb | 4 +- .../appsec/contrib/rails/gateway/watcher.rb | 8 +- .../appsec/contrib/rails/integration.rb | 8 +- lib/datadog/appsec/contrib/rails/patcher.rb | 14 +-- .../appsec/contrib/rails/reactive/action.rb | 2 +- .../contrib/sinatra/configuration/settings.rb | 4 +- .../appsec/contrib/sinatra/gateway/watcher.rb | 10 +- .../appsec/contrib/sinatra/integration.rb | 8 +- lib/datadog/appsec/contrib/sinatra/patcher.rb | 12 +-- lib/datadog/appsec/event.rb | 6 +- lib/datadog/appsec/extensions.rb | 2 +- lib/datadog/appsec/processor.rb | 2 +- lib/datadog/appsec/reactive/engine.rb | 4 +- lib/datadog/appsec/reactive/operation.rb | 2 +- lib/datadog/ci.rb | 12 +-- lib/datadog/ci/configuration/components.rb | 2 +- lib/datadog/ci/configuration/settings.rb | 2 +- .../cucumber/configuration/settings.rb | 4 +- lib/datadog/ci/contrib/cucumber/formatter.rb | 10 +- .../ci/contrib/cucumber/instrumentation.rb | 2 +- .../ci/contrib/cucumber/integration.rb | 6 +- lib/datadog/ci/contrib/cucumber/patcher.rb | 4 +- .../contrib/rspec/configuration/settings.rb | 4 +- lib/datadog/ci/contrib/rspec/example.rb | 10 +- lib/datadog/ci/contrib/rspec/integration.rb | 6 +- lib/datadog/ci/contrib/rspec/patcher.rb | 4 +- lib/datadog/ci/ext/environment.rb | 2 +- lib/datadog/ci/extensions.rb | 8 +- lib/datadog/ci/flush.rb | 4 +- lib/datadog/ci/test.rb | 6 +- lib/datadog/core.rb | 100 +++++++++--------- lib/datadog/core/buffer/cruby.rb | 2 +- lib/datadog/core/buffer/thread_safe.rb | 2 +- lib/datadog/core/configuration.rb | 8 +- .../configuration/agent_settings_resolver.rb | 6 +- lib/datadog/core/configuration/base.rb | 4 +- lib/datadog/core/configuration/components.rb | 22 ++-- .../core/configuration/option_definition.rb | 2 +- .../configuration/option_definition_set.rb | 2 +- lib/datadog/core/configuration/options.rb | 6 +- lib/datadog/core/configuration/settings.rb | 10 +- lib/datadog/core/diagnostics/health.rb | 4 +- lib/datadog/core/environment/cgroup.rb | 2 +- lib/datadog/core/environment/container.rb | 2 +- lib/datadog/core/environment/ext.rb | 2 +- lib/datadog/core/environment/identity.rb | 4 +- lib/datadog/core/environment/platform.rb | 2 +- lib/datadog/core/environment/socket.rb | 2 +- lib/datadog/core/error.rb | 2 +- lib/datadog/core/extensions.rb | 2 +- lib/datadog/core/metrics/client.rb | 16 +-- lib/datadog/core/metrics/options.rb | 6 +- lib/datadog/core/runtime/metrics.rb | 12 +-- lib/datadog/core/utils.rb | 4 +- lib/datadog/core/utils/object_set.rb | 2 +- lib/datadog/core/utils/string_table.rb | 2 +- .../multipart/post/multipartable.rb | 4 +- .../multipart-post/net/http/post/multipart.rb | 6 +- lib/datadog/core/workers/async.rb | 2 +- lib/datadog/core/workers/polling.rb | 4 +- lib/datadog/core/workers/runtime_metrics.rb | 8 +- lib/datadog/kit.rb | 2 +- lib/datadog/opentracer.rb | 32 +++--- lib/datadog/opentracer/distributed_headers.rb | 4 +- lib/datadog/opentracer/rack_propagator.rb | 10 +- lib/datadog/opentracer/span.rb | 2 +- lib/datadog/opentracer/text_map_propagator.rb | 8 +- .../opentracer/thread_local_scope_manager.rb | 2 +- lib/datadog/opentracer/tracer.rb | 4 +- lib/datadog/profiling.rb | 40 +++---- lib/datadog/profiling/buffer.rb | 6 +- lib/datadog/profiling/collectors/old_stack.rb | 14 +-- lib/datadog/profiling/encoding/profile.rb | 2 +- lib/datadog/profiling/events/stack.rb | 2 +- lib/datadog/profiling/exporter.rb | 6 +- lib/datadog/profiling/flush.rb | 4 +- lib/datadog/profiling/old_recorder.rb | 4 +- lib/datadog/profiling/pprof/builder.rb | 8 +- lib/datadog/profiling/pprof/converter.rb | 2 +- lib/datadog/profiling/pprof/message_set.rb | 2 +- lib/datadog/profiling/pprof/stack_sample.rb | 8 +- lib/datadog/profiling/pprof/string_table.rb | 2 +- lib/datadog/profiling/pprof/template.rb | 10 +- lib/datadog/profiling/preload.rb | 2 +- lib/datadog/profiling/scheduler.rb | 6 +- lib/datadog/profiling/tag_builder.rb | 2 +- lib/datadog/profiling/tasks/setup.rb | 4 +- .../profiling/trace_identifiers/ddtrace.rb | 4 +- .../profiling/trace_identifiers/helper.rb | 2 +- lib/datadog/profiling/transport/http.rb | 18 ++-- lib/datadog/profiling/transport/http/api.rb | 10 +- .../profiling/transport/http/api/endpoint.rb | 10 +- .../profiling/transport/http/api/instance.rb | 4 +- .../profiling/transport/http/api/spec.rb | 2 +- .../profiling/transport/http/builder.rb | 6 +- .../profiling/transport/http/client.rb | 4 +- .../profiling/transport/http/response.rb | 2 +- lib/datadog/tracing.rb | 4 +- lib/datadog/tracing/analytics.rb | 2 +- lib/datadog/tracing/buffer.rb | 10 +- lib/datadog/tracing/context.rb | 2 +- lib/datadog/tracing/context_provider.rb | 4 +- lib/datadog/tracing/contrib.rb | 96 ++++++++--------- .../action_cable/configuration/settings.rb | 4 +- .../tracing/contrib/action_cable/event.rb | 10 +- .../tracing/contrib/action_cable/events.rb | 8 +- .../contrib/action_cable/events/broadcast.rb | 8 +- .../action_cable/events/perform_action.rb | 6 +- .../contrib/action_cable/events/transmit.rb | 8 +- .../contrib/action_cable/instrumentation.rb | 8 +- .../contrib/action_cable/integration.rb | 8 +- .../tracing/contrib/action_cable/patcher.rb | 8 +- .../action_mailer/configuration/settings.rb | 4 +- .../tracing/contrib/action_mailer/event.rb | 6 +- .../tracing/contrib/action_mailer/events.rb | 4 +- .../contrib/action_mailer/events/deliver.rb | 6 +- .../contrib/action_mailer/events/process.rb | 6 +- .../contrib/action_mailer/integration.rb | 8 +- .../tracing/contrib/action_mailer/patcher.rb | 6 +- .../action_controller/instrumentation.rb | 12 +-- .../action_pack/action_controller/patcher.rb | 4 +- .../action_pack/configuration/settings.rb | 4 +- .../contrib/action_pack/integration.rb | 8 +- .../tracing/contrib/action_pack/patcher.rb | 4 +- .../tracing/contrib/action_pack/utils.rb | 2 +- .../action_view/configuration/settings.rb | 4 +- .../tracing/contrib/action_view/event.rb | 2 +- .../tracing/contrib/action_view/events.rb | 4 +- .../action_view/events/render_partial.rb | 10 +- .../action_view/events/render_template.rb | 10 +- .../instrumentation/partial_renderer.rb | 4 +- .../instrumentation/template_renderer.rb | 4 +- .../contrib/action_view/integration.rb | 8 +- .../tracing/contrib/action_view/patcher.rb | 14 +-- .../tracing/contrib/action_view/utils.rb | 2 +- .../active_job/configuration/settings.rb | 6 +- .../tracing/contrib/active_job/event.rb | 6 +- .../tracing/contrib/active_job/events.rb | 12 +-- .../contrib/active_job/events/discard.rb | 8 +- .../contrib/active_job/events/enqueue.rb | 8 +- .../contrib/active_job/events/enqueue_at.rb | 8 +- .../active_job/events/enqueue_retry.rb | 8 +- .../contrib/active_job/events/perform.rb | 8 +- .../active_job/events/retry_stopped.rb | 8 +- .../tracing/contrib/active_job/integration.rb | 8 +- .../contrib/active_job/log_injection.rb | 2 +- .../tracing/contrib/active_job/patcher.rb | 8 +- .../configuration/settings.rb | 4 +- .../contrib/active_model_serializers/event.rb | 10 +- .../active_model_serializers/events.rb | 4 +- .../active_model_serializers/events/render.rb | 6 +- .../events/serialize.rb | 4 +- .../active_model_serializers/integration.rb | 6 +- .../active_model_serializers/patcher.rb | 8 +- .../active_record/configuration/resolver.rb | 4 +- .../active_record/configuration/settings.rb | 6 +- .../tracing/contrib/active_record/event.rb | 2 +- .../tracing/contrib/active_record/events.rb | 4 +- .../active_record/events/instantiation.rb | 8 +- .../contrib/active_record/events/sql.rb | 12 +-- .../contrib/active_record/integration.rb | 12 +-- .../tracing/contrib/active_record/patcher.rb | 4 +- .../tracing/contrib/active_record/utils.rb | 4 +- .../active_support/cache/instrumentation.rb | 6 +- .../contrib/active_support/cache/patcher.rb | 4 +- .../contrib/active_support/cache/redis.rb | 2 +- .../active_support/configuration/settings.rb | 4 +- .../contrib/active_support/integration.rb | 10 +- .../active_support/notifications/event.rb | 2 +- .../notifications/subscriber.rb | 2 +- .../tracing/contrib/active_support/patcher.rb | 4 +- lib/datadog/tracing/contrib/analytics.rb | 2 +- .../tracing/contrib/auto_instrument.rb | 8 +- .../contrib/aws/configuration/settings.rb | 4 +- .../tracing/contrib/aws/instrumentation.rb | 8 +- .../tracing/contrib/aws/integration.rb | 6 +- lib/datadog/tracing/contrib/aws/patcher.rb | 10 +- .../concurrent_ruby/configuration/settings.rb | 4 +- .../contrib/concurrent_ruby/future_patch.rb | 2 +- .../contrib/concurrent_ruby/integration.rb | 6 +- .../contrib/concurrent_ruby/patcher.rb | 4 +- lib/datadog/tracing/contrib/configurable.rb | 4 +- .../resolvers/pattern_resolver.rb | 2 +- .../tracing/contrib/configuration/settings.rb | 4 +- .../contrib/dalli/configuration/settings.rb | 4 +- .../tracing/contrib/dalli/instrumentation.rb | 10 +- .../tracing/contrib/dalli/integration.rb | 6 +- lib/datadog/tracing/contrib/dalli/patcher.rb | 6 +- lib/datadog/tracing/contrib/dalli/quantize.rb | 2 +- .../delayed_job/configuration/settings.rb | 6 +- .../contrib/delayed_job/integration.rb | 6 +- .../tracing/contrib/delayed_job/patcher.rb | 6 +- .../tracing/contrib/delayed_job/plugin.rb | 8 +- .../elasticsearch/configuration/settings.rb | 4 +- .../contrib/elasticsearch/integration.rb | 6 +- .../tracing/contrib/elasticsearch/patcher.rb | 14 +-- .../tracing/contrib/elasticsearch/quantize.rb | 2 +- .../contrib/ethon/configuration/settings.rb | 4 +- .../tracing/contrib/ethon/easy_patch.rb | 10 +- .../tracing/contrib/ethon/integration.rb | 8 +- .../tracing/contrib/ethon/multi_patch.rb | 8 +- lib/datadog/tracing/contrib/ethon/patcher.rb | 6 +- .../contrib/excon/configuration/settings.rb | 4 +- .../tracing/contrib/excon/integration.rb | 8 +- .../tracing/contrib/excon/middleware.rb | 14 +-- lib/datadog/tracing/contrib/excon/patcher.rb | 4 +- lib/datadog/tracing/contrib/extensions.rb | 2 +- .../contrib/faraday/configuration/settings.rb | 4 +- .../tracing/contrib/faraday/integration.rb | 8 +- .../tracing/contrib/faraday/middleware.rb | 12 +-- .../tracing/contrib/faraday/patcher.rb | 10 +- .../contrib/grape/configuration/settings.rb | 6 +- lib/datadog/tracing/contrib/grape/endpoint.rb | 10 +- .../tracing/contrib/grape/integration.rb | 6 +- lib/datadog/tracing/contrib/grape/patcher.rb | 8 +- .../contrib/graphql/configuration/settings.rb | 4 +- .../tracing/contrib/graphql/integration.rb | 6 +- .../tracing/contrib/graphql/patcher.rb | 6 +- .../contrib/grpc/configuration/settings.rb | 6 +- .../contrib/grpc/datadog_interceptor.rb | 8 +- .../grpc/datadog_interceptor/client.rb | 8 +- .../grpc/datadog_interceptor/server.rb | 12 +-- .../tracing/contrib/grpc/integration.rb | 6 +- lib/datadog/tracing/contrib/grpc/patcher.rb | 10 +- .../tracing/contrib/http/circuit_breaker.rb | 4 +- .../contrib/http/configuration/settings.rb | 4 +- .../tracing/contrib/http/instrumentation.rb | 8 +- .../tracing/contrib/http/integration.rb | 12 +-- lib/datadog/tracing/contrib/http/patcher.rb | 6 +- .../httpclient/configuration/settings.rb | 4 +- .../contrib/httpclient/instrumentation.rb | 10 +- .../tracing/contrib/httpclient/integration.rb | 8 +- .../tracing/contrib/httpclient/patcher.rb | 6 +- .../contrib/httprb/configuration/settings.rb | 4 +- .../tracing/contrib/httprb/instrumentation.rb | 10 +- .../tracing/contrib/httprb/integration.rb | 8 +- lib/datadog/tracing/contrib/httprb/patcher.rb | 6 +- lib/datadog/tracing/contrib/integration.rb | 6 +- .../contrib/kafka/configuration/settings.rb | 4 +- lib/datadog/tracing/contrib/kafka/event.rb | 6 +- lib/datadog/tracing/contrib/kafka/events.rb | 18 ++-- .../kafka/events/connection/request.rb | 4 +- .../kafka/events/consumer/process_batch.rb | 6 +- .../kafka/events/consumer/process_message.rb | 6 +- .../kafka/events/consumer_group/heartbeat.rb | 8 +- .../kafka/events/consumer_group/join_group.rb | 8 +- .../events/consumer_group/leave_group.rb | 8 +- .../kafka/events/consumer_group/sync_group.rb | 8 +- .../events/produce_operation/send_messages.rb | 4 +- .../kafka/events/producer/deliver_messages.rb | 4 +- .../tracing/contrib/kafka/integration.rb | 6 +- lib/datadog/tracing/contrib/kafka/patcher.rb | 6 +- .../contrib/lograge/configuration/settings.rb | 4 +- .../contrib/lograge/instrumentation.rb | 4 +- .../tracing/contrib/lograge/integration.rb | 6 +- .../tracing/contrib/lograge/patcher.rb | 4 +- .../contrib/mongodb/configuration/settings.rb | 4 +- .../contrib/mongodb/instrumentation.rb | 6 +- .../tracing/contrib/mongodb/integration.rb | 8 +- .../tracing/contrib/mongodb/parsers.rb | 2 +- .../tracing/contrib/mongodb/patcher.rb | 6 +- .../tracing/contrib/mongodb/subscribers.rb | 8 +- .../contrib/mysql2/configuration/settings.rb | 4 +- .../tracing/contrib/mysql2/instrumentation.rb | 8 +- .../tracing/contrib/mysql2/integration.rb | 6 +- lib/datadog/tracing/contrib/mysql2/patcher.rb | 4 +- lib/datadog/tracing/contrib/patcher.rb | 4 +- .../contrib/pg/configuration/settings.rb | 4 +- .../tracing/contrib/pg/instrumentation.rb | 8 +- lib/datadog/tracing/contrib/pg/integration.rb | 6 +- lib/datadog/tracing/contrib/pg/patcher.rb | 4 +- .../contrib/presto/configuration/settings.rb | 4 +- .../tracing/contrib/presto/instrumentation.rb | 6 +- .../tracing/contrib/presto/integration.rb | 6 +- lib/datadog/tracing/contrib/presto/patcher.rb | 8 +- .../contrib/qless/configuration/settings.rb | 4 +- .../tracing/contrib/qless/integration.rb | 6 +- lib/datadog/tracing/contrib/qless/patcher.rb | 4 +- .../tracing/contrib/qless/qless_job.rb | 6 +- .../tracing/contrib/qless/tracer_cleaner.rb | 2 +- .../contrib/que/configuration/settings.rb | 6 +- .../tracing/contrib/que/integration.rb | 8 +- lib/datadog/tracing/contrib/que/patcher.rb | 2 +- lib/datadog/tracing/contrib/que/tracer.rb | 2 +- .../contrib/racecar/configuration/settings.rb | 4 +- lib/datadog/tracing/contrib/racecar/event.rb | 10 +- lib/datadog/tracing/contrib/racecar/events.rb | 6 +- .../tracing/contrib/racecar/events/batch.rb | 4 +- .../tracing/contrib/racecar/events/consume.rb | 4 +- .../tracing/contrib/racecar/events/message.rb | 4 +- .../tracing/contrib/racecar/integration.rb | 6 +- .../tracing/contrib/racecar/patcher.rb | 6 +- .../contrib/rack/configuration/settings.rb | 4 +- .../tracing/contrib/rack/integration.rb | 8 +- .../tracing/contrib/rack/middlewares.rb | 16 +-- .../contrib/rails/auto_instrument_railtie.rb | 2 +- .../contrib/rails/configuration/settings.rb | 2 +- .../tracing/contrib/rails/framework.rb | 24 ++--- .../tracing/contrib/rails/integration.rb | 8 +- .../tracing/contrib/rails/log_injection.rb | 2 +- .../tracing/contrib/rails/middlewares.rb | 4 +- lib/datadog/tracing/contrib/rails/patcher.rb | 16 +-- lib/datadog/tracing/contrib/rails/railtie.rb | 6 +- lib/datadog/tracing/contrib/rails/utils.rb | 2 +- .../contrib/rake/configuration/settings.rb | 4 +- .../tracing/contrib/rake/instrumentation.rb | 10 +- .../tracing/contrib/rake/integration.rb | 6 +- lib/datadog/tracing/contrib/rake/patcher.rb | 8 +- .../contrib/redis/configuration/resolver.rb | 2 +- .../contrib/redis/configuration/settings.rb | 4 +- .../tracing/contrib/redis/instrumentation.rb | 12 +-- .../tracing/contrib/redis/integration.rb | 6 +- lib/datadog/tracing/contrib/redis/patcher.rb | 12 +-- lib/datadog/tracing/contrib/redis/tags.rb | 8 +- .../contrib/resque/configuration/settings.rb | 6 +- .../tracing/contrib/resque/integration.rb | 6 +- lib/datadog/tracing/contrib/resque/patcher.rb | 4 +- .../tracing/contrib/resque/resque_job.rb | 8 +- .../rest_client/configuration/settings.rb | 4 +- .../contrib/rest_client/integration.rb | 6 +- .../tracing/contrib/rest_client/patcher.rb | 4 +- .../contrib/rest_client/request_patch.rb | 10 +- .../semantic_logger/configuration/settings.rb | 4 +- .../semantic_logger/instrumentation.rb | 4 +- .../contrib/semantic_logger/integration.rb | 6 +- .../contrib/semantic_logger/patcher.rb | 4 +- .../contrib/sequel/configuration/settings.rb | 4 +- .../tracing/contrib/sequel/database.rb | 10 +- lib/datadog/tracing/contrib/sequel/dataset.rb | 10 +- .../tracing/contrib/sequel/integration.rb | 6 +- lib/datadog/tracing/contrib/sequel/patcher.rb | 6 +- lib/datadog/tracing/contrib/sequel/utils.rb | 4 +- .../shoryuken/configuration/settings.rb | 6 +- .../tracing/contrib/shoryuken/integration.rb | 8 +- .../tracing/contrib/shoryuken/patcher.rb | 2 +- .../tracing/contrib/shoryuken/tracer.rb | 2 +- .../tracing/contrib/sidekiq/client_tracer.rb | 10 +- .../contrib/sidekiq/configuration/settings.rb | 6 +- .../tracing/contrib/sidekiq/integration.rb | 6 +- .../tracing/contrib/sidekiq/patcher.rb | 14 +-- .../tracing/contrib/sidekiq/server_tracer.rb | 12 +-- .../tracing/contrib/sidekiq/tracing.rb | 4 +- .../contrib/sinatra/configuration/settings.rb | 4 +- lib/datadog/tracing/contrib/sinatra/env.rb | 4 +- .../tracing/contrib/sinatra/framework.rb | 2 +- .../tracing/contrib/sinatra/headers.rb | 2 +- .../tracing/contrib/sinatra/integration.rb | 6 +- .../tracing/contrib/sinatra/patcher.rb | 10 +- lib/datadog/tracing/contrib/sinatra/tracer.rb | 16 +-- .../contrib/sinatra/tracer_middleware.rb | 14 +-- .../sneakers/configuration/settings.rb | 4 +- .../tracing/contrib/sneakers/integration.rb | 8 +- .../tracing/contrib/sneakers/patcher.rb | 4 +- .../tracing/contrib/sneakers/tracer.rb | 6 +- .../tracing/contrib/status_code_matcher.rb | 4 +- .../sucker_punch/configuration/settings.rb | 4 +- .../contrib/sucker_punch/instrumentation.rb | 8 +- .../contrib/sucker_punch/integration.rb | 6 +- .../tracing/contrib/sucker_punch/patcher.rb | 10 +- lib/datadog/tracing/correlation.rb | 2 +- lib/datadog/tracing/distributed/headers/b3.rb | 8 +- .../tracing/distributed/headers/b3_single.rb | 8 +- .../tracing/distributed/headers/datadog.rb | 6 +- .../tracing/distributed/headers/parser.rb | 2 +- lib/datadog/tracing/distributed/helpers.rb | 4 +- .../tracing/distributed/metadata/b3.rb | 8 +- .../tracing/distributed/metadata/b3_single.rb | 8 +- .../tracing/distributed/metadata/datadog.rb | 4 +- .../tracing/distributed/metadata/parser.rb | 2 +- lib/datadog/tracing/event.rb | 2 +- lib/datadog/tracing/metadata.rb | 6 +- lib/datadog/tracing/metadata/analytics.rb | 4 +- lib/datadog/tracing/metadata/errors.rb | 4 +- lib/datadog/tracing/metadata/tagging.rb | 4 +- lib/datadog/tracing/pipeline.rb | 6 +- lib/datadog/tracing/pipeline/span_filter.rb | 2 +- lib/datadog/tracing/propagation/grpc.rb | 12 +-- lib/datadog/tracing/propagation/http.rb | 16 +-- lib/datadog/tracing/runtime/metrics.rb | 2 +- lib/datadog/tracing/sampling/all_sampler.rb | 2 +- .../tracing/sampling/priority_sampler.rb | 8 +- .../tracing/sampling/rate_by_key_sampler.rb | 4 +- .../sampling/rate_by_service_sampler.rb | 4 +- lib/datadog/tracing/sampling/rate_limiter.rb | 2 +- lib/datadog/tracing/sampling/rate_sampler.rb | 6 +- lib/datadog/tracing/sampling/rule.rb | 6 +- lib/datadog/tracing/sampling/rule_sampler.rb | 8 +- lib/datadog/tracing/span.rb | 8 +- lib/datadog/tracing/span_operation.rb | 18 ++-- lib/datadog/tracing/sync_writer.rb | 10 +- lib/datadog/tracing/trace_operation.rb | 20 ++-- lib/datadog/tracing/trace_segment.rb | 10 +- lib/datadog/tracing/tracer.rb | 30 +++--- lib/datadog/tracing/workers.rb | 6 +- lib/datadog/tracing/workers/trace_writer.rb | 18 ++-- lib/datadog/tracing/writer.rb | 10 +- lib/ddtrace.rb | 12 +-- lib/ddtrace/auto_instrument.rb | 4 +- lib/ddtrace/transport/http.rb | 18 ++-- lib/ddtrace/transport/http/adapters/net.rb | 4 +- lib/ddtrace/transport/http/adapters/test.rb | 2 +- .../transport/http/adapters/unix_socket.rb | 4 +- lib/ddtrace/transport/http/api.rb | 8 +- lib/ddtrace/transport/http/api/map.rb | 2 +- lib/ddtrace/transport/http/builder.rb | 10 +- lib/ddtrace/transport/http/client.rb | 4 +- lib/ddtrace/transport/http/response.rb | 2 +- lib/ddtrace/transport/http/statistics.rb | 2 +- lib/ddtrace/transport/http/traces.rb | 10 +- lib/ddtrace/transport/io.rb | 6 +- lib/ddtrace/transport/io/client.rb | 4 +- lib/ddtrace/transport/io/response.rb | 2 +- lib/ddtrace/transport/io/traces.rb | 6 +- lib/ddtrace/transport/statistics.rb | 4 +- lib/ddtrace/transport/trace_formatter.rb | 10 +- lib/ddtrace/transport/traces.rb | 10 +- 430 files changed, 1442 insertions(+), 1442 deletions(-) mode change 100755 => 100644 lib/datadog/tracing/distributed/metadata/b3.rb mode change 100755 => 100644 lib/datadog/tracing/distributed/metadata/b3_single.rb mode change 100755 => 100644 lib/datadog/tracing/distributed/metadata/datadog.rb mode change 100755 => 100644 lib/datadog/tracing/distributed/metadata/parser.rb diff --git a/lib/datadog/appsec.rb b/lib/datadog/appsec.rb index f5ed5408805..926e6bd7950 100644 --- a/lib/datadog/appsec.rb +++ b/lib/datadog/appsec.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/appsec/configuration' -require 'datadog/appsec/extensions' +require_relative 'appsec/configuration' +require_relative 'appsec/extensions' module Datadog # Namespace for Datadog AppSec instrumentation @@ -18,6 +18,6 @@ def self.writer end # Integrations -require 'datadog/appsec/contrib/rack/integration' -require 'datadog/appsec/contrib/sinatra/integration' -require 'datadog/appsec/contrib/rails/integration' +require_relative 'appsec/contrib/rack/integration' +require_relative 'appsec/contrib/sinatra/integration' +require_relative 'appsec/contrib/rails/integration' diff --git a/lib/datadog/appsec/autoload.rb b/lib/datadog/appsec/autoload.rb index f40fb625db3..543c6e56ccb 100644 --- a/lib/datadog/appsec/autoload.rb +++ b/lib/datadog/appsec/autoload.rb @@ -2,13 +2,13 @@ if %w[1 true].include?((ENV['DD_APPSEC_ENABLED'] || '').downcase) begin - require 'datadog/appsec' + require_relative '../appsec' rescue StandardError => e puts "AppSec failed to load. No security check will be performed. error: #{e.class.name} #{e.message}" end begin - require 'datadog/appsec/contrib/auto_instrument' + require_relative 'contrib/auto_instrument' Datadog::AppSec::Contrib::AutoInstrument.patch_all rescue StandardError => e puts "AppSec failed to instrument. No security check will be performed. error: #{e.class.name} #{e.message}" diff --git a/lib/datadog/appsec/configuration.rb b/lib/datadog/appsec/configuration.rb index 0a627e17bdc..35393c2fc3c 100644 --- a/lib/datadog/appsec/configuration.rb +++ b/lib/datadog/appsec/configuration.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/configuration/settings' +require_relative 'configuration/settings' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/auto_instrument.rb b/lib/datadog/appsec/contrib/auto_instrument.rb index 8278ff91868..fa4969abab2 100644 --- a/lib/datadog/appsec/contrib/auto_instrument.rb +++ b/lib/datadog/appsec/contrib/auto_instrument.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace' +require_relative '../../../ddtrace' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/configuration/settings.rb b/lib/datadog/appsec/contrib/configuration/settings.rb index 8b66625fb74..86865a980bb 100644 --- a/lib/datadog/appsec/contrib/configuration/settings.rb +++ b/lib/datadog/appsec/contrib/configuration/settings.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/core/configuration/base' +require_relative '../../../core/configuration/base' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/configuration/settings.rb b/lib/datadog/appsec/contrib/rack/configuration/settings.rb index b8b5055c60b..b330e0b1f00 100644 --- a/lib/datadog/appsec/contrib/rack/configuration/settings.rb +++ b/lib/datadog/appsec/contrib/rack/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/appsec/contrib/configuration/settings' -require 'datadog/appsec/contrib/rack/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/gateway/watcher.rb b/lib/datadog/appsec/contrib/rack/gateway/watcher.rb index 2a623ed038e..9ae423424c9 100644 --- a/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/rack/gateway/watcher.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/appsec/instrumentation/gateway' -require 'datadog/appsec/reactive/operation' -require 'datadog/appsec/contrib/rack/reactive/request' -require 'datadog/appsec/contrib/rack/reactive/request_body' -require 'datadog/appsec/contrib/rack/reactive/response' -require 'datadog/appsec/event' +require_relative '../../../instrumentation/gateway' +require_relative '../../../reactive/operation' +require_relative '../reactive/request' +require_relative '../reactive/request_body' +require_relative '../reactive/response' +require_relative '../../../event' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/integration.rb b/lib/datadog/appsec/contrib/rack/integration.rb index fa815a047f2..68e9c398e27 100644 --- a/lib/datadog/appsec/contrib/rack/integration.rb +++ b/lib/datadog/appsec/contrib/rack/integration.rb @@ -1,11 +1,11 @@ # typed: ignore -require 'datadog/appsec/contrib/integration' +require_relative '../integration' -require 'datadog/appsec/contrib/rack/configuration/settings' -require 'datadog/appsec/contrib/rack/patcher' -require 'datadog/appsec/contrib/rack/request_middleware' -require 'datadog/appsec/contrib/rack/request_body_middleware' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative 'request_middleware' +require_relative 'request_body_middleware' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/patcher.rb b/lib/datadog/appsec/contrib/rack/patcher.rb index f208b9c6df6..6797385d27c 100644 --- a/lib/datadog/appsec/contrib/rack/patcher.rb +++ b/lib/datadog/appsec/contrib/rack/patcher.rb @@ -1,7 +1,7 @@ # typed: ignore -require 'datadog/appsec/contrib/patcher' -require 'datadog/appsec/contrib/rack/gateway/watcher' +require_relative '../patcher' +require_relative 'gateway/watcher' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/reactive/request.rb b/lib/datadog/appsec/contrib/rack/reactive/request.rb index 7015400f8bd..eeac0cea352 100644 --- a/lib/datadog/appsec/contrib/rack/reactive/request.rb +++ b/lib/datadog/appsec/contrib/rack/reactive/request.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/contrib/rack/request' +require_relative '../request' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/reactive/request_body.rb b/lib/datadog/appsec/contrib/rack/reactive/request_body.rb index ef181e0aef8..b9d6614954e 100644 --- a/lib/datadog/appsec/contrib/rack/reactive/request_body.rb +++ b/lib/datadog/appsec/contrib/rack/reactive/request_body.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/contrib/rack/request' +require_relative '../request' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/reactive/response.rb b/lib/datadog/appsec/contrib/rack/reactive/response.rb index b916145eb7b..a1d8e95582c 100644 --- a/lib/datadog/appsec/contrib/rack/reactive/response.rb +++ b/lib/datadog/appsec/contrib/rack/reactive/response.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/contrib/rack/response' +require_relative '../response' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/request_body_middleware.rb b/lib/datadog/appsec/contrib/rack/request_body_middleware.rb index 492a18431a2..3d9dbab55f6 100644 --- a/lib/datadog/appsec/contrib/rack/request_body_middleware.rb +++ b/lib/datadog/appsec/contrib/rack/request_body_middleware.rb @@ -1,7 +1,7 @@ # typed: ignore -require 'datadog/appsec/instrumentation/gateway' -require 'datadog/appsec/assets' +require_relative '../../instrumentation/gateway' +require_relative '../../assets' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rack/request_middleware.rb b/lib/datadog/appsec/contrib/rack/request_middleware.rb index 113b0e716e3..74c64dc2517 100644 --- a/lib/datadog/appsec/contrib/rack/request_middleware.rb +++ b/lib/datadog/appsec/contrib/rack/request_middleware.rb @@ -2,9 +2,9 @@ require 'json' -require 'datadog/appsec/instrumentation/gateway' -require 'datadog/appsec/processor' -require 'datadog/appsec/assets' +require_relative '../../instrumentation/gateway' +require_relative '../../processor' +require_relative '../../assets' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rails/configuration/settings.rb b/lib/datadog/appsec/contrib/rails/configuration/settings.rb index f16c17bfe6e..f38ef78f6c7 100644 --- a/lib/datadog/appsec/contrib/rails/configuration/settings.rb +++ b/lib/datadog/appsec/contrib/rails/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/appsec/contrib/configuration/settings' -require 'datadog/appsec/contrib/rails/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rails/gateway/watcher.rb b/lib/datadog/appsec/contrib/rails/gateway/watcher.rb index 69f0acfcdfa..c8fcdfc5ea6 100644 --- a/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/rails/gateway/watcher.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/appsec/instrumentation/gateway' -require 'datadog/appsec/reactive/operation' -require 'datadog/appsec/contrib/rails/reactive/action' -require 'datadog/appsec/event' +require_relative '../../../instrumentation/gateway' +require_relative '../../../reactive/operation' +require_relative '../reactive/action' +require_relative '../../../event' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rails/integration.rb b/lib/datadog/appsec/contrib/rails/integration.rb index 8b60ff9d548..a95fa60dfa9 100644 --- a/lib/datadog/appsec/contrib/rails/integration.rb +++ b/lib/datadog/appsec/contrib/rails/integration.rb @@ -1,10 +1,10 @@ # typed: ignore -require 'datadog/appsec/contrib/integration' +require_relative '../integration' -require 'datadog/appsec/contrib/rails/configuration/settings' -require 'datadog/appsec/contrib/rails/patcher' -require 'datadog/appsec/contrib/rails/request_middleware' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative 'request_middleware' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rails/patcher.rb b/lib/datadog/appsec/contrib/rails/patcher.rb index a45d4b8a382..94122e7da1c 100644 --- a/lib/datadog/appsec/contrib/rails/patcher.rb +++ b/lib/datadog/appsec/contrib/rails/patcher.rb @@ -1,14 +1,14 @@ # typed: ignore -require 'datadog/core/utils/only_once' +require_relative '../../../core/utils/only_once' -require 'datadog/appsec/contrib/patcher' -require 'datadog/appsec/contrib/rails/framework' -require 'datadog/appsec/contrib/rack/request_middleware' -require 'datadog/appsec/contrib/rack/request_body_middleware' -require 'datadog/appsec/contrib/rails/gateway/watcher' +require_relative '../patcher' +require_relative 'framework' +require_relative '../rack/request_middleware' +require_relative '../rack/request_body_middleware' +require_relative 'gateway/watcher' -require 'datadog/tracing/contrib/rack/middlewares' +require_relative '../../../tracing/contrib/rack/middlewares' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/rails/reactive/action.rb b/lib/datadog/appsec/contrib/rails/reactive/action.rb index 004506675c0..4d00c5676eb 100644 --- a/lib/datadog/appsec/contrib/rails/reactive/action.rb +++ b/lib/datadog/appsec/contrib/rails/reactive/action.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/contrib/rails/request' +require_relative '../request' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb b/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb index 9c1cb612929..9b7d60626a1 100644 --- a/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb +++ b/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/appsec/contrib/configuration/settings' -require 'datadog/appsec/contrib/sinatra/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb b/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb index e16f4feaee1..b975a1d0c6c 100644 --- a/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/appsec/instrumentation/gateway' -require 'datadog/appsec/reactive/operation' -require 'datadog/appsec/contrib/rack/reactive/request_body' -require 'datadog/appsec/contrib/sinatra/reactive/routed' -require 'datadog/appsec/event' +require_relative '../../../instrumentation/gateway' +require_relative '../../../reactive/operation' +require_relative '../../rack/reactive/request_body' +require_relative '../reactive/routed' +require_relative '../../../event' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/sinatra/integration.rb b/lib/datadog/appsec/contrib/sinatra/integration.rb index b63cd214465..5872c1b53e1 100644 --- a/lib/datadog/appsec/contrib/sinatra/integration.rb +++ b/lib/datadog/appsec/contrib/sinatra/integration.rb @@ -1,10 +1,10 @@ # typed: ignore -require 'datadog/appsec/contrib/integration' +require_relative '../integration' -require 'datadog/appsec/contrib/sinatra/configuration/settings' -require 'datadog/appsec/contrib/sinatra/patcher' -require 'datadog/appsec/contrib/sinatra/request_middleware' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative 'request_middleware' module Datadog module AppSec diff --git a/lib/datadog/appsec/contrib/sinatra/patcher.rb b/lib/datadog/appsec/contrib/sinatra/patcher.rb index ffc94d7f5ba..3752861a50a 100644 --- a/lib/datadog/appsec/contrib/sinatra/patcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/patcher.rb @@ -1,12 +1,12 @@ # typed: ignore -require 'datadog/tracing/contrib/rack/middlewares' +require_relative '../../../tracing/contrib/rack/middlewares' -require 'datadog/appsec/contrib/patcher' -require 'datadog/appsec/contrib/rack/request_middleware' -require 'datadog/appsec/contrib/sinatra/framework' -require 'datadog/appsec/contrib/sinatra/gateway/watcher' -require 'datadog/tracing/contrib/sinatra/framework' +require_relative '../patcher' +require_relative '../rack/request_middleware' +require_relative 'framework' +require_relative 'gateway/watcher' +require_relative '../../../tracing/contrib/sinatra/framework' module Datadog module AppSec diff --git a/lib/datadog/appsec/event.rb b/lib/datadog/appsec/event.rb index 698e12e3cc8..364809e8647 100644 --- a/lib/datadog/appsec/event.rb +++ b/lib/datadog/appsec/event.rb @@ -2,9 +2,9 @@ require 'json' -require 'datadog/appsec/contrib/rack/request' -require 'datadog/appsec/contrib/rack/response' -require 'datadog/appsec/rate_limiter' +require_relative 'contrib/rack/request' +require_relative 'contrib/rack/response' +require_relative 'rate_limiter' module Datadog module AppSec diff --git a/lib/datadog/appsec/extensions.rb b/lib/datadog/appsec/extensions.rb index 19a5566f52f..52c34108436 100644 --- a/lib/datadog/appsec/extensions.rb +++ b/lib/datadog/appsec/extensions.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/appsec/configuration' +require_relative 'configuration' module Datadog module AppSec diff --git a/lib/datadog/appsec/processor.rb b/lib/datadog/appsec/processor.rb index 64c3d031e4a..6c965526358 100644 --- a/lib/datadog/appsec/processor.rb +++ b/lib/datadog/appsec/processor.rb @@ -1,6 +1,6 @@ # typed: ignore -require 'datadog/appsec/assets' +require_relative 'assets' module Datadog module AppSec diff --git a/lib/datadog/appsec/reactive/engine.rb b/lib/datadog/appsec/reactive/engine.rb index f96f2ebceb6..ef3833ee104 100644 --- a/lib/datadog/appsec/reactive/engine.rb +++ b/lib/datadog/appsec/reactive/engine.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/appsec/reactive/address_hash' -require 'datadog/appsec/reactive/subscriber' +require_relative 'address_hash' +require_relative 'subscriber' module Datadog module AppSec diff --git a/lib/datadog/appsec/reactive/operation.rb b/lib/datadog/appsec/reactive/operation.rb index 9e2e7d0000e..7330fd6fa23 100644 --- a/lib/datadog/appsec/reactive/operation.rb +++ b/lib/datadog/appsec/reactive/operation.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/appsec/reactive/engine' +require_relative 'engine' module Datadog module AppSec diff --git a/lib/datadog/ci.rb b/lib/datadog/ci.rb index 4a4a07cb1fa..4271c2b56f2 100644 --- a/lib/datadog/ci.rb +++ b/lib/datadog/ci.rb @@ -1,8 +1,8 @@ # typed: strict -require 'datadog/core' -require 'datadog/tracing' -require 'datadog/tracing/contrib' +require_relative 'core' +require_relative 'tracing' +require_relative 'tracing/contrib' module Datadog # Namespace for Datadog CI instrumentation: @@ -12,9 +12,9 @@ module CI end # Integrations -require 'datadog/ci/contrib/cucumber/integration' -require 'datadog/ci/contrib/rspec/integration' +require_relative 'ci/contrib/cucumber/integration' +require_relative 'ci/contrib/rspec/integration' # Extensions -require 'datadog/ci/extensions' +require_relative 'ci/extensions' Datadog::CI::Extensions.activate! diff --git a/lib/datadog/ci/configuration/components.rb b/lib/datadog/ci/configuration/components.rb index 83bc880edc0..74bf71e3764 100644 --- a/lib/datadog/ci/configuration/components.rb +++ b/lib/datadog/ci/configuration/components.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/ci/flush' +require_relative '../flush' module Datadog module CI diff --git a/lib/datadog/ci/configuration/settings.rb b/lib/datadog/ci/configuration/settings.rb index 38936a387cc..29eb369fc41 100644 --- a/lib/datadog/ci/configuration/settings.rb +++ b/lib/datadog/ci/configuration/settings.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/ci/ext/settings' +require_relative '../ext/settings' module Datadog module CI diff --git a/lib/datadog/ci/contrib/cucumber/configuration/settings.rb b/lib/datadog/ci/contrib/cucumber/configuration/settings.rb index 889f0431ad1..77573e3ec30 100644 --- a/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +++ b/lib/datadog/ci/contrib/cucumber/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/ci/contrib/cucumber/ext' +require_relative '../../../../tracing/contrib/configuration/settings' +require_relative '../ext' module Datadog module CI diff --git a/lib/datadog/ci/contrib/cucumber/formatter.rb b/lib/datadog/ci/contrib/cucumber/formatter.rb index a8d513e5e09..d7d60556a74 100644 --- a/lib/datadog/ci/contrib/cucumber/formatter.rb +++ b/lib/datadog/ci/contrib/cucumber/formatter.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/ci/test' -require 'datadog/ci/ext/app_types' -require 'datadog/ci/ext/environment' -require 'datadog/ci/ext/test' -require 'datadog/ci/contrib/cucumber/ext' +require_relative '../../test' +require_relative '../../ext/app_types' +require_relative '../../ext/environment' +require_relative '../../ext/test' +require_relative 'ext' module Datadog module CI diff --git a/lib/datadog/ci/contrib/cucumber/instrumentation.rb b/lib/datadog/ci/contrib/cucumber/instrumentation.rb index a710a66ebd1..3d96e784e4a 100644 --- a/lib/datadog/ci/contrib/cucumber/instrumentation.rb +++ b/lib/datadog/ci/contrib/cucumber/instrumentation.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/ci/contrib/cucumber/formatter' +require_relative 'formatter' module Datadog module CI diff --git a/lib/datadog/ci/contrib/cucumber/integration.rb b/lib/datadog/ci/contrib/cucumber/integration.rb index 75598b81235..14322eec807 100644 --- a/lib/datadog/ci/contrib/cucumber/integration.rb +++ b/lib/datadog/ci/contrib/cucumber/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' +require_relative '../../../tracing/contrib/integration' -require 'datadog/ci/contrib/cucumber/configuration/settings' -require 'datadog/ci/contrib/cucumber/patcher' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module CI diff --git a/lib/datadog/ci/contrib/cucumber/patcher.rb b/lib/datadog/ci/contrib/cucumber/patcher.rb index aab1fdee5ff..a3a1690b7f3 100644 --- a/lib/datadog/ci/contrib/cucumber/patcher.rb +++ b/lib/datadog/ci/contrib/cucumber/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/ci/contrib/cucumber/instrumentation' +require_relative '../../../tracing/contrib/patcher' +require_relative 'instrumentation' module Datadog module CI diff --git a/lib/datadog/ci/contrib/rspec/configuration/settings.rb b/lib/datadog/ci/contrib/rspec/configuration/settings.rb index e36363ca30b..4df32d1b200 100644 --- a/lib/datadog/ci/contrib/rspec/configuration/settings.rb +++ b/lib/datadog/ci/contrib/rspec/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/ci/contrib/rspec/ext' +require_relative '../../../../tracing/contrib/configuration/settings' +require_relative '../ext' module Datadog module CI diff --git a/lib/datadog/ci/contrib/rspec/example.rb b/lib/datadog/ci/contrib/rspec/example.rb index 2d150f50927..8ced610323e 100644 --- a/lib/datadog/ci/contrib/rspec/example.rb +++ b/lib/datadog/ci/contrib/rspec/example.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/ci/test' +require_relative '../../test' -require 'datadog/ci/ext/app_types' -require 'datadog/ci/ext/environment' -require 'datadog/ci/ext/test' -require 'datadog/ci/contrib/rspec/ext' +require_relative '../../ext/app_types' +require_relative '../../ext/environment' +require_relative '../../ext/test' +require_relative 'ext' module Datadog module CI diff --git a/lib/datadog/ci/contrib/rspec/integration.rb b/lib/datadog/ci/contrib/rspec/integration.rb index 4f212d15680..5a396cb2d0c 100644 --- a/lib/datadog/ci/contrib/rspec/integration.rb +++ b/lib/datadog/ci/contrib/rspec/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' +require_relative '../../../tracing/contrib/integration' -require 'datadog/ci/contrib/rspec/configuration/settings' -require 'datadog/ci/contrib/rspec/patcher' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module CI diff --git a/lib/datadog/ci/contrib/rspec/patcher.rb b/lib/datadog/ci/contrib/rspec/patcher.rb index 5d59f02f3a2..191c082c255 100644 --- a/lib/datadog/ci/contrib/rspec/patcher.rb +++ b/lib/datadog/ci/contrib/rspec/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/ci/contrib/rspec/example' +require_relative '../../../tracing/contrib/patcher' +require_relative 'example' module Datadog module CI diff --git a/lib/datadog/ci/ext/environment.rb b/lib/datadog/ci/ext/environment.rb index 094938b3a8f..5110668e488 100644 --- a/lib/datadog/ci/ext/environment.rb +++ b/lib/datadog/ci/ext/environment.rb @@ -2,7 +2,7 @@ # typed: true -require 'datadog/core/git/ext' +require_relative '../../core/git/ext' require 'open3' diff --git a/lib/datadog/ci/extensions.rb b/lib/datadog/ci/extensions.rb index b8023a184d2..dd0edd869ba 100644 --- a/lib/datadog/ci/extensions.rb +++ b/lib/datadog/ci/extensions.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core/configuration/settings' -require 'datadog/core/configuration/components' +require_relative '../core/configuration/settings' +require_relative '../core/configuration/components' -require 'datadog/ci/configuration/settings' -require 'datadog/ci/configuration/components' +require_relative 'configuration/settings' +require_relative 'configuration/components' module Datadog module CI diff --git a/lib/datadog/ci/flush.rb b/lib/datadog/ci/flush.rb index ae3f3aecc82..bdefa570310 100644 --- a/lib/datadog/ci/flush.rb +++ b/lib/datadog/ci/flush.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/flush' +require_relative '../tracing/metadata/ext' +require_relative '../tracing/flush' module Datadog module CI diff --git a/lib/datadog/ci/test.rb b/lib/datadog/ci/test.rb index f5dd1a01d1e..f500b53f493 100644 --- a/lib/datadog/ci/test.rb +++ b/lib/datadog/ci/test.rb @@ -2,10 +2,10 @@ # typed: false -require 'datadog/tracing/contrib/analytics' +require_relative '../tracing/contrib/analytics' -require 'datadog/ci/ext/app_types' -require 'datadog/ci/ext/test' +require_relative 'ext/app_types' +require_relative 'ext/test' require 'rbconfig' diff --git a/lib/datadog/core.rb b/lib/datadog/core.rb index baf51f5577f..f3d4621a1fd 100644 --- a/lib/datadog/core.rb +++ b/lib/datadog/core.rb @@ -4,57 +4,57 @@ # Would be better to lazy load these; not # all of these components will be used in # every application. -# require 'datadog/core/buffer/cruby' -# require 'datadog/core/buffer/random' -# require 'datadog/core/buffer/thread_safe' -# require 'datadog/core/chunker' -# require 'datadog/core/configuration' -# require 'datadog/core/diagnostics/environment_logger' -# require 'datadog/core/diagnostics/ext' -# require 'datadog/core/diagnostics/health' -# require 'datadog/core/encoding' -# require 'datadog/core/environment/cgroup' -# require 'datadog/core/environment/class_count' -# require 'datadog/core/environment/container' -# require 'datadog/core/environment/ext' -# require 'datadog/core/environment/gc' -# require 'datadog/core/environment/identity' -# require 'datadog/core/environment/socket' -# require 'datadog/core/environment/thread_count' -# require 'datadog/core/environment/variable_helpers' -# require 'datadog/core/environment/vm_cache' -# require 'datadog/core/error' -# require 'datadog/core/event' -# require 'datadog/core/git/ext' -# require 'datadog/core/logger' -# require 'datadog/core/metrics/client' -# require 'datadog/core/metrics/ext' -# require 'datadog/core/metrics/helpers' -# require 'datadog/core/metrics/logging' -# require 'datadog/core/metrics/metric' -# require 'datadog/core/metrics/options' -# require 'datadog/core/pin' -# require 'datadog/core/quantization/hash' -# require 'datadog/core/quantization/http' -# require 'datadog/core/runtime/ext' -# require 'datadog/core/runtime/metrics' -# require 'datadog/core/utils' -# require 'datadog/core/utils/compression' -# require 'datadog/core/utils/database' -# require 'datadog/core/utils/forking' -# require 'datadog/core/utils/object_set' -# require 'datadog/core/utils/only_once' -# require 'datadog/core/utils/sequence' -# require 'datadog/core/utils/string_table' -# require 'datadog/core/utils/time' -# require 'datadog/core/worker' -# require 'datadog/core/workers/async' -# require 'datadog/core/workers/interval_loop' -# require 'datadog/core/workers/polling' -# require 'datadog/core/workers/queue' -# require 'datadog/core/workers/runtime_metrics' +# require_relative 'core/buffer/cruby' +# require_relative 'core/buffer/random' +# require_relative 'core/buffer/thread_safe' +# require_relative 'core/chunker' +# require_relative 'core/configuration' +# require_relative 'core/diagnostics/environment_logger' +# require_relative 'core/diagnostics/ext' +# require_relative 'core/diagnostics/health' +# require_relative 'core/encoding' +# require_relative 'core/environment/cgroup' +# require_relative 'core/environment/class_count' +# require_relative 'core/environment/container' +# require_relative 'core/environment/ext' +# require_relative 'core/environment/gc' +# require_relative 'core/environment/identity' +# require_relative 'core/environment/socket' +# require_relative 'core/environment/thread_count' +# require_relative 'core/environment/variable_helpers' +# require_relative 'core/environment/vm_cache' +# require_relative 'core/error' +# require_relative 'core/event' +# require_relative 'core/git/ext' +# require_relative 'core/logger' +# require_relative 'core/metrics/client' +# require_relative 'core/metrics/ext' +# require_relative 'core/metrics/helpers' +# require_relative 'core/metrics/logging' +# require_relative 'core/metrics/metric' +# require_relative 'core/metrics/options' +# require_relative 'core/pin' +# require_relative 'core/quantization/hash' +# require_relative 'core/quantization/http' +# require_relative 'core/runtime/ext' +# require_relative 'core/runtime/metrics' +# require_relative 'core/utils' +# require_relative 'core/utils/compression' +# require_relative 'core/utils/database' +# require_relative 'core/utils/forking' +# require_relative 'core/utils/object_set' +# require_relative 'core/utils/only_once' +# require_relative 'core/utils/sequence' +# require_relative 'core/utils/string_table' +# require_relative 'core/utils/time' +# require_relative 'core/worker' +# require_relative 'core/workers/async' +# require_relative 'core/workers/interval_loop' +# require_relative 'core/workers/polling' +# require_relative 'core/workers/queue' +# require_relative 'core/workers/runtime_metrics' -require 'datadog/core/extensions' +require_relative 'core/extensions' # We must load core extensions to make certain global APIs # accessible: both for Datadog features and the core itself. diff --git a/lib/datadog/core/buffer/cruby.rb b/lib/datadog/core/buffer/cruby.rb index 2a5c603c2c6..51d506b95ec 100644 --- a/lib/datadog/core/buffer/cruby.rb +++ b/lib/datadog/core/buffer/cruby.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/buffer/random' +require_relative 'random' module Datadog module Core diff --git a/lib/datadog/core/buffer/thread_safe.rb b/lib/datadog/core/buffer/thread_safe.rb index 9a39429cee6..a225af63993 100644 --- a/lib/datadog/core/buffer/thread_safe.rb +++ b/lib/datadog/core/buffer/thread_safe.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/buffer/random' +require_relative 'random' module Datadog module Core diff --git a/lib/datadog/core/configuration.rb b/lib/datadog/core/configuration.rb index 79009e49497..0a4d9957080 100644 --- a/lib/datadog/core/configuration.rb +++ b/lib/datadog/core/configuration.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/configuration/components' -require 'datadog/core/configuration/settings' -require 'datadog/core/logger' -require 'datadog/core/pin' +require_relative 'configuration/components' +require_relative 'configuration/settings' +require_relative 'logger' +require_relative 'pin' module Datadog module Core diff --git a/lib/datadog/core/configuration/agent_settings_resolver.rb b/lib/datadog/core/configuration/agent_settings_resolver.rb index d629da2eff4..06082121a67 100644 --- a/lib/datadog/core/configuration/agent_settings_resolver.rb +++ b/lib/datadog/core/configuration/agent_settings_resolver.rb @@ -2,9 +2,9 @@ require 'uri' -require 'datadog/core/configuration/settings' -require 'datadog/tracing/configuration/ext' -require 'ddtrace/transport/ext' +require_relative 'settings' +require_relative '../../tracing/configuration/ext' +require_relative '../../../ddtrace/transport/ext' module Datadog module Core diff --git a/lib/datadog/core/configuration/base.rb b/lib/datadog/core/configuration/base.rb index 421f136c6e4..99a17a746e5 100644 --- a/lib/datadog/core/configuration/base.rb +++ b/lib/datadog/core/configuration/base.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/environment/variable_helpers' -require 'datadog/core/configuration/options' +require_relative '../environment/variable_helpers' +require_relative 'options' module Datadog module Core diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 9acd8522ce4..cb70be95242 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -1,15 +1,15 @@ # typed: false -require 'datadog/core/configuration/agent_settings_resolver' -require 'datadog/core/diagnostics/environment_logger' -require 'datadog/core/diagnostics/health' -require 'datadog/core/logger' -require 'datadog/core/runtime/metrics' -require 'datadog/core/workers/runtime_metrics' +require_relative 'agent_settings_resolver' +require_relative '../diagnostics/environment_logger' +require_relative '../diagnostics/health' +require_relative '../logger' +require_relative '../runtime/metrics' +require_relative '../workers/runtime_metrics' -require 'datadog/tracing/tracer' -require 'datadog/tracing/flush' -require 'datadog/tracing/sync_writer' +require_relative '../../tracing/tracer' +require_relative '../../tracing/flush' +require_relative '../../tracing/sync_writer' module Datadog module Core @@ -198,7 +198,7 @@ def build_profiler(settings, agent_settings, tracer) # On the other hand, if datadog/core is loaded by a different product and no general `require 'ddtrace'` is # done, then profiling may not be loaded, and thus to avoid this issue we do a require here (which is a # no-op if profiling is already loaded). - require 'datadog/profiling' + require_relative '../../profiling' return unless Profiling.supported? unless defined?(Profiling::Tasks::Setup) @@ -312,7 +312,7 @@ def build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) def build_profiler_transport(settings, agent_settings) settings.profiling.exporter.transport || if settings.profiling.advanced.legacy_transport_enabled - require 'datadog/profiling/transport/http' + require_relative '../../profiling/transport/http' Datadog.logger.warn('Using legacy profiling transport. Do not use unless instructed to by support.') diff --git a/lib/datadog/core/configuration/option_definition.rb b/lib/datadog/core/configuration/option_definition.rb index a964d2efb25..571a7db2f82 100644 --- a/lib/datadog/core/configuration/option_definition.rb +++ b/lib/datadog/core/configuration/option_definition.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/configuration/option' +require_relative 'option' module Datadog module Core diff --git a/lib/datadog/core/configuration/option_definition_set.rb b/lib/datadog/core/configuration/option_definition_set.rb index 23f99c118d6..339cba083f7 100644 --- a/lib/datadog/core/configuration/option_definition_set.rb +++ b/lib/datadog/core/configuration/option_definition_set.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/configuration/dependency_resolver' +require_relative 'dependency_resolver' module Datadog module Core diff --git a/lib/datadog/core/configuration/options.rb b/lib/datadog/core/configuration/options.rb index c9f3e09c65b..7ae4510fc80 100644 --- a/lib/datadog/core/configuration/options.rb +++ b/lib/datadog/core/configuration/options.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/core/configuration/option_set' -require 'datadog/core/configuration/option_definition' -require 'datadog/core/configuration/option_definition_set' +require_relative 'option_set' +require_relative 'option_definition' +require_relative 'option_definition_set' module Datadog module Core diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 148321d25b0..36ff7d98a29 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -2,11 +2,11 @@ require 'logger' -require 'datadog/core/configuration/base' -require 'datadog/core/environment/ext' -require 'datadog/core/runtime/ext' -require 'datadog/profiling/ext' -require 'datadog/tracing/configuration/ext' +require_relative 'base' +require_relative '../environment/ext' +require_relative '../runtime/ext' +require_relative '../../profiling/ext' +require_relative '../../tracing/configuration/ext' module Datadog module Core diff --git a/lib/datadog/core/diagnostics/health.rb b/lib/datadog/core/diagnostics/health.rb index bb95d28d3a8..ca5810d73c7 100644 --- a/lib/datadog/core/diagnostics/health.rb +++ b/lib/datadog/core/diagnostics/health.rb @@ -1,7 +1,7 @@ # typed: strict -require 'datadog/core/diagnostics/ext' -require 'datadog/core/metrics/client' +require_relative 'ext' +require_relative '../metrics/client' module Datadog module Core diff --git a/lib/datadog/core/environment/cgroup.rb b/lib/datadog/core/environment/cgroup.rb index 40fff2b753e..88a54e08c3c 100644 --- a/lib/datadog/core/environment/cgroup.rb +++ b/lib/datadog/core/environment/cgroup.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/environment/ext' +require_relative 'ext' module Datadog module Core diff --git a/lib/datadog/core/environment/container.rb b/lib/datadog/core/environment/container.rb index 4196ff40996..ad33e4a5a42 100644 --- a/lib/datadog/core/environment/container.rb +++ b/lib/datadog/core/environment/container.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/environment/cgroup' +require_relative 'cgroup' module Datadog module Core diff --git a/lib/datadog/core/environment/ext.rb b/lib/datadog/core/environment/ext.rb index 28013746f3a..875b9a6ade7 100644 --- a/lib/datadog/core/environment/ext.rb +++ b/lib/datadog/core/environment/ext.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/version' +require_relative '../../../ddtrace/version' module Datadog module Core diff --git a/lib/datadog/core/environment/identity.rb b/lib/datadog/core/environment/identity.rb index 0c6d408da91..0cfbdd74cd9 100644 --- a/lib/datadog/core/environment/identity.rb +++ b/lib/datadog/core/environment/identity.rb @@ -2,8 +2,8 @@ require 'securerandom' -require 'datadog/core/environment/ext' -require 'datadog/core/utils/forking' +require_relative 'ext' +require_relative '../utils/forking' module Datadog module Core diff --git a/lib/datadog/core/environment/platform.rb b/lib/datadog/core/environment/platform.rb index 96c91ebd96a..2e43b145f05 100644 --- a/lib/datadog/core/environment/platform.rb +++ b/lib/datadog/core/environment/platform.rb @@ -2,7 +2,7 @@ require 'etc' -require 'datadog/core/environment/identity' +require_relative 'identity' module Datadog module Core diff --git a/lib/datadog/core/environment/socket.rb b/lib/datadog/core/environment/socket.rb index a1856979495..025b0827389 100644 --- a/lib/datadog/core/environment/socket.rb +++ b/lib/datadog/core/environment/socket.rb @@ -1,7 +1,7 @@ # typed: false require 'socket' -require 'datadog/core/utils/forking' +require_relative '../utils/forking' module Datadog module Core diff --git a/lib/datadog/core/error.rb b/lib/datadog/core/error.rb index dcda10cab75..e0139e4c4f0 100644 --- a/lib/datadog/core/error.rb +++ b/lib/datadog/core/error.rb @@ -2,7 +2,7 @@ # typed: false -require 'datadog/core/utils' +require_relative 'utils' module Datadog module Core diff --git a/lib/datadog/core/extensions.rb b/lib/datadog/core/extensions.rb index 76b00804139..66ad6d6e626 100644 --- a/lib/datadog/core/extensions.rb +++ b/lib/datadog/core/extensions.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/configuration' +require_relative 'configuration' # Global namespace that includes all Datadog functionality. # @public_api diff --git a/lib/datadog/core/metrics/client.rb b/lib/datadog/core/metrics/client.rb index 4b6e779c54e..75af09a59a1 100644 --- a/lib/datadog/core/metrics/client.rb +++ b/lib/datadog/core/metrics/client.rb @@ -1,13 +1,13 @@ # typed: false -require 'datadog/core/utils/time' -require 'datadog/core/utils/only_once' - -require 'datadog/core/metrics/ext' -require 'datadog/core/metrics/options' -require 'datadog/core/metrics/helpers' -require 'datadog/core/metrics/logging' -require 'datadog/core/metrics/metric' +require_relative '../utils/time' +require_relative '../utils/only_once' + +require_relative 'ext' +require_relative 'options' +require_relative 'helpers' +require_relative 'logging' +require_relative 'metric' module Datadog module Core diff --git a/lib/datadog/core/metrics/options.rb b/lib/datadog/core/metrics/options.rb index 5cccb20a31e..d8ce8cbd96e 100644 --- a/lib/datadog/core/metrics/options.rb +++ b/lib/datadog/core/metrics/options.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/metrics/ext' -require 'datadog/core/environment/ext' -require 'datadog/core/environment/identity' +require_relative 'ext' +require_relative '../environment/ext' +require_relative '../environment/identity' module Datadog module Core diff --git a/lib/datadog/core/runtime/metrics.rb b/lib/datadog/core/runtime/metrics.rb index 97b2dadacf0..c6761cb31c0 100644 --- a/lib/datadog/core/runtime/metrics.rb +++ b/lib/datadog/core/runtime/metrics.rb @@ -1,12 +1,12 @@ # typed: true -require 'datadog/core/runtime/ext' +require_relative 'ext' -require 'datadog/core/metrics/client' -require 'datadog/core/environment/class_count' -require 'datadog/core/environment/gc' -require 'datadog/core/environment/thread_count' -require 'datadog/core/environment/vm_cache' +require_relative '../metrics/client' +require_relative '../environment/class_count' +require_relative '../environment/gc' +require_relative '../environment/thread_count' +require_relative '../environment/vm_cache' module Datadog module Core diff --git a/lib/datadog/core/utils.rb b/lib/datadog/core/utils.rb index d46a6d8aaca..0969ed54989 100644 --- a/lib/datadog/core/utils.rb +++ b/lib/datadog/core/utils.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/core/utils/forking' -require 'datadog/tracing/span' +require_relative 'utils/forking' +require_relative '../tracing/span' module Datadog module Core diff --git a/lib/datadog/core/utils/object_set.rb b/lib/datadog/core/utils/object_set.rb index e3537b02c11..5642ba4bc89 100644 --- a/lib/datadog/core/utils/object_set.rb +++ b/lib/datadog/core/utils/object_set.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils/sequence' +require_relative 'sequence' module Datadog module Core diff --git a/lib/datadog/core/utils/string_table.rb b/lib/datadog/core/utils/string_table.rb index 31105b83cc1..46bb302dab2 100644 --- a/lib/datadog/core/utils/string_table.rb +++ b/lib/datadog/core/utils/string_table.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils/sequence' +require_relative 'sequence' module Datadog module Core diff --git a/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb b/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb index 1c2ae799325..96eb02a72bd 100644 --- a/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb +++ b/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb @@ -6,8 +6,8 @@ # software license details. #++ -require 'datadog/core/vendor/multipart-post/multipart/post/parts' -require 'datadog/core/vendor/multipart-post/multipart/post/composite_read_io' +require_relative 'parts' +require_relative 'composite_read_io' require 'securerandom' module Datadog diff --git a/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb b/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb index 49bc19238ab..ddfab4b5236 100644 --- a/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb +++ b/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb @@ -9,9 +9,9 @@ require 'net/http' require 'stringio' require 'cgi' -require 'datadog/core/vendor/multipart-post/multipart/post/parts' -require 'datadog/core/vendor/multipart-post/multipart/post/composite_read_io' -require 'datadog/core/vendor/multipart-post/multipart/post/multipartable' +require_relative '../../../multipart/post/parts' +require_relative '../../../multipart/post/composite_read_io' +require_relative '../../../multipart/post/multipartable' module Datadog module Core diff --git a/lib/datadog/core/workers/async.rb b/lib/datadog/core/workers/async.rb index bd302e4b1a8..53a804b00c1 100644 --- a/lib/datadog/core/workers/async.rb +++ b/lib/datadog/core/workers/async.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/core/logger' +require_relative '../logger' module Datadog module Core diff --git a/lib/datadog/core/workers/polling.rb b/lib/datadog/core/workers/polling.rb index 0eddc57cd15..f388d26042e 100644 --- a/lib/datadog/core/workers/polling.rb +++ b/lib/datadog/core/workers/polling.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/workers/async' -require 'datadog/core/workers/interval_loop' +require_relative 'async' +require_relative 'interval_loop' module Datadog module Core diff --git a/lib/datadog/core/workers/runtime_metrics.rb b/lib/datadog/core/workers/runtime_metrics.rb index 3e69455ee20..dad137fc414 100644 --- a/lib/datadog/core/workers/runtime_metrics.rb +++ b/lib/datadog/core/workers/runtime_metrics.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/core/runtime/metrics' +require_relative '../runtime/metrics' -require 'datadog/core/worker' -require 'datadog/core/workers/async' -require 'datadog/core/workers/polling' +require_relative '../worker' +require_relative 'async' +require_relative 'polling' module Datadog module Core diff --git a/lib/datadog/kit.rb b/lib/datadog/kit.rb index c48d8d5b4b4..8400348edaa 100644 --- a/lib/datadog/kit.rb +++ b/lib/datadog/kit.rb @@ -8,4 +8,4 @@ module Kit end end -require 'datadog/kit/identity' +require_relative 'kit/identity' diff --git a/lib/datadog/opentracer.rb b/lib/datadog/opentracer.rb index 63d7b3e68ab..f3af32f8f65 100644 --- a/lib/datadog/opentracer.rb +++ b/lib/datadog/opentracer.rb @@ -2,23 +2,23 @@ require 'opentracing' require 'opentracing/carrier' -require 'datadog/tracing' +require_relative 'tracing' -require 'datadog/opentracer/carrier' -require 'datadog/opentracer/tracer' -require 'datadog/opentracer/span' -require 'datadog/opentracer/span_context' -require 'datadog/opentracer/span_context_factory' -require 'datadog/opentracer/scope' -require 'datadog/opentracer/scope_manager' -require 'datadog/opentracer/thread_local_scope' -require 'datadog/opentracer/thread_local_scope_manager' -require 'datadog/opentracer/distributed_headers' -require 'datadog/opentracer/propagator' -require 'datadog/opentracer/text_map_propagator' -require 'datadog/opentracer/binary_propagator' -require 'datadog/opentracer/rack_propagator' -require 'datadog/opentracer/global_tracer' +require_relative 'opentracer/carrier' +require_relative 'opentracer/tracer' +require_relative 'opentracer/span' +require_relative 'opentracer/span_context' +require_relative 'opentracer/span_context_factory' +require_relative 'opentracer/scope' +require_relative 'opentracer/scope_manager' +require_relative 'opentracer/thread_local_scope' +require_relative 'opentracer/thread_local_scope_manager' +require_relative 'opentracer/distributed_headers' +require_relative 'opentracer/propagator' +require_relative 'opentracer/text_map_propagator' +require_relative 'opentracer/binary_propagator' +require_relative 'opentracer/rack_propagator' +require_relative 'opentracer/global_tracer' # Modify the OpenTracing module functions ::OpenTracing.singleton_class.prepend(Datadog::OpenTracer::GlobalTracer) diff --git a/lib/datadog/opentracer/distributed_headers.rb b/lib/datadog/opentracer/distributed_headers.rb index 788a186a650..930acf272ae 100644 --- a/lib/datadog/opentracer/distributed_headers.rb +++ b/lib/datadog/opentracer/distributed_headers.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/span' -require 'datadog/tracing/distributed/headers/ext' +require_relative '../tracing/span' +require_relative '../tracing/distributed/headers/ext' module Datadog module OpenTracer diff --git a/lib/datadog/opentracer/rack_propagator.rb b/lib/datadog/opentracer/rack_propagator.rb index 61ddef72480..13897e3dfb7 100644 --- a/lib/datadog/opentracer/rack_propagator.rb +++ b/lib/datadog/opentracer/rack_propagator.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/tracing/context' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/trace_operation' -require 'datadog/opentracer/propagator' +require_relative '../tracing/context' +require_relative '../tracing/distributed/headers/ext' +require_relative '../tracing/propagation/http' +require_relative '../tracing/trace_operation' +require_relative 'propagator' module Datadog module OpenTracer diff --git a/lib/datadog/opentracer/span.rb b/lib/datadog/opentracer/span.rb index 7ce9c27f53c..29b9d84cc79 100644 --- a/lib/datadog/opentracer/span.rb +++ b/lib/datadog/opentracer/span.rb @@ -2,7 +2,7 @@ require 'time' -require 'datadog/tracing/metadata/ext' +require_relative '../tracing/metadata/ext' module Datadog module OpenTracer diff --git a/lib/datadog/opentracer/text_map_propagator.rb b/lib/datadog/opentracer/text_map_propagator.rb index 3f7f848f5a9..f6a58d0ea28 100644 --- a/lib/datadog/opentracer/text_map_propagator.rb +++ b/lib/datadog/opentracer/text_map_propagator.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/context' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_operation' -require 'datadog/opentracer/propagator' +require_relative '../tracing/context' +require_relative '../tracing/distributed/headers/ext' +require_relative '../tracing/trace_operation' +require_relative 'propagator' module Datadog module OpenTracer diff --git a/lib/datadog/opentracer/thread_local_scope_manager.rb b/lib/datadog/opentracer/thread_local_scope_manager.rb index c4322957510..707a3640bf7 100644 --- a/lib/datadog/opentracer/thread_local_scope_manager.rb +++ b/lib/datadog/opentracer/thread_local_scope_manager.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/core/utils/sequence' +require_relative '../core/utils/sequence' module Datadog module OpenTracer diff --git a/lib/datadog/opentracer/tracer.rb b/lib/datadog/opentracer/tracer.rb index 43ba9a3b063..a0c58319a44 100644 --- a/lib/datadog/opentracer/tracer.rb +++ b/lib/datadog/opentracer/tracer.rb @@ -2,8 +2,8 @@ require 'time' -require 'datadog/tracing/context' -require 'datadog/tracing/tracer' +require_relative '../tracing/context' +require_relative '../tracing/tracer' module Datadog module OpenTracer diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index a7635021be4..a22af587dfa 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core' -require 'datadog/core/environment/variable_helpers' -require 'datadog/core/utils/only_once' +require_relative 'core' +require_relative 'core/environment/variable_helpers' +require_relative 'core/utils/only_once' module Datadog # Contains profiler for generating stack profiles, etc. @@ -132,7 +132,7 @@ def self.start_if_enabled private_class_method def self.try_loading_native_library begin - require 'datadog/profiling/load_native_extension' + require_relative 'profiling/load_native_extension' success = defined?(Profiling::NativeExtension) && Profiling::NativeExtension.send(:native_working?) @@ -145,22 +145,22 @@ def self.start_if_enabled private_class_method def self.load_profiling return false unless supported? - require 'datadog/profiling/ext/forking' - require 'datadog/profiling/collectors/code_provenance' - require 'datadog/profiling/collectors/cpu_and_wall_time' - require 'datadog/profiling/collectors/old_stack' - require 'datadog/profiling/collectors/stack' - require 'datadog/profiling/stack_recorder' - require 'datadog/profiling/old_recorder' - require 'datadog/profiling/exporter' - require 'datadog/profiling/scheduler' - require 'datadog/profiling/tasks/setup' - require 'datadog/profiling/profiler' - require 'datadog/profiling/native_extension' - require 'datadog/profiling/trace_identifiers/helper' - require 'datadog/profiling/pprof/pprof_pb' - require 'datadog/profiling/tag_builder' - require 'datadog/profiling/http_transport' + require_relative 'profiling/ext/forking' + require_relative 'profiling/collectors/code_provenance' + require_relative 'profiling/collectors/cpu_and_wall_time' + require_relative 'profiling/collectors/old_stack' + require_relative 'profiling/collectors/stack' + require_relative 'profiling/stack_recorder' + require_relative 'profiling/old_recorder' + require_relative 'profiling/exporter' + require_relative 'profiling/scheduler' + require_relative 'profiling/tasks/setup' + require_relative 'profiling/profiler' + require_relative 'profiling/native_extension' + require_relative 'profiling/trace_identifiers/helper' + require_relative 'profiling/pprof/pprof_pb' + require_relative 'profiling/tag_builder' + require_relative 'profiling/http_transport' true end diff --git a/lib/datadog/profiling/buffer.rb b/lib/datadog/profiling/buffer.rb index ee9d6f3bb5a..c3a19683432 100644 --- a/lib/datadog/profiling/buffer.rb +++ b/lib/datadog/profiling/buffer.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/buffer/thread_safe' -require 'datadog/core/utils/object_set' -require 'datadog/core/utils/string_table' +require_relative '../core/buffer/thread_safe' +require_relative '../core/utils/object_set' +require_relative '../core/utils/string_table' module Datadog module Profiling diff --git a/lib/datadog/profiling/collectors/old_stack.rb b/lib/datadog/profiling/collectors/old_stack.rb index 11cce3792ef..743b0947150 100644 --- a/lib/datadog/profiling/collectors/old_stack.rb +++ b/lib/datadog/profiling/collectors/old_stack.rb @@ -1,12 +1,12 @@ # typed: true -require 'datadog/core/utils/only_once' -require 'datadog/core/utils/time' -require 'datadog/core/worker' -require 'datadog/core/workers/polling' -require 'datadog/profiling/backtrace_location' -require 'datadog/profiling/events/stack' -require 'datadog/profiling/native_extension' +require_relative '../../core/utils/only_once' +require_relative '../../core/utils/time' +require_relative '../../core/worker' +require_relative '../../core/workers/polling' +require_relative '../backtrace_location' +require_relative '../events/stack' +require_relative '../native_extension' module Datadog module Profiling diff --git a/lib/datadog/profiling/encoding/profile.rb b/lib/datadog/profiling/encoding/profile.rb index 80016ebfbc7..7781dd98a5c 100644 --- a/lib/datadog/profiling/encoding/profile.rb +++ b/lib/datadog/profiling/encoding/profile.rb @@ -2,7 +2,7 @@ require 'time' -require 'datadog/profiling/pprof/template' +require_relative '../pprof/template' module Datadog module Profiling diff --git a/lib/datadog/profiling/events/stack.rb b/lib/datadog/profiling/events/stack.rb index 16fb9a4f540..5c16f393832 100644 --- a/lib/datadog/profiling/events/stack.rb +++ b/lib/datadog/profiling/events/stack.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/profiling/event' +require_relative '../event' module Datadog module Profiling diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb index 7f5549745b7..7e415b49c59 100644 --- a/lib/datadog/profiling/exporter.rb +++ b/lib/datadog/profiling/exporter.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/profiling/ext' -require 'datadog/core/utils/compression' -require 'datadog/profiling/tag_builder' +require_relative 'ext' +require_relative '../core/utils/compression' +require_relative 'tag_builder' module Datadog module Profiling diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index 2a1be5e9a84..adce71e1145 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/environment/identity' -require 'datadog/core/environment/socket' +require_relative '../core/environment/identity' +require_relative '../core/environment/socket' module Datadog module Profiling diff --git a/lib/datadog/profiling/old_recorder.rb b/lib/datadog/profiling/old_recorder.rb index a5a4180f75c..87dd6ac68f9 100644 --- a/lib/datadog/profiling/old_recorder.rb +++ b/lib/datadog/profiling/old_recorder.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/profiling/buffer' -require 'datadog/profiling/encoding/profile' +require_relative 'buffer' +require_relative 'encoding/profile' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/builder.rb b/lib/datadog/profiling/pprof/builder.rb index e3a59e833db..3ddcaeef024 100644 --- a/lib/datadog/profiling/pprof/builder.rb +++ b/lib/datadog/profiling/pprof/builder.rb @@ -2,10 +2,10 @@ # typed: true -require 'datadog/profiling/flush' -require 'datadog/profiling/pprof/message_set' -require 'datadog/profiling/pprof/string_table' -require 'datadog/core/utils/time' +require_relative '../flush' +require_relative 'message_set' +require_relative 'string_table' +require_relative '../../core/utils/time' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/converter.rb b/lib/datadog/profiling/pprof/converter.rb index ee3a2006cdd..302534c7635 100644 --- a/lib/datadog/profiling/pprof/converter.rb +++ b/lib/datadog/profiling/pprof/converter.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/profiling/ext' +require_relative '../ext' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/message_set.rb b/lib/datadog/profiling/pprof/message_set.rb index 2fabe247209..967886174fd 100644 --- a/lib/datadog/profiling/pprof/message_set.rb +++ b/lib/datadog/profiling/pprof/message_set.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils/object_set' +require_relative '../../core/utils/object_set' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/stack_sample.rb b/lib/datadog/profiling/pprof/stack_sample.rb index c92aec3b6d5..cb820789baf 100644 --- a/lib/datadog/profiling/pprof/stack_sample.rb +++ b/lib/datadog/profiling/pprof/stack_sample.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/profiling/ext' -require 'datadog/profiling/events/stack' -require 'datadog/profiling/pprof/builder' -require 'datadog/profiling/pprof/converter' +require_relative '../ext' +require_relative '../events/stack' +require_relative 'builder' +require_relative 'converter' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/string_table.rb b/lib/datadog/profiling/pprof/string_table.rb index fc45ec1917a..cef1fea2586 100644 --- a/lib/datadog/profiling/pprof/string_table.rb +++ b/lib/datadog/profiling/pprof/string_table.rb @@ -1,6 +1,6 @@ # typed: strict -require 'datadog/core/utils/string_table' +require_relative '../../core/utils/string_table' module Datadog module Profiling diff --git a/lib/datadog/profiling/pprof/template.rb b/lib/datadog/profiling/pprof/template.rb index 4eb234748dd..c676869bf0e 100644 --- a/lib/datadog/profiling/pprof/template.rb +++ b/lib/datadog/profiling/pprof/template.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/profiling/pprof/payload' -require 'datadog/profiling/pprof/message_set' -require 'datadog/profiling/pprof/builder' +require_relative 'payload' +require_relative 'message_set' +require_relative 'builder' -require 'datadog/profiling/events/stack' -require 'datadog/profiling/pprof/stack_sample' +require_relative '../events/stack' +require_relative 'stack_sample' module Datadog module Profiling diff --git a/lib/datadog/profiling/preload.rb b/lib/datadog/profiling/preload.rb index 915cdd7827e..94f06458a92 100644 --- a/lib/datadog/profiling/preload.rb +++ b/lib/datadog/profiling/preload.rb @@ -1,5 +1,5 @@ # typed: strict -require 'ddtrace' +require_relative '../../ddtrace' Datadog::Profiling.start_if_enabled diff --git a/lib/datadog/profiling/scheduler.rb b/lib/datadog/profiling/scheduler.rb index 4c803df3541..5fa147c69bb 100644 --- a/lib/datadog/profiling/scheduler.rb +++ b/lib/datadog/profiling/scheduler.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/utils/time' +require_relative '../core/utils/time' -require 'datadog/core/worker' -require 'datadog/core/workers/polling' +require_relative '../core/worker' +require_relative '../core/workers/polling' module Datadog module Profiling diff --git a/lib/datadog/profiling/tag_builder.rb b/lib/datadog/profiling/tag_builder.rb index 6b7df6fd43f..53d36136a0c 100644 --- a/lib/datadog/profiling/tag_builder.rb +++ b/lib/datadog/profiling/tag_builder.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils' +require_relative '../core/utils' module Datadog module Profiling diff --git a/lib/datadog/profiling/tasks/setup.rb b/lib/datadog/profiling/tasks/setup.rb index 27ddc4943e8..0035142a890 100644 --- a/lib/datadog/profiling/tasks/setup.rb +++ b/lib/datadog/profiling/tasks/setup.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/utils/only_once' -require 'datadog/profiling/ext/forking' +require_relative '../../core/utils/only_once' +require_relative '../ext/forking' module Datadog module Profiling diff --git a/lib/datadog/profiling/trace_identifiers/ddtrace.rb b/lib/datadog/profiling/trace_identifiers/ddtrace.rb index 41a0f5e4658..d90a75f99fe 100644 --- a/lib/datadog/profiling/trace_identifiers/ddtrace.rb +++ b/lib/datadog/profiling/trace_identifiers/ddtrace.rb @@ -2,8 +2,8 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' +require_relative '../../tracing' +require_relative '../../tracing/metadata/ext' module Datadog module Profiling diff --git a/lib/datadog/profiling/trace_identifiers/helper.rb b/lib/datadog/profiling/trace_identifiers/helper.rb index 8675dae6584..4aa3846de9d 100644 --- a/lib/datadog/profiling/trace_identifiers/helper.rb +++ b/lib/datadog/profiling/trace_identifiers/helper.rb @@ -2,7 +2,7 @@ # typed: true -require 'datadog/profiling/trace_identifiers/ddtrace' +require_relative 'ddtrace' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http.rb b/lib/datadog/profiling/transport/http.rb index d20c7aea574..902f01d05ef 100644 --- a/lib/datadog/profiling/transport/http.rb +++ b/lib/datadog/profiling/transport/http.rb @@ -1,17 +1,17 @@ # typed: true -require 'datadog/core/environment/ext' -require 'ddtrace/transport/ext' +require_relative '../../core/environment/ext' +require_relative '../../../ddtrace/transport/ext' -require 'datadog/core/environment/container' -require 'datadog/core/environment/variable_helpers' +require_relative '../../core/environment/container' +require_relative '../../core/environment/variable_helpers' -require 'datadog/profiling/transport/http/builder' -require 'datadog/profiling/transport/http/api' +require_relative 'http/builder' +require_relative 'http/api' -require 'ddtrace/transport/http/adapters/net' -require 'ddtrace/transport/http/adapters/test' -require 'ddtrace/transport/http/adapters/unix_socket' +require_relative '../../../ddtrace/transport/http/adapters/net' +require_relative '../../../ddtrace/transport/http/adapters/test' +require_relative '../../../ddtrace/transport/http/adapters/unix_socket' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/api.rb b/lib/datadog/profiling/transport/http/api.rb index b2ec92ddbff..ef46534eff3 100644 --- a/lib/datadog/profiling/transport/http/api.rb +++ b/lib/datadog/profiling/transport/http/api.rb @@ -1,10 +1,10 @@ # typed: true -require 'ddtrace/transport/http/api/map' -require 'datadog/profiling/encoding/profile' -require 'datadog/profiling/transport/http/api/spec' -require 'datadog/profiling/transport/http/api/instance' -require 'datadog/profiling/transport/http/api/endpoint' +require_relative '../../../../ddtrace/transport/http/api/map' +require_relative '../../encoding/profile' +require_relative 'api/spec' +require_relative 'api/instance' +require_relative 'api/endpoint' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/api/endpoint.rb b/lib/datadog/profiling/transport/http/api/endpoint.rb index a318e61cc72..04bad6b38ba 100644 --- a/lib/datadog/profiling/transport/http/api/endpoint.rb +++ b/lib/datadog/profiling/transport/http/api/endpoint.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core/utils/compression' -require 'datadog/core/vendor/multipart-post/multipart/post/composite_read_io' -require 'datadog/profiling/old_ext' -require 'datadog/profiling/transport/http/response' -require 'ddtrace/transport/http/api/endpoint' +require_relative '../../../../core/utils/compression' +require_relative '../../../../core/vendor/multipart-post/multipart/post/composite_read_io' +require_relative '../../../old_ext' +require_relative '../response' +require_relative '../../../../../ddtrace/transport/http/api/endpoint' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/api/instance.rb b/lib/datadog/profiling/transport/http/api/instance.rb index fc05ee13486..2d58d58d6fc 100644 --- a/lib/datadog/profiling/transport/http/api/instance.rb +++ b/lib/datadog/profiling/transport/http/api/instance.rb @@ -1,7 +1,7 @@ # typed: true -require 'ddtrace/transport/http/api/instance' -require 'datadog/profiling/transport/http/api/spec' +require_relative '../../../../../ddtrace/transport/http/api/instance' +require_relative 'spec' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/api/spec.rb b/lib/datadog/profiling/transport/http/api/spec.rb index a16206e81ff..e9402b6516c 100644 --- a/lib/datadog/profiling/transport/http/api/spec.rb +++ b/lib/datadog/profiling/transport/http/api/spec.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/http/api/spec' +require_relative '../../../../../ddtrace/transport/http/api/spec' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/builder.rb b/lib/datadog/profiling/transport/http/builder.rb index f36fce658f1..f7eaf9b70ad 100644 --- a/lib/datadog/profiling/transport/http/builder.rb +++ b/lib/datadog/profiling/transport/http/builder.rb @@ -1,9 +1,9 @@ # typed: true -require 'ddtrace/transport/http/builder' +require_relative '../../../../ddtrace/transport/http/builder' -require 'datadog/profiling/transport/http/api' -require 'datadog/profiling/transport/http/client' +require_relative 'api' +require_relative 'client' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/client.rb b/lib/datadog/profiling/transport/http/client.rb index f3a68f97194..448da818acc 100644 --- a/lib/datadog/profiling/transport/http/client.rb +++ b/lib/datadog/profiling/transport/http/client.rb @@ -1,7 +1,7 @@ # typed: true -require 'ddtrace/transport/http/client' -require 'ddtrace/transport/request' +require_relative '../../../../ddtrace/transport/http/client' +require_relative '../../../../ddtrace/transport/request' module Datadog module Profiling diff --git a/lib/datadog/profiling/transport/http/response.rb b/lib/datadog/profiling/transport/http/response.rb index 0dd8ab686e9..447e0634e78 100644 --- a/lib/datadog/profiling/transport/http/response.rb +++ b/lib/datadog/profiling/transport/http/response.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/http/response' +require_relative '../../../../ddtrace/transport/http/response' module Datadog module Profiling diff --git a/lib/datadog/tracing.rb b/lib/datadog/tracing.rb index 45af0a38766..f7ad42256b4 100644 --- a/lib/datadog/tracing.rb +++ b/lib/datadog/tracing.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core' -require 'datadog/tracing/pipeline' +require_relative 'core' +require_relative 'tracing/pipeline' module Datadog # Datadog APM tracing public API. diff --git a/lib/datadog/tracing/analytics.rb b/lib/datadog/tracing/analytics.rb index 098adbeb9f7..4200bf30e12 100644 --- a/lib/datadog/tracing/analytics.rb +++ b/lib/datadog/tracing/analytics.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/metadata/ext' +require_relative 'metadata/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/buffer.rb b/lib/datadog/tracing/buffer.rb index 707a6426a3c..522ce635502 100644 --- a/lib/datadog/tracing/buffer.rb +++ b/lib/datadog/tracing/buffer.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core' -require 'datadog/core/environment/ext' -require 'datadog/core/buffer/thread_safe' -require 'datadog/core/buffer/cruby' -require 'datadog/core/diagnostics/health' +require_relative '../core' +require_relative '../core/environment/ext' +require_relative '../core/buffer/thread_safe' +require_relative '../core/buffer/cruby' +require_relative '../core/diagnostics/health' module Datadog module Tracing diff --git a/lib/datadog/tracing/context.rb b/lib/datadog/tracing/context.rb index 8ab204b5168..c8aca180161 100644 --- a/lib/datadog/tracing/context.rb +++ b/lib/datadog/tracing/context.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils/forking' +require_relative '../core/utils/forking' module Datadog module Tracing diff --git a/lib/datadog/tracing/context_provider.rb b/lib/datadog/tracing/context_provider.rb index a1f70f252fa..68a61491ec7 100644 --- a/lib/datadog/tracing/context_provider.rb +++ b/lib/datadog/tracing/context_provider.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/core/utils/sequence' -require 'datadog/tracing/context' +require_relative '../core/utils/sequence' +require_relative 'context' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib.rb b/lib/datadog/tracing/contrib.rb index 0402212848d..6a0187117e3 100644 --- a/lib/datadog/tracing/contrib.rb +++ b/lib/datadog/tracing/contrib.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/registry' -require 'datadog/tracing/contrib/extensions' +require_relative '../tracing' +require_relative 'contrib/registry' +require_relative 'contrib/extensions' module Datadog module Tracing @@ -30,48 +30,48 @@ module Contrib end end -require 'datadog/tracing/contrib/action_cable/integration' -require 'datadog/tracing/contrib/action_mailer/integration' -require 'datadog/tracing/contrib/action_pack/integration' -require 'datadog/tracing/contrib/action_view/integration' -require 'datadog/tracing/contrib/active_model_serializers/integration' -require 'datadog/tracing/contrib/active_job/integration' -require 'datadog/tracing/contrib/active_record/integration' -require 'datadog/tracing/contrib/active_support/integration' -require 'datadog/tracing/contrib/aws/integration' -require 'datadog/tracing/contrib/concurrent_ruby/integration' -require 'datadog/tracing/contrib/dalli/integration' -require 'datadog/tracing/contrib/delayed_job/integration' -require 'datadog/tracing/contrib/elasticsearch/integration' -require 'datadog/tracing/contrib/ethon/integration' -require 'datadog/tracing/contrib/excon/integration' -require 'datadog/tracing/contrib/faraday/integration' -require 'datadog/tracing/contrib/grape/integration' -require 'datadog/tracing/contrib/graphql/integration' -require 'datadog/tracing/contrib/grpc/integration' -require 'datadog/tracing/contrib/http/integration' -require 'datadog/tracing/contrib/httpclient/integration' -require 'datadog/tracing/contrib/httprb/integration' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/kafka/integration' -require 'datadog/tracing/contrib/lograge/integration' -require 'datadog/tracing/contrib/mongodb/integration' -require 'datadog/tracing/contrib/mysql2/integration' -require 'datadog/tracing/contrib/pg/integration' -require 'datadog/tracing/contrib/presto/integration' -require 'datadog/tracing/contrib/qless/integration' -require 'datadog/tracing/contrib/que/integration' -require 'datadog/tracing/contrib/racecar/integration' -require 'datadog/tracing/contrib/rack/integration' -require 'datadog/tracing/contrib/rails/integration' -require 'datadog/tracing/contrib/rake/integration' -require 'datadog/tracing/contrib/redis/integration' -require 'datadog/tracing/contrib/resque/integration' -require 'datadog/tracing/contrib/rest_client/integration' -require 'datadog/tracing/contrib/semantic_logger/integration' -require 'datadog/tracing/contrib/sequel/integration' -require 'datadog/tracing/contrib/shoryuken/integration' -require 'datadog/tracing/contrib/sidekiq/integration' -require 'datadog/tracing/contrib/sinatra/integration' -require 'datadog/tracing/contrib/sneakers/integration' -require 'datadog/tracing/contrib/sucker_punch/integration' +require_relative 'contrib/action_cable/integration' +require_relative 'contrib/action_mailer/integration' +require_relative 'contrib/action_pack/integration' +require_relative 'contrib/action_view/integration' +require_relative 'contrib/active_model_serializers/integration' +require_relative 'contrib/active_job/integration' +require_relative 'contrib/active_record/integration' +require_relative 'contrib/active_support/integration' +require_relative 'contrib/aws/integration' +require_relative 'contrib/concurrent_ruby/integration' +require_relative 'contrib/dalli/integration' +require_relative 'contrib/delayed_job/integration' +require_relative 'contrib/elasticsearch/integration' +require_relative 'contrib/ethon/integration' +require_relative 'contrib/excon/integration' +require_relative 'contrib/faraday/integration' +require_relative 'contrib/grape/integration' +require_relative 'contrib/graphql/integration' +require_relative 'contrib/grpc/integration' +require_relative 'contrib/http/integration' +require_relative 'contrib/httpclient/integration' +require_relative 'contrib/httprb/integration' +require_relative 'contrib/integration' +require_relative 'contrib/kafka/integration' +require_relative 'contrib/lograge/integration' +require_relative 'contrib/mongodb/integration' +require_relative 'contrib/mysql2/integration' +require_relative 'contrib/pg/integration' +require_relative 'contrib/presto/integration' +require_relative 'contrib/qless/integration' +require_relative 'contrib/que/integration' +require_relative 'contrib/racecar/integration' +require_relative 'contrib/rack/integration' +require_relative 'contrib/rails/integration' +require_relative 'contrib/rake/integration' +require_relative 'contrib/redis/integration' +require_relative 'contrib/resque/integration' +require_relative 'contrib/rest_client/integration' +require_relative 'contrib/semantic_logger/integration' +require_relative 'contrib/sequel/integration' +require_relative 'contrib/shoryuken/integration' +require_relative 'contrib/sidekiq/integration' +require_relative 'contrib/sinatra/integration' +require_relative 'contrib/sneakers/integration' +require_relative 'contrib/sucker_punch/integration' diff --git a/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb b/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb index dc66863e819..aeb2a91a88a 100644 --- a/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/action_cable/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/event.rb b/lib/datadog/tracing/contrib/action_cable/event.rb index 326d6340986..875c7821d7a 100644 --- a/lib/datadog/tracing/contrib/action_cable/event.rb +++ b/lib/datadog/tracing/contrib/action_cable/event.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/context' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/action_cable/ext' +require_relative '../../../tracing' +require_relative '../../context' +require_relative '../analytics' +require_relative '../active_support/notifications/event' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/events.rb b/lib/datadog/tracing/contrib/action_cable/events.rb index a2c3cc85dca..6caa5d54c5f 100644 --- a/lib/datadog/tracing/contrib/action_cable/events.rb +++ b/lib/datadog/tracing/contrib/action_cable/events.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/action_cable/event' -require 'datadog/tracing/contrib/action_cable/events/broadcast' -require 'datadog/tracing/contrib/action_cable/events/perform_action' -require 'datadog/tracing/contrib/action_cable/events/transmit' +require_relative 'event' +require_relative 'events/broadcast' +require_relative 'events/perform_action' +require_relative 'events/transmit' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb b/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb index 4f1bbff5258..0c766f142d1 100644 --- a/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +++ b/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_cable/event' -require 'datadog/tracing/contrib/action_cable/ext' -require 'datadog/tracing/contrib/analytics' +require_relative '../../../metadata/ext' +require_relative '../event' +require_relative '../ext' +require_relative '../../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb b/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb index 78aaecbc02a..d7249c1dd29 100644 --- a/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +++ b/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/action_cable/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/events/transmit.rb b/lib/datadog/tracing/contrib/action_cable/events/transmit.rb index 695c02893bc..3fa21374dc0 100644 --- a/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +++ b/lib/datadog/tracing/contrib/action_cable/events/transmit.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_cable/event' -require 'datadog/tracing/contrib/action_cable/ext' -require 'datadog/tracing/contrib/analytics' +require_relative '../../../metadata/ext' +require_relative '../event' +require_relative '../ext' +require_relative '../../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/instrumentation.rb b/lib/datadog/tracing/contrib/action_cable/instrumentation.rb index d426f5886b1..e39dfec9cfd 100644 --- a/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +++ b/lib/datadog/tracing/contrib/action_cable/instrumentation.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_cable/ext' -require 'datadog/tracing/contrib/analytics' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative 'ext' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/integration.rb b/lib/datadog/tracing/contrib/action_cable/integration.rb index 45e80af8b9d..8069efc6b8a 100644 --- a/lib/datadog/tracing/contrib/action_cable/integration.rb +++ b/lib/datadog/tracing/contrib/action_cable/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/action_cable/configuration/settings' -require 'datadog/tracing/contrib/action_cable/patcher' -require 'datadog/tracing/contrib/rails/utils' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_cable/patcher.rb b/lib/datadog/tracing/contrib/action_cable/patcher.rb index d7300af35eb..ee40efa68d7 100644 --- a/lib/datadog/tracing/contrib/action_cable/patcher.rb +++ b/lib/datadog/tracing/contrib/action_cable/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/action_cable/ext' -require 'datadog/tracing/contrib/action_cable/events' -require 'datadog/tracing/contrib/action_cable/instrumentation' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb b/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb index 3226cd5a98a..64d443a92a5 100644 --- a/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/action_mailer/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/event.rb b/lib/datadog/tracing/contrib/action_mailer/event.rb index 795b9d67aa0..b6f60754399 100644 --- a/lib/datadog/tracing/contrib/action_mailer/event.rb +++ b/lib/datadog/tracing/contrib/action_mailer/event.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/action_mailer/ext' +require_relative '../analytics' +require_relative '../active_support/notifications/event' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/events.rb b/lib/datadog/tracing/contrib/action_mailer/events.rb index 77d01db4a0f..be6464d552e 100644 --- a/lib/datadog/tracing/contrib/action_mailer/events.rb +++ b/lib/datadog/tracing/contrib/action_mailer/events.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/action_mailer/events/process' -require 'datadog/tracing/contrib/action_mailer/events/deliver' +require_relative 'events/process' +require_relative 'events/deliver' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb b/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb index e464a585b4e..e0473f4c1a4 100644 --- a/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +++ b/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_mailer/ext' -require 'datadog/tracing/contrib/action_mailer/event' +require_relative '../../../metadata/ext' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/events/process.rb b/lib/datadog/tracing/contrib/action_mailer/events/process.rb index 0ad73c2cfcc..9118f4d9aef 100644 --- a/lib/datadog/tracing/contrib/action_mailer/events/process.rb +++ b/lib/datadog/tracing/contrib/action_mailer/events/process.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_mailer/ext' -require 'datadog/tracing/contrib/action_mailer/event' +require_relative '../../../metadata/ext' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/integration.rb b/lib/datadog/tracing/contrib/action_mailer/integration.rb index 93cef39a0a1..f0a6a0bcc17 100644 --- a/lib/datadog/tracing/contrib/action_mailer/integration.rb +++ b/lib/datadog/tracing/contrib/action_mailer/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/action_mailer/configuration/settings' -require 'datadog/tracing/contrib/action_mailer/patcher' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rails/utils' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../integration' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_mailer/patcher.rb b/lib/datadog/tracing/contrib/action_mailer/patcher.rb index 8baeaab4095..2fef482bbf1 100644 --- a/lib/datadog/tracing/contrib/action_mailer/patcher.rb +++ b/lib/datadog/tracing/contrib/action_mailer/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/action_mailer/ext' -require 'datadog/tracing/contrib/action_mailer/events' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb b/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb index 400c1fb0a5a..6e307a7aa0d 100644 --- a/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +++ b/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb @@ -1,12 +1,12 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' +require_relative '../../../../tracing' +require_relative '../../../metadata/ext' -require 'datadog/tracing/contrib/action_pack/ext' -require 'datadog/tracing/contrib/action_pack/utils' -require 'datadog/tracing/contrib/rack/middlewares' -require 'datadog/tracing/contrib/analytics' +require_relative '../ext' +require_relative '../utils' +require_relative '../../rack/middlewares' +require_relative '../../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb b/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb index c153dbb8933..01a0821a393 100644 --- a/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +++ b/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/action_pack/action_controller/instrumentation' +require_relative '../../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb b/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb index 9f68731f820..1a2c90c0c57 100644 --- a/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/action_pack/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/integration.rb b/lib/datadog/tracing/contrib/action_pack/integration.rb index 720733eddac..77a15ccbca9 100644 --- a/lib/datadog/tracing/contrib/action_pack/integration.rb +++ b/lib/datadog/tracing/contrib/action_pack/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/action_pack/configuration/settings' -require 'datadog/tracing/contrib/action_pack/patcher' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rails/utils' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../integration' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/patcher.rb b/lib/datadog/tracing/contrib/action_pack/patcher.rb index a346ba3f513..2e0b3268ad4 100644 --- a/lib/datadog/tracing/contrib/action_pack/patcher.rb +++ b/lib/datadog/tracing/contrib/action_pack/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/action_pack/action_controller/patcher' +require_relative '../patcher' +require_relative 'action_controller/patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_pack/utils.rb b/lib/datadog/tracing/contrib/action_pack/utils.rb index e79122eb487..ca2943e1ac2 100644 --- a/lib/datadog/tracing/contrib/action_pack/utils.rb +++ b/lib/datadog/tracing/contrib/action_pack/utils.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/configuration/settings.rb b/lib/datadog/tracing/contrib/action_view/configuration/settings.rb index 0ef057a97bd..68c48f90899 100644 --- a/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/action_view/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/action_view/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/event.rb b/lib/datadog/tracing/contrib/action_view/event.rb index 92e323b1456..f74ed578a78 100644 --- a/lib/datadog/tracing/contrib/action_view/event.rb +++ b/lib/datadog/tracing/contrib/action_view/event.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/active_support/notifications/event' +require_relative '../active_support/notifications/event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/events.rb b/lib/datadog/tracing/contrib/action_view/events.rb index ddae25402e3..c53a1d51eec 100644 --- a/lib/datadog/tracing/contrib/action_view/events.rb +++ b/lib/datadog/tracing/contrib/action_view/events.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/action_view/events/render_partial' -require 'datadog/tracing/contrib/action_view/events/render_template' +require_relative 'events/render_partial' +require_relative 'events/render_template' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/events/render_partial.rb b/lib/datadog/tracing/contrib/action_view/events/render_partial.rb index 6a58740b2e9..a7029523c75 100644 --- a/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +++ b/lib/datadog/tracing/contrib/action_view/events/render_partial.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/action_view/ext' -require 'datadog/tracing/contrib/action_view/event' +require_relative '../../../../tracing' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/events/render_template.rb b/lib/datadog/tracing/contrib/action_view/events/render_template.rb index dd82872451e..13df65ab8ee 100644 --- a/lib/datadog/tracing/contrib/action_view/events/render_template.rb +++ b/lib/datadog/tracing/contrib/action_view/events/render_template.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/action_view/ext' -require 'datadog/tracing/contrib/action_view/event' +require_relative '../../../../tracing' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb b/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb index 126f08b7e2c..c1787c4778e 100644 --- a/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb +++ b/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_view/ext' +require_relative '../../../metadata/ext' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb b/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb index ba68cfcd118..1e8ecf23098 100644 --- a/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb +++ b/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/action_view/ext' +require_relative '../../../metadata/ext' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/integration.rb b/lib/datadog/tracing/contrib/action_view/integration.rb index b81a1a26f4c..6dd2e6cab76 100644 --- a/lib/datadog/tracing/contrib/action_view/integration.rb +++ b/lib/datadog/tracing/contrib/action_view/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/action_view/configuration/settings' -require 'datadog/tracing/contrib/action_view/patcher' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rails/utils' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../integration' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/patcher.rb b/lib/datadog/tracing/contrib/action_view/patcher.rb index 86fa8a1bbbf..29fe982c88c 100644 --- a/lib/datadog/tracing/contrib/action_view/patcher.rb +++ b/lib/datadog/tracing/contrib/action_view/patcher.rb @@ -1,12 +1,12 @@ # typed: true -require 'datadog/core' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/action_view/events' -require 'datadog/tracing/contrib/action_view/ext' -require 'datadog/tracing/contrib/action_view/instrumentation/partial_renderer' -require 'datadog/tracing/contrib/action_view/instrumentation/template_renderer' -require 'datadog/tracing/contrib/action_view/utils' +require_relative '../../../core' +require_relative '../patcher' +require_relative 'events' +require_relative 'ext' +require_relative 'instrumentation/partial_renderer' +require_relative 'instrumentation/template_renderer' +require_relative 'utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/action_view/utils.rb b/lib/datadog/tracing/contrib/action_view/utils.rb index 6cb8a399829..4433ae4940e 100644 --- a/lib/datadog/tracing/contrib/action_view/utils.rb +++ b/lib/datadog/tracing/contrib/action_view/utils.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/configuration/settings.rb b/lib/datadog/tracing/contrib/active_job/configuration/settings.rb index f02fdd19079..ecd9c9dbc48 100644 --- a/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/active_job/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/configuration/settings' +require_relative '../../../span_operation' +require_relative '../ext' +require_relative '../../configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/event.rb b/lib/datadog/tracing/contrib/active_job/event.rb index b798d9d356a..d5bbfcd28b3 100644 --- a/lib/datadog/tracing/contrib/active_job/event.rb +++ b/lib/datadog/tracing/contrib/active_job/event.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/active_job/ext' +require_relative '../../metadata/ext' +require_relative '../active_support/notifications/event' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events.rb b/lib/datadog/tracing/contrib/active_job/events.rb index f61c857f90d..a04539c74dd 100644 --- a/lib/datadog/tracing/contrib/active_job/events.rb +++ b/lib/datadog/tracing/contrib/active_job/events.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing/contrib/active_job/events/discard' -require 'datadog/tracing/contrib/active_job/events/enqueue' -require 'datadog/tracing/contrib/active_job/events/enqueue_at' -require 'datadog/tracing/contrib/active_job/events/enqueue_retry' -require 'datadog/tracing/contrib/active_job/events/perform' -require 'datadog/tracing/contrib/active_job/events/retry_stopped' +require_relative 'events/discard' +require_relative 'events/enqueue' +require_relative 'events/enqueue_at' +require_relative 'events/enqueue_retry' +require_relative 'events/perform' +require_relative 'events/retry_stopped' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/discard.rb b/lib/datadog/tracing/contrib/active_job/events/discard.rb index 6effc1d382f..13432cede2b 100644 --- a/lib/datadog/tracing/contrib/active_job/events/discard.rb +++ b/lib/datadog/tracing/contrib/active_job/events/discard.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/enqueue.rb b/lib/datadog/tracing/contrib/active_job/events/enqueue.rb index 624337d59eb..e33cf5ff398 100644 --- a/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +++ b/lib/datadog/tracing/contrib/active_job/events/enqueue.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb b/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb index 293380fda2a..9d0fde2b83d 100644 --- a/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +++ b/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb b/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb index ce91a6e50fa..202f7b5169f 100644 --- a/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +++ b/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/perform.rb b/lib/datadog/tracing/contrib/active_job/events/perform.rb index bb165632717..9d8768ac081 100644 --- a/lib/datadog/tracing/contrib/active_job/events/perform.rb +++ b/lib/datadog/tracing/contrib/active_job/events/perform.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb b/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb index eba91dddce0..7a8096f346a 100644 --- a/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +++ b/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/integration.rb b/lib/datadog/tracing/contrib/active_job/integration.rb index c144d802370..e89ed34e50d 100644 --- a/lib/datadog/tracing/contrib/active_job/integration.rb +++ b/lib/datadog/tracing/contrib/active_job/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/active_job/configuration/settings' -require 'datadog/tracing/contrib/active_job/patcher' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rails/utils' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../integration' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/log_injection.rb b/lib/datadog/tracing/contrib/active_job/log_injection.rb index 396ddb7104e..0a3bec21a4a 100644 --- a/lib/datadog/tracing/contrib/active_job/log_injection.rb +++ b/lib/datadog/tracing/contrib/active_job/log_injection.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing' +require_relative '../../../tracing' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_job/patcher.rb b/lib/datadog/tracing/contrib/active_job/patcher.rb index 838897c2e9f..7f6aa0f9006 100644 --- a/lib/datadog/tracing/contrib/active_job/patcher.rb +++ b/lib/datadog/tracing/contrib/active_job/patcher.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/active_job/ext' -require 'datadog/tracing/contrib/active_job/events' -require 'datadog/tracing/contrib/active_job/log_injection' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' +require_relative 'log_injection' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb b/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb index 0c4be0c574e..d7094289278 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/active_model_serializers/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/event.rb b/lib/datadog/tracing/contrib/active_model_serializers/event.rb index 9937fd1a760..193c891920c 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/event.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/event.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/active_model_serializers/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative '../active_support/notifications/event' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/events.rb b/lib/datadog/tracing/contrib/active_model_serializers/events.rb index 5c56f82bea3..13c377c963e 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/events.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/events.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/active_model_serializers/events/render' -require 'datadog/tracing/contrib/active_model_serializers/events/serialize' +require_relative 'events/render' +require_relative 'events/serialize' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb b/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb index ad2cab41332..a3cb771602c 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/active_model_serializers/ext' -require 'datadog/tracing/contrib/active_model_serializers/event' +require_relative '../../../metadata/ext' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb b/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb index d200ce92057..bf601cd34f8 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/active_model_serializers/ext' -require 'datadog/tracing/contrib/active_model_serializers/event' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/integration.rb b/lib/datadog/tracing/contrib/active_model_serializers/integration.rb index ec036760c16..5d3478f816c 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/integration.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/active_model_serializers/configuration/settings' -require 'datadog/tracing/contrib/active_model_serializers/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb b/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb index 2aded5909ff..e0ee55ee984 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/active_model_serializers/ext' -require 'datadog/tracing/contrib/active_model_serializers/events' +require_relative '../../../tracing' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb b/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb index 5b9b250a62b..afa4cf6e887 100644 --- a/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +++ b/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/resolver' -require 'datadog/tracing/contrib/active_record/vendor/connection_specification' +require_relative '../../configuration/resolver' +require_relative '../vendor/connection_specification' require_relative 'makara_resolver' module Datadog diff --git a/lib/datadog/tracing/contrib/active_record/configuration/settings.rb b/lib/datadog/tracing/contrib/active_record/configuration/settings.rb index e09060922a0..55f381b22ab 100644 --- a/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/active_record/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/active_record/ext' -require 'datadog/tracing/contrib/active_record/utils' +require_relative '../../configuration/settings' +require_relative '../ext' +require_relative '../utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/event.rb b/lib/datadog/tracing/contrib/active_record/event.rb index ef27adc8066..1cd80a3059a 100644 --- a/lib/datadog/tracing/contrib/active_record/event.rb +++ b/lib/datadog/tracing/contrib/active_record/event.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/active_support/notifications/event' +require_relative '../active_support/notifications/event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/events.rb b/lib/datadog/tracing/contrib/active_record/events.rb index 0870bfd1934..ac4f8fd88cf 100644 --- a/lib/datadog/tracing/contrib/active_record/events.rb +++ b/lib/datadog/tracing/contrib/active_record/events.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/active_record/events/instantiation' -require 'datadog/tracing/contrib/active_record/events/sql' +require_relative 'events/instantiation' +require_relative 'events/sql' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/events/instantiation.rb b/lib/datadog/tracing/contrib/active_record/events/instantiation.rb index 4d3be1c8b0c..63f590ea5bb 100644 --- a/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +++ b/lib/datadog/tracing/contrib/active_record/events/instantiation.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_record/ext' -require 'datadog/tracing/contrib/active_record/event' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/events/sql.rb b/lib/datadog/tracing/contrib/active_record/events/sql.rb index 2d385e12915..6dedb2cfdf6 100644 --- a/lib/datadog/tracing/contrib/active_record/events/sql.rb +++ b/lib/datadog/tracing/contrib/active_record/events/sql.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/active_record/event' -require 'datadog/tracing/contrib/active_record/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/utils/database' +require_relative '../../../../tracing' +require_relative '../../../metadata/ext' +require_relative '../event' +require_relative '../ext' +require_relative '../../analytics' +require_relative '../../utils/database' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/integration.rb b/lib/datadog/tracing/contrib/active_record/integration.rb index e74c10b0495..634e869b89b 100644 --- a/lib/datadog/tracing/contrib/active_record/integration.rb +++ b/lib/datadog/tracing/contrib/active_record/integration.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing/contrib/active_record/configuration/resolver' -require 'datadog/tracing/contrib/active_record/configuration/settings' -require 'datadog/tracing/contrib/active_record/events' -require 'datadog/tracing/contrib/active_record/patcher' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rails/utils' +require_relative 'configuration/resolver' +require_relative 'configuration/settings' +require_relative 'events' +require_relative 'patcher' +require_relative '../integration' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/patcher.rb b/lib/datadog/tracing/contrib/active_record/patcher.rb index b035e4e5dbc..7b1b62c5030 100644 --- a/lib/datadog/tracing/contrib/active_record/patcher.rb +++ b/lib/datadog/tracing/contrib/active_record/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/active_record/events' +require_relative '../patcher' +require_relative 'events' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_record/utils.rb b/lib/datadog/tracing/contrib/active_record/utils.rb index 276d312f7dd..a4646dafad3 100644 --- a/lib/datadog/tracing/contrib/active_record/utils.rb +++ b/lib/datadog/tracing/contrib/active_record/utils.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/environment/ext' -require 'datadog/tracing/contrib/utils/database' +require_relative '../../../core/environment/ext' +require_relative '../utils/database' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb index e1a454bf350..6ce32fccb85 100644 --- a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +++ b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/core/utils' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/active_support/ext' +require_relative '../../../../core/utils' +require_relative '../../../metadata/ext' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/cache/patcher.rb b/lib/datadog/tracing/contrib/active_support/cache/patcher.rb index f1643e510b1..91be736635c 100644 --- a/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +++ b/lib/datadog/tracing/contrib/active_support/cache/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/active_support/cache/instrumentation' +require_relative '../../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/cache/redis.rb b/lib/datadog/tracing/contrib/active_support/cache/redis.rb index 5c26d16b6fc..4983bfb8e19 100644 --- a/lib/datadog/tracing/contrib/active_support/cache/redis.rb +++ b/lib/datadog/tracing/contrib/active_support/cache/redis.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/active_support/cache/patcher' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/configuration/settings.rb b/lib/datadog/tracing/contrib/active_support/configuration/settings.rb index 73d5f4e5305..b4efb2accbb 100644 --- a/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/active_support/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/active_support/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/integration.rb b/lib/datadog/tracing/contrib/active_support/integration.rb index 533f815684a..ccce70d6dd2 100644 --- a/lib/datadog/tracing/contrib/active_support/integration.rb +++ b/lib/datadog/tracing/contrib/active_support/integration.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/active_support/configuration/settings' -require 'datadog/tracing/contrib/active_support/patcher' -require 'datadog/tracing/contrib/active_support/cache/redis' -require 'datadog/tracing/contrib/rails/utils' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative 'cache/redis' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/notifications/event.rb b/lib/datadog/tracing/contrib/active_support/notifications/event.rb index c2ee59b8288..46ed5af126e 100644 --- a/lib/datadog/tracing/contrib/active_support/notifications/event.rb +++ b/lib/datadog/tracing/contrib/active_support/notifications/event.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/active_support/notifications/subscriber' +require_relative 'subscriber' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb b/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb index 54c5cff4325..e14c266aeb0 100644 --- a/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +++ b/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb @@ -1,7 +1,7 @@ # typed: true require 'set' -require 'datadog/tracing/contrib/active_support/notifications/subscription' +require_relative 'subscription' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/active_support/patcher.rb b/lib/datadog/tracing/contrib/active_support/patcher.rb index 562c4f530e5..c66719acd2e 100644 --- a/lib/datadog/tracing/contrib/active_support/patcher.rb +++ b/lib/datadog/tracing/contrib/active_support/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/active_support/cache/patcher' +require_relative '../patcher' +require_relative 'cache/patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/analytics.rb b/lib/datadog/tracing/contrib/analytics.rb index 5f5ba6304f2..ffe5d0b731c 100644 --- a/lib/datadog/tracing/contrib/analytics.rb +++ b/lib/datadog/tracing/contrib/analytics.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/auto_instrument.rb b/lib/datadog/tracing/contrib/auto_instrument.rb index 530e7c89d18..35cea614331 100644 --- a/lib/datadog/tracing/contrib/auto_instrument.rb +++ b/lib/datadog/tracing/contrib/auto_instrument.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib' -require 'datadog/tracing/contrib/extensions' +require_relative '../contrib' +require_relative 'extensions' module Datadog module Tracing @@ -9,11 +9,11 @@ module Tracing module Contrib # Auto-activate instrumentation def self.auto_instrument! - require 'datadog/tracing/contrib/rails/utils' + require_relative 'rails/utils' # Defer to Rails if this is a Rails application if Datadog::Tracing::Contrib::Rails::Utils.railtie_supported? - require 'datadog/tracing/contrib/rails/auto_instrument_railtie' + require_relative 'rails/auto_instrument_railtie' else AutoInstrument.patch_all! end diff --git a/lib/datadog/tracing/contrib/aws/configuration/settings.rb b/lib/datadog/tracing/contrib/aws/configuration/settings.rb index 09334f68d3d..e41ddc50a41 100644 --- a/lib/datadog/tracing/contrib/aws/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/aws/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/aws/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/aws/instrumentation.rb b/lib/datadog/tracing/contrib/aws/instrumentation.rb index be1aecb7eac..17504e41d74 100644 --- a/lib/datadog/tracing/contrib/aws/instrumentation.rb +++ b/lib/datadog/tracing/contrib/aws/instrumentation.rb @@ -1,9 +1,9 @@ # typed: ignore -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/aws/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/aws/integration.rb b/lib/datadog/tracing/contrib/aws/integration.rb index a3310028619..2fcc2e6b3ac 100644 --- a/lib/datadog/tracing/contrib/aws/integration.rb +++ b/lib/datadog/tracing/contrib/aws/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/aws/configuration/settings' -require 'datadog/tracing/contrib/aws/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/aws/patcher.rb b/lib/datadog/tracing/contrib/aws/patcher.rb index cd51006a08f..7cb9587024d 100644 --- a/lib/datadog/tracing/contrib/aws/patcher.rb +++ b/lib/datadog/tracing/contrib/aws/patcher.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/aws/ext' +require_relative '../patcher' +require_relative 'ext' module Datadog module Tracing @@ -18,9 +18,9 @@ def target_version end def patch - require 'datadog/tracing/contrib/aws/parsed_context' - require 'datadog/tracing/contrib/aws/instrumentation' - require 'datadog/tracing/contrib/aws/services' + require_relative 'parsed_context' + require_relative 'instrumentation' + require_relative 'services' add_plugin(Seahorse::Client::Base, *loaded_constants) diff --git a/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb b/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb index 1d277b0a9f4..f3567739490 100644 --- a/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/concurrent_ruby/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb b/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb index 1bc617d6e6d..30a7941d087 100644 --- a/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb +++ b/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service' +require_relative 'context_composite_executor_service' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb b/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb index 980d629b6e9..b19839037e9 100644 --- a/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb +++ b/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/concurrent_ruby/patcher' -require 'datadog/tracing/contrib/concurrent_ruby/configuration/settings' +require_relative '../integration' +require_relative 'patcher' +require_relative 'configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb b/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb index 4f20d936633..90a793137e7 100644 --- a/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +++ b/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -18,7 +18,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/concurrent_ruby/future_patch' + require_relative 'future_patch' patch_future end diff --git a/lib/datadog/tracing/contrib/configurable.rb b/lib/datadog/tracing/contrib/configurable.rb index 1ce854f69f8..472c7ea9f52 100644 --- a/lib/datadog/tracing/contrib/configurable.rb +++ b/lib/datadog/tracing/contrib/configurable.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/configuration/resolver' -require 'datadog/tracing/contrib/configuration/settings' +require_relative 'configuration/resolver' +require_relative 'configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb b/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb index f0755b1426e..79ca05b97f7 100644 --- a/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb +++ b/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/configuration/resolver' +require_relative '../resolver' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/configuration/settings.rb b/lib/datadog/tracing/contrib/configuration/settings.rb index 41faac76b12..105aaeaa237 100644 --- a/lib/datadog/tracing/contrib/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/configuration/base' -require 'datadog/core/utils/only_once' +require_relative '../../../core/configuration/base' +require_relative '../../../core/utils/only_once' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/dalli/configuration/settings.rb b/lib/datadog/tracing/contrib/dalli/configuration/settings.rb index b026b37c2d5..df15b502cf3 100644 --- a/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/dalli/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/dalli/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/dalli/instrumentation.rb b/lib/datadog/tracing/contrib/dalli/instrumentation.rb index c6d0bd88def..7a792c5e465 100644 --- a/lib/datadog/tracing/contrib/dalli/instrumentation.rb +++ b/lib/datadog/tracing/contrib/dalli/instrumentation.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/dalli/ext' -require 'datadog/tracing/contrib/dalli/quantize' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'quantize' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/dalli/integration.rb b/lib/datadog/tracing/contrib/dalli/integration.rb index 704a8c3ce66..c9d901c051e 100644 --- a/lib/datadog/tracing/contrib/dalli/integration.rb +++ b/lib/datadog/tracing/contrib/dalli/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/dalli/configuration/settings' -require 'datadog/tracing/contrib/dalli/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/dalli/patcher.rb b/lib/datadog/tracing/contrib/dalli/patcher.rb index 20ecd08892d..336c1a643cc 100644 --- a/lib/datadog/tracing/contrib/dalli/patcher.rb +++ b/lib/datadog/tracing/contrib/dalli/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/dalli/ext' -require 'datadog/tracing/contrib/dalli/instrumentation' -require 'datadog/tracing/contrib/patcher' +require_relative 'ext' +require_relative 'instrumentation' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/dalli/quantize.rb b/lib/datadog/tracing/contrib/dalli/quantize.rb index 763e0ef79e9..c5fca2686df 100644 --- a/lib/datadog/tracing/contrib/dalli/quantize.rb +++ b/lib/datadog/tracing/contrib/dalli/quantize.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/dalli/ext' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb b/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb index 9256bb17ac5..e460c671c23 100644 --- a/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/delayed_job/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/delayed_job/integration.rb b/lib/datadog/tracing/contrib/delayed_job/integration.rb index 6a4288bc822..d68ba57b708 100644 --- a/lib/datadog/tracing/contrib/delayed_job/integration.rb +++ b/lib/datadog/tracing/contrib/delayed_job/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/delayed_job/configuration/settings' -require 'datadog/tracing/contrib/delayed_job/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/delayed_job/patcher.rb b/lib/datadog/tracing/contrib/delayed_job/patcher.rb index 5292776461a..ca5a9ca0fcf 100644 --- a/lib/datadog/tracing/contrib/delayed_job/patcher.rb +++ b/lib/datadog/tracing/contrib/delayed_job/patcher.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -17,7 +17,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/delayed_job/plugin' + require_relative 'plugin' add_instrumentation(::Delayed::Worker) patch_server_internals end @@ -27,7 +27,7 @@ def add_instrumentation(klass) end def patch_server_internals - require 'datadog/tracing/contrib/delayed_job/server_internal_tracer/worker' + require_relative 'server_internal_tracer/worker' ::Delayed::Worker.prepend(ServerInternalTracer::Worker) end end diff --git a/lib/datadog/tracing/contrib/delayed_job/plugin.rb b/lib/datadog/tracing/contrib/delayed_job/plugin.rb index 4971677ee02..6a39693004b 100644 --- a/lib/datadog/tracing/contrib/delayed_job/plugin.rb +++ b/lib/datadog/tracing/contrib/delayed_job/plugin.rb @@ -2,10 +2,10 @@ require 'delayed/plugin' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/delayed_job/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb b/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb index 85a0731d218..34f6406f176 100644 --- a/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/elasticsearch/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/elasticsearch/integration.rb b/lib/datadog/tracing/contrib/elasticsearch/integration.rb index 069a9561a5b..9fe53b4211b 100644 --- a/lib/datadog/tracing/contrib/elasticsearch/integration.rb +++ b/lib/datadog/tracing/contrib/elasticsearch/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/elasticsearch/configuration/settings' -require 'datadog/tracing/contrib/elasticsearch/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/elasticsearch/patcher.rb b/lib/datadog/tracing/contrib/elasticsearch/patcher.rb index 5913adcbecc..4395bf72be0 100644 --- a/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +++ b/lib/datadog/tracing/contrib/elasticsearch/patcher.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/elasticsearch/ext' -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/patcher' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative '../integration' +require_relative '../patcher' module Datadog module Tracing @@ -24,7 +24,7 @@ def target_version def patch require 'uri' require 'json' - require 'datadog/tracing/contrib/elasticsearch/quantize' + require_relative 'quantize' patch_elasticsearch_transport_client end diff --git a/lib/datadog/tracing/contrib/elasticsearch/quantize.rb b/lib/datadog/tracing/contrib/elasticsearch/quantize.rb index 6d23a449016..31af533f7e5 100644 --- a/lib/datadog/tracing/contrib/elasticsearch/quantize.rb +++ b/lib/datadog/tracing/contrib/elasticsearch/quantize.rb @@ -1,4 +1,4 @@ -require 'datadog/tracing/contrib/utils/quantization/hash' +require_relative '../utils/quantization/hash' # typed: true diff --git a/lib/datadog/tracing/contrib/ethon/configuration/settings.rb b/lib/datadog/tracing/contrib/ethon/configuration/settings.rb index 0ea715d7a87..6f705eece6f 100644 --- a/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/ethon/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/ethon/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/ethon/easy_patch.rb b/lib/datadog/tracing/contrib/ethon/easy_patch.rb index 12f4e917ec3..3c42da6c484 100644 --- a/lib/datadog/tracing/contrib/ethon/easy_patch.rb +++ b/lib/datadog/tracing/contrib/ethon/easy_patch.rb @@ -2,11 +2,11 @@ require 'uri' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/ethon/ext' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative 'ext' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/ethon/integration.rb b/lib/datadog/tracing/contrib/ethon/integration.rb index f412e300cb6..993e5a948a5 100644 --- a/lib/datadog/tracing/contrib/ethon/integration.rb +++ b/lib/datadog/tracing/contrib/ethon/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/ethon/configuration/settings' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/ethon/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/ethon/multi_patch.rb b/lib/datadog/tracing/contrib/ethon/multi_patch.rb index 1d646d480b7..c86ace142a4 100644 --- a/lib/datadog/tracing/contrib/ethon/multi_patch.rb +++ b/lib/datadog/tracing/contrib/ethon/multi_patch.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/ethon/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/ethon/patcher.rb b/lib/datadog/tracing/contrib/ethon/patcher.rb index 202df21538a..6e412fe5498 100644 --- a/lib/datadog/tracing/contrib/ethon/patcher.rb +++ b/lib/datadog/tracing/contrib/ethon/patcher.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -18,8 +18,8 @@ def target_version end def patch - require 'datadog/tracing/contrib/ethon/easy_patch' - require 'datadog/tracing/contrib/ethon/multi_patch' + require_relative 'easy_patch' + require_relative 'multi_patch' ::Ethon::Easy.include(EasyPatch) ::Ethon::Multi.include(MultiPatch) diff --git a/lib/datadog/tracing/contrib/excon/configuration/settings.rb b/lib/datadog/tracing/contrib/excon/configuration/settings.rb index f5d3b33b087..3252eeb145d 100644 --- a/lib/datadog/tracing/contrib/excon/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/excon/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/excon/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/excon/integration.rb b/lib/datadog/tracing/contrib/excon/integration.rb index 4858d8967a4..4600d55cd65 100644 --- a/lib/datadog/tracing/contrib/excon/integration.rb +++ b/lib/datadog/tracing/contrib/excon/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/excon/configuration/settings' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/excon/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/excon/middleware.rb b/lib/datadog/tracing/contrib/excon/middleware.rb index d5858ed301f..07729658c6f 100644 --- a/lib/datadog/tracing/contrib/excon/middleware.rb +++ b/lib/datadog/tracing/contrib/excon/middleware.rb @@ -2,13 +2,13 @@ require 'excon' -require 'datadog/core' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/excon/ext' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../core' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative 'ext' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/excon/patcher.rb b/lib/datadog/tracing/contrib/excon/patcher.rb index 5edf334d221..29040c6afa1 100644 --- a/lib/datadog/tracing/contrib/excon/patcher.rb +++ b/lib/datadog/tracing/contrib/excon/patcher.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -17,7 +17,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/excon/middleware' + require_relative 'middleware' add_middleware end diff --git a/lib/datadog/tracing/contrib/extensions.rb b/lib/datadog/tracing/contrib/extensions.rb index 715a879c455..c04e7647d0e 100644 --- a/lib/datadog/tracing/contrib/extensions.rb +++ b/lib/datadog/tracing/contrib/extensions.rb @@ -2,7 +2,7 @@ require 'set' -require 'datadog/core/configuration/settings' +require_relative '../../core/configuration/settings' # Datadog module Datadog diff --git a/lib/datadog/tracing/contrib/faraday/configuration/settings.rb b/lib/datadog/tracing/contrib/faraday/configuration/settings.rb index ac0d4b5efee..5c5ad662587 100644 --- a/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/faraday/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/faraday/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/faraday/integration.rb b/lib/datadog/tracing/contrib/faraday/integration.rb index bb8704adced..59bd9c81020 100644 --- a/lib/datadog/tracing/contrib/faraday/integration.rb +++ b/lib/datadog/tracing/contrib/faraday/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/faraday/configuration/settings' -require 'datadog/tracing/contrib/faraday/patcher' +require_relative '../integration' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/faraday/middleware.rb b/lib/datadog/tracing/contrib/faraday/middleware.rb index ce7134486eb..176cdd1ccfb 100644 --- a/lib/datadog/tracing/contrib/faraday/middleware.rb +++ b/lib/datadog/tracing/contrib/faraday/middleware.rb @@ -2,12 +2,12 @@ require 'faraday' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/faraday/ext' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative 'ext' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/faraday/patcher.rb b/lib/datadog/tracing/contrib/faraday/patcher.rb index 9230210dc3c..ba7e611a762 100644 --- a/lib/datadog/tracing/contrib/faraday/patcher.rb +++ b/lib/datadog/tracing/contrib/faraday/patcher.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/faraday/connection' -require 'datadog/tracing/contrib/faraday/ext' -require 'datadog/tracing/contrib/faraday/rack_builder' -require 'datadog/tracing/contrib/patcher' +require_relative 'connection' +require_relative 'ext' +require_relative 'rack_builder' +require_relative '../patcher' module Datadog module Tracing @@ -20,7 +20,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/faraday/middleware' + require_relative 'middleware' register_middleware! add_default_middleware! diff --git a/lib/datadog/tracing/contrib/grape/configuration/settings.rb b/lib/datadog/tracing/contrib/grape/configuration/settings.rb index 5891bc38968..8478824d5f0 100644 --- a/lib/datadog/tracing/contrib/grape/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/grape/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/grape/ext' -require 'datadog/tracing/contrib/status_code_matcher' +require_relative '../../configuration/settings' +require_relative '../ext' +require_relative '../../status_code_matcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grape/endpoint.rb b/lib/datadog/tracing/contrib/grape/endpoint.rb index 593ee6f4fe9..be38d115c5c 100644 --- a/lib/datadog/tracing/contrib/grape/endpoint.rb +++ b/lib/datadog/tracing/contrib/grape/endpoint.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/core' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/rack/ext' +require_relative '../../../core' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative '../rack/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grape/integration.rb b/lib/datadog/tracing/contrib/grape/integration.rb index 13cea38e065..24774833de3 100644 --- a/lib/datadog/tracing/contrib/grape/integration.rb +++ b/lib/datadog/tracing/contrib/grape/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/grape/configuration/settings' -require 'datadog/tracing/contrib/grape/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grape/patcher.rb b/lib/datadog/tracing/contrib/grape/patcher.rb index ffd40874a97..0dcef26b165 100644 --- a/lib/datadog/tracing/contrib/grape/patcher.rb +++ b/lib/datadog/tracing/contrib/grape/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/grape/endpoint' -require 'datadog/tracing/contrib/grape/ext' -require 'datadog/tracing/contrib/grape/instrumentation' -require 'datadog/tracing/contrib/patcher' +require_relative 'endpoint' +require_relative 'ext' +require_relative 'instrumentation' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/graphql/configuration/settings.rb b/lib/datadog/tracing/contrib/graphql/configuration/settings.rb index c47423b959e..ad72235a8b5 100644 --- a/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/graphql/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/graphql/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/graphql/integration.rb b/lib/datadog/tracing/contrib/graphql/integration.rb index b3cd3cdbb16..8503b554af1 100644 --- a/lib/datadog/tracing/contrib/graphql/integration.rb +++ b/lib/datadog/tracing/contrib/graphql/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/graphql/configuration/settings' -require 'datadog/tracing/contrib/graphql/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/graphql/patcher.rb b/lib/datadog/tracing/contrib/graphql/patcher.rb index 73d7a8ac2a7..d51ee8ae573 100644 --- a/lib/datadog/tracing/contrib/graphql/patcher.rb +++ b/lib/datadog/tracing/contrib/graphql/patcher.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/patcher' +require_relative '../../../tracing' +require_relative '../analytics' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/configuration/settings.rb b/lib/datadog/tracing/contrib/grpc/configuration/settings.rb index 009dc99732d..4a7e5f8e738 100644 --- a/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/grpc/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/grpc/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb index 9e02f58fe7c..a4f98d22a94 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb @@ -1,9 +1,9 @@ # typed: ignore -require 'datadog/tracing' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/grpc/ext' -require 'datadog/tracing/contrib/grpc/configuration/settings' +require_relative '../../../tracing' +require_relative '../analytics' +require_relative 'ext' +require_relative 'configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb index 6f9338e68c1..6c0a2f57750 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb @@ -1,9 +1,9 @@ # typed: ignore -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/grpc/ext' +require_relative '../../../../tracing' +require_relative '../../../metadata/ext' +require_relative '../../analytics' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb index 0cf261fef77..4b6d99e15cb 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb @@ -1,11 +1,11 @@ # typed: ignore -require 'datadog/tracing' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/grpc' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/grpc/ext' +require_relative '../../../../tracing' +require_relative '../../../distributed/headers/ext' +require_relative '../../../metadata/ext' +require_relative '../../../propagation/grpc' +require_relative '../../analytics' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/integration.rb b/lib/datadog/tracing/contrib/grpc/integration.rb index a31436d1b57..e8d48f96a0e 100644 --- a/lib/datadog/tracing/contrib/grpc/integration.rb +++ b/lib/datadog/tracing/contrib/grpc/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/grpc/configuration/settings' -require 'datadog/tracing/contrib/grpc/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/grpc/patcher.rb b/lib/datadog/tracing/contrib/grpc/patcher.rb index 77f6f1b86ca..5d220db4e46 100644 --- a/lib/datadog/tracing/contrib/grpc/patcher.rb +++ b/lib/datadog/tracing/contrib/grpc/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/grpc/ext' -require 'datadog/tracing/contrib/patcher' +require_relative 'ext' +require_relative '../patcher' module Datadog module Tracing @@ -19,9 +19,9 @@ def target_version end def patch - require 'datadog/tracing/propagation/grpc' - require 'datadog/tracing/contrib/grpc/datadog_interceptor' - require 'datadog/tracing/contrib/grpc/intercept_with_datadog' + require_relative '../../propagation/grpc' + require_relative 'datadog_interceptor' + require_relative 'intercept_with_datadog' prepend_interceptor end diff --git a/lib/datadog/tracing/contrib/http/circuit_breaker.rb b/lib/datadog/tracing/contrib/http/circuit_breaker.rb index 2318250bbf4..b4932688ccf 100644 --- a/lib/datadog/tracing/contrib/http/circuit_breaker.rb +++ b/lib/datadog/tracing/contrib/http/circuit_breaker.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing' -require 'ddtrace/transport/ext' +require_relative '../../../tracing' +require_relative '../../../../ddtrace/transport/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/http/configuration/settings.rb b/lib/datadog/tracing/contrib/http/configuration/settings.rb index 86799213dd3..9c4d5081036 100644 --- a/lib/datadog/tracing/contrib/http/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/http/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/http/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/http/instrumentation.rb b/lib/datadog/tracing/contrib/http/instrumentation.rb index 11a750f159f..3d4a39869b3 100644 --- a/lib/datadog/tracing/contrib/http/instrumentation.rb +++ b/lib/datadog/tracing/contrib/http/instrumentation.rb @@ -2,10 +2,10 @@ require 'uri' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/http/integration.rb b/lib/datadog/tracing/contrib/http/integration.rb index b2258724327..bc9297d99c7 100644 --- a/lib/datadog/tracing/contrib/http/integration.rb +++ b/lib/datadog/tracing/contrib/http/integration.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/http/circuit_breaker' -require 'datadog/tracing/contrib/http/configuration/settings' -require 'datadog/tracing/contrib/http/patcher' -require 'datadog/tracing/contrib/integration' -require 'ddtrace/version' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'circuit_breaker' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../integration' +require_relative '../../../../ddtrace/version' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/http/patcher.rb b/lib/datadog/tracing/contrib/http/patcher.rb index a4782ae4c35..35f6b519998 100644 --- a/lib/datadog/tracing/contrib/http/patcher.rb +++ b/lib/datadog/tracing/contrib/http/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/http/ext' -require 'datadog/tracing/contrib/http/instrumentation' +require_relative '../patcher' +require_relative 'ext' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb b/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb index bfe80339ae4..5d734966e9c 100644 --- a/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/httpclient/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httpclient/instrumentation.rb b/lib/datadog/tracing/contrib/httpclient/instrumentation.rb index 8d269d57748..cfec0e6679b 100644 --- a/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +++ b/lib/datadog/tracing/contrib/httpclient/instrumentation.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httpclient/integration.rb b/lib/datadog/tracing/contrib/httpclient/integration.rb index 9cc7a5cffd6..4bf8ce9cf14 100644 --- a/lib/datadog/tracing/contrib/httpclient/integration.rb +++ b/lib/datadog/tracing/contrib/httpclient/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/httpclient/configuration/settings' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/httpclient/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httpclient/patcher.rb b/lib/datadog/tracing/contrib/httpclient/patcher.rb index dc7ce9275b7..e2d6b561c74 100644 --- a/lib/datadog/tracing/contrib/httpclient/patcher.rb +++ b/lib/datadog/tracing/contrib/httpclient/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/utils/only_once' -require 'datadog/tracing/contrib/httpclient/instrumentation' -require 'datadog/tracing/contrib/patcher' +require_relative '../../../core/utils/only_once' +require_relative 'instrumentation' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httprb/configuration/settings.rb b/lib/datadog/tracing/contrib/httprb/configuration/settings.rb index e43f00ca55b..8943c75bd85 100644 --- a/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/httprb/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/httprb/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httprb/instrumentation.rb b/lib/datadog/tracing/contrib/httprb/instrumentation.rb index f528ad721f1..48087bb1e05 100644 --- a/lib/datadog/tracing/contrib/httprb/instrumentation.rb +++ b/lib/datadog/tracing/contrib/httprb/instrumentation.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/http_annotation_helper' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative '../http_annotation_helper' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httprb/integration.rb b/lib/datadog/tracing/contrib/httprb/integration.rb index f0fb36379c0..db50eb149f3 100644 --- a/lib/datadog/tracing/contrib/httprb/integration.rb +++ b/lib/datadog/tracing/contrib/httprb/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/httprb/configuration/settings' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/httprb/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/httprb/patcher.rb b/lib/datadog/tracing/contrib/httprb/patcher.rb index d4cf7b874fd..4478896c574 100644 --- a/lib/datadog/tracing/contrib/httprb/patcher.rb +++ b/lib/datadog/tracing/contrib/httprb/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/utils/only_once' -require 'datadog/tracing/contrib/httprb/instrumentation' -require 'datadog/tracing/contrib/patcher' +require_relative '../../../core/utils/only_once' +require_relative 'instrumentation' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/integration.rb b/lib/datadog/tracing/contrib/integration.rb index d6509589462..0ce5d4305f9 100644 --- a/lib/datadog/tracing/contrib/integration.rb +++ b/lib/datadog/tracing/contrib/integration.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/configurable' -require 'datadog/tracing/contrib/patchable' -require 'datadog/tracing/contrib/registerable' +require_relative 'configurable' +require_relative 'patchable' +require_relative 'registerable' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/configuration/settings.rb b/lib/datadog/tracing/contrib/kafka/configuration/settings.rb index 0b68121644d..908608f84b3 100644 --- a/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/kafka/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/kafka/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/event.rb b/lib/datadog/tracing/contrib/kafka/event.rb index e155c4695d9..45ff806569c 100644 --- a/lib/datadog/tracing/contrib/kafka/event.rb +++ b/lib/datadog/tracing/contrib/kafka/event.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/kafka/ext' +require_relative '../analytics' +require_relative '../active_support/notifications/event' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events.rb b/lib/datadog/tracing/contrib/kafka/events.rb index 9d9defcd4b1..3bb596a63e5 100644 --- a/lib/datadog/tracing/contrib/kafka/events.rb +++ b/lib/datadog/tracing/contrib/kafka/events.rb @@ -1,14 +1,14 @@ # typed: false -require 'datadog/tracing/contrib/kafka/events/connection/request' -require 'datadog/tracing/contrib/kafka/events/consumer/process_batch' -require 'datadog/tracing/contrib/kafka/events/consumer/process_message' -require 'datadog/tracing/contrib/kafka/events/consumer_group/heartbeat' -require 'datadog/tracing/contrib/kafka/events/consumer_group/join_group' -require 'datadog/tracing/contrib/kafka/events/consumer_group/leave_group' -require 'datadog/tracing/contrib/kafka/events/consumer_group/sync_group' -require 'datadog/tracing/contrib/kafka/events/produce_operation/send_messages' -require 'datadog/tracing/contrib/kafka/events/producer/deliver_messages' +require_relative 'events/connection/request' +require_relative 'events/consumer/process_batch' +require_relative 'events/consumer/process_message' +require_relative 'events/consumer_group/heartbeat' +require_relative 'events/consumer_group/join_group' +require_relative 'events/consumer_group/leave_group' +require_relative 'events/consumer_group/sync_group' +require_relative 'events/produce_operation/send_messages' +require_relative 'events/producer/deliver_messages' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/connection/request.rb b/lib/datadog/tracing/contrib/kafka/events/connection/request.rb index c1d5342e17d..e312c51e1a9 100644 --- a/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +++ b/lib/datadog/tracing/contrib/kafka/events/connection/request.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' +require_relative '../../ext' +require_relative '../../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb b/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb index 1ffe0070f8e..4fec28f6099 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb b/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb index cf09da9eb8b..20796382bfb 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb b/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb index 43573670cc8..dd9e4f473bb 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' -require 'datadog/tracing/contrib/kafka/consumer_group_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' +require_relative '../../consumer_group_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb b/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb index c03c3fe9c43..2c76ca34a40 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' -require 'datadog/tracing/contrib/kafka/consumer_group_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' +require_relative '../../consumer_group_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb b/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb index 7492040890f..0366d42f746 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' -require 'datadog/tracing/contrib/kafka/consumer_group_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' +require_relative '../../consumer_group_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb b/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb index 96bdb63d5fc..a44f5ab7952 100644 --- a/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb +++ b/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' -require 'datadog/tracing/contrib/kafka/consumer_event' -require 'datadog/tracing/contrib/kafka/consumer_group_event' +require_relative '../../ext' +require_relative '../../event' +require_relative '../../consumer_event' +require_relative '../../consumer_group_event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb b/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb index 6bda3f2d621..c19661b4f73 100644 --- a/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +++ b/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' +require_relative '../../ext' +require_relative '../../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb b/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb index b6ef40e8c69..1198bf192e4 100644 --- a/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +++ b/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/event' +require_relative '../../ext' +require_relative '../../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/integration.rb b/lib/datadog/tracing/contrib/kafka/integration.rb index c05464846a1..a7a065b7702 100644 --- a/lib/datadog/tracing/contrib/kafka/integration.rb +++ b/lib/datadog/tracing/contrib/kafka/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/kafka/configuration/settings' -require 'datadog/tracing/contrib/kafka/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/kafka/patcher.rb b/lib/datadog/tracing/contrib/kafka/patcher.rb index 69790979b8a..4c36b49ff7e 100644 --- a/lib/datadog/tracing/contrib/kafka/patcher.rb +++ b/lib/datadog/tracing/contrib/kafka/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/kafka/ext' -require 'datadog/tracing/contrib/kafka/events' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/lograge/configuration/settings.rb b/lib/datadog/tracing/contrib/lograge/configuration/settings.rb index 9332a5d64df..c93e7adf5f2 100644 --- a/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/lograge/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/lograge/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/lograge/instrumentation.rb b/lib/datadog/tracing/contrib/lograge/instrumentation.rb index 8bc0d234280..3980fd1bbf1 100644 --- a/lib/datadog/tracing/contrib/lograge/instrumentation.rb +++ b/lib/datadog/tracing/contrib/lograge/instrumentation.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing' -require 'datadog/core/logging/ext' +require_relative '../../../tracing' +require_relative '../../../core/logging/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/lograge/integration.rb b/lib/datadog/tracing/contrib/lograge/integration.rb index 48defe55a98..ada6b488993 100644 --- a/lib/datadog/tracing/contrib/lograge/integration.rb +++ b/lib/datadog/tracing/contrib/lograge/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/lograge/configuration/settings' -require 'datadog/tracing/contrib/lograge/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/lograge/patcher.rb b/lib/datadog/tracing/contrib/lograge/patcher.rb index dc882057bb2..bfdcb8cf511 100644 --- a/lib/datadog/tracing/contrib/lograge/patcher.rb +++ b/lib/datadog/tracing/contrib/lograge/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/lograge/instrumentation' +require_relative '../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb b/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb index 8b371d1c0bd..671e09ec75e 100644 --- a/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/mongodb/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mongodb/instrumentation.rb b/lib/datadog/tracing/contrib/mongodb/instrumentation.rb index fff696e8e06..a01e3f1710d 100644 --- a/lib/datadog/tracing/contrib/mongodb/instrumentation.rb +++ b/lib/datadog/tracing/contrib/mongodb/instrumentation.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/mongodb/ext' -require 'datadog/tracing/contrib/mongodb/parsers' -require 'datadog/tracing/contrib/mongodb/subscribers' +require_relative 'ext' +require_relative 'parsers' +require_relative 'subscribers' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mongodb/integration.rb b/lib/datadog/tracing/contrib/mongodb/integration.rb index a7247b8988a..ebe6e9b8aba 100644 --- a/lib/datadog/tracing/contrib/mongodb/integration.rb +++ b/lib/datadog/tracing/contrib/mongodb/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/configuration/resolvers/pattern_resolver' -require 'datadog/tracing/contrib/mongodb/configuration/settings' -require 'datadog/tracing/contrib/mongodb/patcher' +require_relative '../integration' +require_relative '../configuration/resolvers/pattern_resolver' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mongodb/parsers.rb b/lib/datadog/tracing/contrib/mongodb/parsers.rb index c1a91cb61c0..cb64019a617 100644 --- a/lib/datadog/tracing/contrib/mongodb/parsers.rb +++ b/lib/datadog/tracing/contrib/mongodb/parsers.rb @@ -1,4 +1,4 @@ -require 'datadog/tracing/contrib/utils/quantization/hash' +require_relative '../utils/quantization/hash' # typed: true diff --git a/lib/datadog/tracing/contrib/mongodb/patcher.rb b/lib/datadog/tracing/contrib/mongodb/patcher.rb index 0cd34cf2c87..35b7a7b1310 100644 --- a/lib/datadog/tracing/contrib/mongodb/patcher.rb +++ b/lib/datadog/tracing/contrib/mongodb/patcher.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/mongodb/ext' -require 'datadog/tracing/contrib/mongodb/instrumentation' +require_relative '../patcher' +require_relative 'ext' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mongodb/subscribers.rb b/lib/datadog/tracing/contrib/mongodb/subscribers.rb index a93ee45c2f8..d730b3a4765 100644 --- a/lib/datadog/tracing/contrib/mongodb/subscribers.rb +++ b/lib/datadog/tracing/contrib/mongodb/subscribers.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/mongodb/ext' -require 'datadog/tracing/contrib/mongodb/parsers' -require 'datadog/tracing/metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'parsers' +require_relative '../../metadata/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb b/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb index 61bf318a372..b37228d1f0f 100644 --- a/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/mysql2/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mysql2/instrumentation.rb b/lib/datadog/tracing/contrib/mysql2/instrumentation.rb index 8debb63eafc..fd13595f635 100644 --- a/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +++ b/lib/datadog/tracing/contrib/mysql2/instrumentation.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/mysql2/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mysql2/integration.rb b/lib/datadog/tracing/contrib/mysql2/integration.rb index 48b923de953..48b0167008d 100644 --- a/lib/datadog/tracing/contrib/mysql2/integration.rb +++ b/lib/datadog/tracing/contrib/mysql2/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/mysql2/configuration/settings' -require 'datadog/tracing/contrib/mysql2/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/mysql2/patcher.rb b/lib/datadog/tracing/contrib/mysql2/patcher.rb index 232a2e8c533..8f706697e4b 100644 --- a/lib/datadog/tracing/contrib/mysql2/patcher.rb +++ b/lib/datadog/tracing/contrib/mysql2/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/mysql2/instrumentation' +require_relative '../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/patcher.rb b/lib/datadog/tracing/contrib/patcher.rb index 6bf3561a289..b8d1a98bee8 100644 --- a/lib/datadog/tracing/contrib/patcher.rb +++ b/lib/datadog/tracing/contrib/patcher.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core' -require 'datadog/core/utils/only_once' +require_relative '../../core' +require_relative '../../core/utils/only_once' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/pg/configuration/settings.rb b/lib/datadog/tracing/contrib/pg/configuration/settings.rb index e53114a6d87..702a29038bd 100644 --- a/lib/datadog/tracing/contrib/pg/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/pg/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/pg/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/pg/instrumentation.rb b/lib/datadog/tracing/contrib/pg/instrumentation.rb index c433d50089d..dfcc3a3a26c 100644 --- a/lib/datadog/tracing/contrib/pg/instrumentation.rb +++ b/lib/datadog/tracing/contrib/pg/instrumentation.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/pg/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/pg/integration.rb b/lib/datadog/tracing/contrib/pg/integration.rb index acbbacc0af0..0dd6a828f25 100644 --- a/lib/datadog/tracing/contrib/pg/integration.rb +++ b/lib/datadog/tracing/contrib/pg/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/pg/configuration/settings' -require 'datadog/tracing/contrib/pg/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/pg/patcher.rb b/lib/datadog/tracing/contrib/pg/patcher.rb index e72ac102853..7a67640577a 100644 --- a/lib/datadog/tracing/contrib/pg/patcher.rb +++ b/lib/datadog/tracing/contrib/pg/patcher.rb @@ -1,7 +1,7 @@ # typed: ignore -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/pg/instrumentation' +require_relative '../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/presto/configuration/settings.rb b/lib/datadog/tracing/contrib/presto/configuration/settings.rb index e03343cd3f9..f9f9511ba16 100644 --- a/lib/datadog/tracing/contrib/presto/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/presto/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/presto/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/presto/instrumentation.rb b/lib/datadog/tracing/contrib/presto/instrumentation.rb index f36ab1bc94e..6d3ef8e2996 100644 --- a/lib/datadog/tracing/contrib/presto/instrumentation.rb +++ b/lib/datadog/tracing/contrib/presto/instrumentation.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/presto/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/presto/integration.rb b/lib/datadog/tracing/contrib/presto/integration.rb index 6644679a338..e8160bcb9a1 100644 --- a/lib/datadog/tracing/contrib/presto/integration.rb +++ b/lib/datadog/tracing/contrib/presto/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/presto/configuration/settings' -require 'datadog/tracing/contrib/presto/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/presto/patcher.rb b/lib/datadog/tracing/contrib/presto/patcher.rb index ab18174f8ba..9239096a031 100644 --- a/lib/datadog/tracing/contrib/presto/patcher.rb +++ b/lib/datadog/tracing/contrib/presto/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/utils/only_once' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/presto/ext' -require 'datadog/tracing/contrib/presto/instrumentation' +require_relative '../../../core/utils/only_once' +require_relative '../patcher' +require_relative 'ext' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/qless/configuration/settings.rb b/lib/datadog/tracing/contrib/qless/configuration/settings.rb index 7e920a3b473..232817d1b81 100644 --- a/lib/datadog/tracing/contrib/qless/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/qless/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/qless/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/qless/integration.rb b/lib/datadog/tracing/contrib/qless/integration.rb index e723b5bb2eb..c8445c56803 100644 --- a/lib/datadog/tracing/contrib/qless/integration.rb +++ b/lib/datadog/tracing/contrib/qless/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/qless/configuration/settings' -require 'datadog/tracing/contrib/qless/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/qless/patcher.rb b/lib/datadog/tracing/contrib/qless/patcher.rb index c30f4cec839..eee38f5e597 100644 --- a/lib/datadog/tracing/contrib/qless/patcher.rb +++ b/lib/datadog/tracing/contrib/qless/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/patcher' +require_relative '../../../tracing' +require_relative '../patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/qless/qless_job.rb b/lib/datadog/tracing/contrib/qless/qless_job.rb index f73e7252d3d..8863972c83f 100644 --- a/lib/datadog/tracing/contrib/qless/qless_job.rb +++ b/lib/datadog/tracing/contrib/qless/qless_job.rb @@ -2,9 +2,9 @@ require 'qless' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb b/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb index 380ea6741ba..c5a3fb3d32f 100644 --- a/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +++ b/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing' +require_relative '../../../tracing' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/que/configuration/settings.rb b/lib/datadog/tracing/contrib/que/configuration/settings.rb index 5811528a649..68b414ba18c 100644 --- a/lib/datadog/tracing/contrib/que/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/que/configuration/settings.rb @@ -2,9 +2,9 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/que/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/que/integration.rb b/lib/datadog/tracing/contrib/que/integration.rb index b232b0f6508..67644726331 100644 --- a/lib/datadog/tracing/contrib/que/integration.rb +++ b/lib/datadog/tracing/contrib/que/integration.rb @@ -2,10 +2,10 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/que/ext' -require 'datadog/tracing/contrib/que/configuration/settings' -require 'datadog/tracing/contrib/que/patcher' +require_relative '../integration' +require_relative 'ext' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/que/patcher.rb b/lib/datadog/tracing/contrib/que/patcher.rb index 829b776cedd..2c37e82247e 100644 --- a/lib/datadog/tracing/contrib/que/patcher.rb +++ b/lib/datadog/tracing/contrib/que/patcher.rb @@ -2,7 +2,7 @@ # typed: false -require 'datadog/tracing/contrib/que/tracer' +require_relative 'tracer' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/que/tracer.rb b/lib/datadog/tracing/contrib/que/tracer.rb index c98c1f01a2a..d01842e90a0 100644 --- a/lib/datadog/tracing/contrib/que/tracer.rb +++ b/lib/datadog/tracing/contrib/que/tracer.rb @@ -2,7 +2,7 @@ # typed: true -require 'datadog/tracing/contrib/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/configuration/settings.rb b/lib/datadog/tracing/contrib/racecar/configuration/settings.rb index b62a9ee2d91..d390a7dbe35 100644 --- a/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/racecar/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/racecar/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/event.rb b/lib/datadog/tracing/contrib/racecar/event.rb index d949fea0830..9b699831906 100644 --- a/lib/datadog/tracing/contrib/racecar/event.rb +++ b/lib/datadog/tracing/contrib/racecar/event.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/active_support/notifications/event' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/racecar/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../active_support/notifications/event' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/events.rb b/lib/datadog/tracing/contrib/racecar/events.rb index aa4bedf2f24..15308dab097 100644 --- a/lib/datadog/tracing/contrib/racecar/events.rb +++ b/lib/datadog/tracing/contrib/racecar/events.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/racecar/events/batch' -require 'datadog/tracing/contrib/racecar/events/message' -require 'datadog/tracing/contrib/racecar/events/consume' +require_relative 'events/batch' +require_relative 'events/message' +require_relative 'events/consume' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/events/batch.rb b/lib/datadog/tracing/contrib/racecar/events/batch.rb index d3b5281aa7d..54922539f83 100644 --- a/lib/datadog/tracing/contrib/racecar/events/batch.rb +++ b/lib/datadog/tracing/contrib/racecar/events/batch.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/racecar/ext' -require 'datadog/tracing/contrib/racecar/event' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/events/consume.rb b/lib/datadog/tracing/contrib/racecar/events/consume.rb index a918e1b0775..3179d8a8a2e 100644 --- a/lib/datadog/tracing/contrib/racecar/events/consume.rb +++ b/lib/datadog/tracing/contrib/racecar/events/consume.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/racecar/ext' -require 'datadog/tracing/contrib/racecar/event' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/events/message.rb b/lib/datadog/tracing/contrib/racecar/events/message.rb index 6b9389a17e7..2def46fdf87 100644 --- a/lib/datadog/tracing/contrib/racecar/events/message.rb +++ b/lib/datadog/tracing/contrib/racecar/events/message.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/racecar/ext' -require 'datadog/tracing/contrib/racecar/event' +require_relative '../ext' +require_relative '../event' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/integration.rb b/lib/datadog/tracing/contrib/racecar/integration.rb index 7617528acbc..3ceae77da88 100644 --- a/lib/datadog/tracing/contrib/racecar/integration.rb +++ b/lib/datadog/tracing/contrib/racecar/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/racecar/configuration/settings' -require 'datadog/tracing/contrib/racecar/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/racecar/patcher.rb b/lib/datadog/tracing/contrib/racecar/patcher.rb index 9d6a66a4cb5..c1a9c10b21f 100644 --- a/lib/datadog/tracing/contrib/racecar/patcher.rb +++ b/lib/datadog/tracing/contrib/racecar/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/racecar/ext' -require 'datadog/tracing/contrib/racecar/events' +require_relative '../patcher' +require_relative 'ext' +require_relative 'events' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rack/configuration/settings.rb b/lib/datadog/tracing/contrib/rack/configuration/settings.rb index 89248771ce9..3a0a14364b1 100644 --- a/lib/datadog/tracing/contrib/rack/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rack/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/rack/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rack/integration.rb b/lib/datadog/tracing/contrib/rack/integration.rb index ea99ec63014..6fd5fe2c602 100644 --- a/lib/datadog/tracing/contrib/rack/integration.rb +++ b/lib/datadog/tracing/contrib/rack/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rack/configuration/settings' -require 'datadog/tracing/contrib/rack/patcher' -require 'datadog/tracing/contrib/rails/utils' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' +require_relative '../rails/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 930f8f1eadf..02c1bc6d7ed 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -2,14 +2,14 @@ require 'date' -require 'datadog/core/environment/variable_helpers' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/rack/ext' -require 'datadog/tracing/contrib/rack/request_queue' -require 'datadog/tracing/contrib/utils/quantization/http' +require_relative '../../../core/environment/variable_helpers' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative 'ext' +require_relative 'request_queue' +require_relative '../utils/quantization/http' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb b/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb index 091fb042d4c..f3a67b11952 100644 --- a/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +++ b/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb @@ -1,6 +1,6 @@ # typed: ignore -require 'datadog/tracing/contrib/auto_instrument' +require_relative '../auto_instrument' # Railtie to include AutoInstrumentation in rails loading class DatadogAutoInstrumentRailtie < Rails::Railtie diff --git a/lib/datadog/tracing/contrib/rails/configuration/settings.rb b/lib/datadog/tracing/contrib/rails/configuration/settings.rb index 7695ff49513..5285a1ac169 100644 --- a/lib/datadog/tracing/contrib/rails/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rails/configuration/settings.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' +require_relative '../../configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/framework.rb b/lib/datadog/tracing/contrib/rails/framework.rb index 7ba2fbea921..23038ff6645 100644 --- a/lib/datadog/tracing/contrib/rails/framework.rb +++ b/lib/datadog/tracing/contrib/rails/framework.rb @@ -1,17 +1,17 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/contrib/action_cable/integration' -require 'datadog/tracing/contrib/action_mailer/integration' -require 'datadog/tracing/contrib/action_pack/integration' -require 'datadog/tracing/contrib/action_view/integration' -require 'datadog/tracing/contrib/active_record/integration' -require 'datadog/tracing/contrib/active_support/integration' -require 'datadog/tracing/contrib/grape/endpoint' -require 'datadog/tracing/contrib/lograge/integration' -require 'datadog/tracing/contrib/rails/ext' -require 'datadog/tracing/contrib/rails/utils' -require 'datadog/tracing/contrib/semantic_logger/integration' +require_relative '../../../tracing' +require_relative '../action_cable/integration' +require_relative '../action_mailer/integration' +require_relative '../action_pack/integration' +require_relative '../action_view/integration' +require_relative '../active_record/integration' +require_relative '../active_support/integration' +require_relative '../grape/endpoint' +require_relative '../lograge/integration' +require_relative 'ext' +require_relative 'utils' +require_relative '../semantic_logger/integration' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/integration.rb b/lib/datadog/tracing/contrib/rails/integration.rb index 8769a7b037b..cd82a9a9187 100644 --- a/lib/datadog/tracing/contrib/rails/integration.rb +++ b/lib/datadog/tracing/contrib/rails/integration.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing/contrib/integration' +require_relative '../integration' -require 'datadog/tracing/contrib/rails/ext' -require 'datadog/tracing/contrib/rails/configuration/settings' -require 'datadog/tracing/contrib/rails/patcher' +require_relative 'ext' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/log_injection.rb b/lib/datadog/tracing/contrib/rails/log_injection.rb index b2064b6efea..9a668b1f8c1 100644 --- a/lib/datadog/tracing/contrib/rails/log_injection.rb +++ b/lib/datadog/tracing/contrib/rails/log_injection.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing' +require_relative '../../../tracing' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/middlewares.rb b/lib/datadog/tracing/contrib/rails/middlewares.rb index eb777015b72..1db7f52bd5d 100644 --- a/lib/datadog/tracing/contrib/rails/middlewares.rb +++ b/lib/datadog/tracing/contrib/rails/middlewares.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/action_pack/utils' +require_relative '../../../tracing' +require_relative '../action_pack/utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/patcher.rb b/lib/datadog/tracing/contrib/rails/patcher.rb index 33eb03dc499..80b31b37902 100644 --- a/lib/datadog/tracing/contrib/rails/patcher.rb +++ b/lib/datadog/tracing/contrib/rails/patcher.rb @@ -1,13 +1,13 @@ # typed: ignore -require 'datadog/core/utils/only_once' -require 'datadog/tracing' -require 'datadog/tracing/contrib/rack/middlewares' -require 'datadog/tracing/contrib/rails/framework' -require 'datadog/tracing/contrib/rails/log_injection' -require 'datadog/tracing/contrib/rails/middlewares' -require 'datadog/tracing/contrib/rails/utils' -require 'datadog/tracing/contrib/semantic_logger/patcher' +require_relative '../../../core/utils/only_once' +require_relative '../../../tracing' +require_relative '../rack/middlewares' +require_relative 'framework' +require_relative 'log_injection' +require_relative 'middlewares' +require_relative 'utils' +require_relative '../semantic_logger/patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rails/railtie.rb b/lib/datadog/tracing/contrib/rails/railtie.rb index bcd94e494c3..a000962a5d2 100644 --- a/lib/datadog/tracing/contrib/rails/railtie.rb +++ b/lib/datadog/tracing/contrib/rails/railtie.rb @@ -1,8 +1,8 @@ # typed: ignore -require 'datadog/tracing/contrib/rails/framework' -require 'datadog/tracing/contrib/rails/middlewares' -require 'datadog/tracing/contrib/rack/middlewares' +require_relative 'framework' +require_relative 'middlewares' +require_relative '../rack/middlewares' module Datadog # Railtie class initializes diff --git a/lib/datadog/tracing/contrib/rails/utils.rb b/lib/datadog/tracing/contrib/rails/utils.rb index 181cd5aa54b..ac7a615782b 100644 --- a/lib/datadog/tracing/contrib/rails/utils.rb +++ b/lib/datadog/tracing/contrib/rails/utils.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rake/configuration/settings.rb b/lib/datadog/tracing/contrib/rake/configuration/settings.rb index 76f315427d1..7f747bfdac4 100644 --- a/lib/datadog/tracing/contrib/rake/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rake/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/rake/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rake/instrumentation.rb b/lib/datadog/tracing/contrib/rake/instrumentation.rb index d7bc168bd69..5e94a8c8e53 100644 --- a/lib/datadog/tracing/contrib/rake/instrumentation.rb +++ b/lib/datadog/tracing/contrib/rake/instrumentation.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/rake/ext' -require 'datadog/tracing/contrib/utils/quantization/hash' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative '../utils/quantization/hash' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rake/integration.rb b/lib/datadog/tracing/contrib/rake/integration.rb index bcde47c2320..bc79d8c3ca3 100644 --- a/lib/datadog/tracing/contrib/rake/integration.rb +++ b/lib/datadog/tracing/contrib/rake/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rake/configuration/settings' -require 'datadog/tracing/contrib/rake/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rake/patcher.rb b/lib/datadog/tracing/contrib/rake/patcher.rb index 6fa5382e2e8..92a7a09cef4 100644 --- a/lib/datadog/tracing/contrib/rake/patcher.rb +++ b/lib/datadog/tracing/contrib/rake/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/rake/ext' -require 'datadog/tracing/contrib/rake/instrumentation' +require_relative '../../../tracing' +require_relative '../patcher' +require_relative 'ext' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/redis/configuration/resolver.rb b/lib/datadog/tracing/contrib/redis/configuration/resolver.rb index 9a0dd790817..1c9a6ffa3b4 100644 --- a/lib/datadog/tracing/contrib/redis/configuration/resolver.rb +++ b/lib/datadog/tracing/contrib/redis/configuration/resolver.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/redis/vendor/resolver' +require_relative '../vendor/resolver' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/redis/configuration/settings.rb b/lib/datadog/tracing/contrib/redis/configuration/settings.rb index 33f02f55fea..075c6d9f891 100644 --- a/lib/datadog/tracing/contrib/redis/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/redis/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/redis/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/redis/instrumentation.rb b/lib/datadog/tracing/contrib/redis/instrumentation.rb index d49536d4a03..005eceae99e 100644 --- a/lib/datadog/tracing/contrib/redis/instrumentation.rb +++ b/lib/datadog/tracing/contrib/redis/instrumentation.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/redis/configuration/resolver' -require 'datadog/tracing/contrib/redis/ext' -require 'datadog/tracing/contrib/redis/quantize' -require 'datadog/tracing/contrib/redis/tags' +require_relative '../../../tracing' +require_relative '../patcher' +require_relative 'configuration/resolver' +require_relative 'ext' +require_relative 'quantize' +require_relative 'tags' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/redis/integration.rb b/lib/datadog/tracing/contrib/redis/integration.rb index c1ba9ae1c93..d02d30c8c52 100644 --- a/lib/datadog/tracing/contrib/redis/integration.rb +++ b/lib/datadog/tracing/contrib/redis/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/redis/configuration/settings' -require 'datadog/tracing/contrib/redis/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/redis/patcher.rb b/lib/datadog/tracing/contrib/redis/patcher.rb index 3ee1792099e..921a6f00f82 100644 --- a/lib/datadog/tracing/contrib/redis/patcher.rb +++ b/lib/datadog/tracing/contrib/redis/patcher.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/redis/ext' -require 'datadog/tracing/contrib/redis/configuration/resolver' +require_relative '../patcher' +require_relative 'ext' +require_relative 'configuration/resolver' module Datadog module Tracing @@ -22,9 +22,9 @@ def target_version def patch # do not require these by default, but only when actually patching require 'redis' - require 'datadog/tracing/contrib/redis/tags' - require 'datadog/tracing/contrib/redis/quantize' - require 'datadog/tracing/contrib/redis/instrumentation' + require_relative 'tags' + require_relative 'quantize' + require_relative 'instrumentation' ::Redis::Client.include(Instrumentation) end diff --git a/lib/datadog/tracing/contrib/redis/tags.rb b/lib/datadog/tracing/contrib/redis/tags.rb index 05da8a1235d..e425db50a81 100644 --- a/lib/datadog/tracing/contrib/redis/tags.rb +++ b/lib/datadog/tracing/contrib/redis/tags.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/redis/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/resque/configuration/settings.rb b/lib/datadog/tracing/contrib/resque/configuration/settings.rb index d4a422b7bfe..8e4e2e8b7b7 100644 --- a/lib/datadog/tracing/contrib/resque/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/resque/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/resque/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/resque/integration.rb b/lib/datadog/tracing/contrib/resque/integration.rb index b43baa1ecd4..668b66d7479 100644 --- a/lib/datadog/tracing/contrib/resque/integration.rb +++ b/lib/datadog/tracing/contrib/resque/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/resque/configuration/settings' -require 'datadog/tracing/contrib/resque/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/resque/patcher.rb b/lib/datadog/tracing/contrib/resque/patcher.rb index 38ecbfe2d54..0f0105f55b9 100644 --- a/lib/datadog/tracing/contrib/resque/patcher.rb +++ b/lib/datadog/tracing/contrib/resque/patcher.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/sidekiq/ext' +require_relative '../patcher' +require_relative '../sidekiq/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/resque/resque_job.rb b/lib/datadog/tracing/contrib/resque/resque_job.rb index cff397bbbca..5c776f9b79c 100644 --- a/lib/datadog/tracing/contrib/resque/resque_job.rb +++ b/lib/datadog/tracing/contrib/resque/resque_job.rb @@ -2,10 +2,10 @@ require 'resque' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sidekiq/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative '../sidekiq/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb b/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb index d3e497f05ad..36c0347c7e9 100644 --- a/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/rest_client/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rest_client/integration.rb b/lib/datadog/tracing/contrib/rest_client/integration.rb index d2b275900e8..983d4a8186b 100644 --- a/lib/datadog/tracing/contrib/rest_client/integration.rb +++ b/lib/datadog/tracing/contrib/rest_client/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/rest_client/configuration/settings' -require 'datadog/tracing/contrib/rest_client/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/rest_client/patcher.rb b/lib/datadog/tracing/contrib/rest_client/patcher.rb index 1deaf2a05b3..0e2500763e4 100644 --- a/lib/datadog/tracing/contrib/rest_client/patcher.rb +++ b/lib/datadog/tracing/contrib/rest_client/patcher.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -18,7 +18,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/rest_client/request_patch' + require_relative 'request_patch' ::RestClient::Request.include(RequestPatch) end diff --git a/lib/datadog/tracing/contrib/rest_client/request_patch.rb b/lib/datadog/tracing/contrib/rest_client/request_patch.rb index 6878a339f05..126bf8d3d96 100644 --- a/lib/datadog/tracing/contrib/rest_client/request_patch.rb +++ b/lib/datadog/tracing/contrib/rest_client/request_patch.rb @@ -2,11 +2,11 @@ require 'uri' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/rest_client/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb b/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb index 3fb812f6fd4..dc33f5068c8 100644 --- a/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/semantic_logger/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb b/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb index 54057d46b3b..029dbd861c1 100644 --- a/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +++ b/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing' -require 'datadog/core/logging/ext' +require_relative '../../../tracing' +require_relative '../../../core/logging/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/semantic_logger/integration.rb b/lib/datadog/tracing/contrib/semantic_logger/integration.rb index 43005bfc0e3..812e3477859 100644 --- a/lib/datadog/tracing/contrib/semantic_logger/integration.rb +++ b/lib/datadog/tracing/contrib/semantic_logger/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/semantic_logger/configuration/settings' -require 'datadog/tracing/contrib/semantic_logger/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/semantic_logger/patcher.rb b/lib/datadog/tracing/contrib/semantic_logger/patcher.rb index cbcbc715f00..398fb3ea4ac 100644 --- a/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +++ b/lib/datadog/tracing/contrib/semantic_logger/patcher.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/semantic_logger/instrumentation' +require_relative '../patcher' +require_relative 'instrumentation' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/configuration/settings.rb b/lib/datadog/tracing/contrib/sequel/configuration/settings.rb index 1b0c049ddc0..d293de17ea8 100644 --- a/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/sequel/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/sequel/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/database.rb b/lib/datadog/tracing/contrib/sequel/database.rb index 74d090b5f7e..26e2779033d 100644 --- a/lib/datadog/tracing/contrib/sequel/database.rb +++ b/lib/datadog/tracing/contrib/sequel/database.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sequel/ext' -require 'datadog/tracing/contrib/sequel/utils' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/dataset.rb b/lib/datadog/tracing/contrib/sequel/dataset.rb index 73b29e898cf..b603aa2fbb5 100644 --- a/lib/datadog/tracing/contrib/sequel/dataset.rb +++ b/lib/datadog/tracing/contrib/sequel/dataset.rb @@ -1,10 +1,10 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sequel/ext' -require 'datadog/tracing/contrib/sequel/utils' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'utils' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/integration.rb b/lib/datadog/tracing/contrib/sequel/integration.rb index 5d7e8b4ed4b..fc98c0328a4 100644 --- a/lib/datadog/tracing/contrib/sequel/integration.rb +++ b/lib/datadog/tracing/contrib/sequel/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/sequel/configuration/settings' -require 'datadog/tracing/contrib/sequel/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/patcher.rb b/lib/datadog/tracing/contrib/sequel/patcher.rb index 24d6b30cb12..30c39410597 100644 --- a/lib/datadog/tracing/contrib/sequel/patcher.rb +++ b/lib/datadog/tracing/contrib/sequel/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/sequel/database' -require 'datadog/tracing/contrib/sequel/dataset' +require_relative '../patcher' +require_relative 'database' +require_relative 'dataset' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sequel/utils.rb b/lib/datadog/tracing/contrib/sequel/utils.rb index 823d4dcca44..3f5086dcf8c 100644 --- a/lib/datadog/tracing/contrib/sequel/utils.rb +++ b/lib/datadog/tracing/contrib/sequel/utils.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/utils/database' +require_relative '../../metadata/ext' +require_relative '../utils/database' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb b/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb index 78838a0fc45..2d25908fe5a 100644 --- a/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/shoryuken/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/shoryuken/integration.rb b/lib/datadog/tracing/contrib/shoryuken/integration.rb index 15cb7ed386c..13cf63ab076 100644 --- a/lib/datadog/tracing/contrib/shoryuken/integration.rb +++ b/lib/datadog/tracing/contrib/shoryuken/integration.rb @@ -1,9 +1,9 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/shoryuken/ext' -require 'datadog/tracing/contrib/shoryuken/configuration/settings' -require 'datadog/tracing/contrib/shoryuken/patcher' +require_relative '../integration' +require_relative 'ext' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/shoryuken/patcher.rb b/lib/datadog/tracing/contrib/shoryuken/patcher.rb index d9d58896e49..ef984055633 100644 --- a/lib/datadog/tracing/contrib/shoryuken/patcher.rb +++ b/lib/datadog/tracing/contrib/shoryuken/patcher.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/shoryuken/tracer' +require_relative 'tracer' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/shoryuken/tracer.rb b/lib/datadog/tracing/contrib/shoryuken/tracer.rb index 385f9f58811..1d90c47f152 100644 --- a/lib/datadog/tracing/contrib/shoryuken/tracer.rb +++ b/lib/datadog/tracing/contrib/shoryuken/tracer.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/contrib/analytics' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb b/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb index 304496eaff8..8f5636366a5 100644 --- a/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +++ b/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sidekiq/ext' -require 'datadog/tracing/contrib/sidekiq/tracing' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'tracing' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb b/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb index 76408363df9..47a905ea1e6 100644 --- a/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/sidekiq/ext' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sidekiq/integration.rb b/lib/datadog/tracing/contrib/sidekiq/integration.rb index 94e0c7111a3..32afb70ed87 100644 --- a/lib/datadog/tracing/contrib/sidekiq/integration.rb +++ b/lib/datadog/tracing/contrib/sidekiq/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/sidekiq/configuration/settings' -require 'datadog/tracing/contrib/sidekiq/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sidekiq/patcher.rb b/lib/datadog/tracing/contrib/sidekiq/patcher.rb index 3df410605b7..2f2809aa1d1 100644 --- a/lib/datadog/tracing/contrib/sidekiq/patcher.rb +++ b/lib/datadog/tracing/contrib/sidekiq/patcher.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/contrib/patcher' +require_relative '../patcher' module Datadog module Tracing @@ -17,8 +17,8 @@ def target_version end def patch - require 'datadog/tracing/contrib/sidekiq/client_tracer' - require 'datadog/tracing/contrib/sidekiq/server_tracer' + require_relative 'client_tracer' + require_relative 'server_tracer' ::Sidekiq.configure_client do |config| config.client_middleware do |chain| @@ -49,25 +49,25 @@ def patch_server_internals end def patch_server_heartbeat - require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat' + require_relative 'server_internal_tracer/heartbeat' ::Sidekiq::Launcher.prepend(ServerInternalTracer::Heartbeat) end def patch_server_job_fetch - require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch' + require_relative 'server_internal_tracer/job_fetch' ::Sidekiq::Processor.prepend(ServerInternalTracer::JobFetch) end def patch_server_scheduled_push - require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller' + require_relative 'server_internal_tracer/scheduled_poller' ::Sidekiq::Scheduled::Poller.prepend(ServerInternalTracer::ScheduledPoller) end def patch_redis_info - require 'datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info' + require_relative 'server_internal_tracer/redis_info' ::Sidekiq.singleton_class.prepend(ServerInternalTracer::RedisInfo) end diff --git a/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb b/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb index 14d8224defa..453e2fbdd36 100644 --- a/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +++ b/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb @@ -1,11 +1,11 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sidekiq/ext' -require 'datadog/tracing/contrib/sidekiq/tracing' -require 'datadog/tracing/contrib/utils/quantization/hash' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' +require_relative 'tracing' +require_relative '../utils/quantization/hash' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sidekiq/tracing.rb b/lib/datadog/tracing/contrib/sidekiq/tracing.rb index 131df6ab698..fb729899031 100644 --- a/lib/datadog/tracing/contrib/sidekiq/tracing.rb +++ b/lib/datadog/tracing/contrib/sidekiq/tracing.rb @@ -2,8 +2,8 @@ require 'yaml' -require 'datadog/core' -require 'datadog/tracing/contrib/sidekiq/ext' +require_relative '../../../core' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb b/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb index b31f6828149..55c88cd5ed8 100644 --- a/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/sinatra/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/env.rb b/lib/datadog/tracing/contrib/sinatra/env.rb index 75f7d2a247c..cb54e7ac88e 100644 --- a/lib/datadog/tracing/contrib/sinatra/env.rb +++ b/lib/datadog/tracing/contrib/sinatra/env.rb @@ -2,8 +2,8 @@ require 'time' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/sinatra/ext' +require_relative '../../metadata/ext' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/framework.rb b/lib/datadog/tracing/contrib/sinatra/framework.rb index dd192474611..24636620aa7 100644 --- a/lib/datadog/tracing/contrib/sinatra/framework.rb +++ b/lib/datadog/tracing/contrib/sinatra/framework.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing' +require_relative '../../../tracing' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/headers.rb b/lib/datadog/tracing/contrib/sinatra/headers.rb index 8bd0df5eaf7..9d89825d01b 100644 --- a/lib/datadog/tracing/contrib/sinatra/headers.rb +++ b/lib/datadog/tracing/contrib/sinatra/headers.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/metadata/ext' +require_relative '../../metadata/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/integration.rb b/lib/datadog/tracing/contrib/sinatra/integration.rb index 18655761ba6..f6b0e3709e5 100644 --- a/lib/datadog/tracing/contrib/sinatra/integration.rb +++ b/lib/datadog/tracing/contrib/sinatra/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/sinatra/configuration/settings' -require 'datadog/tracing/contrib/sinatra/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/patcher.rb b/lib/datadog/tracing/contrib/sinatra/patcher.rb index 9e9d299d6d0..96927a8ebfa 100644 --- a/lib/datadog/tracing/contrib/sinatra/patcher.rb +++ b/lib/datadog/tracing/contrib/sinatra/patcher.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/utils/only_once' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/rack/middlewares' -require 'datadog/tracing/contrib/sinatra/framework' +require_relative '../../../core/utils/only_once' +require_relative '../patcher' +require_relative '../rack/middlewares' +require_relative 'framework' module Datadog module Tracing @@ -50,7 +50,7 @@ def target_version end def patch - require 'datadog/tracing/contrib/sinatra/tracer' + require_relative 'tracer' register_tracer patch_default_middlewares diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index ccab54a1022..97a8d827704 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -2,14 +2,14 @@ require 'sinatra/base' -require 'datadog/core/utils/only_once' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/propagation/http' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sinatra/env' -require 'datadog/tracing/contrib/sinatra/ext' -require 'datadog/tracing/contrib/sinatra/tracer_middleware' +require_relative '../../../core/utils/only_once' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../../propagation/http' +require_relative '../analytics' +require_relative 'env' +require_relative 'ext' +require_relative 'tracer_middleware' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb index b1ffc4f7e0a..b7cc23a9344 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb @@ -1,12 +1,12 @@ # typed: false -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/rack/ext' -require 'datadog/tracing/contrib/sinatra/env' -require 'datadog/tracing/contrib/sinatra/ext' -require 'datadog/tracing/contrib/sinatra/headers' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative '../rack/ext' +require_relative 'env' +require_relative 'ext' +require_relative 'headers' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb b/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb index c9971024da7..8e5552f23ee 100644 --- a/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb @@ -2,8 +2,8 @@ # typed: false -require 'datadog/tracing/span_operation' -require 'datadog/tracing/contrib/configuration/settings' +require_relative '../../../span_operation' +require_relative '../../configuration/settings' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sneakers/integration.rb b/lib/datadog/tracing/contrib/sneakers/integration.rb index bbfa14cc52d..4279c899b16 100644 --- a/lib/datadog/tracing/contrib/sneakers/integration.rb +++ b/lib/datadog/tracing/contrib/sneakers/integration.rb @@ -2,10 +2,10 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/sneakers/ext' -require 'datadog/tracing/contrib/sneakers/configuration/settings' -require 'datadog/tracing/contrib/sneakers/patcher' +require_relative '../integration' +require_relative 'ext' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sneakers/patcher.rb b/lib/datadog/tracing/contrib/sneakers/patcher.rb index 42185f50651..19cf57dafb2 100644 --- a/lib/datadog/tracing/contrib/sneakers/patcher.rb +++ b/lib/datadog/tracing/contrib/sneakers/patcher.rb @@ -2,8 +2,8 @@ # typed: false -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/sneakers/tracer' +require_relative '../patcher' +require_relative 'tracer' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sneakers/tracer.rb b/lib/datadog/tracing/contrib/sneakers/tracer.rb index f1ad7322118..edfaa1c7521 100644 --- a/lib/datadog/tracing/contrib/sneakers/tracer.rb +++ b/lib/datadog/tracing/contrib/sneakers/tracer.rb @@ -2,9 +2,9 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/status_code_matcher.rb b/lib/datadog/tracing/contrib/status_code_matcher.rb index 3385377b7df..e1f786779a5 100644 --- a/lib/datadog/tracing/contrib/status_code_matcher.rb +++ b/lib/datadog/tracing/contrib/status_code_matcher.rb @@ -2,8 +2,8 @@ require 'set' -require 'datadog/core' -require 'datadog/tracing/metadata/ext' +require_relative '../../core' +require_relative '../metadata/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb b/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb index b12ddb283bd..49c8e57efb8 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/tracing/contrib/configuration/settings' -require 'datadog/tracing/contrib/sucker_punch/ext' +require_relative '../../configuration/settings' +require_relative '../ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb b/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb index ffaafc6da5f..a2dd9d17329 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb @@ -2,10 +2,10 @@ require 'sucker_punch' -require 'datadog/tracing' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/contrib/analytics' -require 'datadog/tracing/contrib/sucker_punch/ext' +require_relative '../../../tracing' +require_relative '../../metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sucker_punch/integration.rb b/lib/datadog/tracing/contrib/sucker_punch/integration.rb index 05ac3affd93..d04f119931c 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/integration.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/integration.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/tracing/contrib/integration' -require 'datadog/tracing/contrib/sucker_punch/configuration/settings' -require 'datadog/tracing/contrib/sucker_punch/patcher' +require_relative '../integration' +require_relative 'configuration/settings' +require_relative 'patcher' module Datadog module Tracing diff --git a/lib/datadog/tracing/contrib/sucker_punch/patcher.rb b/lib/datadog/tracing/contrib/sucker_punch/patcher.rb index 8a04353f35b..bca42450d2f 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/patcher.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing' -require 'datadog/tracing/contrib/patcher' -require 'datadog/tracing/contrib/sucker_punch/ext' +require_relative '../../../tracing' +require_relative '../patcher' +require_relative 'ext' module Datadog module Tracing @@ -20,8 +20,8 @@ def target_version end def patch - require 'datadog/tracing/contrib/sucker_punch/exception_handler' - require 'datadog/tracing/contrib/sucker_punch/instrumentation' + require_relative 'exception_handler' + require_relative 'instrumentation' ExceptionHandler.patch! Instrumentation.patch! diff --git a/lib/datadog/tracing/correlation.rb b/lib/datadog/tracing/correlation.rb index b3d604e8a27..490ecc97f13 100644 --- a/lib/datadog/tracing/correlation.rb +++ b/lib/datadog/tracing/correlation.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core' +require_relative '../core' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/headers/b3.rb b/lib/datadog/tracing/distributed/headers/b3.rb index 3685c766b53..3e302f8ade6 100644 --- a/lib/datadog/tracing/distributed/headers/b3.rb +++ b/lib/datadog/tracing/distributed/headers/b3.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/distributed/headers/parser' -require 'datadog/tracing/distributed/helpers' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_digest' +require_relative 'parser' +require_relative '../helpers' +require_relative 'ext' +require_relative '../../trace_digest' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/headers/b3_single.rb b/lib/datadog/tracing/distributed/headers/b3_single.rb index 8dd56f35a92..5347add45f5 100644 --- a/lib/datadog/tracing/distributed/headers/b3_single.rb +++ b/lib/datadog/tracing/distributed/headers/b3_single.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/distributed/headers/parser' -require 'datadog/tracing/distributed/helpers' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_digest' +require_relative 'parser' +require_relative '../helpers' +require_relative 'ext' +require_relative '../../trace_digest' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/headers/datadog.rb b/lib/datadog/tracing/distributed/headers/datadog.rb index 6214cb8e7df..dc06f28cbf1 100644 --- a/lib/datadog/tracing/distributed/headers/datadog.rb +++ b/lib/datadog/tracing/distributed/headers/datadog.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/distributed/headers/parser' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_digest' +require_relative 'parser' +require_relative 'ext' +require_relative '../../trace_digest' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/headers/parser.rb b/lib/datadog/tracing/distributed/headers/parser.rb index 18288acac44..e126f195e2e 100644 --- a/lib/datadog/tracing/distributed/headers/parser.rb +++ b/lib/datadog/tracing/distributed/headers/parser.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/tracing/distributed/helpers' +require_relative '../helpers' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/helpers.rb b/lib/datadog/tracing/distributed/helpers.rb index 96c5f4b7ce7..d65d8f67db9 100644 --- a/lib/datadog/tracing/distributed/helpers.rb +++ b/lib/datadog/tracing/distributed/helpers.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/core/configuration' -require 'datadog/tracing/sampling/ext' +require_relative '../../core/configuration' +require_relative '../sampling/ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/metadata/b3.rb b/lib/datadog/tracing/distributed/metadata/b3.rb old mode 100755 new mode 100644 index a77693951bd..74de1b8bc5b --- a/lib/datadog/tracing/distributed/metadata/b3.rb +++ b/lib/datadog/tracing/distributed/metadata/b3.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/distributed/helpers' -require 'datadog/tracing/distributed/metadata/parser' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_digest' +require_relative '../helpers' +require_relative 'parser' +require_relative '../headers/ext' +require_relative '../../trace_digest' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/metadata/b3_single.rb b/lib/datadog/tracing/distributed/metadata/b3_single.rb old mode 100755 new mode 100644 index 26caed655db..bbd455ecf32 --- a/lib/datadog/tracing/distributed/metadata/b3_single.rb +++ b/lib/datadog/tracing/distributed/metadata/b3_single.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/distributed/metadata/parser' -require 'datadog/tracing/distributed/helpers' -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/trace_digest' +require_relative 'parser' +require_relative '../helpers' +require_relative '../headers/ext' +require_relative '../../trace_digest' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/metadata/datadog.rb b/lib/datadog/tracing/distributed/metadata/datadog.rb old mode 100755 new mode 100644 index 63a73022531..131486de830 --- a/lib/datadog/tracing/distributed/metadata/datadog.rb +++ b/lib/datadog/tracing/distributed/metadata/datadog.rb @@ -1,5 +1,5 @@ -require 'datadog/tracing/distributed/headers/ext' -require 'datadog/tracing/distributed/metadata/parser' +require_relative '../headers/ext' +require_relative 'parser' module Datadog module Tracing diff --git a/lib/datadog/tracing/distributed/metadata/parser.rb b/lib/datadog/tracing/distributed/metadata/parser.rb old mode 100755 new mode 100644 index 998f242db3f..e392e31dd85 --- a/lib/datadog/tracing/distributed/metadata/parser.rb +++ b/lib/datadog/tracing/distributed/metadata/parser.rb @@ -1,4 +1,4 @@ -require 'datadog/tracing/distributed/helpers' +require_relative '../helpers' module Datadog module Tracing diff --git a/lib/datadog/tracing/event.rb b/lib/datadog/tracing/event.rb index c8d496838fb..617cd64c03b 100644 --- a/lib/datadog/tracing/event.rb +++ b/lib/datadog/tracing/event.rb @@ -1,6 +1,6 @@ # typed: false -require 'datadog/core' +require_relative '../core' module Datadog module Tracing diff --git a/lib/datadog/tracing/metadata.rb b/lib/datadog/tracing/metadata.rb index 3ed206de476..a155e62b922 100644 --- a/lib/datadog/tracing/metadata.rb +++ b/lib/datadog/tracing/metadata.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/tracing/metadata/analytics' -require 'datadog/tracing/metadata/tagging' -require 'datadog/tracing/metadata/errors' +require_relative 'metadata/analytics' +require_relative 'metadata/tagging' +require_relative 'metadata/errors' module Datadog module Tracing diff --git a/lib/datadog/tracing/metadata/analytics.rb b/lib/datadog/tracing/metadata/analytics.rb index 49513f7389a..4b54ad2c09c 100644 --- a/lib/datadog/tracing/metadata/analytics.rb +++ b/lib/datadog/tracing/metadata/analytics.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/analytics' -require 'datadog/tracing/metadata/ext' +require_relative '../analytics' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/metadata/errors.rb b/lib/datadog/tracing/metadata/errors.rb index a24e1ca634d..524f78820bc 100644 --- a/lib/datadog/tracing/metadata/errors.rb +++ b/lib/datadog/tracing/metadata/errors.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/core/error' +require_relative '../../core/error' -require 'datadog/tracing/metadata/ext' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 90e8a2a33b3..93626a4dd48 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -1,8 +1,8 @@ # typed: false -require 'datadog/core/environment/ext' +require_relative '../../core/environment/ext' -require 'datadog/tracing/metadata/ext' +require_relative 'ext' module Datadog module Tracing diff --git a/lib/datadog/tracing/pipeline.rb b/lib/datadog/tracing/pipeline.rb index 44d9e4b5349..b355f290638 100644 --- a/lib/datadog/tracing/pipeline.rb +++ b/lib/datadog/tracing/pipeline.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core' +require_relative '../core' -require 'datadog/tracing/pipeline/span_filter' -require 'datadog/tracing/pipeline/span_processor' +require_relative 'pipeline/span_filter' +require_relative 'pipeline/span_processor' module Datadog module Tracing diff --git a/lib/datadog/tracing/pipeline/span_filter.rb b/lib/datadog/tracing/pipeline/span_filter.rb index 8e7bb019233..5339ac81e77 100644 --- a/lib/datadog/tracing/pipeline/span_filter.rb +++ b/lib/datadog/tracing/pipeline/span_filter.rb @@ -1,7 +1,7 @@ # typed: true require 'set' -require 'datadog/tracing/pipeline/span_processor' +require_relative 'span_processor' module Datadog module Tracing diff --git a/lib/datadog/tracing/propagation/grpc.rb b/lib/datadog/tracing/propagation/grpc.rb index 039ae0545c3..670280bede1 100644 --- a/lib/datadog/tracing/propagation/grpc.rb +++ b/lib/datadog/tracing/propagation/grpc.rb @@ -1,12 +1,12 @@ # typed: false -require 'datadog/tracing/distributed/metadata/datadog' -require 'datadog/tracing/distributed/metadata/b3' -require 'datadog/tracing/distributed/metadata/b3_single' +require_relative '../distributed/metadata/datadog' +require_relative '../distributed/metadata/b3' +require_relative '../distributed/metadata/b3_single' -require 'datadog/tracing/span' -require 'datadog/tracing/trace_digest' -require 'datadog/tracing/trace_operation' +require_relative '../span' +require_relative '../trace_digest' +require_relative '../trace_operation' module Datadog module Tracing diff --git a/lib/datadog/tracing/propagation/http.rb b/lib/datadog/tracing/propagation/http.rb index 262cad16810..cfe818428e0 100644 --- a/lib/datadog/tracing/propagation/http.rb +++ b/lib/datadog/tracing/propagation/http.rb @@ -1,15 +1,15 @@ # typed: false -require 'datadog/core' +require_relative '../../core' -require 'datadog/tracing/configuration/ext' -require 'datadog/tracing/sampling/ext' -require 'datadog/tracing/distributed/headers/b3' -require 'datadog/tracing/distributed/headers/b3_single' -require 'datadog/tracing/distributed/headers/datadog' +require_relative '../configuration/ext' +require_relative '../sampling/ext' +require_relative '../distributed/headers/b3' +require_relative '../distributed/headers/b3_single' +require_relative '../distributed/headers/datadog' -require 'datadog/tracing/trace_digest' -require 'datadog/tracing/trace_operation' +require_relative '../trace_digest' +require_relative '../trace_operation' module Datadog module Tracing diff --git a/lib/datadog/tracing/runtime/metrics.rb b/lib/datadog/tracing/runtime/metrics.rb index fdd15c69eea..4a6419b3266 100644 --- a/lib/datadog/tracing/runtime/metrics.rb +++ b/lib/datadog/tracing/runtime/metrics.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core' +require_relative '../../core' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/all_sampler.rb b/lib/datadog/tracing/sampling/all_sampler.rb index 813fbd89051..c56fca91435 100644 --- a/lib/datadog/tracing/sampling/all_sampler.rb +++ b/lib/datadog/tracing/sampling/all_sampler.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/tracing/sampling/sampler' +require_relative 'sampler' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/priority_sampler.rb b/lib/datadog/tracing/sampling/priority_sampler.rb index 52ec9320b98..cd1abdaceb2 100644 --- a/lib/datadog/tracing/sampling/priority_sampler.rb +++ b/lib/datadog/tracing/sampling/priority_sampler.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/tracing/sampling/ext' -require 'datadog/tracing/sampling/all_sampler' -require 'datadog/tracing/sampling/rate_sampler' -require 'datadog/tracing/sampling/rate_by_service_sampler' +require_relative 'ext' +require_relative 'all_sampler' +require_relative 'rate_sampler' +require_relative 'rate_by_service_sampler' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rate_by_key_sampler.rb b/lib/datadog/tracing/sampling/rate_by_key_sampler.rb index 804b3c7e203..0ae2eaee24a 100644 --- a/lib/datadog/tracing/sampling/rate_by_key_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_by_key_sampler.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/tracing/sampling/sampler' -require 'datadog/tracing/sampling/rate_sampler' +require_relative 'sampler' +require_relative 'rate_sampler' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rate_by_service_sampler.rb b/lib/datadog/tracing/sampling/rate_by_service_sampler.rb index 7864be44808..dc7aa5a663e 100644 --- a/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_by_service_sampler.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/core' -require 'datadog/tracing/sampling/rate_by_key_sampler' +require_relative '../../core' +require_relative 'rate_by_key_sampler' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rate_limiter.rb b/lib/datadog/tracing/sampling/rate_limiter.rb index 8f7661c9055..97990490fcf 100644 --- a/lib/datadog/tracing/sampling/rate_limiter.rb +++ b/lib/datadog/tracing/sampling/rate_limiter.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/utils/time' +require_relative '../../core/utils/time' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rate_sampler.rb b/lib/datadog/tracing/sampling/rate_sampler.rb index 7fcc13c31d7..2ba0fe5a95a 100644 --- a/lib/datadog/tracing/sampling/rate_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_sampler.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core' +require_relative '../../core' -require 'datadog/tracing/sampling/sampler' -require 'datadog/tracing/span' +require_relative 'sampler' +require_relative '../span' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rule.rb b/lib/datadog/tracing/sampling/rule.rb index 909439a5907..2700c3933dd 100644 --- a/lib/datadog/tracing/sampling/rule.rb +++ b/lib/datadog/tracing/sampling/rule.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core' +require_relative '../../core' -require 'datadog/tracing/sampling/matcher' -require 'datadog/tracing/sampling/rate_sampler' +require_relative 'matcher' +require_relative 'rate_sampler' module Datadog module Tracing diff --git a/lib/datadog/tracing/sampling/rule_sampler.rb b/lib/datadog/tracing/sampling/rule_sampler.rb index 08938c320e1..3c86cdd9894 100644 --- a/lib/datadog/tracing/sampling/rule_sampler.rb +++ b/lib/datadog/tracing/sampling/rule_sampler.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core' +require_relative '../../core' -require 'datadog/tracing/sampling/ext' -require 'datadog/tracing/sampling/rate_limiter' -require 'datadog/tracing/sampling/rule' +require_relative 'ext' +require_relative 'rate_limiter' +require_relative 'rule' module Datadog module Tracing diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index ef88ff0ac5f..ee0ce054f8f 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -2,11 +2,11 @@ # typed: true -require 'datadog/core/utils' -require 'datadog/core/utils/safe_dup' +require_relative '../core/utils' +require_relative '../core/utils/safe_dup' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/metadata' +require_relative 'metadata/ext' +require_relative 'metadata' module Datadog module Tracing diff --git a/lib/datadog/tracing/span_operation.rb b/lib/datadog/tracing/span_operation.rb index 657c564cb76..d49042d7ef4 100644 --- a/lib/datadog/tracing/span_operation.rb +++ b/lib/datadog/tracing/span_operation.rb @@ -2,15 +2,15 @@ require 'time' -require 'datadog/core' -require 'datadog/core/environment/identity' -require 'datadog/core/utils' -require 'datadog/core/utils/time' - -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/event' -require 'datadog/tracing/span' -require 'datadog/tracing/metadata' +require_relative '../core' +require_relative '../core/environment/identity' +require_relative '../core/utils' +require_relative '../core/utils/time' + +require_relative 'metadata/ext' +require_relative 'event' +require_relative 'span' +require_relative 'metadata' module Datadog module Tracing diff --git a/lib/datadog/tracing/sync_writer.rb b/lib/datadog/tracing/sync_writer.rb index 9b7a4dc8902..693e206c1fa 100644 --- a/lib/datadog/tracing/sync_writer.rb +++ b/lib/datadog/tracing/sync_writer.rb @@ -1,12 +1,12 @@ # typed: true -require 'datadog/core' +require_relative '../core' -require 'datadog/tracing/pipeline' -require 'datadog/tracing/runtime/metrics' -require 'datadog/tracing/writer' +require_relative 'pipeline' +require_relative 'runtime/metrics' +require_relative 'writer' -require 'ddtrace/transport/http' +require_relative '../../ddtrace/transport/http' module Datadog module Tracing diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index e6189a40db0..7a3861aa482 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -1,15 +1,15 @@ # typed: false -require 'datadog/core' -require 'datadog/core/environment/identity' -require 'datadog/core/utils' - -require 'datadog/tracing/sampling/ext' -require 'datadog/tracing/event' -require 'datadog/tracing/span_operation' -require 'datadog/tracing/trace_segment' -require 'datadog/tracing/trace_digest' -require 'datadog/tracing/metadata/tagging' +require_relative '../core' +require_relative '../core/environment/identity' +require_relative '../core/utils' + +require_relative 'sampling/ext' +require_relative 'event' +require_relative 'span_operation' +require_relative 'trace_segment' +require_relative 'trace_digest' +require_relative 'metadata/tagging' module Datadog module Tracing diff --git a/lib/datadog/tracing/trace_segment.rb b/lib/datadog/tracing/trace_segment.rb index 272ecf0bca0..655d55b2f97 100644 --- a/lib/datadog/tracing/trace_segment.rb +++ b/lib/datadog/tracing/trace_segment.rb @@ -1,11 +1,11 @@ # typed: true -require 'datadog/core/runtime/ext' -require 'datadog/core/utils/safe_dup' +require_relative '../core/runtime/ext' +require_relative '../core/utils/safe_dup' -require 'datadog/tracing/sampling/ext' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/metadata/tagging' +require_relative 'sampling/ext' +require_relative 'metadata/ext' +require_relative 'metadata/tagging' module Datadog module Tracing diff --git a/lib/datadog/tracing/tracer.rb b/lib/datadog/tracing/tracer.rb index 315b10fc7b1..f0c1ff59b7a 100644 --- a/lib/datadog/tracing/tracer.rb +++ b/lib/datadog/tracing/tracer.rb @@ -1,20 +1,20 @@ # typed: true -require 'datadog/core' -require 'datadog/core/environment/ext' -require 'datadog/core/environment/socket' - -require 'datadog/tracing/correlation' -require 'datadog/tracing/event' -require 'datadog/tracing/flush' -require 'datadog/tracing/context_provider' -require 'datadog/tracing/sampling/all_sampler' -require 'datadog/tracing/sampling/rule_sampler' -require 'datadog/tracing/sampling/priority_sampler' -require 'datadog/tracing/span_operation' -require 'datadog/tracing/trace_digest' -require 'datadog/tracing/trace_operation' -require 'datadog/tracing/writer' +require_relative '../core' +require_relative '../core/environment/ext' +require_relative '../core/environment/socket' + +require_relative 'correlation' +require_relative 'event' +require_relative 'flush' +require_relative 'context_provider' +require_relative 'sampling/all_sampler' +require_relative 'sampling/rule_sampler' +require_relative 'sampling/priority_sampler' +require_relative 'span_operation' +require_relative 'trace_digest' +require_relative 'trace_operation' +require_relative 'writer' module Datadog module Tracing diff --git a/lib/datadog/tracing/workers.rb b/lib/datadog/tracing/workers.rb index 439731326b2..a5ce1b7637c 100644 --- a/lib/datadog/tracing/workers.rb +++ b/lib/datadog/tracing/workers.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core' +require_relative '../core' -require 'datadog/tracing/buffer' -require 'datadog/tracing/pipeline' +require_relative 'buffer' +require_relative 'pipeline' module Datadog module Tracing diff --git a/lib/datadog/tracing/workers/trace_writer.rb b/lib/datadog/tracing/workers/trace_writer.rb index d8b85ceb8f4..378310332b1 100644 --- a/lib/datadog/tracing/workers/trace_writer.rb +++ b/lib/datadog/tracing/workers/trace_writer.rb @@ -1,16 +1,16 @@ # typed: false -require 'datadog/core' -require 'datadog/core/worker' -require 'datadog/core/workers/async' -require 'datadog/core/workers/polling' -require 'datadog/core/workers/queue' +require_relative '../../core' +require_relative '../../core/worker' +require_relative '../../core/workers/async' +require_relative '../../core/workers/polling' +require_relative '../../core/workers/queue' -require 'datadog/tracing/buffer' -require 'datadog/tracing/pipeline' -require 'datadog/tracing/event' +require_relative '../buffer' +require_relative '../pipeline' +require_relative '../event' -require 'ddtrace/transport/http' +require_relative '../../../ddtrace/transport/http' module Datadog module Tracing diff --git a/lib/datadog/tracing/writer.rb b/lib/datadog/tracing/writer.rb index b203e1ebfde..3d686b2c8a1 100644 --- a/lib/datadog/tracing/writer.rb +++ b/lib/datadog/tracing/writer.rb @@ -1,12 +1,12 @@ # typed: true -require 'datadog/core' +require_relative '../core' -require 'datadog/tracing/event' -require 'datadog/tracing/runtime/metrics' -require 'datadog/tracing/workers' +require_relative 'event' +require_relative 'runtime/metrics' +require_relative 'workers' -require 'ddtrace/transport/http' +require_relative '../../ddtrace/transport/http' module Datadog module Tracing diff --git a/lib/ddtrace.rb b/lib/ddtrace.rb index 42966595abf..1bf3e25ac77 100644 --- a/lib/ddtrace.rb +++ b/lib/ddtrace.rb @@ -1,13 +1,13 @@ # typed: strict # Load tracing -require 'datadog/tracing' -require 'datadog/tracing/contrib' +require_relative 'datadog/tracing' +require_relative 'datadog/tracing/contrib' # Load appsec -require 'datadog/appsec/autoload' # TODO: datadog/appsec? +require_relative 'datadog/appsec/autoload' # TODO: datadog/appsec? # Load other products (must follow tracing) -require 'datadog/profiling' -require 'datadog/ci' -require 'datadog/kit' +require_relative 'datadog/profiling' +require_relative 'datadog/ci' +require_relative 'datadog/kit' diff --git a/lib/ddtrace/auto_instrument.rb b/lib/ddtrace/auto_instrument.rb index e4d3497bf25..0034a6c4d30 100644 --- a/lib/ddtrace/auto_instrument.rb +++ b/lib/ddtrace/auto_instrument.rb @@ -3,7 +3,7 @@ # Entrypoint file for auto instrumentation. # # This file's path is part of the @public_api. -require 'ddtrace' -require 'datadog/tracing/contrib/auto_instrument' +require_relative '../ddtrace' +require_relative '../datadog/tracing/contrib/auto_instrument' Datadog::Profiling.start_if_enabled diff --git a/lib/ddtrace/transport/http.rb b/lib/ddtrace/transport/http.rb index 3f160502244..cf6d886740f 100644 --- a/lib/ddtrace/transport/http.rb +++ b/lib/ddtrace/transport/http.rb @@ -4,15 +4,15 @@ require 'uri' -require 'datadog/core/environment/container' -require 'datadog/core/environment/ext' -require 'ddtrace/transport/ext' -require 'ddtrace/transport/http/adapters/net' -require 'ddtrace/transport/http/adapters/test' -require 'ddtrace/transport/http/adapters/unix_socket' -require 'ddtrace/transport/http/api' -require 'ddtrace/transport/http/builder' -require 'ddtrace/version' +require_relative '../../datadog/core/environment/container' +require_relative '../../datadog/core/environment/ext' +require_relative 'ext' +require_relative 'http/adapters/net' +require_relative 'http/adapters/test' +require_relative 'http/adapters/unix_socket' +require_relative 'http/api' +require_relative 'http/builder' +require_relative '../version' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/adapters/net.rb b/lib/ddtrace/transport/http/adapters/net.rb index d908ecc1a3c..2cd1c0a45e2 100644 --- a/lib/ddtrace/transport/http/adapters/net.rb +++ b/lib/ddtrace/transport/http/adapters/net.rb @@ -1,7 +1,7 @@ # typed: true -require 'ddtrace/transport/response' -require 'datadog/core/vendor/multipart-post/net/http/post/multipart' +require_relative '../../response' +require_relative '../../../../datadog/core/vendor/multipart-post/net/http/post/multipart' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/adapters/test.rb b/lib/ddtrace/transport/http/adapters/test.rb index 319f7850b9d..87991e0a7fa 100644 --- a/lib/ddtrace/transport/http/adapters/test.rb +++ b/lib/ddtrace/transport/http/adapters/test.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/response' +require_relative '../../response' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/adapters/unix_socket.rb b/lib/ddtrace/transport/http/adapters/unix_socket.rb index 53620186b8c..0ffb2ba4fc8 100644 --- a/lib/ddtrace/transport/http/adapters/unix_socket.rb +++ b/lib/ddtrace/transport/http/adapters/unix_socket.rb @@ -1,8 +1,8 @@ # typed: false require 'net/http' -require 'ddtrace/transport/ext' -require 'ddtrace/transport/http/adapters/net' +require_relative '../../ext' +require_relative 'net' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/api.rb b/lib/ddtrace/transport/http/api.rb index a3d265c9f14..f6d42a1b39e 100644 --- a/lib/ddtrace/transport/http/api.rb +++ b/lib/ddtrace/transport/http/api.rb @@ -1,11 +1,11 @@ # typed: false -require 'datadog/core/encoding' +require_relative '../../../datadog/core/encoding' -require 'ddtrace/transport/http/api/map' -require 'ddtrace/transport/http/api/spec' +require_relative 'api/map' +require_relative 'api/spec' -require 'ddtrace/transport/http/traces' +require_relative 'traces' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/api/map.rb b/lib/ddtrace/transport/http/api/map.rb index 81878ea77e8..c623228754d 100644 --- a/lib/ddtrace/transport/http/api/map.rb +++ b/lib/ddtrace/transport/http/api/map.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/http/api/fallbacks' +require_relative 'fallbacks' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/builder.rb b/lib/ddtrace/transport/http/builder.rb index 04d8083603c..20253169832 100644 --- a/lib/ddtrace/transport/http/builder.rb +++ b/lib/ddtrace/transport/http/builder.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core/configuration/agent_settings_resolver' -require 'ddtrace/transport/http/adapters/registry' -require 'ddtrace/transport/http/api/map' -require 'ddtrace/transport/http/api/instance' -require 'ddtrace/transport/http/client' +require_relative '../../../datadog/core/configuration/agent_settings_resolver' +require_relative 'adapters/registry' +require_relative 'api/map' +require_relative 'api/instance' +require_relative 'client' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/client.rb b/lib/ddtrace/transport/http/client.rb index bfdc1e40ea7..7706a7b7792 100644 --- a/lib/ddtrace/transport/http/client.rb +++ b/lib/ddtrace/transport/http/client.rb @@ -1,7 +1,7 @@ # typed: true -require 'ddtrace/transport/http/statistics' -require 'ddtrace/transport/http/env' +require_relative 'statistics' +require_relative 'env' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/response.rb b/lib/ddtrace/transport/http/response.rb index 949193b8a29..bb59ae002f2 100644 --- a/lib/ddtrace/transport/http/response.rb +++ b/lib/ddtrace/transport/http/response.rb @@ -1,6 +1,6 @@ # typed: false -require 'ddtrace/transport/response' +require_relative '../response' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/statistics.rb b/lib/ddtrace/transport/http/statistics.rb index c19ed054895..82e62062ff2 100644 --- a/lib/ddtrace/transport/http/statistics.rb +++ b/lib/ddtrace/transport/http/statistics.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/statistics' +require_relative '../statistics' module Datadog module Transport diff --git a/lib/ddtrace/transport/http/traces.rb b/lib/ddtrace/transport/http/traces.rb index 82079087618..9403a644876 100644 --- a/lib/ddtrace/transport/http/traces.rb +++ b/lib/ddtrace/transport/http/traces.rb @@ -2,11 +2,11 @@ require 'json' -require 'ddtrace/transport/traces' -require 'ddtrace/transport/http/client' -require 'ddtrace/transport/http/response' -require 'ddtrace/transport/http/api/endpoint' -require 'ddtrace/transport/http/api/instance' +require_relative '../traces' +require_relative 'client' +require_relative 'response' +require_relative 'api/endpoint' +require_relative 'api/instance' module Datadog module Transport diff --git a/lib/ddtrace/transport/io.rb b/lib/ddtrace/transport/io.rb index 489887f3f95..88d4be8eef0 100644 --- a/lib/ddtrace/transport/io.rb +++ b/lib/ddtrace/transport/io.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/encoding' -require 'ddtrace/transport/io/client' -require 'ddtrace/transport/io/traces' +require_relative '../../datadog/core/encoding' +require_relative 'io/client' +require_relative 'io/traces' module Datadog module Transport diff --git a/lib/ddtrace/transport/io/client.rb b/lib/ddtrace/transport/io/client.rb index b2d718c0a5d..db0b82df763 100644 --- a/lib/ddtrace/transport/io/client.rb +++ b/lib/ddtrace/transport/io/client.rb @@ -1,7 +1,7 @@ # typed: true -require 'ddtrace/transport/statistics' -require 'ddtrace/transport/io/response' +require_relative '../statistics' +require_relative 'response' module Datadog module Transport diff --git a/lib/ddtrace/transport/io/response.rb b/lib/ddtrace/transport/io/response.rb index 783f3866724..dd378df29b9 100644 --- a/lib/ddtrace/transport/io/response.rb +++ b/lib/ddtrace/transport/io/response.rb @@ -1,6 +1,6 @@ # typed: true -require 'ddtrace/transport/response' +require_relative '../response' module Datadog module Transport diff --git a/lib/ddtrace/transport/io/traces.rb b/lib/ddtrace/transport/io/traces.rb index a0623cf36ab..b31c957b03e 100644 --- a/lib/ddtrace/transport/io/traces.rb +++ b/lib/ddtrace/transport/io/traces.rb @@ -1,9 +1,9 @@ # typed: false -require 'ddtrace/transport/traces' +require_relative '../traces' -require 'ddtrace/transport/io/response' -require 'ddtrace/transport/io/client' +require_relative 'response' +require_relative 'client' module Datadog module Transport diff --git a/lib/ddtrace/transport/statistics.rb b/lib/ddtrace/transport/statistics.rb index 6b504d32e41..734db23883b 100644 --- a/lib/ddtrace/transport/statistics.rb +++ b/lib/ddtrace/transport/statistics.rb @@ -1,7 +1,7 @@ # typed: true -require 'datadog/core/metrics/metric' -require 'datadog/core/diagnostics/health' +require_relative '../../datadog/core/metrics/metric' +require_relative '../../datadog/core/diagnostics/health' module Datadog module Transport diff --git a/lib/ddtrace/transport/trace_formatter.rb b/lib/ddtrace/transport/trace_formatter.rb index c413075a3d0..455c04a9847 100644 --- a/lib/ddtrace/transport/trace_formatter.rb +++ b/lib/ddtrace/transport/trace_formatter.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core/environment/identity' -require 'datadog/core/environment/socket' -require 'datadog/core/runtime/ext' -require 'datadog/tracing/metadata/ext' -require 'datadog/tracing/trace_segment' +require_relative '../../datadog/core/environment/identity' +require_relative '../../datadog/core/environment/socket' +require_relative '../../datadog/core/runtime/ext' +require_relative '../../datadog/tracing/metadata/ext' +require_relative '../../datadog/tracing/trace_segment' module Datadog module Transport diff --git a/lib/ddtrace/transport/traces.rb b/lib/ddtrace/transport/traces.rb index f04691bfabf..cca596f3077 100644 --- a/lib/ddtrace/transport/traces.rb +++ b/lib/ddtrace/transport/traces.rb @@ -1,10 +1,10 @@ # typed: true -require 'datadog/core/chunker' -require 'ddtrace/transport/parcel' -require 'ddtrace/transport/request' -require 'ddtrace/transport/serializable_trace' -require 'ddtrace/transport/trace_formatter' +require_relative '../../datadog/core/chunker' +require_relative 'parcel' +require_relative 'request' +require_relative 'serializable_trace' +require_relative 'trace_formatter' module Datadog module Transport From 67445239b19aa557f124e3662836d9ac02fa89d6 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 22 Jul 2022 18:04:38 -0700 Subject: [PATCH 0287/2133] Fix Profiler require test assertions --- spec/datadog/profiling_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/datadog/profiling_spec.rb b/spec/datadog/profiling_spec.rb index 644486e483f..23936202d42 100644 --- a/spec/datadog/profiling_spec.rb +++ b/spec/datadog/profiling_spec.rb @@ -180,13 +180,13 @@ describe '::try_loading_native_library' do subject(:try_loading_native_library) { described_class.send(:try_loading_native_library) } - let(:native_extension_require) { 'datadog/profiling/load_native_extension' } + let(:native_extension_require_relative) { 'profiling/load_native_extension' } context 'when the profiling native library loads successfully' do before do expect(described_class) - .to receive(:require) - .with(native_extension_require) + .to receive(:require_relative) + .with(native_extension_require_relative) stub_const('Datadog::Profiling::NativeExtension', double(native_working?: true)) end @@ -195,7 +195,7 @@ context 'when the profiling native library fails to load with a LoadError' do before do - expect(described_class).to receive(:require).with(native_extension_require).and_raise(loaderror) + expect(described_class).to receive(:require_relative).with(native_extension_require_relative).and_raise(loaderror) end let(:loaderror) { LoadError.new('Simulated require failure') } @@ -205,7 +205,7 @@ context 'when the profiling native library fails to load with a different error' do before do - expect(described_class).to receive(:require).with(native_extension_require).and_raise(error) + expect(described_class).to receive(:require_relative).with(native_extension_require_relative).and_raise(error) end let(:error) { StandardError.new('Simulated require failure') } @@ -216,8 +216,8 @@ context 'when the profiling native library loads but does not install code correctly' do before do expect(described_class) - .to receive(:require) - .with(native_extension_require) + .to receive(:require_relative) + .with(native_extension_require_relative) stub_const('Datadog::Profiling::NativeExtension', double(native_working?: false)) end From 9f5f81a3f9028ddbe8150068238da6a5c33c6fa2 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 09:14:51 +0200 Subject: [PATCH 0288/2133] Update appraisal gemfile.lock with platform aarch64-linux --- gemfiles/ruby_3.0.3_contrib.gemfile.lock | 26 +++++++++---------- gemfiles/ruby_3.0.3_contrib_old.gemfile.lock | 21 ++++++--------- gemfiles/ruby_3.0.3_core_old.gemfile.lock | 21 ++++++--------- gemfiles/ruby_3.0.3_cucumber3.gemfile.lock | 21 ++++++--------- gemfiles/ruby_3.0.3_cucumber4.gemfile.lock | 21 ++++++--------- gemfiles/ruby_3.0.3_cucumber5.gemfile.lock | 21 ++++++--------- .../ruby_3.0.3_rails61_mysql2.gemfile.lock | 23 +++++++--------- .../ruby_3.0.3_rails61_postgres.gemfile.lock | 23 +++++++--------- ..._3.0.3_rails61_postgres_redis.gemfile.lock | 23 +++++++--------- ....0.3_rails61_postgres_sidekiq.gemfile.lock | 23 +++++++--------- ...3.0.3_rails61_semantic_logger.gemfile.lock | 23 +++++++--------- .../ruby_3.0.3_resque2_redis3.gemfile.lock | 21 ++++++--------- .../ruby_3.0.3_resque2_redis4.gemfile.lock | 21 ++++++--------- 13 files changed, 119 insertions(+), 169 deletions(-) diff --git a/gemfiles/ruby_3.0.3_contrib.gemfile.lock b/gemfiles/ruby_3.0.3_contrib.gemfile.lock index 711e19262b0..6665c4e159f 100644 --- a/gemfiles/ruby_3.0.3_contrib.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1407,6 +1407,7 @@ GEM ffi-compiler (1.0.1) ffi (>= 1.0.0) rake + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) googleapis-common-protos-types (1.3.0) google-protobuf (~> 3.14) @@ -1418,6 +1419,9 @@ GEM rack (>= 1.3.0) rack-accept graphql (2.0.6) + grpc (1.45.0) + google-protobuf (~> 3.19) + googleapis-common-protos-types (~> 1.0) grpc (1.45.0-x86_64-linux) google-protobuf (~> 3.19) googleapis-common-protos-types (~> 1.0) @@ -1443,8 +1447,8 @@ GEM json-schema (2.8.1) addressable (>= 2.4) jsonapi-renderer (0.2.2) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) @@ -1481,6 +1485,8 @@ GEM net-protocol timeout netrc (0.11.0) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -1575,6 +1581,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1617,17 +1625,9 @@ GEM rake (~> 12.3) serverengine (~> 2.1.0) thor - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) sorted_set (1.0.3) rbtree set (~> 1.0) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sqlite3 (1.4.2) statsd-ruby (1.5.0) sucker_punch (3.0.1) @@ -1661,6 +1661,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -1720,6 +1721,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) @@ -1731,8 +1733,6 @@ DEPENDENCIES simplecov! sinatra sneakers (>= 2.12.0) - sorbet (= 0.5.9672) - spoom (~> 1.1) sqlite3 (>= 1.4.2) sucker_punch typhoeus diff --git a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock index 918ad4dad5c..2fcef09b249 100644 --- a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -59,13 +59,14 @@ GEM faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) graphql (1.12.24) hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -129,6 +130,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -138,14 +141,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -158,6 +153,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -191,12 +187,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_core_old.gemfile.lock b/gemfiles/ruby_3.0.3_core_old.gemfile.lock index 57f5ca4ae89..945d84028de 100644 --- a/gemfiles/ruby_3.0.3_core_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_core_old.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -46,12 +46,13 @@ GEM docile (1.4.0) dogstatsd-ruby (4.8.3) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -109,6 +110,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -118,14 +121,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -138,6 +133,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -167,12 +163,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock index b1bf33092ee..b68192becc2 100644 --- a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -64,12 +64,13 @@ GEM dogstatsd-ruby (5.4.0) ffi (1.15.5) gherkin (5.1.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -129,6 +130,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -138,14 +141,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -158,6 +153,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -188,12 +184,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock index 53eddc9e081..c99af402c0a 100644 --- a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,14 +82,15 @@ GEM docile (1.4.0) dogstatsd-ruby (5.4.0) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -155,6 +156,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -164,14 +167,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sys-uname (1.2.2) ffi (~> 1.1) thor (1.2.1) @@ -189,6 +184,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -219,12 +215,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock index bdf4fd06c30..1388e33e22d 100644 --- a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -82,14 +82,15 @@ GEM docile (1.4.0) dogstatsd-ruby (5.4.0) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -155,6 +156,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -164,14 +167,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sys-uname (1.2.2) ffi (~> 1.1) thor (1.2.1) @@ -189,6 +184,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -219,12 +215,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock index 4d0cdb5e172..7e1ea8fab1f 100644 --- a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,6 +110,7 @@ GEM ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) @@ -117,8 +118,8 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -145,6 +146,8 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -232,6 +235,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -241,14 +246,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -275,6 +272,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -308,12 +306,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock index 6537b96d6f8..88de1df8462 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,6 +110,7 @@ GEM ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) @@ -117,8 +118,8 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -144,6 +145,8 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -232,6 +235,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -241,14 +246,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -275,6 +272,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -308,12 +306,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock index 3ec62e15dd2..78c93f0b0f1 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,6 +110,7 @@ GEM ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) @@ -117,8 +118,8 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -144,6 +145,8 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -233,6 +236,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -242,14 +247,6 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -276,6 +273,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -310,12 +308,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock index 739a3947251..385d688371f 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,6 +111,7 @@ GEM ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) @@ -118,8 +119,8 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -145,6 +146,8 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -238,6 +241,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -253,14 +258,6 @@ GEM redis (>= 4.2.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -287,6 +284,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -321,13 +319,12 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) sidekiq (>= 6.1.2) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock index 940c0b61c5e..efaa6e46c86 100644 --- a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,6 +110,7 @@ GEM ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) i18n (1.10.0) @@ -117,8 +118,8 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) @@ -139,6 +140,8 @@ GEM net-protocol timeout nio4r (2.5.8) + nokogiri (1.13.3-aarch64-linux) + racc (~> 1.4) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) opentracing (0.5.0) @@ -229,6 +232,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -240,14 +245,6 @@ GEM concurrent-ruby (~> 1.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -274,6 +271,7 @@ GEM zeitwerk (2.5.4) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -307,12 +305,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock index d9a5e047a5c..f8f808a9b97 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -46,12 +46,13 @@ GEM docile (1.4.0) dogstatsd-ruby (5.4.0) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -124,6 +125,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -139,14 +142,6 @@ GEM rack (~> 2.2) rack-protection (= 2.2.0) tilt (~> 2.0) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) thor (1.2.1) tilt (2.0.10) unicode-display_width (2.1.0) @@ -160,6 +155,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -191,12 +187,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock index b0d8dfb4787..ff512b90c49 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock @@ -13,7 +13,7 @@ PATH specs: ddtrace (1.2.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -46,12 +46,13 @@ GEM docile (1.4.0) dogstatsd-ruby (5.4.0) ffi (1.15.5) + google-protobuf (3.19.4) google-protobuf (3.19.4-x86_64-linux) hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0-aarch64-linux) + libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) @@ -124,6 +125,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -139,14 +142,6 @@ GEM rack (~> 2.2) rack-protection (= 2.2.0) tilt (~> 2.0) - sorbet (0.5.9672) - sorbet-static (= 0.5.9672) - sorbet-runtime (0.5.9807) - sorbet-static (0.5.9672-x86_64-linux) - spoom (1.1.9) - sorbet (>= 0.5.9204) - sorbet-runtime (>= 0.5.9204) - thor (>= 0.19.2) thor (1.2.1) tilt (2.0.10) unicode-display_width (2.1.0) @@ -160,6 +155,7 @@ GEM webrick (~> 1.7.0) PLATFORMS + aarch64-linux x86_64-linux DEPENDENCIES @@ -191,12 +187,11 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! - sorbet (= 0.5.9672) - spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) From 343879de787f3d71e6a88e49a9b7232be612d6ea Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 25 Jul 2022 11:48:26 +0100 Subject: [PATCH 0289/2133] Minor: Rename `thread_cpu_time_id` argument to `time_id` As discussed during code review, using `thread_cpu_time_id` for both the `typedef` and the variable name can be a confusing read. --- ext/ddtrace_profiling_native_extension/clock_id.h | 2 +- .../clock_id_from_pthread.c | 6 +++--- ext/ddtrace_profiling_native_extension/clock_id_noop.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/clock_id.h b/ext/ddtrace_profiling_native_extension/clock_id.h index 1e19f307b56..8a2f5389e28 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id.h +++ b/ext/ddtrace_profiling_native_extension/clock_id.h @@ -21,4 +21,4 @@ void self_test_clock_id(void); VALUE clock_id_for(VALUE self, VALUE thread); thread_cpu_time_id thread_cpu_time_id_for(VALUE thread); -thread_cpu_time thread_cpu_time_for(thread_cpu_time_id thread_cpu_time_id); +thread_cpu_time thread_cpu_time_for(thread_cpu_time_id time_id); diff --git a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c index 090255305f0..2841deb04c2 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c @@ -57,15 +57,15 @@ thread_cpu_time_id thread_cpu_time_id_for(VALUE thread) { } } -thread_cpu_time thread_cpu_time_for(thread_cpu_time_id thread_cpu_time_id) { +thread_cpu_time thread_cpu_time_for(thread_cpu_time_id time_id) { thread_cpu_time error = (thread_cpu_time) {.valid = false}; - if (!thread_cpu_time_id.valid) { return error; } + if (!time_id.valid) { return error; } struct timespec current_cpu; // TODO: Include the error code in some way in the output? - if (clock_gettime(thread_cpu_time_id.clock_id, ¤t_cpu) != 0) return error; + if (clock_gettime(time_id.clock_id, ¤t_cpu) != 0) return error; return (thread_cpu_time) {.valid = true, .result_ns = current_cpu.tv_nsec + (current_cpu.tv_sec * 1000 * 1000 * 1000)}; } diff --git a/ext/ddtrace_profiling_native_extension/clock_id_noop.c b/ext/ddtrace_profiling_native_extension/clock_id_noop.c index 27f5f6e592f..47d74b73c43 100644 --- a/ext/ddtrace_profiling_native_extension/clock_id_noop.c +++ b/ext/ddtrace_profiling_native_extension/clock_id_noop.c @@ -16,7 +16,7 @@ thread_cpu_time_id thread_cpu_time_id_for(DDTRACE_UNUSED VALUE _thread) { return (thread_cpu_time_id) {.valid = false}; } -thread_cpu_time thread_cpu_time_for(DDTRACE_UNUSED thread_cpu_time_id _thread_cpu_time_id) { +thread_cpu_time thread_cpu_time_for(DDTRACE_UNUSED thread_cpu_time_id _time_id) { return (thread_cpu_time) {.valid = false}; } From 3e18556ed043238126d0522399c3f99a66308046 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 22 Jul 2022 10:36:27 +0100 Subject: [PATCH 0290/2133] Extract `StackRecorder` instance native state to struct Previously, the only native state for the `StackRecorder` was the libdatadog profile, and thus we directly stored a pointer to it using the Ruby `TypedData` mechanism. In preparation to store state beyond just a single libdatadog profile, I've introduced a new struct and `StackRecorder` now wraps the entire struct. This does not change any behavior, but opens the door for us to introduce more state. --- .../stack_recorder.c | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 929be08abcd..db72c2260bc 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -15,6 +15,11 @@ static ID ruby_time_from_id; // id of :ruby_time_from in Ruby static VALUE stack_recorder_class = Qnil; +// Contains native state for each instance +struct stack_recorder_state { + ddprof_ffi_Profile *profile; +}; + struct call_serialize_without_gvl_arguments { ddprof_ffi_Profile *profile; ddprof_ffi_SerializeResult result; @@ -32,9 +37,9 @@ void stack_recorder_init(VALUE profiling_module) { // Instances of the StackRecorder class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. - // In our case, we're going to keep a libdatadog profile reference inside our object. + // In this case, it wraps the stack_recorder_state. // - // Because Ruby doesn't know how to initialize libdatadog profiles, we MUST override the allocation function for objects + // Because Ruby doesn't know how to initialize native-level structs, we MUST override the allocation function for objects // of this class so that we can manage this part. Not overriding or disabling the allocation function is a common // gotcha for "TypedData" objects that can very easily lead to VM crashes, see for instance // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. @@ -60,24 +65,30 @@ static const rb_data_type_t stack_recorder_typed_data = { }; static VALUE _native_new(VALUE klass) { + struct stack_recorder_state *state = ruby_xcalloc(1, sizeof(struct stack_recorder_state)); + ddprof_ffi_Slice_value_type sample_types = {.ptr = enabled_value_types, .len = ENABLED_VALUE_TYPES_COUNT}; - ddprof_ffi_Profile *profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); + state->profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); - return TypedData_Wrap_Struct(klass, &stack_recorder_typed_data, profile); + return TypedData_Wrap_Struct(klass, &stack_recorder_typed_data, state); } -static void stack_recorder_typed_data_free(void *data) { - ddprof_ffi_Profile_free((ddprof_ffi_Profile *) data); +static void stack_recorder_typed_data_free(void *state_ptr) { + struct stack_recorder_state *state = (struct stack_recorder_state *) state_ptr; + + ddprof_ffi_Profile_free(state->profile); + + ruby_xfree(state); } static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance) { - ddprof_ffi_Profile *profile; - TypedData_Get_Struct(recorder_instance, ddprof_ffi_Profile, &stack_recorder_typed_data, profile); + struct stack_recorder_state *state; + TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); // We'll release the Global VM Lock while we're calling serialize, so that the Ruby VM can continue to work while this // is pending - struct call_serialize_without_gvl_arguments args = {.profile = profile, .serialize_ran = false}; + struct call_serialize_without_gvl_arguments args = {.profile = state->profile, .serialize_ran = false}; while (!args.serialize_ran) { // Give the Ruby VM an opportunity to process any pending interruptions (including raising exceptions). @@ -112,7 +123,7 @@ static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instan VALUE start = ruby_time_from(ddprof_start); VALUE finish = ruby_time_from(ddprof_finish); - if (!ddprof_ffi_Profile_reset(profile, NULL /* start_time is optional */ )) { + if (!ddprof_ffi_Profile_reset(state->profile, NULL /* start_time is optional */ )) { return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Failed to reset profile")); } @@ -130,10 +141,10 @@ static VALUE ruby_time_from(ddprof_ffi_Timespec ddprof_time) { } void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample) { - ddprof_ffi_Profile *profile; - TypedData_Get_Struct(recorder_instance, ddprof_ffi_Profile, &stack_recorder_typed_data, profile); + struct stack_recorder_state *state; + TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); - ddprof_ffi_Profile_add(profile, sample); + ddprof_ffi_Profile_add(state->profile, sample); } static void *call_serialize_without_gvl(void *call_args) { From 97601fb7390470f5d5d8443f3e0a67f7fb8dc76c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 22 Jul 2022 10:51:56 +0100 Subject: [PATCH 0291/2133] Introduce notion of profile slots, and mutexes to protect them See the next commits for the documentation on why and what we're doing. --- .../stack_recorder.c | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index db72c2260bc..4379e0489dd 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -1,5 +1,6 @@ #include #include +#include #include "helpers.h" #include "stack_recorder.h" #include "libdatadog_helpers.h" @@ -17,7 +18,11 @@ static VALUE stack_recorder_class = Qnil; // Contains native state for each instance struct stack_recorder_state { - ddprof_ffi_Profile *profile; + pthread_mutex_t slot_one_mutex; + ddprof_ffi_Profile *slot_one_profile; + + pthread_mutex_t slot_two_mutex; + ddprof_ffi_Profile *slot_two_profile; }; struct call_serialize_without_gvl_arguments { @@ -69,7 +74,11 @@ static VALUE _native_new(VALUE klass) { ddprof_ffi_Slice_value_type sample_types = {.ptr = enabled_value_types, .len = ENABLED_VALUE_TYPES_COUNT}; - state->profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); + state->slot_one_mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; + state->slot_one_profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); + + state->slot_two_mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; + state->slot_two_profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); return TypedData_Wrap_Struct(klass, &stack_recorder_typed_data, state); } @@ -77,7 +86,11 @@ static VALUE _native_new(VALUE klass) { static void stack_recorder_typed_data_free(void *state_ptr) { struct stack_recorder_state *state = (struct stack_recorder_state *) state_ptr; - ddprof_ffi_Profile_free(state->profile); + pthread_mutex_destroy(&state->slot_one_mutex); + ddprof_ffi_Profile_free(state->slot_one_profile); + + pthread_mutex_destroy(&state->slot_two_mutex); + ddprof_ffi_Profile_free(state->slot_two_profile); ruby_xfree(state); } @@ -88,7 +101,7 @@ static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instan // We'll release the Global VM Lock while we're calling serialize, so that the Ruby VM can continue to work while this // is pending - struct call_serialize_without_gvl_arguments args = {.profile = state->profile, .serialize_ran = false}; + struct call_serialize_without_gvl_arguments args = {.profile = state->slot_one_profile, .serialize_ran = false}; while (!args.serialize_ran) { // Give the Ruby VM an opportunity to process any pending interruptions (including raising exceptions). @@ -123,7 +136,7 @@ static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instan VALUE start = ruby_time_from(ddprof_start); VALUE finish = ruby_time_from(ddprof_finish); - if (!ddprof_ffi_Profile_reset(state->profile, NULL /* start_time is optional */ )) { + if (!ddprof_ffi_Profile_reset(state->slot_one_profile, NULL /* start_time is optional */ )) { return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Failed to reset profile")); } @@ -144,7 +157,7 @@ void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample) { struct stack_recorder_state *state; TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); - ddprof_ffi_Profile_add(state->profile, sample); + ddprof_ffi_Profile_add(state->slot_one_profile, sample); } static void *call_serialize_without_gvl(void *call_args) { From dd6b62db676a1e88ad4938591fcb2d2004bb047b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 22 Jul 2022 11:07:41 +0100 Subject: [PATCH 0292/2133] Add concurrency-safe mechanism to StackRecorder The `StackRecorder` state is expected to be accessed in parallel by two different threads (the sampler thread and the serializer thread). To make such access correct even when it happens in parallel, this commit adds a mutex-based mechanism to protect the `StackRecorder` state. See the added documentation for implementation details. --- .../stack_recorder.c | 257 +++++++++++++++++- lib/datadog/profiling/stack_recorder.rb | 18 ++ spec/datadog/profiling/stack_recorder_spec.rb | 51 ++++ 3 files changed, 321 insertions(+), 5 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 4379e0489dd..ef2d0caa966 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "helpers.h" #include "stack_recorder.h" #include "libdatadog_helpers.h" @@ -9,6 +10,121 @@ // Used to wrap a ddprof_ffi_Profile in a Ruby object and expose Ruby-level serialization APIs // This file implements the native bits of the Datadog::Profiling::StackRecorder class +// --- +// ## Concurrency-safe design notes +// +// The state of the StackRecorder is managed using a set of locks to avoid concurrency issues. +// +// This is needed because the state is expected to be accessed, in parallel, by two different threads. +// +// 1. The thread that is taking a stack sample and that called `record_sample`, let's call it the **sampler thread**. +// In the current implementation of the profiler, there can only exist one **sampler thread** at a time; if this +// constraint changes, we should revise the design of the StackRecorder. +// +// 2. The thread that serializes and reports profiles, let's call it the **serializer thread**. We enforce that there +// cannot be more than one thread attempting to serialize profiles at a time. +// +// If both the sampler and serializer threads are trying to access the same `ddprof_ffi_Profile` in parallel, we will +// have a concurrency issue. Thus, the StackRecorder has an added mechanism to avoid this. +// +// As an additional constraint, the **sampler thread** has absolute priority and must never block while +// recording a sample. +// +// ### The solution: Keep two profiles at the same time +// +// To solve for the constraints above, the StackRecorder keeps two `ddprof_ffi_Profile` profile instances inside itself. +// They are called the `slot_one_profile` and `slot_two_profile`. +// +// Each profile is paired with its own mutex. `slot_one_profile` is protected by `slot_one_mutex` and `slot_two_profile` +// is protected by `slot_two_mutex`. +// +// We additionally introduce the concept of **active** and **inactive** profile slots. At any point, the sampler thread +// can probe the mutexes to discover which of the profiles corresponds to the active slot, and then records samples in it. +// When the serializer thread is ready to serialize data, it flips the active and inactive slots; it reports the data +// on the previously-active profile slot, and the sampler thread can continue to record in the previously-inactive +// profile slot. +// +// Thus, the sampler and serializer threads never cross paths, avoiding concurrency issues. The sampler thread writes to +// the active profile slot, and the serializer thread reads from the inactive profile slot. +// +// ### Locking protocol, high-level +// +// The active profile slot is the slot for which its corresponding mutex **is unlocked**. That is, if the sampler +// thread can grab a lock for a profile slot, then that slot is the active one. (Here you see where the constraint +// stated above that only one sampler thread can exist kicks in -- this part would need to be more complex if multiple +// sampler threads were in play.) +// +// On the flip side, this means that the inactive profile slot mutex is **kept locked** until such time the serializer +// thread is ready to work and decides to flip the slots. +// +// When a new StackRecorder is initialized, the `slot_one_mutex` is unlocked, and the `slot_two_mutex` is kept locked, +// that is, a new instance always starts with slot one active. +// +// Additionally, an `active_slot` field is kept, containing a `1` or `2`; this is only kept for the serializer thread +// to use as a simplification, as well as for testing and debugging; the **sampler thread must never use the `active_slot` +// field**. +// +// ### Locking protocol, from the sampler thread side +// +// When the sampler thread wants to record a sample, it goes through the following steps to discover which is the +// active profile slot: +// +// 1. `pthread_mutex_trylock(slot_one_mutex)`. If it succeeds to grab the lock, this means the active profile slot is +// slot one. If it fails, we move to the next step. +// +// 2. `pthread_mutex_trylock(slot_two_mutex)`. If it succeeds to grab the lock, this means the active profile slot is +// slot two. If it fails, we move to the next step. +// +// 3. What does it mean for the sampler thread to have observed both `slot_one_mutex` as well as `slot_two_mutex` as +// being locked? There are two options: +// a. The sampler thread got really unlucky. When it tried to grab the `slot_one_mutex`, the active profile slot was +// the second one BUT then the serializer thread flipped the slots, and by the time the sampler thread probed the +// `slot_two_mutex`, that one was taken. Since the serializer thread is expected only to work once a minute, +// we retry steps 1. and 2. and should be able to find an active slot. +// b. Something is incorrect in the StackRecorder state. In this situation, the sampler thread should give up on +// sampling and enter an error state. +// +// Note that in the steps above, and because the sampler thread uses `trylock` to probe the mutexes, that the +// sampler thread never blocks. It either is able to find an active profile slot in a bounded amount of steps or it +// enters an error state. +// +// This guarantees that sampler performance is never constrained by serializer performance. +// +// ### Locking protocol, from the serializer thread side +// +// When the serializer thread wants to serialize a profile, it first flips the active and inactive profile slots. +// +// The flipping action is described below. Consider previously-inactive and previously-active as the state of the slots +// before the flipping happens. +// +// The flipping steps are the following: +// +// 1. Release the mutex for the previously-inactive profile slot. That slot, as seen by the sampler thread, is now +// active. +// +// 2. Grab the mutex for the previously-active profile slot. Note that this can lead to the serializer thread blocking, +// if the sampler thread is holding this mutex. After the mutex is grabbed, the previously-active slot becomes inactive, +// as seen by the sampler thread. +// +// 3. Update `active_slot`. +// +// After flipping the profile slots, the serializer thread is now free to serialize the inactive profile slot. The slot +// is kept inactive until the next time the serializer thread wants to serialize data. +// +// Note there can be a brief period between steps 1 and 2 where the serializer thread holds no lock, which means that +// the sampler thread can pick either slot. This is OK: if the sampler thread picks the previously-inactive slot, the +// samples will be reported on the next serialization; if the sampler thread picks the previously-active slot, the +// samples are still included in the current serialization. Either option is correct. +// +// ### Additional notes +// +// Q: Can the sampler thread and the serializer thread ever be the same thread? (E.g. sampling in interrupt handler) +// A: No; the current profiler design requires that sampling happens only on the thread that is holding the Global VM +// Lock (GVL). The serializer thread flipping occurs after the serializer thread releases the GVL, and thus the +// serializer thread will not be able to host the sampling process. +// +// --- + static VALUE ok_symbol = Qnil; // :ok in Ruby static VALUE error_symbol = Qnil; // :error in Ruby @@ -23,11 +139,25 @@ struct stack_recorder_state { pthread_mutex_t slot_two_mutex; ddprof_ffi_Profile *slot_two_profile; + + short active_slot; // MUST NEVER BE ACCESSED FROM record_sample; this is NOT for the sampler thread to use. +}; + +// Used to return a pair of values from sampler_lock_active_profile() +struct active_slot_pair { + pthread_mutex_t *mutex; + ddprof_ffi_Profile *profile; }; struct call_serialize_without_gvl_arguments { + // Set by caller + struct stack_recorder_state *state; + + // Set by callee ddprof_ffi_Profile *profile; ddprof_ffi_SerializeResult result; + + // Set by both bool serialize_ran; }; @@ -36,6 +166,13 @@ static void stack_recorder_typed_data_free(void *data); static VALUE _native_serialize(VALUE self, VALUE recorder_instance); static VALUE ruby_time_from(ddprof_ffi_Timespec ddprof_time); static void *call_serialize_without_gvl(void *call_args); +static struct active_slot_pair sampler_lock_active_profile(); +static void sampler_unlock_active_profile(struct active_slot_pair active_slot); +static ddprof_ffi_Profile *serializer_flip_active_and_inactive_slots(struct stack_recorder_state *state); +static VALUE _native_active_slot(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance); +static VALUE _native_is_slot_one_mutex_locked(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance); +static VALUE _native_is_slot_two_mutex_locked(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance); +static VALUE test_slot_mutex_state(VALUE recorder_instance, int slot); void stack_recorder_init(VALUE profiling_module) { stack_recorder_class = rb_define_class_under(profiling_module, "StackRecorder", rb_cObject); @@ -51,6 +188,9 @@ void stack_recorder_init(VALUE profiling_module) { rb_define_alloc_func(stack_recorder_class, _native_new); rb_define_singleton_method(stack_recorder_class, "_native_serialize", _native_serialize, 1); + rb_define_singleton_method(stack_recorder_class, "_native_active_slot", _native_active_slot, 1); + rb_define_singleton_method(stack_recorder_class, "_native_slot_one_mutex_locked?", _native_is_slot_one_mutex_locked, 1); + rb_define_singleton_method(stack_recorder_class, "_native_slot_two_mutex_locked?", _native_is_slot_two_mutex_locked, 1); ok_symbol = ID2SYM(rb_intern_const("ok")); error_symbol = ID2SYM(rb_intern_const("error")); @@ -75,9 +215,17 @@ static VALUE _native_new(VALUE klass) { ddprof_ffi_Slice_value_type sample_types = {.ptr = enabled_value_types, .len = ENABLED_VALUE_TYPES_COUNT}; state->slot_one_mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; - state->slot_one_profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); - state->slot_two_mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; + + // A newly-created StackRecorder starts with slot one being active for samples, so let's lock slot two + int error = pthread_mutex_lock(&state->slot_two_mutex); + if (error) rb_syserr_fail(error, "Unexpected failure during pthread_mutex_lock"); + + state->active_slot = 1; + + // Note: Don't raise exceptions after this point, since it'll lead to libdatadog memory leaking! + + state->slot_one_profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); state->slot_two_profile = ddprof_ffi_Profile_new(sample_types, NULL /* period is optional */, NULL /* start_time is optional */); return TypedData_Wrap_Struct(klass, &stack_recorder_typed_data, state); @@ -101,7 +249,7 @@ static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instan // We'll release the Global VM Lock while we're calling serialize, so that the Ruby VM can continue to work while this // is pending - struct call_serialize_without_gvl_arguments args = {.profile = state->slot_one_profile, .serialize_ran = false}; + struct call_serialize_without_gvl_arguments args = {.state = state, .serialize_ran = false}; while (!args.serialize_ran) { // Give the Ruby VM an opportunity to process any pending interruptions (including raising exceptions). @@ -136,7 +284,7 @@ static VALUE _native_serialize(DDTRACE_UNUSED VALUE _self, VALUE recorder_instan VALUE start = ruby_time_from(ddprof_start); VALUE finish = ruby_time_from(ddprof_finish); - if (!ddprof_ffi_Profile_reset(state->slot_one_profile, NULL /* start_time is optional */ )) { + if (!ddprof_ffi_Profile_reset(args.profile, NULL /* start_time is optional */ )) { return rb_ary_new_from_args(2, error_symbol, rb_str_new_cstr("Failed to reset profile")); } @@ -157,12 +305,17 @@ void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample) { struct stack_recorder_state *state; TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); - ddprof_ffi_Profile_add(state->slot_one_profile, sample); + struct active_slot_pair active_slot = sampler_lock_active_profile(state); + + ddprof_ffi_Profile_add(active_slot.profile, sample); + + sampler_unlock_active_profile(active_slot); } static void *call_serialize_without_gvl(void *call_args) { struct call_serialize_without_gvl_arguments *args = (struct call_serialize_without_gvl_arguments *) call_args; + args->profile = serializer_flip_active_and_inactive_slots(args->state); args->result = ddprof_ffi_Profile_serialize(args->profile, NULL /* end_time is optional */, NULL /* duration_nanos is optional */); args->serialize_ran = true; @@ -172,3 +325,97 @@ static void *call_serialize_without_gvl(void *call_args) { void enforce_recorder_instance(VALUE object) { Check_TypedStruct(object, &stack_recorder_typed_data); } + +static struct active_slot_pair sampler_lock_active_profile(struct stack_recorder_state *state) { + int error; + + for (int attempts = 0; attempts < 2; attempts++) { + error = pthread_mutex_trylock(&state->slot_one_mutex); + if (error && error != EBUSY) rb_syserr_fail(error, "Unexpected failure during sampler_lock_active_profile for slot_one_mutex"); + + // Slot one is active + if (!error) return (struct active_slot_pair) {.mutex = &state->slot_one_mutex, .profile = state->slot_one_profile}; + + // If we got here, slot one was not active, let's try slot two + + error = pthread_mutex_trylock(&state->slot_two_mutex); + if (error && error != EBUSY) rb_syserr_fail(error, "Unexpected failure during sampler_lock_active_profile for slot_two_mutex"); + + // Slot two is active + if (!error) return (struct active_slot_pair) {.mutex = &state->slot_two_mutex, .profile = state->slot_two_profile}; + } + + // We already tried both multiple times, and we did not succeed. This is not expected to happen. Let's stop sampling. + rb_raise(rb_eRuntimeError, "Failed to grab either mutex in sampler_lock_active_profile"); +} + +static void sampler_unlock_active_profile(struct active_slot_pair active_slot) { + int error = pthread_mutex_unlock(active_slot.mutex); + if (error != 0) rb_syserr_fail(error, "Unexpected failure in sampler_unlock_active_profile"); +} + +static ddprof_ffi_Profile *serializer_flip_active_and_inactive_slots(struct stack_recorder_state *state) { + // TODO: ENSURE THAT ONLY ONE SERIALIZE IS RUNNING AT A TIME + + int error; + int previously_active_slot = state->active_slot; + + if (previously_active_slot != 1 && previously_active_slot != 2) { + rb_raise(rb_eRuntimeError, "Unexpected active_slot state %d in serializer_flip_active_and_inactive_slots", previously_active_slot); + } + + pthread_mutex_t *previously_active = (previously_active_slot == 1) ? &state->slot_one_mutex : &state->slot_two_mutex; + pthread_mutex_t *previously_inactive = (previously_active_slot == 1) ? &state->slot_two_mutex : &state->slot_one_mutex; + + // Release the lock, thus making this slot active + error = pthread_mutex_unlock(previously_inactive); + if (error) rb_syserr_fail(error, "Unexpected failure during serializer_flip_active_and_inactive_slots for previously_inactive"); + + // Grab the lock, thus making this slot inactive + error = pthread_mutex_lock(previously_active); + if (error) rb_syserr_fail(error, "Unexpected failure during serializer_flip_active_and_inactive_slots for previously_active"); + + // Update active_slot + state->active_slot = (previously_active_slot == 1) ? 2 : 1; + + // Return profile for previously active slot (now inactive) + return (previously_active_slot == 1) ? state->slot_one_profile : state->slot_two_profile; +} + +// This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. +// It SHOULD NOT be used for other purposes. +static VALUE _native_active_slot(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance) { + struct stack_recorder_state *state; + TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); + + return INT2NUM(state->active_slot); +} + +// This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. +// It SHOULD NOT be used for other purposes. +static VALUE _native_is_slot_one_mutex_locked(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance) { return test_slot_mutex_state(recorder_instance, 1); } + +// This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. +// It SHOULD NOT be used for other purposes. +static VALUE _native_is_slot_two_mutex_locked(DDTRACE_UNUSED VALUE _self, VALUE recorder_instance) { return test_slot_mutex_state(recorder_instance, 2); } + +static VALUE test_slot_mutex_state(VALUE recorder_instance, int slot) { + struct stack_recorder_state *state; + TypedData_Get_Struct(recorder_instance, struct stack_recorder_state, &stack_recorder_typed_data, state); + + pthread_mutex_t *slot_mutex = (slot == 1) ? &state->slot_one_mutex : &state->slot_two_mutex; + + // Like Heisenberg's uncertainty principle, we can't observe without affecting... + int error = pthread_mutex_trylock(slot_mutex); + + if (error == 0) { + // Mutex was unlocked + pthread_mutex_unlock(slot_mutex); + return Qfalse; + } else if (error == EBUSY) { + // Mutex was locked + return Qtrue; + } else { + rb_syserr_fail(error, "Unexpected failure when checking mutex state"); + } +} diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index 329809cb90c..fa43f9b63f3 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -27,6 +27,24 @@ def serialize def self.ruby_time_from(timespec_seconds, timespec_nanoseconds) Time.at(0).utc + timespec_seconds + (timespec_nanoseconds.to_r / 1_000_000_000) end + + # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def active_slot + self.class._native_active_slot(self) + end + + # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def slot_one_mutex_locked? + self.class._native_slot_one_mutex_locked?(self) + end + + # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. + # It SHOULD NOT be used for other purposes. + def slot_two_mutex_locked? + self.class._native_slot_two_mutex_locked?(self) + end end end end diff --git a/spec/datadog/profiling/stack_recorder_spec.rb b/spec/datadog/profiling/stack_recorder_spec.rb index b37a1ebbd73..fca5cb4d9a2 100644 --- a/spec/datadog/profiling/stack_recorder_spec.rb +++ b/spec/datadog/profiling/stack_recorder_spec.rb @@ -11,6 +11,22 @@ # NOTE: A lot of libdatadog integration behaviors are tested in the Collectors::Stack specs, since we need actual # samples in order to observe what comes out of libdatadog + describe '#initialize' do + describe 'locking behavior' do + it 'sets slot one as the active slot' do + expect(stack_recorder.active_slot).to be 1 + end + + it 'keeps the slot one mutex unlocked' do + expect(stack_recorder.slot_one_mutex_locked?).to be false + end + + it 'keeps the slot two mutex locked' do + expect(stack_recorder.slot_two_mutex_locked?).to be true + end + end + end + describe '#serialize' do subject(:serialize) { stack_recorder.serialize } @@ -33,6 +49,41 @@ expect(message).to include finish.iso8601 end + describe 'locking behavior' do + context 'when slot one was the active slot' do + it 'sets slot two as the active slot' do + expect { serialize }.to change { stack_recorder.active_slot }.from(1).to(2) + end + + it 'locks the slot one mutex and keeps it locked' do + expect { serialize }.to change { stack_recorder.slot_one_mutex_locked? }.from(false).to(true) + end + + it 'unlocks the slot two mutex and keeps it unlocked' do + expect { serialize }.to change { stack_recorder.slot_two_mutex_locked? }.from(true).to(false) + end + end + + context 'when slot two was the active slot' do + before do + # Trigger serialization once, so that active slots get flipped + stack_recorder.serialize + end + + it 'sets slot one as the active slot' do + expect { serialize }.to change { stack_recorder.active_slot }.from(2).to(1) + end + + it 'unlocks the slot one mutex and keeps it unlocked' do + expect { serialize }.to change { stack_recorder.slot_one_mutex_locked? }.from(true).to(false) + end + + it 'locks the slow two mutex and keeps it locked' do + expect { serialize }.to change { stack_recorder.slot_two_mutex_locked? }.from(false).to(true) + end + end + end + context 'when the profile is empty' do it 'uses the current time as the start and finish time' do before_serialize = Time.now From a83139ffaef8015ca75c954d818ef7247c9743bd Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 25 Jul 2022 13:59:27 +0100 Subject: [PATCH 0293/2133] Protect against concurrent attempts at serialization The `StackRecorder` C implementation assumes that there is only a single serializer thread operating at any time. To protect against bugs and accidents, let's add a regular Ruby mutex around the call to `._native_serialize` to enforce this. --- ext/ddtrace_profiling_native_extension/stack_recorder.c | 2 -- lib/datadog/profiling/stack_recorder.rb | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index ef2d0caa966..584474a97fc 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -355,8 +355,6 @@ static void sampler_unlock_active_profile(struct active_slot_pair active_slot) { } static ddprof_ffi_Profile *serializer_flip_active_and_inactive_slots(struct stack_recorder_state *state) { - // TODO: ENSURE THAT ONLY ONE SERIALIZE IS RUNNING AT A TIME - int error; int previously_active_slot = state->active_slot; diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index fa43f9b63f3..f7d2d7f7d9f 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -5,8 +5,12 @@ module Profiling # Used to wrap a ddprof_ffi_Profile in a Ruby object and expose Ruby-level serialization APIs # Methods prefixed with _native_ are implemented in `stack_recorder.c` class StackRecorder + def initialize + @no_concurrent_synchronize_mutex = Thread::Mutex.new + end + def serialize - status, result = self.class._native_serialize(self) + status, result = @no_concurrent_synchronize_mutex.synchronize { self.class._native_serialize(self) } if status == :ok start, finish, encoded_pprof = result From f0cc36c21b338cb09fffa75750f0e9e74a31b56f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 25 Jul 2022 14:17:19 +0100 Subject: [PATCH 0294/2133] Minor: Tweak comment wording --- ext/ddtrace_profiling_native_extension/stack_recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 584474a97fc..c0b6a5938da 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -54,7 +54,7 @@ // stated above that only one sampler thread can exist kicks in -- this part would need to be more complex if multiple // sampler threads were in play.) // -// On the flip side, this means that the inactive profile slot mutex is **kept locked** until such time the serializer +// As a counterpart, the inactive profile slot mutex is **kept locked** until such time the serializer // thread is ready to work and decides to flip the slots. // // When a new StackRecorder is initialized, the `slot_one_mutex` is unlocked, and the `slot_two_mutex` is kept locked, From 58000e2bd742c1639b01e68a7f62c4528b7e6499 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 25 Jul 2022 14:52:29 +0100 Subject: [PATCH 0295/2133] Update profiling development documentation A quick update to the `ProfilingDevelopment.md` file with the current state of affairs around the new profiler components. --- docs/ProfilingDevelopment.md | 57 +++++++++++++++++------ lib/datadog/profiling/collectors/stack.rb | 3 +- lib/datadog/profiling/stack_recorder.rb | 3 +- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index 59c764b3f9a..f8005a0b156 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -8,26 +8,31 @@ For a more practical view of getting started with development of `ddtrace`, see Components below live inside <../lib/datadog/profiling>: -* `Collectors::OldStack`: Collects stack trace samples from Ruby threads for both CPU-time (if available) and wall-clock. +* (Deprecated) `Collectors::OldStack`: Collects stack trace samples from Ruby threads for both CPU-time (if available) and wall-clock. Runs on its own background thread. * `Collectors::CodeProvenance`: Collects library metadata to power grouping and categorization of stack traces (e.g. to help distinguish user code, from libraries, from the standard library, etc). -* `Encoding::Profile::Protobuf`: Encodes gathered data into the pprof format. -* `Events::Stack`, `Events::StackSample`: Entity classes used to represent stacks. +* (Deprecated) `Encoding::Profile::Protobuf`: Encodes gathered data into the pprof format. +* (Deprecated) `Events::Stack`, `Events::StackSample`: Entity classes used to represent stacks. * `Ext::Forking`: Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore profiling abilities after the VM forks (such as re-instrumenting the main thread, and restarting profiler threads). -* `Pprof::*` (in <../lib/datadog/profiling/pprof>): Used by `Encoding::Profile::Protobuf` to convert samples captured in +* (Deprecated) `Pprof::*` (in <../lib/datadog/profiling/pprof>): Used by `Encoding::Profile::Protobuf` to convert samples captured in the `OldRecorder` into the pprof format. -* `Tasks::Setup`: Takes care of loading our extensions/monkey patches to handle `fork()`. +* `Tasks::Setup`: Takes care of loading and applying `Ext::Forking``. * `HttpTransport`: Implements transmission of profiling payloads to the Datadog agent or backend. -* `TraceIdentifiers::*`: Used to retrieve trace id and span id from tracers, to be used to connect traces to profiles. -* `BacktraceLocation`: Entity class used to represent an entry in a stack trace. -* `Buffer`: Bounded buffer used to store profiling events. +* (Deprecated) `TraceIdentifiers::*`: Used to retrieve trace id and span id from tracers, to be used to connect traces to profiles. +* (Deprecated) `BacktraceLocation`: Entity class used to represent an entry in a stack trace. +* (Deprecated) `Buffer`: Bounded buffer used to store profiling events. * `Flush`: Entity class used to represent the payload to be reported for a given profile. * `Profiler`: Profiling entry point, which coordinates collectors and a scheduler. -* `OldRecorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) +* (Deprecated) `OldRecorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) * `Exporter`: Gathers data from `OldRecorder` and `Collectors::CodeProvenance` to be reported as a profile. * `Scheduler`: Periodically (every 1 minute) takes data from the `Exporter` and pushes them to the configured transport. Runs on its own background thread. +* `Collectors::CpuAndWallTime`: TODO +* `Collectors::Stack`: Used to gather a stack trace from a given Ruby thread. Used to gather a stack trace from a given Ruby thread. + Stores its output on a `StackRecorder`. +* `StackRecorder`: Stores stack samples in a native libdatadog data structure and exposes Ruby-level serialization APIs. +* `TagBuilder`: Builds a hash of default plus user tags to be included in a profile ## Initialization @@ -67,6 +72,36 @@ flow: ``` 6. The profiler gets started when `startup!` is called by `Datadog::Configuration` after component creation. +### Work in progress + +The profiler is undergoing a lot of refactoring. After this work is done, this is how we expect it will be wired up: + +```asciiflow + +------------------------+ + | Profiler | + +-+--------------------+-+ + | | + v v ++---------+--------------+ +-+---------+ +| Collectors::CpuAndWall | | Scheduler | ++---------+--------------+ +-+-------+-+ + | | | + v | v ++---------+---------+ | +----+----------+ +| Collectors::Stack | | | HttpTransport | ++---------+---------+ | +---------------+ + | | + v v + +-------+-------+ +--+-------+ + | StackRecorder |<--------| Exporter | + +---------------+ +--+-------+ + | + v + +--------------+--+ + | Code Provenance | + +-----------------+ +``` + ## Run-time execution During run-time, the `Scheduler` and the `Collectors::OldStack` each execute on their own background thread. @@ -78,10 +113,6 @@ The `Scheduler` wakes up every 1 minute to flush the results of the `Exporter` i By default, the `Scheduler` gets created with the default `HttpTransport`, which takes care of encoding the data and reporting it to the Datadog agent. -## How CPU-time profiling works - -**TODO**: Document our pthread-based approach to getting CPU-time for threads. - ## How linking of traces to profiles works The [code hotspots feature](https://docs.datadoghq.com/tracing/profiler/connect_traces_and_profiles) allows users to start diff --git a/lib/datadog/profiling/collectors/stack.rb b/lib/datadog/profiling/collectors/stack.rb index 51e59293faf..a1a1ed00feb 100644 --- a/lib/datadog/profiling/collectors/stack.rb +++ b/lib/datadog/profiling/collectors/stack.rb @@ -3,7 +3,8 @@ module Datadog module Profiling module Collectors - # Used to gather a stack trace from a given Ruby thread. Almost all of this class is implemented as native code. + # Used to gather a stack trace from a given Ruby thread. Stores its output on a `StackRecorder`. + # Almost all of this class is implemented as native code. # # Methods prefixed with _native_ are implemented in `collectors_stack.c` class Stack diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index 329809cb90c..d7e371f59fb 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -2,7 +2,8 @@ module Datadog module Profiling - # Used to wrap a ddprof_ffi_Profile in a Ruby object and expose Ruby-level serialization APIs + # Stores stack samples in a native libdatadog data structure and expose Ruby-level serialization APIs + # Note that `record_sample` is only accessible from native code. # Methods prefixed with _native_ are implemented in `stack_recorder.c` class StackRecorder def serialize From 9ae563a79ff9b9a0359a412d34d3dbc6400244c5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 15:53:36 +0200 Subject: [PATCH 0296/2133] Using `datadog/dd-apm-demo:wrk` for load-tester --- integration/apps/rack/docker-compose.yml | 4 +--- integration/apps/rails-five/docker-compose.yml | 4 +--- integration/apps/rails-seven/docker-compose.yml | 4 +--- integration/apps/rails-six/docker-compose.yml | 4 +--- integration/apps/sinatra2-classic/docker-compose.yml | 4 +--- integration/apps/sinatra2-modular/docker-compose.yml | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/integration/apps/rack/docker-compose.yml b/integration/apps/rack/docker-compose.yml index e52a9d18175..5ad2f9d2eec 100644 --- a/integration/apps/rack/docker-compose.yml +++ b/integration/apps/rack/docker-compose.yml @@ -66,9 +66,7 @@ services: # source: /sys/fs/cgroup/ # target: /host/sys/fs/cgroup:ro load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default depends_on: - app diff --git a/integration/apps/rails-five/docker-compose.yml b/integration/apps/rails-five/docker-compose.yml index a41634f32d9..3f0c3108f3e 100644 --- a/integration/apps/rails-five/docker-compose.yml +++ b/integration/apps/rails-five/docker-compose.yml @@ -91,9 +91,7 @@ services: expose: - "6379" load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default depends_on: - app diff --git a/integration/apps/rails-seven/docker-compose.yml b/integration/apps/rails-seven/docker-compose.yml index ffb0e34adca..862744b35c0 100644 --- a/integration/apps/rails-seven/docker-compose.yml +++ b/integration/apps/rails-seven/docker-compose.yml @@ -101,9 +101,7 @@ services: expose: - "6379" load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://nginx/basic/default depends_on: - app diff --git a/integration/apps/rails-six/docker-compose.yml b/integration/apps/rails-six/docker-compose.yml index 5fa8507aeb5..c5d5cf18b19 100644 --- a/integration/apps/rails-six/docker-compose.yml +++ b/integration/apps/rails-six/docker-compose.yml @@ -91,9 +91,7 @@ services: expose: - "6379" load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default depends_on: - app diff --git a/integration/apps/sinatra2-classic/docker-compose.yml b/integration/apps/sinatra2-classic/docker-compose.yml index c2848bb6f1d..4cec8a71488 100644 --- a/integration/apps/sinatra2-classic/docker-compose.yml +++ b/integration/apps/sinatra2-classic/docker-compose.yml @@ -64,9 +64,7 @@ services: # source: /sys/fs/cgroup/ # target: /host/sys/fs/cgroup:ro load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/default depends_on: - app diff --git a/integration/apps/sinatra2-modular/docker-compose.yml b/integration/apps/sinatra2-modular/docker-compose.yml index 886c149052b..6385da8d934 100644 --- a/integration/apps/sinatra2-modular/docker-compose.yml +++ b/integration/apps/sinatra2-modular/docker-compose.yml @@ -64,9 +64,7 @@ services: # source: /sys/fs/cgroup/ # target: /host/sys/fs/cgroup:ro load-tester: - build: - context: ../../images - dockerfile: wrk/Dockerfile + image: datadog/dd-apm-demo:wrk command: -t10 -c10 -d43200s -s /scripts/scenarios/basic/default.lua http://app/basic/fibonacci depends_on: - app From 710bc3f38ae491dce16c39f237578a8228f3867b Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 15:55:51 +0200 Subject: [PATCH 0297/2133] Use `redis:3.2` image --- integration/apps/rails-five/docker-compose.yml | 2 +- integration/apps/rails-seven/docker-compose.yml | 2 +- integration/apps/rails-six/docker-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/apps/rails-five/docker-compose.yml b/integration/apps/rails-five/docker-compose.yml index 3f0c3108f3e..2e540eec06f 100644 --- a/integration/apps/rails-five/docker-compose.yml +++ b/integration/apps/rails-five/docker-compose.yml @@ -87,7 +87,7 @@ services: expose: - "3306" redis: - image: redis:3.0 + image: redis:3.2 expose: - "6379" load-tester: diff --git a/integration/apps/rails-seven/docker-compose.yml b/integration/apps/rails-seven/docker-compose.yml index 862744b35c0..1675bbcfce9 100644 --- a/integration/apps/rails-seven/docker-compose.yml +++ b/integration/apps/rails-seven/docker-compose.yml @@ -97,7 +97,7 @@ services: expose: - "3306" redis: - image: redis:3.0 + image: redis:3.2 expose: - "6379" load-tester: diff --git a/integration/apps/rails-six/docker-compose.yml b/integration/apps/rails-six/docker-compose.yml index c5d5cf18b19..c28983b491e 100644 --- a/integration/apps/rails-six/docker-compose.yml +++ b/integration/apps/rails-six/docker-compose.yml @@ -87,7 +87,7 @@ services: expose: - "3306" redis: - image: redis:3.0 + image: redis:3.2 expose: - "6379" load-tester: From 7203995419667a049261b25b01ebdf362048228b Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 22 Jul 2022 15:28:51 +0200 Subject: [PATCH 0298/2133] Overwrite rack resource --- .../tracing/contrib/rack/middlewares.rb | 2 + .../contrib/rack/integration_test_spec.rb | 94 ++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 930f8f1eadf..81d24b18683 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -150,6 +150,8 @@ def set_request_tags!(trace, request_span, env, status, headers, response, origi # Set trace name if it hasn't been set yet (name == resource) trace.resource = request_span.resource if trace.resource == trace.name + request_span.resource = trace.resource unless trace.resource.nil? + request_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) request_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST) diff --git a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb index f1a356f771d..8ce4f46e97a 100644 --- a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb +++ b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb @@ -3,7 +3,6 @@ require 'datadog/tracing/contrib/support/spec_helper' require 'rack/test' require 'securerandom' - require 'rack' require 'ddtrace' require 'datadog/tracing/contrib/rack/middlewares' @@ -196,6 +195,48 @@ end end + context 'when `request_queuing` enabled' do + let(:rack_options) { { request_queuing: true } } + let(:routes) do + proc do + map '/request_queuing_enabled' do + run(proc { |_env| [200, { 'Content-Type' => 'text/html' }, ['OK']] }) + end + end + end + + describe 'GET request with `HTTP_X_REQUEST_START` header' do + it 'creates web_server_span and rack span' do + get 'request_queuing_enabled', + nil, + { Datadog::Tracing::Contrib::Rack::QueueTime::REQUEST_START => "t=#{Time.now.to_f}" } + + expect(spans).to have(2).items + + web_server_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_HTTP_SERVER_QUEUE } + rack_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } + + expect(web_server_span).to be_root_span + expect(web_server_span.span_type).to eq('proxy') + expect(web_server_span.service).to eq('web-server') + expect(web_server_span.resource).to eq('http_server.queue') + expect(web_server_span.get_tag('component')).to eq('rack') + expect(web_server_span.get_tag('operation')).to eq('queue') + expect(web_server_span.get_tag('peer.service')).to eq('web-server') + expect(web_server_span.status).to eq(0) + + expect(rack_span.span_type).to eq('web') + expect(rack_span.service).to eq(tracer.default_service) + expect(rack_span.resource).to eq('GET 200') + expect(rack_span.get_tag('http.method')).to eq('GET') + expect(rack_span.get_tag('http.status_code')).to eq('200') + expect(rack_span.status).to eq(0) + expect(rack_span.get_tag('component')).to eq('rack') + expect(rack_span.get_tag('operation')).to eq('request') + end + end + end + context 'with a route that has a client error' do let(:routes) do proc do @@ -402,6 +443,57 @@ end end + context 'when `request_queuing` enabled and trace resource overwritten by nested app' do + let(:rack_options) { { request_queuing: true } } + let(:routes) do + proc do + map '/resource_override' do + run( + proc do |_env| + Datadog::Tracing.trace('nested_app', resource: 'UserController#show') do |span_op, trace_op| + trace_op.resource = span_op.resource + + [200, { 'Content-Type' => 'text/html' }, ['OK']] + end + end + ) + end + end + end + + it 'creates a web_server_span and rack span with resource overriden' do + get '/resource_override', + nil, + { Datadog::Tracing::Contrib::Rack::QueueTime::REQUEST_START => "t=#{Time.now.to_f}" } + + expect(spans).to have(3).items + + web_server_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_HTTP_SERVER_QUEUE } + rack_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } + nested_app_span = spans.find { |s| s.name == 'nested_app' } + + expect(web_server_span).to be_root_span + expect(web_server_span.span_type).to eq('proxy') + expect(web_server_span.service).to eq('web-server') + expect(web_server_span.resource).to eq('http_server.queue') + expect(web_server_span.get_tag('component')).to eq('rack') + expect(web_server_span.get_tag('operation')).to eq('queue') + expect(web_server_span.get_tag('peer.service')).to eq('web-server') + expect(web_server_span.status).to eq(0) + + expect(rack_span.span_type).to eq('web') + expect(rack_span.service).to eq(tracer.default_service) + expect(rack_span.resource).to eq('UserController#show') + expect(rack_span.get_tag('http.method')).to eq('GET') + expect(rack_span.get_tag('http.status_code')).to eq('200') + expect(rack_span.status).to eq(0) + expect(rack_span.get_tag('component')).to eq('rack') + expect(rack_span.get_tag('operation')).to eq('request') + + expect(nested_app_span.resource).to eq('UserController#show') + end + end + context 'that raises a server error' do before do is_expected.to be_server_error From e6a65992b74711da4ad37ec57575661e34b37d02 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 12:39:10 +0200 Subject: [PATCH 0299/2133] Refactor --- .../tracing/contrib/rack/middlewares.rb | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 81d24b18683..e7edeb56e78 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -41,6 +41,9 @@ def compute_queue_time(env) service: configuration[:web_service_name] ) + # Will be set later, avoid setting the trace.resource to propagate to rack span resource + frontend_span.resource = nil + # Tag this span as belonging to Rack frontend_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) frontend_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_HTTP_SERVER_QUEUE) @@ -113,17 +116,12 @@ def call(env) request_span.finish end - frontend_span.finish unless frontend_span.nil? - end - # rubocop:enable Lint/RescueException - - def resource_name_for(env, status) - if configuration[:middleware_names] && env['RESPONSE_MIDDLEWARE'] - "#{env['RESPONSE_MIDDLEWARE']}##{env['REQUEST_METHOD']}" - else - "#{env['REQUEST_METHOD']} #{status}".strip + if frontend_span + frontend_span.resource = Ext::SPAN_HTTP_SERVER_QUEUE + frontend_span.finish end end + # rubocop:enable Lint/RescueException # rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/CyclomaticComplexity @@ -145,12 +143,12 @@ def set_request_tags!(trace, request_span, env, status, headers, response, origi request_headers = parse_request_headers(env) response_headers = parse_response_headers(headers || {}) - request_span.resource ||= resource_name_for(env, status) - - # Set trace name if it hasn't been set yet (name == resource) - trace.resource = request_span.resource if trace.resource == trace.name - - request_span.resource = trace.resource unless trace.resource.nil? + request_span.resource ||= + if configuration[:middleware_names] && env['RESPONSE_MIDDLEWARE'] + "#{env['RESPONSE_MIDDLEWARE']}##{env['REQUEST_METHOD']}" + else + trace.resource || "#{env['REQUEST_METHOD']} #{status}".strip + end request_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) request_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST) From 278d06fceae0cb517984d39d4b3de68869503424 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 15:41:56 +0200 Subject: [PATCH 0300/2133] Fix action_cable instrumentation spec about resource --- .../tracing/contrib/action_cable/instrumentation_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/datadog/tracing/contrib/action_cable/instrumentation_spec.rb b/spec/datadog/tracing/contrib/action_cable/instrumentation_spec.rb index 5023f06b542..9b37cd0b808 100644 --- a/spec/datadog/tracing/contrib/action_cable/instrumentation_spec.rb +++ b/spec/datadog/tracing/contrib/action_cable/instrumentation_spec.rb @@ -66,7 +66,7 @@ expect(trace.resource).to eq('ActionCable::Connection::Base#on_open') expect(rack.name).to eq('rack.request') - expect(rack.resource).to eq('GET -1') + expect(rack.resource).to eq('ActionCable::Connection::Base#on_open') end end end From 08c58afe7321c9fa70c2f7fc55c83bc61ff2c7df Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 18:01:19 +0200 Subject: [PATCH 0301/2133] Fix contrib rails spec --- .../datadog/tracing/contrib/rails/middleware_spec.rb | 8 ++++---- spec/datadog/tracing/contrib/rails/rack_spec.rb | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/datadog/tracing/contrib/rails/middleware_spec.rb b/spec/datadog/tracing/contrib/rails/middleware_spec.rb index 7b77e40b8b7..b170ba03849 100644 --- a/spec/datadog/tracing/contrib/rails/middleware_spec.rb +++ b/spec/datadog/tracing/contrib/rails/middleware_spec.rb @@ -153,7 +153,7 @@ def call(env) expect(span.name).to eq('rack.request') expect(span.span_type).to eq('web') - expect(span.resource).to eq('GET 500') + expect(span.resource).to eq('TestController#index') expect(span.get_tag('http.url')).to eq('/') expect(span.get_tag('http.method')).to eq('GET') expect(span.get_tag('http.status_code')).to eq('500') @@ -199,7 +199,7 @@ def call(env) expect(span.name).to eq('rack.request') expect(span.span_type).to eq('web') - expect(span.resource).to eq('GET 404') + expect(span.resource).to eq('TestController#index') expect(span.get_tag('http.url')).to eq('/') expect(span.get_tag('http.method')).to eq('GET') expect(span.get_tag('http.status_code')).to eq('404') @@ -260,7 +260,7 @@ def call(env) expect(span.name).to eq('rack.request') expect(span.span_type).to eq('web') - expect(span.resource).to eq('GET 500') + expect(span.resource).to eq('TestController#index') expect(span.get_tag('http.url')).to eq('/') expect(span.get_tag('http.method')).to eq('GET') @@ -307,7 +307,7 @@ def call(env) expect(span.name).to eq('rack.request') expect(span.span_type).to eq('web') - expect(span.resource).to eq('GET 404') + expect(span.resource).to eq('TestController#index') expect(span.get_tag('http.url')).to eq('/') expect(span.get_tag('http.method')).to eq('GET') expect(span.get_tag('http.status_code')).to eq('404') diff --git a/spec/datadog/tracing/contrib/rails/rack_spec.rb b/spec/datadog/tracing/contrib/rails/rack_spec.rb index 0d849204002..e952ab5ab22 100644 --- a/spec/datadog/tracing/contrib/rails/rack_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rack_spec.rb @@ -144,7 +144,7 @@ def internal_server_error expect(request_span.name).to eq('rack.request') expect(request_span.span_type).to eq('web') expect(request_span.service).to eq(tracer.default_service) - expect(request_span.resource).to eq('GET 200') + expect(request_span.resource).to eq('TestController#full') expect(request_span.get_tag('http.url')).to eq('/full') expect(request_span.get_tag('http.method')).to eq('GET') expect(request_span.get_tag('http.status_code')).to eq('200') @@ -379,7 +379,7 @@ def internal_server_error expect(request_span.name).to eq('rack.request') expect(request_span.span_type).to eq('web') - expect(request_span.resource).to eq('GET 500') + expect(request_span.resource).to eq('TestController#error') expect(request_span.get_tag('http.url')).to eq('/error') expect(request_span.get_tag('http.method')).to eq('GET') expect(request_span.get_tag('http.status_code')).to eq('500') @@ -414,7 +414,7 @@ def internal_server_error expect(request_span.name).to eq('rack.request') expect(request_span.span_type).to eq('web') - expect(request_span.resource).to eq('GET 520') + expect(request_span.resource).to eq('TestController#soft_error') expect(request_span.get_tag('http.url')).to eq('/soft_error') expect(request_span.get_tag('http.method')).to eq('GET') expect(request_span.get_tag('http.status_code')).to eq('520') @@ -449,7 +449,7 @@ def internal_server_error expect(request_span.name).to eq('rack.request') expect(request_span.span_type).to eq('web') - expect(request_span.resource).to eq('GET 500') + expect(request_span.resource).to eq('TestController#sub_error') expect(request_span.get_tag('http.url')).to eq('/sub_error') expect(request_span.get_tag('http.method')).to eq('GET') expect(request_span.get_tag('http.status_code')).to eq('500') @@ -520,7 +520,7 @@ def internal_server_error expect(trace.resource).to eq('ErrorsController#internal_server_error') expect(request_span).to have_error - expect(request_span.resource).to_not eq(controller_span.resource) + expect(request_span.resource).to eq('ErrorsController#internal_server_error') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) .to eq('rack') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) @@ -573,7 +573,7 @@ def internal_server_error expect(request_span.name).to eq('rack.request') expect(request_span.span_type).to eq('web') - expect(request_span.resource).to eq('GET 404') + expect(request_span.resource).to eq('TestController#explicitly_not_found') expect(request_span.get_tag('http.url')).to eq('/explicitly_not_found') expect(request_span.get_tag('http.method')).to eq('GET') expect(request_span.get_tag('http.status_code')).to eq('404') From 75dbf2885460ed71fb09ed46f5ced6a4104816a6 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 18:07:20 +0200 Subject: [PATCH 0302/2133] Use deterministic assertion --- spec/datadog/tracing/contrib/rails/rack_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/tracing/contrib/rails/rack_spec.rb b/spec/datadog/tracing/contrib/rails/rack_spec.rb index e952ab5ab22..3cf75a71ac3 100644 --- a/spec/datadog/tracing/contrib/rails/rack_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rack_spec.rb @@ -607,7 +607,7 @@ def internal_server_error expect(request_span).to have_error_type('ActionView::Template::Error') expect(request_span).to have_error_stack expect(request_span).to have_error_message - expect(request_span.resource).to_not eq(render_span.resource) + expect(request_span.resource).to eq('TestController#error_template') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) .to eq('rack') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) @@ -651,7 +651,7 @@ def internal_server_error expect(request_span).to have_error_type('ActionView::Template::Error') expect(request_span).to have_error_stack expect(request_span).to have_error_message - expect(request_span.resource).to_not eq(render_span.resource) + expect(request_span.resource).to eq('TestController#error_partial') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)) .to eq('rack') expect(request_span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) From f1cfaabc6d1b0be57d3b61c6bf798332e5485909 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 18:13:13 +0200 Subject: [PATCH 0303/2133] Fix contrib grape spec --- spec/datadog/tracing/contrib/grape/tracer_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/tracing/contrib/grape/tracer_spec.rb b/spec/datadog/tracing/contrib/grape/tracer_spec.rb index 00420719785..21ee5219301 100644 --- a/spec/datadog/tracing/contrib/grape/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/grape/tracer_spec.rb @@ -670,7 +670,7 @@ expect(rack_span.name).to eq('rack.request') expect(rack_span.span_type).to eq('web') expect(rack_span.service).to eq(tracer.default_service) - expect(rack_span.resource).to eq('GET 200') + expect(rack_span.resource).to eq('RackTestingAPI GET /success') expect(rack_span).to_not have_error expect(rack_span).to be_root_span end @@ -735,7 +735,7 @@ expect(rack_span.name).to eq('rack.request') expect(rack_span.span_type).to eq('web') expect(rack_span.service).to eq(tracer.default_service) - expect(rack_span.resource).to eq('GET') + expect(rack_span.resource).to eq('RackTestingAPI GET /hard_failure') expect(rack_span).to have_error expect(rack_span).to be_root_span end From d83e55b303662ea567c3f2f1b01c071b1344f919 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 25 Jul 2022 18:25:40 +0200 Subject: [PATCH 0304/2133] Fix contrib rails spec for older rubies --- spec/datadog/tracing/contrib/rails/rack_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/tracing/contrib/rails/rack_spec.rb b/spec/datadog/tracing/contrib/rails/rack_spec.rb index 3cf75a71ac3..48deb715cbd 100644 --- a/spec/datadog/tracing/contrib/rails/rack_spec.rb +++ b/spec/datadog/tracing/contrib/rails/rack_spec.rb @@ -263,7 +263,7 @@ def internal_server_error expect(trace.resource).to eq('TestController#nonexistent_template') expect(request_span.name).to eq('rack.request') - expect(request_span.resource).to eq('GET 500') + expect(request_span.resource).to eq('TestController#nonexistent_template') expect(request_span).to have_error expect(request_span).to have_error_type('ActionView::MissingTemplate') expect(request_span).to have_error_message(include('Missing template test/does_not_exist')) @@ -316,7 +316,7 @@ def internal_server_error expect(trace.resource).to eq('TestController#nonexistent_partial') expect(request_span.name).to eq('rack.request') - expect(request_span.resource).to eq('GET 500') + expect(request_span.resource).to eq('TestController#nonexistent_partial') expect(request_span).to have_error expect(request_span).to have_error_type('ActionView::Template::Error') expect(request_span).to have_error_message(include('Missing partial test/no_partial_here')) From 6fc3b51d9ce39cc335b97967b476c1031bd99e24 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 25 Jul 2022 17:17:00 -0700 Subject: [PATCH 0305/2133] Remove unused profiling flush dependencies --- lib/datadog/profiling/flush.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/datadog/profiling/flush.rb b/lib/datadog/profiling/flush.rb index adce71e1145..1680fbe4810 100644 --- a/lib/datadog/profiling/flush.rb +++ b/lib/datadog/profiling/flush.rb @@ -1,8 +1,5 @@ # typed: false -require_relative '../core/environment/identity' -require_relative '../core/environment/socket' - module Datadog module Profiling # Represents a collection of events of a specific type being flushed. From f9d16bdf77f0001c2741e520906eb32a13b270ec Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 25 Jul 2022 17:18:57 -0700 Subject: [PATCH 0306/2133] Remove redundant tracing require in contrib --- lib/datadog/tracing/contrib/action_cable/event.rb | 1 - lib/datadog/tracing/contrib/action_cable/instrumentation.rb | 1 - lib/datadog/tracing/contrib/active_job/log_injection.rb | 2 -- lib/datadog/tracing/contrib/active_model_serializers/event.rb | 1 - lib/datadog/tracing/contrib/active_model_serializers/patcher.rb | 1 - lib/datadog/tracing/contrib/aws/instrumentation.rb | 1 - lib/datadog/tracing/contrib/dalli/instrumentation.rb | 1 - lib/datadog/tracing/contrib/delayed_job/plugin.rb | 1 - lib/datadog/tracing/contrib/elasticsearch/patcher.rb | 1 - lib/datadog/tracing/contrib/ethon/easy_patch.rb | 1 - lib/datadog/tracing/contrib/ethon/multi_patch.rb | 1 - lib/datadog/tracing/contrib/excon/middleware.rb | 1 - lib/datadog/tracing/contrib/faraday/middleware.rb | 1 - lib/datadog/tracing/contrib/grape/endpoint.rb | 1 - lib/datadog/tracing/contrib/graphql/patcher.rb | 1 - lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb | 1 - lib/datadog/tracing/contrib/http/circuit_breaker.rb | 1 - lib/datadog/tracing/contrib/http/instrumentation.rb | 1 - lib/datadog/tracing/contrib/httpclient/instrumentation.rb | 1 - lib/datadog/tracing/contrib/httprb/instrumentation.rb | 1 - lib/datadog/tracing/contrib/lograge/instrumentation.rb | 1 - lib/datadog/tracing/contrib/mysql2/instrumentation.rb | 1 - lib/datadog/tracing/contrib/pg/instrumentation.rb | 1 - lib/datadog/tracing/contrib/presto/instrumentation.rb | 1 - lib/datadog/tracing/contrib/qless/patcher.rb | 1 - lib/datadog/tracing/contrib/qless/qless_job.rb | 1 - lib/datadog/tracing/contrib/qless/tracer_cleaner.rb | 2 -- lib/datadog/tracing/contrib/racecar/event.rb | 1 - lib/datadog/tracing/contrib/rack/middlewares.rb | 1 - lib/datadog/tracing/contrib/rails/framework.rb | 1 - lib/datadog/tracing/contrib/rails/log_injection.rb | 2 -- lib/datadog/tracing/contrib/rails/middlewares.rb | 1 - lib/datadog/tracing/contrib/rails/patcher.rb | 1 - lib/datadog/tracing/contrib/rake/instrumentation.rb | 1 - lib/datadog/tracing/contrib/rake/patcher.rb | 1 - lib/datadog/tracing/contrib/redis/instrumentation.rb | 1 - lib/datadog/tracing/contrib/redis/tags.rb | 1 - lib/datadog/tracing/contrib/resque/resque_job.rb | 1 - lib/datadog/tracing/contrib/rest_client/request_patch.rb | 1 - lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb | 1 - lib/datadog/tracing/contrib/sequel/database.rb | 1 - lib/datadog/tracing/contrib/sequel/dataset.rb | 1 - lib/datadog/tracing/contrib/sidekiq/client_tracer.rb | 1 - lib/datadog/tracing/contrib/sidekiq/server_tracer.rb | 1 - lib/datadog/tracing/contrib/sinatra/framework.rb | 2 -- lib/datadog/tracing/contrib/sinatra/tracer.rb | 1 - lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb | 1 - lib/datadog/tracing/contrib/sneakers/tracer.rb | 1 - lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb | 1 - lib/datadog/tracing/contrib/sucker_punch/patcher.rb | 1 - 50 files changed, 54 deletions(-) diff --git a/lib/datadog/tracing/contrib/action_cable/event.rb b/lib/datadog/tracing/contrib/action_cable/event.rb index 875c7821d7a..429593bd337 100644 --- a/lib/datadog/tracing/contrib/action_cable/event.rb +++ b/lib/datadog/tracing/contrib/action_cable/event.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../context' require_relative '../analytics' require_relative '../active_support/notifications/event' diff --git a/lib/datadog/tracing/contrib/action_cable/instrumentation.rb b/lib/datadog/tracing/contrib/action_cable/instrumentation.rb index e39dfec9cfd..3653786efbf 100644 --- a/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +++ b/lib/datadog/tracing/contrib/action_cable/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative 'ext' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/active_job/log_injection.rb b/lib/datadog/tracing/contrib/active_job/log_injection.rb index 0a3bec21a4a..e7bfc35356b 100644 --- a/lib/datadog/tracing/contrib/active_job/log_injection.rb +++ b/lib/datadog/tracing/contrib/active_job/log_injection.rb @@ -1,7 +1,5 @@ # typed: false -require_relative '../../../tracing' - module Datadog module Tracing module Contrib diff --git a/lib/datadog/tracing/contrib/active_model_serializers/event.rb b/lib/datadog/tracing/contrib/active_model_serializers/event.rb index 193c891920c..8bddda45147 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/event.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/event.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative '../active_support/notifications/event' diff --git a/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb b/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb index e0ee55ee984..c9c0465bddc 100644 --- a/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +++ b/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../patcher' require_relative 'ext' require_relative 'events' diff --git a/lib/datadog/tracing/contrib/aws/instrumentation.rb b/lib/datadog/tracing/contrib/aws/instrumentation.rb index 17504e41d74..73268cae748 100644 --- a/lib/datadog/tracing/contrib/aws/instrumentation.rb +++ b/lib/datadog/tracing/contrib/aws/instrumentation.rb @@ -1,6 +1,5 @@ # typed: ignore -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/dalli/instrumentation.rb b/lib/datadog/tracing/contrib/dalli/instrumentation.rb index 7a792c5e465..335ca85e823 100644 --- a/lib/datadog/tracing/contrib/dalli/instrumentation.rb +++ b/lib/datadog/tracing/contrib/dalli/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/delayed_job/plugin.rb b/lib/datadog/tracing/contrib/delayed_job/plugin.rb index 6a39693004b..c8f618bb99c 100644 --- a/lib/datadog/tracing/contrib/delayed_job/plugin.rb +++ b/lib/datadog/tracing/contrib/delayed_job/plugin.rb @@ -2,7 +2,6 @@ require 'delayed/plugin' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/elasticsearch/patcher.rb b/lib/datadog/tracing/contrib/elasticsearch/patcher.rb index 4395bf72be0..615b30bcd21 100644 --- a/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +++ b/lib/datadog/tracing/contrib/elasticsearch/patcher.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/ethon/easy_patch.rb b/lib/datadog/tracing/contrib/ethon/easy_patch.rb index 3c42da6c484..fd5d5a42c1a 100644 --- a/lib/datadog/tracing/contrib/ethon/easy_patch.rb +++ b/lib/datadog/tracing/contrib/ethon/easy_patch.rb @@ -2,7 +2,6 @@ require 'uri' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/ethon/multi_patch.rb b/lib/datadog/tracing/contrib/ethon/multi_patch.rb index c86ace142a4..4ae90b02753 100644 --- a/lib/datadog/tracing/contrib/ethon/multi_patch.rb +++ b/lib/datadog/tracing/contrib/ethon/multi_patch.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/excon/middleware.rb b/lib/datadog/tracing/contrib/excon/middleware.rb index 07729658c6f..1ff184cbc5e 100644 --- a/lib/datadog/tracing/contrib/excon/middleware.rb +++ b/lib/datadog/tracing/contrib/excon/middleware.rb @@ -3,7 +3,6 @@ require 'excon' require_relative '../../../core' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/faraday/middleware.rb b/lib/datadog/tracing/contrib/faraday/middleware.rb index 176cdd1ccfb..56b26cefe6b 100644 --- a/lib/datadog/tracing/contrib/faraday/middleware.rb +++ b/lib/datadog/tracing/contrib/faraday/middleware.rb @@ -2,7 +2,6 @@ require 'faraday' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/grape/endpoint.rb b/lib/datadog/tracing/contrib/grape/endpoint.rb index be38d115c5c..b702ea26d65 100644 --- a/lib/datadog/tracing/contrib/grape/endpoint.rb +++ b/lib/datadog/tracing/contrib/grape/endpoint.rb @@ -1,7 +1,6 @@ # typed: false require_relative '../../../core' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative '../rack/ext' diff --git a/lib/datadog/tracing/contrib/graphql/patcher.rb b/lib/datadog/tracing/contrib/graphql/patcher.rb index d51ee8ae573..f9566aa65f7 100644 --- a/lib/datadog/tracing/contrib/graphql/patcher.rb +++ b/lib/datadog/tracing/contrib/graphql/patcher.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../analytics' require_relative '../patcher' diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb index a4f98d22a94..f35bc85be9e 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb @@ -1,6 +1,5 @@ # typed: ignore -require_relative '../../../tracing' require_relative '../analytics' require_relative 'ext' require_relative 'configuration/settings' diff --git a/lib/datadog/tracing/contrib/http/circuit_breaker.rb b/lib/datadog/tracing/contrib/http/circuit_breaker.rb index b4932688ccf..139a5623a7d 100644 --- a/lib/datadog/tracing/contrib/http/circuit_breaker.rb +++ b/lib/datadog/tracing/contrib/http/circuit_breaker.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../../../ddtrace/transport/ext' module Datadog diff --git a/lib/datadog/tracing/contrib/http/instrumentation.rb b/lib/datadog/tracing/contrib/http/instrumentation.rb index 3d4a39869b3..05b17b12688 100644 --- a/lib/datadog/tracing/contrib/http/instrumentation.rb +++ b/lib/datadog/tracing/contrib/http/instrumentation.rb @@ -2,7 +2,6 @@ require 'uri' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative '../http_annotation_helper' diff --git a/lib/datadog/tracing/contrib/httpclient/instrumentation.rb b/lib/datadog/tracing/contrib/httpclient/instrumentation.rb index cfec0e6679b..857db968dda 100644 --- a/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +++ b/lib/datadog/tracing/contrib/httpclient/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/httprb/instrumentation.rb b/lib/datadog/tracing/contrib/httprb/instrumentation.rb index 48087bb1e05..6bc86daceb6 100644 --- a/lib/datadog/tracing/contrib/httprb/instrumentation.rb +++ b/lib/datadog/tracing/contrib/httprb/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/lograge/instrumentation.rb b/lib/datadog/tracing/contrib/lograge/instrumentation.rb index 3980fd1bbf1..ffb47fc7bdf 100644 --- a/lib/datadog/tracing/contrib/lograge/instrumentation.rb +++ b/lib/datadog/tracing/contrib/lograge/instrumentation.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../../core/logging/ext' module Datadog diff --git a/lib/datadog/tracing/contrib/mysql2/instrumentation.rb b/lib/datadog/tracing/contrib/mysql2/instrumentation.rb index fd13595f635..73e0ae597b8 100644 --- a/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +++ b/lib/datadog/tracing/contrib/mysql2/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/pg/instrumentation.rb b/lib/datadog/tracing/contrib/pg/instrumentation.rb index dfcc3a3a26c..8dab4d5c158 100644 --- a/lib/datadog/tracing/contrib/pg/instrumentation.rb +++ b/lib/datadog/tracing/contrib/pg/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/presto/instrumentation.rb b/lib/datadog/tracing/contrib/presto/instrumentation.rb index 6d3ef8e2996..9014feec7be 100644 --- a/lib/datadog/tracing/contrib/presto/instrumentation.rb +++ b/lib/datadog/tracing/contrib/presto/instrumentation.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/qless/patcher.rb b/lib/datadog/tracing/contrib/qless/patcher.rb index eee38f5e597..57c20e8a5d9 100644 --- a/lib/datadog/tracing/contrib/qless/patcher.rb +++ b/lib/datadog/tracing/contrib/qless/patcher.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../patcher' module Datadog diff --git a/lib/datadog/tracing/contrib/qless/qless_job.rb b/lib/datadog/tracing/contrib/qless/qless_job.rb index 8863972c83f..b4ae14ae70e 100644 --- a/lib/datadog/tracing/contrib/qless/qless_job.rb +++ b/lib/datadog/tracing/contrib/qless/qless_job.rb @@ -2,7 +2,6 @@ require 'qless' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb b/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb index c5a3fb3d32f..cb5c9f824cd 100644 --- a/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +++ b/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb @@ -1,7 +1,5 @@ # typed: true -require_relative '../../../tracing' - module Datadog module Tracing module Contrib diff --git a/lib/datadog/tracing/contrib/racecar/event.rb b/lib/datadog/tracing/contrib/racecar/event.rb index 9b699831906..9dde405ed2c 100644 --- a/lib/datadog/tracing/contrib/racecar/event.rb +++ b/lib/datadog/tracing/contrib/racecar/event.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../active_support/notifications/event' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 02c1bc6d7ed..8c0d4e1d029 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -3,7 +3,6 @@ require 'date' require_relative '../../../core/environment/variable_helpers' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/rails/framework.rb b/lib/datadog/tracing/contrib/rails/framework.rb index 23038ff6645..aedaf6bc35a 100644 --- a/lib/datadog/tracing/contrib/rails/framework.rb +++ b/lib/datadog/tracing/contrib/rails/framework.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../action_cable/integration' require_relative '../action_mailer/integration' require_relative '../action_pack/integration' diff --git a/lib/datadog/tracing/contrib/rails/log_injection.rb b/lib/datadog/tracing/contrib/rails/log_injection.rb index 9a668b1f8c1..33d238782a9 100644 --- a/lib/datadog/tracing/contrib/rails/log_injection.rb +++ b/lib/datadog/tracing/contrib/rails/log_injection.rb @@ -1,7 +1,5 @@ # typed: false -require_relative '../../../tracing' - module Datadog module Tracing module Contrib diff --git a/lib/datadog/tracing/contrib/rails/middlewares.rb b/lib/datadog/tracing/contrib/rails/middlewares.rb index 1db7f52bd5d..f03442983a7 100644 --- a/lib/datadog/tracing/contrib/rails/middlewares.rb +++ b/lib/datadog/tracing/contrib/rails/middlewares.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../action_pack/utils' module Datadog diff --git a/lib/datadog/tracing/contrib/rails/patcher.rb b/lib/datadog/tracing/contrib/rails/patcher.rb index 80b31b37902..2a9e0dc15b6 100644 --- a/lib/datadog/tracing/contrib/rails/patcher.rb +++ b/lib/datadog/tracing/contrib/rails/patcher.rb @@ -1,7 +1,6 @@ # typed: ignore require_relative '../../../core/utils/only_once' -require_relative '../../../tracing' require_relative '../rack/middlewares' require_relative 'framework' require_relative 'log_injection' diff --git a/lib/datadog/tracing/contrib/rake/instrumentation.rb b/lib/datadog/tracing/contrib/rake/instrumentation.rb index d9ec234d258..f282e189853 100644 --- a/lib/datadog/tracing/contrib/rake/instrumentation.rb +++ b/lib/datadog/tracing/contrib/rake/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/rake/patcher.rb b/lib/datadog/tracing/contrib/rake/patcher.rb index 92a7a09cef4..d7baf973a8b 100644 --- a/lib/datadog/tracing/contrib/rake/patcher.rb +++ b/lib/datadog/tracing/contrib/rake/patcher.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../patcher' require_relative 'ext' require_relative 'instrumentation' diff --git a/lib/datadog/tracing/contrib/redis/instrumentation.rb b/lib/datadog/tracing/contrib/redis/instrumentation.rb index 005eceae99e..2b7d6e2b83b 100644 --- a/lib/datadog/tracing/contrib/redis/instrumentation.rb +++ b/lib/datadog/tracing/contrib/redis/instrumentation.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../patcher' require_relative 'configuration/resolver' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/redis/tags.rb b/lib/datadog/tracing/contrib/redis/tags.rb index e425db50a81..5bcb31b4554 100644 --- a/lib/datadog/tracing/contrib/redis/tags.rb +++ b/lib/datadog/tracing/contrib/redis/tags.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/resque/resque_job.rb b/lib/datadog/tracing/contrib/resque/resque_job.rb index 5c776f9b79c..0697038d33f 100644 --- a/lib/datadog/tracing/contrib/resque/resque_job.rb +++ b/lib/datadog/tracing/contrib/resque/resque_job.rb @@ -2,7 +2,6 @@ require 'resque' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative '../sidekiq/ext' diff --git a/lib/datadog/tracing/contrib/rest_client/request_patch.rb b/lib/datadog/tracing/contrib/rest_client/request_patch.rb index 126bf8d3d96..c0b1f9a8186 100644 --- a/lib/datadog/tracing/contrib/rest_client/request_patch.rb +++ b/lib/datadog/tracing/contrib/rest_client/request_patch.rb @@ -2,7 +2,6 @@ require 'uri' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb b/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb index 029dbd861c1..21844f36cc1 100644 --- a/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +++ b/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../../core/logging/ext' module Datadog diff --git a/lib/datadog/tracing/contrib/sequel/database.rb b/lib/datadog/tracing/contrib/sequel/database.rb index 26e2779033d..a9dad6858f0 100644 --- a/lib/datadog/tracing/contrib/sequel/database.rb +++ b/lib/datadog/tracing/contrib/sequel/database.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/sequel/dataset.rb b/lib/datadog/tracing/contrib/sequel/dataset.rb index b603aa2fbb5..0e8b0954af7 100644 --- a/lib/datadog/tracing/contrib/sequel/dataset.rb +++ b/lib/datadog/tracing/contrib/sequel/dataset.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb b/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb index 8f5636366a5..afe80e09c05 100644 --- a/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +++ b/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb b/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb index 453e2fbdd36..ad0b9371a0e 100644 --- a/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +++ b/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/sinatra/framework.rb b/lib/datadog/tracing/contrib/sinatra/framework.rb index 24636620aa7..a2267f3a105 100644 --- a/lib/datadog/tracing/contrib/sinatra/framework.rb +++ b/lib/datadog/tracing/contrib/sinatra/framework.rb @@ -1,7 +1,5 @@ # typed: false -require_relative '../../../tracing' - module Datadog module Tracing module Contrib diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index 97a8d827704..dfde326dc7a 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -3,7 +3,6 @@ require 'sinatra/base' require_relative '../../../core/utils/only_once' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../../propagation/http' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb index b7cc23a9344..868145b5851 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb @@ -1,6 +1,5 @@ # typed: false -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative '../rack/ext' diff --git a/lib/datadog/tracing/contrib/sneakers/tracer.rb b/lib/datadog/tracing/contrib/sneakers/tracer.rb index edfaa1c7521..394164b3c33 100644 --- a/lib/datadog/tracing/contrib/sneakers/tracer.rb +++ b/lib/datadog/tracing/contrib/sneakers/tracer.rb @@ -2,7 +2,6 @@ # typed: true -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' diff --git a/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb b/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb index a2dd9d17329..267e86c8239 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb @@ -2,7 +2,6 @@ require 'sucker_punch' -require_relative '../../../tracing' require_relative '../../metadata/ext' require_relative '../analytics' require_relative 'ext' diff --git a/lib/datadog/tracing/contrib/sucker_punch/patcher.rb b/lib/datadog/tracing/contrib/sucker_punch/patcher.rb index bca42450d2f..389c4e78f3f 100644 --- a/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +++ b/lib/datadog/tracing/contrib/sucker_punch/patcher.rb @@ -1,6 +1,5 @@ # typed: true -require_relative '../../../tracing' require_relative '../patcher' require_relative 'ext' From 72e4fe3f38dbacb60561eb9a7b4acbcd66a64010 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 25 Jul 2022 17:30:44 -0700 Subject: [PATCH 0307/2133] Move appsec autoload ddtrace dependency one level up --- lib/datadog/appsec/autoload.rb | 2 ++ lib/datadog/appsec/contrib/auto_instrument.rb | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datadog/appsec/autoload.rb b/lib/datadog/appsec/autoload.rb index 543c6e56ccb..d1d9be005bb 100644 --- a/lib/datadog/appsec/autoload.rb +++ b/lib/datadog/appsec/autoload.rb @@ -1,6 +1,8 @@ # typed: ignore if %w[1 true].include?((ENV['DD_APPSEC_ENABLED'] || '').downcase) + require_relative '../../ddtrace' + begin require_relative '../appsec' rescue StandardError => e diff --git a/lib/datadog/appsec/contrib/auto_instrument.rb b/lib/datadog/appsec/contrib/auto_instrument.rb index fa4969abab2..c64c62a733b 100644 --- a/lib/datadog/appsec/contrib/auto_instrument.rb +++ b/lib/datadog/appsec/contrib/auto_instrument.rb @@ -1,7 +1,5 @@ # typed: true -require_relative '../../../ddtrace' - module Datadog module AppSec module Contrib From d39f5935ae3ff3abcb3e4734726d2879f99eb533 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Jul 2022 12:05:12 +0100 Subject: [PATCH 0308/2133] Log the compiler version during profiler installation This may come in handy when we ask customers for the compilation log file to debug issues. --- ext/ddtrace_profiling_native_extension/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index 2829674934e..d10a966e667 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -169,6 +169,10 @@ def add_compiler_flag(flag) "#{Datadog::Profiling::NativeExtensionHelpers.libdatadog_folder_relative_to_native_lib_folder}" Logging.message(" [ddtrace] After pkg-config $LDFLAGS were set to: #{$LDFLAGS.inspect}\n") +Logging.message(" [ddtrace] Using compiler:\n") +xsystem("#{CONFIG['CC']} --version") +Logging.message(" [ddtrace] End of compiler information\n") + # Tag the native extension library with the Ruby version and Ruby platform. # This makes it easier for development (avoids "oops I forgot to rebuild when I switched my Ruby") and ensures that # the wrong library is never loaded. From 13aac32df2de5c30a6c5bf343e16836371f28937 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Jul 2022 12:15:29 +0100 Subject: [PATCH 0309/2133] Include link to troubleshooting page when native extension fails to build --- .../native_extension_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb index 6a27b46bd99..a8963557930 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb @@ -138,6 +138,8 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global CONTACT_SUPPORT = [ 'For help solving this issue, please contact Datadog support at', '.', + 'You can also check out the Continuous Profiler troubleshooting page at', + '.' ].freeze REPORT_ISSUE = [ From c11635934ac9ef579ae7bef6a70430f325d38b1b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 26 Jul 2022 12:20:00 +0100 Subject: [PATCH 0310/2133] Tweak documentation with "who is this page for?" and note about MJIT header usage --- .../NativeExtensionDesign.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md index af38092a19d..275853f45de 100644 --- a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +++ b/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md @@ -18,6 +18,11 @@ the gem. Setting `DD_PROFILING_NO_EXTENSION` at installation time skips compilat In past releases, it was possible for the profiler to run without the native extension, but that's no longer the case, and disabling the extension will disable profiling. +## Who is this page for? + +This documentation is intended to be used by dd-trace-rb developers. Please see the `docs/` folder for user-level +documentation. + ## Must not block or break users that cannot use it The profiling native extension is (and must always be) designed to **not cause failures** during gem installation, even @@ -67,6 +72,8 @@ Because these private header files are not included in regular Ruby installation Functions which make use of these headers are defined in the file. +There is currently no way for disabling usage of the private MJIT header for Ruby 2.6+. + **Important Note**: Our medium/long-term plan is to stop relying on all private Ruby headers, and instead request and contribute upstream changes so that they become official public VM APIs. From 6fd351fd9667907859f7915e8bc65de8ff5d8fff Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Jul 2022 10:30:44 +0100 Subject: [PATCH 0311/2133] Add note explaining what `@no_concurrent_serialize_mutex` is for --- lib/datadog/profiling/stack_recorder.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index f7d2d7f7d9f..9a5bcfe3011 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -6,6 +6,12 @@ module Profiling # Methods prefixed with _native_ are implemented in `stack_recorder.c` class StackRecorder def initialize + # This mutex works in addition to the fancy C-level mutexes we have in the native side (see the docs there). + # It prevents multiple Ruby threads calling serialize at the same time -- something like + # `10.times { Thread.new { stack_recorder.serialize } }`. + # This isn't something we expect to happen normally, but because it would break the assumptions of the + # C-level mutexes (that there is a single serializer thread), we add it here as an extra safeguard against it + # accidentally happening. @no_concurrent_synchronize_mutex = Thread::Mutex.new end From a9440cfe5e5e1173b5fb1ec0e286af21a55af9c0 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 27 Jul 2022 11:41:54 +0100 Subject: [PATCH 0312/2133] Rename title to make it clear what we're talking about --- ext/ddtrace_profiling_native_extension/stack_recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index c0b6a5938da..d1058a77838 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -11,7 +11,7 @@ // This file implements the native bits of the Datadog::Profiling::StackRecorder class // --- -// ## Concurrency-safe design notes +// ## Synchronization mechanism for safe parallel access design notes // // The state of the StackRecorder is managed using a set of locks to avoid concurrency issues. // From be1cc3094b996633c23a947980909d3e69051a41 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 17:00:18 -0700 Subject: [PATCH 0313/2133] Flush out single span sampling yard docs --- lib/datadog/tracing/sampling/span/sampler.rb | 34 ++++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index 178a612f479..35cea50524b 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -2,18 +2,30 @@ module Datadog module Tracing module Sampling module Span - # Applies a set of rules to a span. - # This class is used to apply sampling operations to all - # spans in the tracer. + # Applies Single Span Sampling rules to spans. + # When matching the configured rules, a span is ensured to + # be processed Datadog App. In other words, a single sampled span + # will never be dropped by the tracer or Datadog agent. # - # Span sampling is distinct from trace sampling: span - # sampling can keep a span that is part of tracer that was - # rejected by trace sampling. + # All spans in a trace are subject to the single sampling rules, if + # any rules are configured. + # + # Single Span Sampling is distinct from trace-level sampling: + # Single Span Sampling can ensure a span is kept, even if its + # enclosing trace is rejected by trace-level sampling. # # This class only applies operations to spans that are part - # of traces that were rejected by trace sampling. There's no - # reason to try to sample spans that are already kept by - # the trace sampler. + # of traces that was rejected by trace sampling. + # A trace is rejected if either of the following conditions is true: + # * The priority sampling for a trace is set to either {USER_REJECT} or {AUTO_REJECT}. + # * The trace was rejected by internal sampling, thus never flushed. + # + # Single-sampled spans are tagged and the tracer ensures they will + # reach the Datadog App, regardless of their enclosing trace sampling decision. + # + # Single Span Sampling does not inspect spans that are part of a trace + # that has been accepted by trace-level sampling rules: all spans from such + # trace are guaranteed to reach the Datadog App. class Sampler # Receives sampling rules to apply to individual spans. # @@ -22,7 +34,9 @@ def initialize(rules = []) @rules = rules end - # Applies sampling rules to the span if the trace has been rejected. + + # Applies Single Span Sampling rules to the span if the trace has been rejected. + # # The trace can be outright rejected, and never reach the transport, # or be set as rejected by priority sampling. In both cases, the trace # is considered rejected for Single Span Sampling purposes. From 72eba19d5e269a4f44b76771d91976e61b9aed1d Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 17:21:11 -0700 Subject: [PATCH 0314/2133] Test Span#tag? --- lib/datadog/tracing/metadata/tagging.rb | 9 +++++++-- spec/datadog/tracing/metadata/tagging_spec.rb | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 10b1a2edc6b..7d503177193 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -65,9 +65,14 @@ def set_tags(tags) tags.each { |k, v| set_tag(k, v) } end - # Returns true if the provided `tag` was set to a non-nil value. False otherwise. + # Returns true if the provided `tag` was set to a non-nil value. + # False otherwise. + # + # DEV: This method enables short-hand assertions on span tags: + # DEV: `expect(spans).to have_tag('http.method')` + # # @param [String] tag the tag or metric to check for presence - # @return [Boolean] + # @return [Boolean] if the tag is present and not nil def tag?(tag) !get_tag(tag).nil? # nil is considered not present, thus we can't use `Hash#has_key?` end diff --git a/spec/datadog/tracing/metadata/tagging_spec.rb b/spec/datadog/tracing/metadata/tagging_spec.rb index 30990ab735e..536f7fe837a 100644 --- a/spec/datadog/tracing/metadata/tagging_spec.rb +++ b/spec/datadog/tracing/metadata/tagging_spec.rb @@ -28,6 +28,26 @@ end end + describe '#tag?' do + subject(:tag?) { test_object.tag?(key) } + let(:key) { 'test_tag' } + let(:value) { 'test_value' } + + context 'when no tag exists' do + it { is_expected.to be false } + end + + context 'when a meta tag exists' do + before { test_object.send(:meta)[key] = value } + it { is_expected.to be true } + end + + context 'when a metric exists' do + before { test_object.send(:metrics)[key] = value } + it { is_expected.to be true } + end + end + describe '#set_tag' do subject(:set_tag) { test_object.set_tag(key, value) } From 558afb15415108dbf81804a9d0722f26aaa2f7a3 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 17:31:56 -0700 Subject: [PATCH 0315/2133] Rename span name to make it easy to tell our test subject --- spec/datadog/tracing/integration_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/datadog/tracing/integration_spec.rb b/spec/datadog/tracing/integration_spec.rb index 608c38edf13..d826072b216 100644 --- a/spec/datadog/tracing/integration_spec.rb +++ b/spec/datadog/tracing/integration_spec.rb @@ -294,8 +294,8 @@ def agent_receives_span_step3(previous_success) describe 'single span sampling' do subject(:trace) do tracer.trace('unrelated.top_level', service: 'other-service') do - tracer.trace('my.op', service: 'my-service') do # This is the span we are interested in - tracer.trace('other.trace', service: 'not-service') {} + tracer.trace('single.sampled_span', service: 'my-service') do + tracer.trace('unrelated.child_span', service: 'not-service') {} end end end @@ -341,7 +341,7 @@ def agent_receives_span_step3(previous_success) end let(:single_sampled_span) do - single_sampled_spans = spans.select { |s| s.name == 'my.op' } + single_sampled_spans = spans.select { |s| s.name == 'single.sampled_span' } expect(single_sampled_spans).to have(1).item single_sampled_spans[0] end @@ -396,13 +396,13 @@ def agent_receives_span_step3(previous_success) context 'with rule matching' do context 'on name' do context 'with a dropped span' do - let(:rules) { [{ name: 'my.op', sample_rate: 0.0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } it_behaves_like 'flushed complete trace' it_behaves_like 'does not modify spans' context 'by rate limiting' do - let(:rules) { [{ name: 'my.op', sample_rate: 1.0, max_per_second: 0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } it_behaves_like 'flushed complete trace' it_behaves_like 'does not modify spans' @@ -410,7 +410,7 @@ def agent_receives_span_step3(previous_success) end context 'with a kept span' do - let(:rules) { [{ name: 'my.op', sample_rate: 1.0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } it_behaves_like 'flushed complete trace' it_behaves_like 'set single span sampling tags' @@ -458,20 +458,20 @@ def sample!(trace) context 'on name' do context 'with a dropped span' do context 'by sampling rate' do - let(:rules) { [{ name: 'my.op', sample_rate: 0.0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } it_behaves_like 'flushed no trace' end context 'by rate limiting' do - let(:rules) { [{ name: 'my.op', sample_rate: 1.0, max_per_second: 0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } it_behaves_like 'flushed no trace' end end context 'with a kept span' do - let(:rules) { [{ name: 'my.op', sample_rate: 1.0 }] } + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } # it_behaves_like 'flushed complete trace', expected_span_count: 1 it_behaves_like 'set single span sampling tags' From 82628a6683f1bb69b6cea89b89b4050fe5c2a3ec Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 17:34:02 -0700 Subject: [PATCH 0316/2133] Simplify test --- spec/datadog/tracing/integration_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/datadog/tracing/integration_spec.rb b/spec/datadog/tracing/integration_spec.rb index d826072b216..8520cc73857 100644 --- a/spec/datadog/tracing/integration_spec.rb +++ b/spec/datadog/tracing/integration_spec.rb @@ -359,13 +359,10 @@ def agent_receives_span_step3(previous_success) end shared_examples 'set single span sampling tags' do - let(:rule_rate) { 1.0 } - let(:max_per_second) { -1 } - it do expect(single_sampled_span.get_metric('_dd.span_sampling.mechanism')).to eq(8) - expect(single_sampled_span.get_metric('_dd.span_sampling.rule_rate')).to eq(rule_rate) - expect(single_sampled_span.get_metric('_dd.span_sampling.max_per_second')).to eq(max_per_second) + expect(single_sampled_span.get_metric('_dd.span_sampling.rule_rate')).to eq(1.0) + expect(single_sampled_span.get_metric('_dd.span_sampling.max_per_second')).to eq(-1) end end From 601ee9290c74e731bffc6ce5d8db9f9aa2aec93f Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 17:55:56 -0700 Subject: [PATCH 0317/2133] Simply integration testing --- spec/datadog/tracing/integration_spec.rb | 94 ++++++------------------ 1 file changed, 22 insertions(+), 72 deletions(-) diff --git a/spec/datadog/tracing/integration_spec.rb b/spec/datadog/tracing/integration_spec.rb index 8520cc73857..356406a681e 100644 --- a/spec/datadog/tracing/integration_spec.rb +++ b/spec/datadog/tracing/integration_spec.rb @@ -391,50 +391,25 @@ def agent_receives_span_step3(previous_success) let(:trace_sampling_rate) { 0.0 } context 'with rule matching' do - context 'on name' do - context 'with a dropped span' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } + context 'with a dropped span' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } - it_behaves_like 'flushed complete trace' - it_behaves_like 'does not modify spans' + it_behaves_like 'flushed complete trace' + it_behaves_like 'does not modify spans' - context 'by rate limiting' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } - - it_behaves_like 'flushed complete trace' - it_behaves_like 'does not modify spans' - end - end - - context 'with a kept span' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } - - it_behaves_like 'flushed complete trace' - it_behaves_like 'set single span sampling tags' - end - end - - context 'on service' do - context 'with a dropped span' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 0.0 }] } + context 'by rate limiting' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } it_behaves_like 'flushed complete trace' it_behaves_like 'does not modify spans' - - context 'by rate limiting' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0, max_per_second: 0 }] } - - it_behaves_like 'flushed complete trace' - it_behaves_like 'does not modify spans' - end end + end - context 'with a kept span' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0 }] } + context 'with a kept span' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } - it_behaves_like 'flushed complete trace' - it_behaves_like 'set single span sampling tags' - end + it_behaves_like 'flushed complete trace' + it_behaves_like 'set single span sampling tags' end end end @@ -452,50 +427,25 @@ def sample!(trace) end context 'with rule matching' do - context 'on name' do - context 'with a dropped span' do - context 'by sampling rate' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } - - it_behaves_like 'flushed no trace' - end - - context 'by rate limiting' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } + context 'with a dropped span' do + context 'by sampling rate' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 0.0 }] } - it_behaves_like 'flushed no trace' - end + it_behaves_like 'flushed no trace' end - context 'with a kept span' do - let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } + context 'by rate limiting' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0, max_per_second: 0 }] } - # it_behaves_like 'flushed complete trace', expected_span_count: 1 - it_behaves_like 'set single span sampling tags' + it_behaves_like 'flushed no trace' end end - context 'on service' do - context 'with a dropped span' do - context 'by sampling rate' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 0.0 }] } + context 'with a kept span' do + let(:rules) { [{ name: 'single.sampled_span', sample_rate: 1.0 }] } - it_behaves_like 'flushed no trace' - end - - context 'by rate limiting' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0, max_per_second: 0 }] } - - it_behaves_like 'flushed no trace' - end - end - - context 'with a kept span' do - let(:rules) { [{ service: 'my-ser*', sample_rate: 1.0 }] } - - it_behaves_like 'flushed complete trace', expected_span_count: 1 - it_behaves_like 'set single span sampling tags' - end + it_behaves_like 'flushed complete trace', expected_span_count: 1 + it_behaves_like 'set single span sampling tags' end end end From 3e9c7ca00a84a275fdec83ecd4ba704a70d38f9b Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 18:06:10 -0700 Subject: [PATCH 0318/2133] Lint commit --- lib/datadog/tracing/sampling/span/rule_parser.rb | 12 ++++++++---- lib/datadog/tracing/sampling/span/sampler.rb | 1 - spec/datadog/tracing/integration_spec.rb | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index 58f196b674e..f0706cdc4aa 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -27,8 +27,10 @@ def parse_json(rules) begin list = JSON.parse(rules) rescue => e - Datadog.logger.warn("Error parsing Span Sampling Rules `#{rules.inspect}`: "\ - "#{e.class.name} #{e.message} at #{Array(e.backtrace).first}") + Datadog.logger.warn( + "Error parsing Span Sampling Rules `#{rules.inspect}`: "\ + "#{e.class.name} #{e.message} at #{Array(e.backtrace).first}" + ) return nil end @@ -57,8 +59,10 @@ def parse_list(rules) begin parse_rule(hash) rescue => e - Datadog.logger.warn("Cannot parse Span Sampling Rule #{hash.inspect}: " \ - "#{e.class.name} #{e} at #{Array(e.backtrace).first}") + Datadog.logger.warn( + "Cannot parse Span Sampling Rule #{hash.inspect}: " \ + "#{e.class.name} #{e} at #{Array(e.backtrace).first}" + ) return nil end end diff --git a/lib/datadog/tracing/sampling/span/sampler.rb b/lib/datadog/tracing/sampling/span/sampler.rb index 9f8c6197355..7da05163090 100644 --- a/lib/datadog/tracing/sampling/span/sampler.rb +++ b/lib/datadog/tracing/sampling/span/sampler.rb @@ -36,7 +36,6 @@ def initialize(rules = []) @rules = rules end - # Applies Single Span Sampling rules to the span if the trace has been rejected. # # The trace can be outright rejected, and never reach the transport, diff --git a/spec/datadog/tracing/integration_spec.rb b/spec/datadog/tracing/integration_spec.rb index 356406a681e..46cce34cef6 100644 --- a/spec/datadog/tracing/integration_spec.rb +++ b/spec/datadog/tracing/integration_spec.rb @@ -315,9 +315,9 @@ def agent_receives_span_step3(previous_success) # Capture trace segments as they are about to be serialized allow_any_instance_of(Datadog::Transport::Traces::Transport) .to receive(:send_traces).and_wrap_original do |function, traces| - trace_segments.concat(traces) - function.call(traces) - end + trace_segments.concat(traces) + function.call(traces) + end trace # Run test subject tracer.shutdown! # Ensure trace is flushed, so we can read writer statistics From c06621432c27e0491966a9c32c25f8f54c7b04e4 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 27 Jul 2022 18:13:45 -0700 Subject: [PATCH 0319/2133] Hide documentation TODO until public docs are available --- docs/GettingStarted.md | 2 +- lib/datadog/core/configuration/settings.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index a14cdaf3a76..7828c96ed4f 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2191,7 +2191,7 @@ trace.keep! You can configure sampling rule that allow you keep spans despite their respective traces being dropped by a trace-level sampling rule. -See (TODO: Insert documentation URL here when published. Search for references of this TODO) for the full documentation on Single Span Sampling. +[//]: # (TODO: See for the full documentation on Single Span Sampling.) ### Distributed Tracing diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 28dd60d15ec..2c175185d2a 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -561,7 +561,7 @@ def initialize(*_) # These rules allow a span to be kept when its encompassing trace is dropped. # # The syntax for single span sampling rules can be found here: - # TODO: Insert documentation URL here when published. Search for references of this TODO + # TODO: # # @default `DD_SPAN_SAMPLING_RULES` environment variable. # Otherwise, `ENV_SPAN_SAMPLING_RULES_FILE` environment variable. From e9074e5d9836365d1e905d80b8cc3121fc688f4b Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 28 Jul 2022 11:22:18 +0200 Subject: [PATCH 0320/2133] Introduce TraceOperation#resource_override? --- .../tracing/contrib/rack/middlewares.rb | 17 +++++----- lib/datadog/tracing/trace_operation.rb | 4 +++ spec/datadog/tracing/trace_operation_spec.rb | 34 +++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index e7edeb56e78..284478089a5 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -41,9 +41,6 @@ def compute_queue_time(env) service: configuration[:web_service_name] ) - # Will be set later, avoid setting the trace.resource to propagate to rack span resource - frontend_span.resource = nil - # Tag this span as belonging to Rack frontend_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) frontend_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_HTTP_SERVER_QUEUE) @@ -116,10 +113,7 @@ def call(env) request_span.finish end - if frontend_span - frontend_span.resource = Ext::SPAN_HTTP_SERVER_QUEUE - frontend_span.finish - end + frontend_span.finish if frontend_span end # rubocop:enable Lint/RescueException @@ -143,11 +137,18 @@ def set_request_tags!(trace, request_span, env, status, headers, response, origi request_headers = parse_request_headers(env) response_headers = parse_response_headers(headers || {}) + # The priority + # 1. User overrides span.resource + # 2. Configuration + # 3. Nested App override trace.resource + # 4. Fallback with verb + status, eq `GET 200` request_span.resource ||= if configuration[:middleware_names] && env['RESPONSE_MIDDLEWARE'] "#{env['RESPONSE_MIDDLEWARE']}##{env['REQUEST_METHOD']}" + elsif trace.resource_override? + trace.resource else - trace.resource || "#{env['REQUEST_METHOD']} #{status}".strip + "#{env['REQUEST_METHOD']} #{status}".strip end request_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index e6189a40db0..57c433eeef1 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -135,6 +135,10 @@ def resource @resource || (root_span && root_span.resource) end + def resource_override? + !@resource.nil? + end + def service @service || (root_span && root_span.service) end diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index f188a973673..2fb71306a74 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -851,6 +851,40 @@ it_behaves_like 'root span derived attribute', :resource end + describe '#resource_override?' do + subject { trace_op.resource_override? } + + context 'when initialized without `resource`' do + it { is_expected.to eq(false) } + end + + context 'when initialized with `resource` as `nil`' do + let(:options) { { resource: nil } } + it { is_expected.to eq(false) } + end + + context 'when initialized with `resource` as `GET 200`' do + let(:options) { { resource: 'GET 200' } } + it { is_expected.to eq(true) } + end + + context 'when set `resource` as `nil`' do + it do + trace_op.resource = nil + + is_expected.to eq(false) + end + end + + context 'when set `resource` as `UsersController#show`' do + it do + trace_op.resource = 'UsersController#show' + + is_expected.to eq(true) + end + end + end + describe '#service' do it_behaves_like 'root span derived attribute', :service end From fd5f1d0f46466e31c057e921a150b0077751bf9f Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 28 Jul 2022 12:01:16 +0200 Subject: [PATCH 0321/2133] Add global source --- integration/apps/rack/Gemfile | 2 ++ integration/apps/rails-five/Gemfile | 2 ++ integration/apps/rails-seven/Gemfile | 2 ++ integration/apps/rails-six/Gemfile | 2 ++ integration/apps/rspec/Gemfile | 2 ++ integration/apps/ruby/Gemfile | 2 ++ integration/apps/sinatra2-classic/Gemfile | 2 ++ integration/apps/sinatra2-modular/Gemfile | 2 ++ 8 files changed, 16 insertions(+) diff --git a/integration/apps/rack/Gemfile b/integration/apps/rack/Gemfile index 4c30194802c..8b8a823baae 100644 --- a/integration/apps/rack/Gemfile +++ b/integration/apps/rack/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do gem 'puma' gem 'unicorn' diff --git a/integration/apps/rails-five/Gemfile b/integration/apps/rails-five/Gemfile index 30b2171c65b..96bc1664cd6 100644 --- a/integration/apps/rails-five/Gemfile +++ b/integration/apps/rails-five/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do # gem 'rails', '5.2.2' diff --git a/integration/apps/rails-seven/Gemfile b/integration/apps/rails-seven/Gemfile index 4dec525b0cd..ff9d6d7789c 100644 --- a/integration/apps/rails-seven/Gemfile +++ b/integration/apps/rails-seven/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source "https://rubygems.org" do git_source(:github) { |repo| "https://github.com/#{repo}.git" } diff --git a/integration/apps/rails-six/Gemfile b/integration/apps/rails-six/Gemfile index d983e1753b0..757c93d1376 100644 --- a/integration/apps/rails-six/Gemfile +++ b/integration/apps/rails-six/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do google_protobuf_versions = [ '~> 3.0', diff --git a/integration/apps/rspec/Gemfile b/integration/apps/rspec/Gemfile index 70c9b6742c2..f2cba9c1fa4 100644 --- a/integration/apps/rspec/Gemfile +++ b/integration/apps/rspec/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do gem 'ffi' gem 'google-protobuf' diff --git a/integration/apps/ruby/Gemfile b/integration/apps/ruby/Gemfile index d612520298c..5e15de5a23e 100644 --- a/integration/apps/ruby/Gemfile +++ b/integration/apps/ruby/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do gem 'ffi' gem 'google-protobuf' diff --git a/integration/apps/sinatra2-classic/Gemfile b/integration/apps/sinatra2-classic/Gemfile index 83ec8703af8..1c1221dd37d 100644 --- a/integration/apps/sinatra2-classic/Gemfile +++ b/integration/apps/sinatra2-classic/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do gem 'puma' gem 'unicorn' diff --git a/integration/apps/sinatra2-modular/Gemfile b/integration/apps/sinatra2-modular/Gemfile index bc11bd12b29..c0172ab839a 100644 --- a/integration/apps/sinatra2-modular/Gemfile +++ b/integration/apps/sinatra2-modular/Gemfile @@ -1,5 +1,7 @@ require 'datadog/demo_env' +source "https://rubygems.org" + source 'https://rubygems.org' do gem 'puma' gem 'unicorn' From 4583b47a45906adf7fe27ba983fbe0ce935b95f5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 28 Jul 2022 12:27:18 +0200 Subject: [PATCH 0322/2133] Remove scoped source from Gemfile --- integration/apps/rack/Gemfile | 84 +++++---- integration/apps/rails-five/Gemfile | 198 +++++++++++----------- integration/apps/rails-seven/Gemfile | 160 +++++++++-------- integration/apps/rails-six/Gemfile | 194 +++++++++++---------- integration/apps/rspec/Gemfile | 16 +- integration/apps/ruby/Gemfile | 12 +- integration/apps/sinatra2-classic/Gemfile | 60 ++++--- integration/apps/sinatra2-modular/Gemfile | 62 ++++--- 8 files changed, 385 insertions(+), 401 deletions(-) diff --git a/integration/apps/rack/Gemfile b/integration/apps/rack/Gemfile index 8b8a823baae..d7278acbab2 100644 --- a/integration/apps/rack/Gemfile +++ b/integration/apps/rack/Gemfile @@ -2,50 +2,48 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - gem 'puma' - gem 'unicorn' - gem 'rack' - if RUBY_VERSION < '2.3' - gem 'redis', '< 4.1.1' # 4.1.1 "claims" to support 2.2 but is actually broken - else - gem 'redis' - end - if RUBY_VERSION < '2.2' - gem 'sidekiq', '< 5' # 5.0.3 checks for older Rubies and breaks, but does not declare it on the gemspec :( - else - gem 'sidekiq' - end - gem 'resque' - gem 'rake' +gem 'puma' +gem 'unicorn' +gem 'rack' +if RUBY_VERSION < '2.3' + gem 'redis', '< 4.1.1' # 4.1.1 "claims" to support 2.2 but is actually broken +else + gem 'redis' +end +if RUBY_VERSION < '2.2' + gem 'sidekiq', '< 5' # 5.0.3 checks for older Rubies and breaks, but does not declare it on the gemspec :( +else + gem 'sidekiq' +end +gem 'resque' +gem 'rake' - gem 'dogstatsd-ruby' - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +gem 'dogstatsd-ruby' +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - # Needed for ddtrace profiling - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1' - ] - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') - gem 'google-protobuf', *google_protobuf_versions - else - # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) - gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' - end +# Needed for ddtrace profiling +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' +] +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions +else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' +end - # Development - gem 'pry-byebug' - # gem 'pry-stack_explorer', platform: :ruby - # gem 'rbtrace' - # gem 'ruby-prof' +# Development +gem 'pry-byebug' +# gem 'pry-stack_explorer', platform: :ruby +# gem 'rbtrace' +# gem 'ruby-prof' - gem 'rspec' - gem 'rspec-wait' - gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick -end +gem 'rspec' +gem 'rspec-wait' +gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick diff --git a/integration/apps/rails-five/Gemfile b/integration/apps/rails-five/Gemfile index 96bc1664cd6..2d20cd58948 100644 --- a/integration/apps/rails-five/Gemfile +++ b/integration/apps/rails-five/Gemfile @@ -2,106 +2,104 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do # gem 'rails', '5.2.2' - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1', - '!= 3.20.0.rc.1', - '!= 3.20.0.rc.2', - ] - - rails_version = ['~> 5.2', '>= 5.2.6'] - - gem 'actioncable', *rails_version - gem 'actionmailer', *rails_version - gem 'actionpack', *rails_version - gem 'actionview', *rails_version - gem 'activejob', *rails_version - gem 'activemodel', *rails_version - gem 'activerecord', *rails_version - gem 'railties', *rails_version - - gem 'mysql2' - gem 'puma' - gem 'unicorn' - - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - - gem 'dogstatsd-ruby' - gem 'ffi' - - # Needed for ddtrace profiling - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') - gem 'google-protobuf', *google_protobuf_versions - else - # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) - gem 'google-protobuf', '< 3.19.2' - end - - # Fixes conflict with profiling (patch overwrite in Thread) - # Upgrade this to latest when this patch is merged & released. - # https://github.com/rollbar/rollbar-gem/pull/1018 - gem 'rollbar', git: 'https://github.com/rollbar/rollbar-gem.git', ref: '310a9d1743bb44031480b49e8e0cef79ddc870c3' - - # Gems which give aide to higher performance - gem 'hiredis', '~> 0.6', platform: :ruby - gem 'multi_json' - gem 'oj', '3.3', platform: :ruby - - gem 'active_model_serializers', '0.9.3' - gem 'activerecord-import' # Speeds up mass imports - gem 'aws-sdk', '< 2.0' - gem 'bcrypt-ruby', platform: :ruby - gem 'connection_pool' - gem 'devise' - gem 'faker', require: false # Make up fake data to put in models for load testing - gem 'geoip' - gem 'hawk-auth' - gem 'httparty' - gem 'ipaddress' - gem 'rabl', platform: :ruby - gem 'rack-cors' - gem 'rake' - gem 'redis' - gem 'resque' - # gem 'resque-pool' # Incompatible with Redis 4.0+ - gem 'resque-scheduler' - gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby] - gem 'validates_timeliness', '~> 3.0.8' # Date comparisons - gem 'versionist' - gem 'warden' - - group :development do - gem 'annotate' - gem 'awesome_print' - gem 'bullet' - end - - group :test do - gem 'ci_reporter_rspec' - gem 'database_cleaner' - gem 'factory_girl_rails', '4.5.0' - gem 'rspec' - gem 'rspec-collection_matchers' - gem 'rspec-rails' - gem 'shoulda-matchers', '4.0.1' - gem 'simplecov', require: false # Will install simplecov-html as a dependency - gem 'timecop' - gem 'webmock' - end - - group :test, :development do - gem 'byebug', platform: :ruby - gem 'mock_redis', '0.19.0' - gem 'parallel_tests' - - gem 'listen' - end +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1', + '!= 3.20.0.rc.1', + '!= 3.20.0.rc.2', +] + +rails_version = ['~> 5.2', '>= 5.2.6'] + +gem 'actioncable', *rails_version +gem 'actionmailer', *rails_version +gem 'actionpack', *rails_version +gem 'actionview', *rails_version +gem 'activejob', *rails_version +gem 'activemodel', *rails_version +gem 'activerecord', *rails_version +gem 'railties', *rails_version + +gem 'mysql2' +gem 'puma' +gem 'unicorn' + +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') + +gem 'dogstatsd-ruby' +gem 'ffi' + +# Needed for ddtrace profiling +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions +else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', '< 3.19.2' +end + +# Fixes conflict with profiling (patch overwrite in Thread) +# Upgrade this to latest when this patch is merged & released. +# https://github.com/rollbar/rollbar-gem/pull/1018 +gem 'rollbar', git: 'https://github.com/rollbar/rollbar-gem.git', ref: '310a9d1743bb44031480b49e8e0cef79ddc870c3' + +# Gems which give aide to higher performance +gem 'hiredis', '~> 0.6', platform: :ruby +gem 'multi_json' +gem 'oj', '3.3', platform: :ruby + +gem 'active_model_serializers', '0.9.3' +gem 'activerecord-import' # Speeds up mass imports +gem 'aws-sdk', '< 2.0' +gem 'bcrypt-ruby', platform: :ruby +gem 'connection_pool' +gem 'devise' +gem 'faker', require: false # Make up fake data to put in models for load testing +gem 'geoip' +gem 'hawk-auth' +gem 'httparty' +gem 'ipaddress' +gem 'rabl', platform: :ruby +gem 'rack-cors' +gem 'rake' +gem 'redis' +gem 'resque' +# gem 'resque-pool' # Incompatible with Redis 4.0+ +gem 'resque-scheduler' +gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby] +gem 'validates_timeliness', '~> 3.0.8' # Date comparisons +gem 'versionist' +gem 'warden' + +group :development do + gem 'annotate' + gem 'awesome_print' + gem 'bullet' +end + +group :test do + gem 'ci_reporter_rspec' + gem 'database_cleaner' + gem 'factory_girl_rails', '4.5.0' + gem 'rspec' + gem 'rspec-collection_matchers' + gem 'rspec-rails' + gem 'shoulda-matchers', '4.0.1' + gem 'simplecov', require: false # Will install simplecov-html as a dependency + gem 'timecop' + gem 'webmock' +end + +group :test, :development do + gem 'byebug', platform: :ruby + gem 'mock_redis', '0.19.0' + gem 'parallel_tests' + + gem 'listen' end diff --git a/integration/apps/rails-seven/Gemfile b/integration/apps/rails-seven/Gemfile index ff9d6d7789c..d17af2274ba 100644 --- a/integration/apps/rails-seven/Gemfile +++ b/integration/apps/rails-seven/Gemfile @@ -2,107 +2,105 @@ require 'datadog/demo_env' source "https://rubygems.org" -source "https://rubygems.org" do - git_source(:github) { |repo| "https://github.com/#{repo}.git" } +git_source(:github) { |repo| "https://github.com/#{repo}.git" } - # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" - gem "rails", "~> 7.0.2", ">= 7.0.2.3" +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 7.0.2", ">= 7.0.2.3" - # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] - gem "sprockets-rails" +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" - # Use sqlite3 as the database for Active Record - gem "sqlite3", "~> 1.4" +# Use sqlite3 as the database for Active Record +gem "sqlite3", "~> 1.4" - # Use the Puma web server [https://github.com/puma/puma] - gem "puma", "~> 5.0" +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", "~> 5.0" - # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] - gem "importmap-rails" +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" - # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] - gem "turbo-rails" +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" - # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] - gem "stimulus-rails" +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" - # Build JSON APIs with ease [https://github.com/rails/jbuilder] - gem "jbuilder" +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" - # Use Redis adapter to run Action Cable in production - # gem "redis", "~> 4.0" +# Use Redis adapter to run Action Cable in production +# gem "redis", "~> 4.0" - # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] - # gem "kredis" +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" - # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] - # gem "bcrypt", "~> 3.1.7" +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" - # Windows does not include zoneinfo files, so bundle the tzinfo-data gem - gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] - # Reduces boot times through caching; required in config/boot.rb - gem "bootsnap", require: false +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false - # Use Sass to process CSS - # gem "sassc-rails" +# Use Sass to process CSS +# gem "sassc-rails" - # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] - # gem "image_processing", "~> 1.2" +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" - group :development, :test do - # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem - gem "debug", platforms: %i[ mri mingw x64_mingw ] - end - - group :development do - # Use console on exceptions pages [https://github.com/rails/web-console] - gem "web-console" - - # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] - # gem "rack-mini-profiler" - - # Speed up commands on slow machines / big apps [https://github.com/rails/spring] - # gem "spring" - end +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri mingw x64_mingw ] +end - group :test do - # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] - gem "capybara" - gem "selenium-webdriver" - gem "webdrivers" +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" - gem 'rspec' - gem 'rspec-collection_matchers' - gem 'rspec-rails' - gem 'shoulda-matchers' + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" - gem 'simplecov', require: false # Will install simplecov-html as a dependency - gem 'timecop' - gem 'webmock' - end + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end - # Custom gems: - gem 'aws-sdk' - gem 'devise' - gem 'httparty' - gem 'mysql2' - gem 'redis' - gem 'resque' - gem 'unicorn' +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" + gem "webdrivers" - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - gem 'dogstatsd-ruby' - gem 'rollbar' + gem 'rspec' + gem 'rspec-collection_matchers' + gem 'rspec-rails' + gem 'shoulda-matchers' - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1' - ] - gem 'google-protobuf', *google_protobuf_versions + gem 'simplecov', require: false # Will install simplecov-html as a dependency + gem 'timecop' + gem 'webmock' end + +# Custom gems: +gem 'aws-sdk' +gem 'devise' +gem 'httparty' +gem 'mysql2' +gem 'redis' +gem 'resque' +gem 'unicorn' + +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +gem 'dogstatsd-ruby' +gem 'rollbar' + +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' +] +gem 'google-protobuf', *google_protobuf_versions diff --git a/integration/apps/rails-six/Gemfile b/integration/apps/rails-six/Gemfile index 757c93d1376..b50f9c0b108 100644 --- a/integration/apps/rails-six/Gemfile +++ b/integration/apps/rails-six/Gemfile @@ -2,108 +2,106 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1' - ] - - rails_version = ['~> 6.1'] - - gem 'actioncable', *rails_version - gem 'actionmailer', *rails_version - gem 'actionpack', *rails_version - gem 'actionview', *rails_version - gem 'activejob', *rails_version - gem 'activemodel', *rails_version - gem 'activerecord', *rails_version - gem 'railties', *rails_version - - gem 'mysql2' - gem 'puma' - gem 'unicorn' - - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - - gem 'dogstatsd-ruby' - gem 'ffi' - gem 'google-protobuf', *google_protobuf_versions - - # Gems which give aide to higher performance - gem 'hiredis', platform: :ruby - gem 'multi_json' - gem 'oj', platform: :ruby - - # Need to add these because ActionMailer is broken in 6.1.6 - # https://github.com/rails/rails/pull/44697 +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' +] + +rails_version = ['~> 6.1'] + +gem 'actioncable', *rails_version +gem 'actionmailer', *rails_version +gem 'actionpack', *rails_version +gem 'actionview', *rails_version +gem 'activejob', *rails_version +gem 'activemodel', *rails_version +gem 'activerecord', *rails_version +gem 'railties', *rails_version + +gem 'mysql2' +gem 'puma' +gem 'unicorn' + +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') + +gem 'dogstatsd-ruby' +gem 'ffi' +gem 'google-protobuf', *google_protobuf_versions + +# Gems which give aide to higher performance +gem 'hiredis', platform: :ruby +gem 'multi_json' +gem 'oj', platform: :ruby + +# Need to add these because ActionMailer is broken in 6.1.6 +# https://github.com/rails/rails/pull/44697 +if RUBY_VERSION < '2.6.0' + gem 'net-smtp', '0.3.0' + gem 'net-imap', '0.2.2' +else + gem 'net-smtp' + gem 'net-imap' +end +gem 'net-pop' + +gem 'active_model_serializers' +gem 'activerecord-import' # Speeds up mass imports +gem 'aws-sdk' +gem 'bcrypt-ruby', platform: :ruby +gem 'connection_pool' +gem 'devise' +gem 'faker', require: false # Make up fake data to put in models for load testing +gem 'geoip' +gem 'hawk-auth' +gem 'httparty' +gem 'ipaddress' +gem 'rabl', platform: :ruby +gem 'rack-cors' +gem 'rake' +gem 'redis' +gem 'resque' +# gem 'resque-pool' # Incompatible with Redis 4.0+ +gem 'resque-scheduler' +gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby] +gem 'validates_timeliness' +gem 'versionist' +gem 'warden' +gem 'rollbar' + +group :development do + gem 'annotate' + gem 'awesome_print' + gem 'bullet' +end + +group :test do + gem 'ci_reporter_rspec' + gem 'database_cleaner' + gem 'factory_girl_rails' + gem 'rspec' + gem 'rspec-collection_matchers' + gem 'rspec-rails' + if RUBY_VERSION < '2.6.0' - gem 'net-smtp', '0.3.0' - gem 'net-imap', '0.2.2' + gem 'shoulda-matchers', '~> 4.5' else - gem 'net-smtp' - gem 'net-imap' - end - gem 'net-pop' - - gem 'active_model_serializers' - gem 'activerecord-import' # Speeds up mass imports - gem 'aws-sdk' - gem 'bcrypt-ruby', platform: :ruby - gem 'connection_pool' - gem 'devise' - gem 'faker', require: false # Make up fake data to put in models for load testing - gem 'geoip' - gem 'hawk-auth' - gem 'httparty' - gem 'ipaddress' - gem 'rabl', platform: :ruby - gem 'rack-cors' - gem 'rake' - gem 'redis' - gem 'resque' - # gem 'resque-pool' # Incompatible with Redis 4.0+ - gem 'resque-scheduler' - gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby] - gem 'validates_timeliness' - gem 'versionist' - gem 'warden' - gem 'rollbar' - - group :development do - gem 'annotate' - gem 'awesome_print' - gem 'bullet' + gem 'shoulda-matchers' end - group :test do - gem 'ci_reporter_rspec' - gem 'database_cleaner' - gem 'factory_girl_rails' - gem 'rspec' - gem 'rspec-collection_matchers' - gem 'rspec-rails' - - if RUBY_VERSION < '2.6.0' - gem 'shoulda-matchers', '~> 4.5' - else - gem 'shoulda-matchers' - end - - gem 'simplecov', require: false # Will install simplecov-html as a dependency - gem 'timecop' - gem 'webmock' - end + gem 'simplecov', require: false # Will install simplecov-html as a dependency + gem 'timecop' + gem 'webmock' +end - group :test, :development do - gem 'byebug', platform: :ruby - gem 'mock_redis' - gem 'parallel_tests' +group :test, :development do + gem 'byebug', platform: :ruby + gem 'mock_redis' + gem 'parallel_tests' - gem 'listen' - end + gem 'listen' end diff --git a/integration/apps/rspec/Gemfile b/integration/apps/rspec/Gemfile index f2cba9c1fa4..68e3570d2dd 100644 --- a/integration/apps/rspec/Gemfile +++ b/integration/apps/rspec/Gemfile @@ -2,15 +2,13 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - gem 'ffi' - gem 'google-protobuf' +gem 'ffi' +gem 'google-protobuf' - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - gem 'byebug' +gem 'byebug' - # Testing/CI - gem 'rspec' -end +# Testing/CI +gem 'rspec' diff --git a/integration/apps/ruby/Gemfile b/integration/apps/ruby/Gemfile index 5e15de5a23e..227116c04e7 100644 --- a/integration/apps/ruby/Gemfile +++ b/integration/apps/ruby/Gemfile @@ -2,12 +2,10 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - gem 'ffi' - gem 'google-protobuf' +gem 'ffi' +gem 'google-protobuf' - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - gem 'byebug' -end +gem 'byebug' diff --git a/integration/apps/sinatra2-classic/Gemfile b/integration/apps/sinatra2-classic/Gemfile index 1c1221dd37d..26e430925d6 100644 --- a/integration/apps/sinatra2-classic/Gemfile +++ b/integration/apps/sinatra2-classic/Gemfile @@ -2,37 +2,35 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - gem 'puma' - gem 'unicorn' - gem 'sinatra' +gem 'puma' +gem 'unicorn' +gem 'sinatra' - gem 'dogstatsd-ruby' - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +gem 'dogstatsd-ruby' +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - # Needed for ddtrace profiling - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1' - ] - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') - gem 'google-protobuf', *google_protobuf_versions - else - # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) - gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' - end - - # Development - gem 'pry-byebug' - # gem 'pry-stack_explorer', platform: :ruby - # gem 'rbtrace' - # gem 'ruby-prof' - gem 'rspec' - gem 'rspec-wait' - gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick +# Needed for ddtrace profiling +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' +] +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions +else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' end + +# Development +gem 'pry-byebug' +# gem 'pry-stack_explorer', platform: :ruby +# gem 'rbtrace' +# gem 'ruby-prof' +gem 'rspec' +gem 'rspec-wait' +gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick diff --git a/integration/apps/sinatra2-modular/Gemfile b/integration/apps/sinatra2-modular/Gemfile index c0172ab839a..2752a28be96 100644 --- a/integration/apps/sinatra2-modular/Gemfile +++ b/integration/apps/sinatra2-modular/Gemfile @@ -2,38 +2,36 @@ require 'datadog/demo_env' source "https://rubygems.org" -source 'https://rubygems.org' do - gem 'puma' - gem 'unicorn' - gem 'sinatra' - gem 'sinatra-router' +gem 'puma' +gem 'unicorn' +gem 'sinatra' +gem 'sinatra-router' - gem 'dogstatsd-ruby' - # Choose correct specs for 'ddtrace' demo environment - gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') +gem 'dogstatsd-ruby' +# Choose correct specs for 'ddtrace' demo environment +gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') - # Needed for ddtrace profiling - google_protobuf_versions = [ - '~> 3.0', - '!= 3.7.0.rc.2', - '!= 3.7.0.rc.3', - '!= 3.7.0', - '!= 3.7.1', - '!= 3.8.0.rc.1' - ] - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') - gem 'google-protobuf', *google_protobuf_versions - else - # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) - gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' - end - - # Development - gem 'pry-byebug' - # gem 'pry-stack_explorer', platform: :ruby - # gem 'rbtrace' - # gem 'ruby-prof' - gem 'rspec' - gem 'rspec-wait' - gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick +# Needed for ddtrace profiling +google_protobuf_versions = [ + '~> 3.0', + '!= 3.7.0.rc.2', + '!= 3.7.0.rc.3', + '!= 3.7.0', + '!= 3.7.1', + '!= 3.8.0.rc.1' +] +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4') + gem 'google-protobuf', *google_protobuf_versions +else + # Bundler resolves incorrect version (too new, incompatible with Ruby <= 2.3) + gem 'google-protobuf', *google_protobuf_versions, '< 3.19.2' end + +# Development +gem 'pry-byebug' +# gem 'pry-stack_explorer', platform: :ruby +# gem 'rbtrace' +# gem 'ruby-prof' +gem 'rspec' +gem 'rspec-wait' +gem 'webrick' if RUBY_VERSION >= '2.3' # Older Rubies can just use the built-in version of webrick From b8d4d9a4d5614f181529776808c4e56d8782a356 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 28 Jul 2022 16:00:48 +0200 Subject: [PATCH 0323/2133] Fix trace.resource never set --- lib/datadog/tracing/contrib/rack/middlewares.rb | 4 ++++ spec/datadog/tracing/contrib/rack/configuration_spec.rb | 6 ++++++ .../datadog/tracing/contrib/rack/integration_test_spec.rb | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 1edd2f2ec65..80eb5248865 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -150,6 +150,10 @@ def set_request_tags!(trace, request_span, env, status, headers, response, origi "#{env['REQUEST_METHOD']} #{status}".strip end + # Overrides the trace resource if it never been set + # Otherwise, the getter method would delegate to its root span + trace.resource = request_span.resource unless trace.resource_override? + request_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT) request_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST) diff --git a/spec/datadog/tracing/contrib/rack/configuration_spec.rb b/spec/datadog/tracing/contrib/rack/configuration_spec.rb index 2f74af65590..252a642af16 100644 --- a/spec/datadog/tracing/contrib/rack/configuration_spec.rb +++ b/spec/datadog/tracing/contrib/rack/configuration_spec.rb @@ -74,6 +74,9 @@ it 'produces a queued Rack trace' do is_expected.to be_ok + + expect(trace.resource).to eq('GET 200') + expect(spans).to have(2).items web_service_name = Datadog.configuration.tracing[:rack][:web_service_name] @@ -108,6 +111,9 @@ shared_examples_for 'a Rack request without queuing' do it 'produces a non-queued Rack trace' do is_expected.to be_ok + + expect(trace.resource).to eq('GET 200') + expect(spans).to have(1).items expect(span).to_not be nil diff --git a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb index 8ce4f46e97a..394ce8bceb8 100644 --- a/spec/datadog/tracing/contrib/rack/integration_test_spec.rb +++ b/spec/datadog/tracing/contrib/rack/integration_test_spec.rb @@ -106,6 +106,8 @@ expect(span.get_tag('http.base_url')).to eq('http://example.org') expect(span).to be_root_span end + + it { expect(trace.resource).to eq('GET 200') } end context 'with query string parameters' do @@ -211,6 +213,8 @@ nil, { Datadog::Tracing::Contrib::Rack::QueueTime::REQUEST_START => "t=#{Time.now.to_f}" } + expect(trace.resource).to eq('GET 200') + expect(spans).to have(2).items web_server_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_HTTP_SERVER_QUEUE } @@ -424,6 +428,8 @@ let(:route) { '/app/posts/100' } it do + expect(trace.resource).to eq('GET /app/') + expect(span.name).to eq('rack.request') expect(span.span_type).to eq('web') expect(span.service).to eq(Datadog.configuration.service) @@ -466,6 +472,8 @@ nil, { Datadog::Tracing::Contrib::Rack::QueueTime::REQUEST_START => "t=#{Time.now.to_f}" } + expect(trace.resource).to eq('UserController#show') + expect(spans).to have(3).items web_server_span = spans.find { |s| s.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_HTTP_SERVER_QUEUE } From 2f785d7772a1e1fc7d830f4a10cdd2140c64d7e3 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 29 Jul 2022 14:48:13 +0100 Subject: [PATCH 0324/2133] Report "thread id"s as strings in Collectors::CpuAndWallTime In a separate branch, I'm finally able to report profiles, but noticed the backend was not being able to parse the `thread id`s that we sent. It turns out that they need to be sent as strings, not numbers, so this fixes it and the resulting pprof profile can be correctly rendered in the Datadog UX. --- .../collectors_cpu_and_wall_time.c | 12 ++++++++---- .../collectors/cpu_and_wall_time_spec.rb | 16 ++++++++-------- spec/datadog/profiling/spec_helper.rb | 7 ++++++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index a8e5921f865..d1f2ffdedc6 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -10,6 +10,7 @@ // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class #define INVALID_TIME -1 +#define THREAD_ID_LIMIT_CHARS 20 // Contains state for a single CpuAndWallTime instance struct cpu_and_wall_time_collector_state { @@ -28,7 +29,8 @@ struct cpu_and_wall_time_collector_state { // Tracks per-thread state struct per_thread_context { - long thread_id; + char thread_id[THREAD_ID_LIMIT_CHARS]; + ddprof_ffi_CharSlice thread_id_char_slice; thread_cpu_time_id thread_cpu_time_id; long cpu_time_at_previous_sample_ns; // Can be INVALID_TIME until initialized or if getting it fails for another reason long wall_time_at_previous_sample_ns; // Can be INVALID_TIME until initialized @@ -200,7 +202,7 @@ static void sample(VALUE collector_instance) { int label_count = 1 + (have_thread_name ? 1 : 0); ddprof_ffi_Label labels[label_count]; - labels[0] = (ddprof_ffi_Label) {.key = DDPROF_FFI_CHARSLICE_C("thread id"), .num = thread_context->thread_id}; + labels[0] = (ddprof_ffi_Label) {.key = DDPROF_FFI_CHARSLICE_C("thread id"), .str = thread_context->thread_id_char_slice}; if (have_thread_name) { labels[1] = (ddprof_ffi_Label) { .key = DDPROF_FFI_CHARSLICE_C("thread name"), @@ -246,7 +248,9 @@ static struct per_thread_context *get_or_create_context_for(VALUE thread, struct } static void initialize_context(VALUE thread, struct per_thread_context *thread_context) { - thread_context->thread_id = thread_id_for(thread); + snprintf(thread_context->thread_id, THREAD_ID_LIMIT_CHARS, "%ld", thread_id_for(thread)); + thread_context->thread_id_char_slice = (ddprof_ffi_CharSlice) {.ptr = thread_context->thread_id, .len = strlen(thread_context->thread_id)}; + thread_context->thread_cpu_time_id = thread_cpu_time_id_for(thread); // These will get initialized during actual sampling @@ -284,7 +288,7 @@ static int per_thread_context_as_ruby_hash(st_data_t key_thread, st_data_t value rb_hash_aset(result, thread, context_as_hash); VALUE arguments[] = { - ID2SYM(rb_intern("thread_id")), /* => */ LONG2NUM(thread_context->thread_id), + ID2SYM(rb_intern("thread_id")), /* => */ rb_str_new2(thread_context->thread_id), ID2SYM(rb_intern("thread_cpu_time_id_valid?")), /* => */ thread_context->thread_cpu_time_id.valid ? Qtrue : Qfalse, ID2SYM(rb_intern("thread_cpu_time_id")), /* => */ CLOCKID2NUM(thread_context->thread_cpu_time_id.clock_id), ID2SYM(rb_intern("cpu_time_at_previous_sample_ns")), /* => */ LONG2NUM(thread_context->cpu_time_at_previous_sample_ns), diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 2231dc1c788..9b6087a1e8b 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -64,7 +64,7 @@ cpu_and_wall_time_collector.sample expect(samples.map { |it| it.fetch(:labels).fetch(:'thread id') }) - .to include(*[Thread.main, t1, t2, t3].map(&:object_id)) + .to include(*[Thread.main, t1, t2, t3].map(&:object_id).map(&:to_s)) end it 'includes the thread names, if available' do @@ -76,9 +76,9 @@ cpu_and_wall_time_collector.sample - t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } - t2_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t2.object_id } - t3_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t3.object_id } + t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } + t2_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t2.object_id.to_s } + t3_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t3.object_id.to_s } expect(t1_sample).to include(labels: include(:'thread name' => 'thread t1')) expect(t2_sample.fetch(:labels).keys).to_not include(:'thread name') @@ -100,7 +100,7 @@ wall_time_at_second_sample = cpu_and_wall_time_collector.per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) - t1_samples = samples.select { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } + t1_samples = samples.select { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } wall_time = t1_samples.first.fetch(:values).fetch(:'wall-time') expect(t1_samples.size) @@ -112,7 +112,7 @@ it 'tags samples with how many times they were seen' do 5.times { cpu_and_wall_time_collector.sample } - t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id } + t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } expect(t1_sample).to include(values: include(:'cpu-samples' => 5)) end @@ -145,7 +145,7 @@ # some data for it total_cpu_for_rspec_thread = samples - .select { |it| it.fetch(:labels).fetch(:'thread id') == Thread.current.object_id } + .select { |it| it.fetch(:labels).fetch(:'thread id') == Thread.current.object_id.to_s } .map { |it| it.fetch(:values).fetch(:'cpu-time') } .reduce(:+) @@ -184,7 +184,7 @@ it 'contains the thread ids (object_ids) of all sampled threads' do cpu_and_wall_time_collector.per_thread_context.each do |thread, context| - expect(context.fetch(:thread_id)).to eq thread.object_id + expect(context.fetch(:thread_id)).to eq thread.object_id.to_s end end diff --git a/spec/datadog/profiling/spec_helper.rb b/spec/datadog/profiling/spec_helper.rb index 900ff9fc204..82f11dc695f 100644 --- a/spec/datadog/profiling/spec_helper.rb +++ b/spec/datadog/profiling/spec_helper.rb @@ -62,7 +62,12 @@ def samples_from_pprof(pprof_data) { locations: sample.location_id.map { |location_id| decode_frame_from_pprof(decoded_profile, location_id) }, values: pretty_sample_types.zip(sample.value).to_h, - labels: sample.label.map { |it| [string_table[it.key].to_sym, it.str != 0 ? string_table[it.str] : it.num] }.to_h, + labels: sample.label.map do |it| + [ + string_table[it.key].to_sym, + it.str != 0 ? string_table[it.str] : raise('Unexpected: label encoded as number instead of string'), + ] + end.to_h, } end end From b9650beae56e946e063aa2e273bbdb2f5c5f1793 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 29 Jul 2022 15:02:12 +0100 Subject: [PATCH 0325/2133] Minor: Rename `minimum_duration` to `minimum_duration_seconds` --- lib/datadog/profiling/exporter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb index 7e415b49c59..2d9a7f5e3c1 100644 --- a/lib/datadog/profiling/exporter.rb +++ b/lib/datadog/profiling/exporter.rb @@ -22,18 +22,18 @@ class Exporter attr_reader \ :pprof_recorder, :code_provenance_collector, # The code provenance collector acts both as collector and as a recorder - :minimum_duration + :minimum_duration_seconds public def initialize( pprof_recorder:, code_provenance_collector:, - minimum_duration: PROFILE_DURATION_THRESHOLD_SECONDS + minimum_duration_seconds: PROFILE_DURATION_THRESHOLD_SECONDS ) @pprof_recorder = pprof_recorder @code_provenance_collector = code_provenance_collector - @minimum_duration = minimum_duration + @minimum_duration_seconds = minimum_duration_seconds end def flush @@ -67,7 +67,7 @@ def empty? private def duration_below_threshold?(start, finish) - (finish - start) < @minimum_duration + (finish - start) < minimum_duration_seconds end end end From db05b6c14d81049001c96a2c55a36efcb47fa896 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 29 Jul 2022 15:26:41 +0100 Subject: [PATCH 0326/2133] Replace `Exporter#empty?` with `Exporter#can_flush?` The `#empty?` method was used by the `Scheduler` to determine if there was data to be flushed. With the move to libdatadog to keep the data, it's somewhat awkward to implement an `#empty?` method, since that would entail looking at internal libdatadog state or tracking such a thing ourselves. Instead, let's replace it with a time-based `#can_flush?` that uses the same `duration_below_threshold?` mechanism we had to decide if there was enough data on a flush. The resulting outcome is similar, but needs no extra tracking outside of the `Exporter` class. --- lib/datadog/profiling/exporter.rb | 16 +++++-- lib/datadog/profiling/old_recorder.rb | 5 --- lib/datadog/profiling/scheduler.rb | 2 +- spec/datadog/profiling/exporter_spec.rb | 46 ++++++++++++++++++--- spec/datadog/profiling/old_recorder_spec.rb | 17 -------- spec/datadog/profiling/scheduler_spec.rb | 12 +++--- 6 files changed, 60 insertions(+), 38 deletions(-) diff --git a/lib/datadog/profiling/exporter.rb b/lib/datadog/profiling/exporter.rb index 2d9a7f5e3c1..ca5b75e2c6b 100644 --- a/lib/datadog/profiling/exporter.rb +++ b/lib/datadog/profiling/exporter.rb @@ -22,22 +22,30 @@ class Exporter attr_reader \ :pprof_recorder, :code_provenance_collector, # The code provenance collector acts both as collector and as a recorder - :minimum_duration_seconds + :minimum_duration_seconds, + :time_provider, + :last_flush_finish_at, + :created_at public def initialize( pprof_recorder:, code_provenance_collector:, - minimum_duration_seconds: PROFILE_DURATION_THRESHOLD_SECONDS + minimum_duration_seconds: PROFILE_DURATION_THRESHOLD_SECONDS, + time_provider: Time ) @pprof_recorder = pprof_recorder @code_provenance_collector = code_provenance_collector @minimum_duration_seconds = minimum_duration_seconds + @time_provider = time_provider + @last_flush_finish_at = nil + @created_at = time_provider.now.utc end def flush start, finish, uncompressed_pprof = pprof_recorder.serialize + @last_flush_finish_at = finish return if uncompressed_pprof.nil? # We don't want to report empty profiles @@ -60,8 +68,8 @@ def flush ) end - def empty? - pprof_recorder.empty? + def can_flush? + !duration_below_threshold?(last_flush_finish_at || created_at, time_provider.now.utc) end private diff --git a/lib/datadog/profiling/old_recorder.rb b/lib/datadog/profiling/old_recorder.rb index 87dd6ac68f9..e73d210dbe0 100644 --- a/lib/datadog/profiling/old_recorder.rb +++ b/lib/datadog/profiling/old_recorder.rb @@ -73,11 +73,6 @@ def serialize [start, finish, encoded_pprof] end - # NOTE: Remember that if the recorder is being accessed by multiple threads, this is an inherently racy operation. - def empty? - @buffers.values.all?(&:empty?) - end - # Error when event of an unknown type is used with the OldRecorder class UnknownEventError < StandardError attr_reader :event_class diff --git a/lib/datadog/profiling/scheduler.rb b/lib/datadog/profiling/scheduler.rb index 5fa147c69bb..0933d438826 100644 --- a/lib/datadog/profiling/scheduler.rb +++ b/lib/datadog/profiling/scheduler.rb @@ -83,7 +83,7 @@ def loop_wait_before_first_iteration? end def work_pending? - !exporter.empty? + exporter.can_flush? end private diff --git a/spec/datadog/profiling/exporter_spec.rb b/spec/datadog/profiling/exporter_spec.rb index ffbdd0c2e9b..5cd24b13d6c 100644 --- a/spec/datadog/profiling/exporter_spec.rb +++ b/spec/datadog/profiling/exporter_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Datadog::Profiling::Exporter do subject(:exporter) do - described_class.new(pprof_recorder: pprof_recorder, code_provenance_collector: code_provenance_collector) + described_class.new(pprof_recorder: pprof_recorder, code_provenance_collector: code_provenance_collector, **options) end let(:start) { Time.now } @@ -22,6 +22,7 @@ collector end let(:logger) { Datadog.logger } + let(:options) { {} } describe '#flush' do subject(:flush) { exporter.flush } @@ -73,11 +74,46 @@ end end - describe '#empty?' do - it 'delegates to the pprof_recorder' do - expect(pprof_recorder).to receive(:empty?).and_return(:empty_result) + describe '#can_flush?' do + let(:time_provider) { class_double(Time) } + let(:created_at) { start - 60 } + let(:options) { { **super(), time_provider: time_provider } } - expect(exporter.empty?).to be :empty_result + subject(:can_flush?) { exporter.can_flush? } + + before do + expect(time_provider).to receive(:now).and_return(created_at).once + exporter + end + + context 'when exporter has flushed before' do + before { exporter.flush } + + context 'when less than 1s has elapsed since last flush' do + before { expect(time_provider).to receive(:now).and_return(finish + 0.99).once } + + it { is_expected.to be false } + end + + context 'when 1s or more has elapsed since last flush' do + before { expect(time_provider).to receive(:now).and_return(finish + 1).once } + + it { is_expected.to be true } + end + end + + context 'when exporter has never flushed' do + context 'when less than 1s has elapsed since exporter was created' do + before { expect(time_provider).to receive(:now).and_return(created_at + 0.99).once } + + it { is_expected.to be false } + end + + context 'when 1s or more has elapsed since exporter was created' do + before { expect(time_provider).to receive(:now).and_return(created_at + 1).once } + + it { is_expected.to be true } + end end end end diff --git a/spec/datadog/profiling/old_recorder_spec.rb b/spec/datadog/profiling/old_recorder_spec.rb index ad1c6353c56..f75c44b2c5c 100644 --- a/spec/datadog/profiling/old_recorder_spec.rb +++ b/spec/datadog/profiling/old_recorder_spec.rb @@ -175,21 +175,4 @@ it { is_expected.to be nil } end end - - describe '#empty?' do - let(:event_classes) { [event_class] } - let(:event_class) { Class.new(Datadog::Profiling::Event) } - - context 'when there are no events recorded' do - it { is_expected.to be_empty } - end - - context 'when there are recorded events' do - before do - recorder.push(event_class.new) - end - - it { is_expected.to_not be_empty } - end - end end diff --git a/spec/datadog/profiling/scheduler_spec.rb b/spec/datadog/profiling/scheduler_spec.rb index 549305d63d9..d414d5ae0e7 100644 --- a/spec/datadog/profiling/scheduler_spec.rb +++ b/spec/datadog/profiling/scheduler_spec.rb @@ -199,16 +199,16 @@ describe '#work_pending?' do subject(:work_pending?) { scheduler.work_pending? } - context 'when the exporter has no events' do - before { expect(exporter).to receive(:empty?).and_return(true) } + context 'when the exporter can flush' do + before { expect(exporter).to receive(:can_flush?).and_return(true) } - it { is_expected.to be false } + it { is_expected.to be true } end - context 'when the exporter has events' do - before { expect(exporter).to receive(:empty?).and_return(false) } + context 'when the exporter can not flush' do + before { expect(exporter).to receive(:can_flush?).and_return(false) } - it { is_expected.to be true } + it { is_expected.to be false } end end end From 7243af711746afd78123930edd050f2942c1ea52 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 29 Jul 2022 16:56:45 +0200 Subject: [PATCH 0327/2133] Yard doc --- lib/datadog/tracing/trace_operation.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index 94b20508d26..85083ec71df 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -135,6 +135,9 @@ def resource @resource || (root_span && root_span.resource) end + # Returns true if the resource has been explicitly set + # + # @return [Boolean] def resource_override? !@resource.nil? end From 339cd1865db44b286c00aa483780bf5d476aba9f Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 29 Jul 2022 13:22:15 -0700 Subject: [PATCH 0328/2133] Refactor flushing logic --- lib/datadog/tracing/flush.rb | 87 ++--- lib/datadog/tracing/metadata/tagging.rb | 5 +- .../tracing/sampling/span/rule_parser.rb | 4 +- lib/datadog/tracing/span.rb | 7 - lib/datadog/tracing/trace_operation.rb | 47 +-- spec/datadog/tracing/flush_spec.rb | 28 ++ spec/datadog/tracing/metadata/tagging_spec.rb | 4 +- spec/datadog/tracing/span_spec.rb | 20 -- spec/datadog/tracing/trace_operation_spec.rb | 304 ++++++------------ 9 files changed, 201 insertions(+), 305 deletions(-) diff --git a/lib/datadog/tracing/flush.rb b/lib/datadog/tracing/flush.rb index 8c580c4fa41..3e80c32f24a 100644 --- a/lib/datadog/tracing/flush.rb +++ b/lib/datadog/tracing/flush.rb @@ -3,70 +3,85 @@ module Datadog module Tracing module Flush - # Consumes only completed traces (where all spans have finished) - class Finished - # Consumes and returns completed traces (where all spans have finished) - # from the provided \trace_op, if any. + # Consumes and returns a {TraceSegment} to be flushed, from + # the provided {TraceSegment}. + # + # Only finished spans are consumed. Any spans consumed are + # removed from +trace_op+ as a side effect. Unfinished spans are + # unaffected. + class Base + # Consumes and returns a {TraceSegment} to be flushed, from + # the provided {TraceSegment}. # - # Any traces consumed are removed from +trace_op+ as a side effect. + # Only finished spans are consumed. Any spans consumed are + # removed from +trace_op+ as a side effect. Unfinished spans are + # unaffected. # + # @param [TraceOperation] trace_op # @return [TraceSegment] trace to be flushed, or +nil+ if the trace is not finished def consume!(trace_op) - return unless full_flush?(trace_op) + return unless flush?(trace_op) get_trace(trace_op) end - def full_flush?(trace_op) - trace_op && trace_op.finished? - end - protected + # Consumes all finished spans from trace. + # @return [TraceSegment] def get_trace(trace_op) - trace_op.flush! + trace_op.flush! do |spans| + spans.select! { |span| single_sampled?(span) } unless trace_op.sampled? + + spans + end + end + + # Single Span Sampling has chosen to keep this span + # regardless of the trace-level sampling decision + def single_sampled?(span) + span.get_metric(Sampling::Span::Ext::TAG_MECHANISM) == Sampling::Span::Ext::MECHANISM_SPAN_SAMPLING_RATE end end - # Performs partial trace flushing to avoid large traces residing in memory for too long - class Partial + # Consumes and returns completed traces (where all spans have finished), + # if any, from the provided +trace_op+. + # + # Spans consumed are removed from +trace_op+ as a side effect. + class Finished < Base + # Are all spans finished? + def flush?(trace_op) + trace_op && trace_op.finished? + end + end + + # Consumes and returns completed or partially completed + # traces from the provided +trace_op+, if any. + # + # Partial trace flushing avoids large traces residing in memory for too long. + # + # Partially completed traces, where not all spans have finished, + # will only be returned if there are at least + # +@min_spans_for_partial+ finished spans. + # + # Spans consumed are removed from +trace_op+ as a side effect. + class Partial < Base # Start flushing partial trace after this many active spans in one trace DEFAULT_MIN_SPANS_FOR_PARTIAL_FLUSH = 500 attr_reader :min_spans_for_partial def initialize(options = {}) + super() @min_spans_for_partial = options.fetch(:min_spans_before_partial_flush, DEFAULT_MIN_SPANS_FOR_PARTIAL_FLUSH) end - # Consumes and returns completed or partially completed - # traces from the provided +trace_op+, if any. - # - # Partially completed traces, where not all spans have finished, - # will only be returned if there are at least - # +@min_spans_for_partial+ finished spans. - # - # Any spans consumed are removed from +trace_op+ as a side effect. - # - # @return [TraceSegment] partial or complete trace to be flushed, or +nil+ if no spans are finished - def consume!(trace_op) - return unless partial_flush?(trace_op) - - get_trace(trace_op) - end - - def partial_flush?(trace_op) + def flush?(trace_op) return true if trace_op.finished? return false if trace_op.finished_span_count < @min_spans_for_partial true end - - protected - - def get_trace(trace_op) - trace_op.flush! - end end end end diff --git a/lib/datadog/tracing/metadata/tagging.rb b/lib/datadog/tracing/metadata/tagging.rb index 278ac2bdf71..d32b1e6affa 100644 --- a/lib/datadog/tracing/metadata/tagging.rb +++ b/lib/datadog/tracing/metadata/tagging.rb @@ -68,12 +68,9 @@ def set_tags(tags) # Returns true if the provided `tag` was set to a non-nil value. # False otherwise. # - # DEV: This method enables short-hand assertions on span tags: - # DEV: `expect(spans).to have_tag('http.method')` - # # @param [String] tag the tag or metric to check for presence # @return [Boolean] if the tag is present and not nil - def tag?(tag) + def has_tag?(tag) # rubocop:disable Naming/PredicateName !get_tag(tag).nil? # nil is considered not present, thus we can't use `Hash#has_key?` end diff --git a/lib/datadog/tracing/sampling/span/rule_parser.rb b/lib/datadog/tracing/sampling/span/rule_parser.rb index f0706cdc4aa..98aac49ae9a 100644 --- a/lib/datadog/tracing/sampling/span/rule_parser.rb +++ b/lib/datadog/tracing/sampling/span/rule_parser.rb @@ -29,7 +29,7 @@ def parse_json(rules) rescue => e Datadog.logger.warn( "Error parsing Span Sampling Rules `#{rules.inspect}`: "\ - "#{e.class.name} #{e.message} at #{Array(e.backtrace).first}" + "#{e.class.name} #{e.message} at #{Array(e.backtrace).first}" ) return nil end @@ -61,7 +61,7 @@ def parse_list(rules) rescue => e Datadog.logger.warn( "Cannot parse Span Sampling Rule #{hash.inspect}: " \ - "#{e.class.name} #{e} at #{Array(e.backtrace).first}" + "#{e.class.name} #{e} at #{Array(e.backtrace).first}" ) return nil end diff --git a/lib/datadog/tracing/span.rb b/lib/datadog/tracing/span.rb index 31a2d85d1cf..ee0ce054f8f 100644 --- a/lib/datadog/tracing/span.rb +++ b/lib/datadog/tracing/span.rb @@ -204,13 +204,6 @@ def pretty_print(q) end end - # Single Span Sampling has chosen to keep this span - # regardless of the trace-level sampling decision - # @!visibility private - def single_sampled? - get_metric(Sampling::Span::Ext::TAG_MECHANISM) == Sampling::Span::Ext::MECHANISM_SPAN_SAMPLING_RATE - end - private # Used for serialization diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index 254903bc723..075272e38de 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -243,24 +243,19 @@ def build_span( # Returns a {TraceSegment} with all finished spans that can be flushed # at invocation time. All other **finished** spans are discarded. # - # A span can be flushed if: - # - # 1. The span has finished, and - # 2. Either: - # a. The trace is kept by sampling. - # b. The span is kept by single span sampling. - # - # Unfinished spans are not affected by this method. - # + # @yield [spans] spans that will be returned as part of the trace segment returned # @return [TraceSegment] def flush! - if sampled? - flush_all_spans! - else - # Only spans where the span-level sampling overrides - # the trace-level sampling can be flushed. - flush_single_sampled_spans_only! - end + finished = finished? + + # Copy out completed spans + spans = @spans.dup + @spans = [] + + spans = yield(spans) if block_given? + + # Use them to build a trace + build_trace(spans, !finished) end # Returns a set of trace headers used for continuing traces. @@ -429,26 +424,6 @@ def set_root_span!(span) @root_span = span end - # Flushes all spans from this trace - def flush_all_spans! - # Copy out completed spans - spans = @spans.dup - @spans = [] - - # Use them to build a trace - build_trace(spans, !finished?) - end - - # Flush single sampled span only, as the trace as a whole was dropped by trace-level sampling - def flush_single_sampled_spans_only! - # Copy out completed, selected spans - spans = @spans.select(&:single_sampled?) - @spans = [] - - # Use them to build a trace - build_trace(spans, true) - end - def build_trace(spans, partial = false) TraceSegment.new( spans, diff --git a/spec/datadog/tracing/flush_spec.rb b/spec/datadog/tracing/flush_spec.rb index 760018a2f46..dd46c66fd5b 100644 --- a/spec/datadog/tracing/flush_spec.rb +++ b/spec/datadog/tracing/flush_spec.rb @@ -25,6 +25,34 @@ it { is_expected.to eq(trace) } end + + context 'with a single sampled span' do + let(:trace_op) { Datadog::Tracing::TraceOperation.new(sampled: sampled) } + + before do + trace_op.measure('single.sampled') do |span| + span.set_metric(Datadog::Tracing::Sampling::Span::Ext::TAG_MECHANISM, 8) + + trace_op.measure('not_single.sampled') {} + end + end + + context 'and a kept trace' do + let(:sampled) { true } + + it 'returns all spans' do + is_expected.to have_attributes(spans: have(2).items) + end + end + + context 'and a rejected trace' do + let(:sampled) { false } + + it 'returns only single sampled spans' do + is_expected.to have_attributes(spans: [have_attributes(name: 'single.sampled')]) + end + end + end end RSpec.describe Datadog::Tracing::Flush::Finished do diff --git a/spec/datadog/tracing/metadata/tagging_spec.rb b/spec/datadog/tracing/metadata/tagging_spec.rb index 536f7fe837a..d1a6fc24586 100644 --- a/spec/datadog/tracing/metadata/tagging_spec.rb +++ b/spec/datadog/tracing/metadata/tagging_spec.rb @@ -28,8 +28,8 @@ end end - describe '#tag?' do - subject(:tag?) { test_object.tag?(key) } + describe '#has_tag?' do + subject(:has_tag?) { test_object.has_tag?(key) } let(:key) { 'test_tag' } let(:value) { 'test_value' } diff --git a/spec/datadog/tracing/span_spec.rb b/spec/datadog/tracing/span_spec.rb index 5ab42b5784a..c716fdc13e1 100644 --- a/spec/datadog/tracing/span_spec.rb +++ b/spec/datadog/tracing/span_spec.rb @@ -272,24 +272,4 @@ expect { pretty_print }.to output.to_stdout end end - - describe '#single_sampled?' do - subject(:single_sampled) { span.single_sampled? } - - context 'with the single span sampling sampling mechanism tag' do - let(:span_options) { { meta: { '_dd.span_sampling.mechanism' => 8 } } } - - it { is_expected.to eq(true) } - end - - context 'with another span sampling sampling mechanism tag' do - let(:span_options) { { meta: { '_dd.span_sampling.mechanism' => 999 } } } - - it { is_expected.to eq(false) } - end - - context 'without a span sampling sampling mechanism tag' do - it { is_expected.to eq(false) } - end - end end diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index f1ce0d08b78..a12ec91fcef 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -911,8 +911,6 @@ end describe '#set_tag' do - include_context 'trace attributes' - it 'sets tag on trace before a measurement' do trace_op.set_tag('foo', 'bar') trace_op.measure('top') {} @@ -1553,226 +1551,138 @@ def span end end - context 'is sampled' do - let(:sampled) { true } - context 'is finished' do - before do + context 'is finished' do + before do + trace_op.measure( + 'grandparent', + service: 'boo', + resource: 'far', + type: 'faz' + ) do trace_op.measure( - 'grandparent', - service: 'boo', - resource: 'far', - type: 'faz' + 'parent', + service: 'foo', + resource: 'bar', + type: 'baz' ) do - trace_op.measure( - 'parent', - service: 'foo', - resource: 'bar', - type: 'baz' - ) do - # Do something - end + # Do something end end - - it 'flushes a trace with all spans' do - expect(trace_op.finished?).to be true - - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(2).items - expect(trace.spans.map(&:name)).to include('parent', 'grandparent') - expect(trace.send(:root_span_id)).to be_a_kind_of(Integer) - - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) - end - - it 'does not yield duplicate spans' do - expect(trace_op.flush!.spans).to have(2).items - expect(trace_op.flush!.spans).to have(0).items - end end - context 'is partially finished' do - it 'flushes spans as they finish' do - trace_op.measure('grandparent') do - trace_op.measure('parent') do - # Do something - end - - # Partial flush - flush! - end + it 'flushes a trace with all spans' do + expect(trace_op.finished?).to be true - # Verify partial flush - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(1).items - expect(trace.spans.map(&:name)).to include('parent') - expect(trace.send(:root_span_id)).to be nil + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(2).items + expect(trace.spans.map(&:name)).to include('parent', 'grandparent') + expect(trace.send(:root_span_id)).to be_a_kind_of(Integer) - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) + end - # There should be finished spans pending - expect(trace_op.finished?).to be true - expect(trace_op.finished_span_count).to eq(1) + it 'does not yield duplicate spans' do + expect(trace_op.flush!.spans).to have(2).items + expect(trace_op.flush!.spans).to have(0).items + end - # Verify final flush - final_flush = trace_op.flush! - expect(final_flush.spans).to have(1).items - expect(final_flush.spans.map(&:name)).to include('grandparent') - expect(final_flush.send(:root_span_id)).to be_a_kind_of(Integer) + context 'with a block' do + subject(:flush!) { trace_op.flush! { |spans| spans } } - expect(final_flush).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service + it 'yields spans' do + expect { |b| trace_op.flush!(&b) }.to yield_with_args( + [ + have_attributes(name: 'parent'), + have_attributes(name: 'grandparent') + ] ) + end - # Make sure its actually empty - expect(trace_op.flush!.spans).to have(0).items + it 'uses block return as new span list' do + new_list = [double('span')] + expect(trace_op.flush! { new_list }).to have_attributes(spans: new_list) end end end - context 'is not sampled' do - let(:sampled) { false } - let(:sampling_priority) { nil } - - context 'is finished' do - before do - trace_op.measure( - 'grandparent', - service: 'boo', - resource: 'far', - type: 'faz' - ) do - trace_op.measure( - 'parent', - service: 'foo', - resource: 'bar', - type: 'baz', - tags: { '_dd.span_sampling.mechanism' => 8 } - ) do - # Do something - end + context 'is partially finished' do + it 'flushes spans as they finish' do + trace_op.measure('grandparent') do + trace_op.measure('parent') do + # Do something end - end - it 'flushes a trace with single sampled spans' do - expect(trace_op.finished?).to be true - - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(1).items - expect(trace.spans.map(&:name)).to include('parent') - expect(trace.send(:root_span_id)).to be nil - - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) - - # Verify that final flush is empty - expect(trace_op.flush!.spans).to have(0).items + # Partial flush + flush! end - it 'does not yield duplicate spans' do - expect(trace_op.flush!.spans).to have(1).items - expect(trace_op.flush!.spans).to have(0).items - end - end + # Verify partial flush + is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) + expect(trace.spans).to have(1).items + expect(trace.spans.map(&:name)).to include('parent') + expect(trace.send(:root_span_id)).to be nil - context 'is partially finished' do - it 'flushes spans as they finish' do - trace_op.measure('grandparent') do - trace_op.measure('parent', tags: { '_dd.span_sampling.mechanism' => 8 }) do - # Do something - end - - # Partial flush - flush! - end + expect(trace).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) - # Verify partial flush - is_expected.to be_a_kind_of(Datadog::Tracing::TraceSegment) - expect(trace.spans).to have(1).items - expect(trace.spans.map(&:name)).to include('parent') - expect(trace.send(:root_span_id)).to be nil + # There should be finished spans pending + expect(trace_op.finished?).to be true + expect(trace_op.finished_span_count).to eq(1) - expect(trace).to have_attributes( - agent_sample_rate: agent_sample_rate, - hostname: hostname, - id: trace_op.id, - lang: Datadog::Core::Environment::Identity.lang, - name: name, - origin: origin, - process_id: Datadog::Core::Environment::Identity.pid, - rate_limiter_rate: rate_limiter_rate, - resource: resource, - rule_sample_rate: rule_sample_rate, - runtime_id: Datadog::Core::Environment::Identity.id, - sample_rate: sample_rate, - sampling_priority: sampling_priority, - service: service - ) + # Verify final flush + final_flush = trace_op.flush! + expect(final_flush.spans).to have(1).items + expect(final_flush.spans.map(&:name)).to include('grandparent') + expect(final_flush.send(:root_span_id)).to be_a_kind_of(Integer) - # There should be finished spans pending - expect(trace_op.finished?).to be true - expect(trace_op.finished_span_count).to eq(1) + expect(final_flush).to have_attributes( + agent_sample_rate: agent_sample_rate, + hostname: hostname, + id: trace_op.id, + lang: Datadog::Core::Environment::Identity.lang, + name: name, + origin: origin, + process_id: Datadog::Core::Environment::Identity.pid, + rate_limiter_rate: rate_limiter_rate, + resource: resource, + rule_sample_rate: rule_sample_rate, + runtime_id: Datadog::Core::Environment::Identity.id, + sample_rate: sample_rate, + sampling_priority: sampling_priority, + service: service + ) - # Verify that final flush is empty - expect(trace_op.flush!.spans).to have(0).items - end + # Make sure its actually empty + expect(trace_op.flush!.spans).to have(0).items end end end @@ -2325,8 +2235,6 @@ def span end describe 'integration tests' do - include_context 'trace attributes' - context 'service_entry attributes' do context 'when service not given' do it do From 8f238ee01ed5f3ce3ff99af097fce5e60825b5bd Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 29 Jul 2022 13:41:30 -0700 Subject: [PATCH 0329/2133] Sorbet --- lib/datadog/tracing/flush.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/datadog/tracing/flush.rb b/lib/datadog/tracing/flush.rb index 3e80c32f24a..c9658b4eb8d 100644 --- a/lib/datadog/tracing/flush.rb +++ b/lib/datadog/tracing/flush.rb @@ -9,6 +9,8 @@ module Flush # Only finished spans are consumed. Any spans consumed are # removed from +trace_op+ as a side effect. Unfinished spans are # unaffected. + # + # @abstract class Base # Consumes and returns a {TraceSegment} to be flushed, from # the provided {TraceSegment}. @@ -25,6 +27,12 @@ def consume!(trace_op) get_trace(trace_op) end + # Should we consume spans from the +trace_op+? + # @abstract + def flush?(trace_op) + raise NotImplementedError + end + protected # Consumes all finished spans from trace. From f6813a1e36fd3fe1d420980eecca8e546fde34c8 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 29 Jul 2022 14:53:53 -0700 Subject: [PATCH 0330/2133] active_support: support disabling integration --- .../active_support/cache/instrumentation.rb | 10 +++++ .../tracing/contrib/rails/cache_spec.rb | 45 ++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb index 6ce32fccb85..6493933a728 100644 --- a/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +++ b/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb @@ -15,6 +15,8 @@ module Instrumentation module_function def start_trace_cache(payload) + return unless enabled? + # In most of the cases Rails ``fetch()`` and ``read()`` calls are nested. # This check ensures that two reads are not nested since they don't provide # interesting details. @@ -49,6 +51,8 @@ def start_trace_cache(payload) end def finish_trace_cache(payload) + return unless enabled? + # retrieve the tracing context and continue the trace tracing_context = payload.fetch(:tracing_context) span = tracing_context[:dd_cache_span] @@ -74,6 +78,8 @@ def finish_trace_cache(payload) end def finish_trace_cache_multi(payload) + return unless enabled? + # retrieve the tracing context and continue the trace tracing_context = payload.fetch(:tracing_context) span = tracing_context[:dd_cache_span] @@ -99,6 +105,10 @@ def finish_trace_cache_multi(payload) Datadog.logger.debug(e.message) end + def enabled? + Tracing.enabled? && Datadog.configuration.tracing[:active_support][:enabled] + end + # Defines instrumentation for ActiveSupport cache reading module Read def read(*args, &block) diff --git a/spec/datadog/tracing/contrib/rails/cache_spec.rb b/spec/datadog/tracing/contrib/rails/cache_spec.rb index 2be1ee8102c..725f1bde83f 100644 --- a/spec/datadog/tracing/contrib/rails/cache_spec.rb +++ b/spec/datadog/tracing/contrib/rails/cache_spec.rb @@ -26,11 +26,38 @@ let(:key) { 'custom-key' } let(:multi_keys) { %w[custom-key-1 custom-key-2 custom-key-3] } + shared_examples 'a no-op when instrumentation is disabled' do + context 'disabled at integration level' do + before { Datadog.configuration.tracing[:active_support].enabled = false } + after { Datadog.configuration.tracing[:active_support].reset! } + + it 'does not instrument' do + expect { subject }.to_not change { fetch_spans } + end + end + + context 'disabled at tracer level' do + before do + Datadog.configure do |c| + c.tracing.enabled = false + end + end + + after { Datadog.configuration.tracing.reset! } + + it 'does not instrument' do + expect { subject }.to_not change { fetch_spans } + end + end + end + describe '#read' do subject(:read) { cache.read(key) } before { cache.write(key, 50) } + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { read } @@ -71,6 +98,8 @@ before { multi_keys.each { |key| cache.write(key, 50 + key[-1].to_i) } } + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { read_multi } @@ -109,6 +138,8 @@ describe '#write' do subject(:write) { cache.write(key, 50) } + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { write } end @@ -155,6 +186,8 @@ subject(:write_multi) { cache.write_multi(Hash[multi_keys.zip(values)], opt_name: :opt_value) } + it_behaves_like 'a no-op when instrumentation is disabled' + context 'when the method is defined' do before do unless ::ActiveSupport::Cache::Store.public_method_defined?(:write_multi) @@ -223,11 +256,15 @@ end describe '#delete' do - subject!(:delete) { cache.delete(key) } + subject(:delete) { cache.delete(key) } - it_behaves_like 'measured span for integration', false + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do + before { delete } + end it do + delete expect(span.name).to eq('rails.cache') expect(span.span_type).to eq('cache') expect(span.resource).to eq('DELETE') @@ -247,6 +284,8 @@ describe '#fetch' do subject(:fetch) { cache.fetch(key) { 'default' } } + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { fetch } # Choose either GET or SET span @@ -282,6 +321,8 @@ describe '#fetch_multi' do subject(:fetch_multi) { cache.fetch_multi(*multi_keys, expires_in: 42) { |key| 50 + key[-1].to_i } } + it_behaves_like 'a no-op when instrumentation is disabled' + context 'when the method is defined' do before do unless ::ActiveSupport::Cache::Store.public_method_defined?(:fetch_multi) From e8e2860812e54064ec17848cdbb2dd5a69ba6cfe Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 29 Jul 2022 15:01:08 -0700 Subject: [PATCH 0331/2133] Fix lint issues --- spec/datadog/tracing/contrib/rails/cache_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/tracing/contrib/rails/cache_spec.rb b/spec/datadog/tracing/contrib/rails/cache_spec.rb index 725f1bde83f..de8f37293cf 100644 --- a/spec/datadog/tracing/contrib/rails/cache_spec.rb +++ b/spec/datadog/tracing/contrib/rails/cache_spec.rb @@ -32,7 +32,7 @@ after { Datadog.configuration.tracing[:active_support].reset! } it 'does not instrument' do - expect { subject }.to_not change { fetch_spans } + expect { subject }.to_not(change { fetch_spans }) end end @@ -46,7 +46,7 @@ after { Datadog.configuration.tracing.reset! } it 'does not instrument' do - expect { subject }.to_not change { fetch_spans } + expect { subject }.to_not(change { fetch_spans }) end end end From 1c953fae4b7f0961ebd9f4e0d86ee6d0d1bba234 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 1 Aug 2022 09:53:21 +0100 Subject: [PATCH 0332/2133] Add 3rdparty gem dependencies to LICENSE-3rdparty.csv file As per Datadog policy, as discussed with @jeremy-lq. --- LICENSE-3rdparty.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index d67e544755e..4dfbe99c24e 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -2,3 +2,5 @@ Component,Origin,License,Copyright lib/datadog/core/vendor/multipart-post,https://github.com/socketry/multipart-post,MIT,"Copyright (c) 2007-2013 Nick Sieger." lib/datadog/tracing/contrib/active_record/vendor,https://github.com/rails/rails/,MIT,"Copyright (c) 2005-2018 David Heinemeier Hansson" ext/ddtrace_profiling_native_extension/private_vm_api_access,https://github.com/ruby/ruby,BSD-2-Clause,"Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved." +msgpack,https://rubygems.org/gems/msgpack,Apache-2.0,"Copyright (c) 2008-2015 Sadayuki Furuhashi" +debase-ruby_core_source,https://rubygems.org/gems/debase-ruby_core_source,MIT for gem and BSD-2-Clause for Ruby sources,"Copyright (c) 2012 Gabriel Horner. Files from Ruby sources are Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved." From 3b52b6e7f76fc53ccc1c947c6a0af54080acdc9c Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 1 Aug 2022 16:59:43 +0100 Subject: [PATCH 0333/2133] Prepare `CpuAndWallTime` collector to be called by the upcoming worker class In my original plans, I was thinking of having the time-based trigger sampling behavior live in the `CpuAndWallTime` collector, but as the collector has quite a bit of other responsibilities, I decided to instead have that behavior as a separate class, called `CpuAndWallTimeWorker`. To be able to trigger sampling from that class, I've exposed that function to other components in the project, and I've also added a helper function that can be used in its constructor to ensure it got a correctly-built `CpuAndWallTime` collector (the enforce function). --- .../collectors_cpu_and_wall_time.c | 19 +++++++++++++++---- .../collectors_cpu_and_wall_time.h | 6 ++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index d1f2ffdedc6..8d43f66149b 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -5,6 +5,7 @@ #include "libdatadog_helpers.h" #include "private_vm_api_access.h" #include "stack_recorder.h" +#include "collectors_cpu_and_wall_time.h" // Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class @@ -43,7 +44,6 @@ static int hash_map_per_thread_context_free_values(st_data_t _thread, st_data_t static VALUE _native_new(VALUE klass); static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames); static VALUE _native_sample(VALUE self, VALUE collector_instance); -static void sample(VALUE collector_instance); static VALUE _native_thread_list(VALUE self); static struct per_thread_context *get_or_create_context_for(VALUE thread, struct cpu_and_wall_time_collector_state *state); static void initialize_context(VALUE thread, struct per_thread_context *thread_context); @@ -167,13 +167,17 @@ static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE collector_inst // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. // It SHOULD NOT be used for other purposes. static VALUE _native_sample(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) { - sample(collector_instance); + cpu_and_wall_time_collector_sample(collector_instance); return Qtrue; } -static void sample(VALUE collector_instance) { +// This function gets called from the Collectors::CpuAndWallTimeWorker to trigger the actual sampling. +// +// Assumption 1: This function is called in a thread that is holding the Global VM Lock. Caller is responsible for enforcing this. +// Assumption 2: This function is allowed to raise exceptions. Caller is responsible for handling them, if needed. +VALUE cpu_and_wall_time_collector_sample(VALUE self_instance) { struct cpu_and_wall_time_collector_state *state; - TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); + TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); VALUE threads = ddtrace_thread_list(); long current_wall_time_ns = wall_time_now_ns(); @@ -224,6 +228,9 @@ static void sample(VALUE collector_instance) { // TODO: This seems somewhat overkill and inefficient to do often; right now we just doing every few samples // but there's probably a better way to do this if we actually track when threads finish if (state->sample_count % 100 == 0) remove_context_for_dead_threads(state); + + // Return a VALUE to make it easier to call this function from Ruby APIs that expect a return value (such as rb_rescue2) + return Qnil; } // This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. @@ -368,3 +375,7 @@ static long thread_id_for(VALUE thread) { // record the thread_id (but samples will still be collected). return FIXNUM_P(object_id) ? FIX2LONG(object_id) : -1; } + +void enforce_cpu_and_wall_time_collector_instance(VALUE object) { + Check_TypedStruct(object, &cpu_and_wall_time_collector_typed_data); +} diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h new file mode 100644 index 00000000000..7f700848059 --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +VALUE cpu_and_wall_time_collector_sample(VALUE self_instance); +void enforce_cpu_and_wall_time_collector_instance(VALUE object); From e75974cede25866984cc1192e64a2536b7670496 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 1 Aug 2022 17:03:02 +0100 Subject: [PATCH 0334/2133] Add function header for `ruby_thread_has_gvl_p` As documented in the comment, this function is actually callable from Ruby extensions (such as the profiling native extension) but is not present on any of the publicly-available Ruby headers; thus, we're adding it to our `ruby_helpers.h` file. This function will be used in the upcoming `CpuAndWallTimeWorker` class, which I decided to separate into a follow-up branch/PR. --- ext/ddtrace_profiling_native_extension/ruby_helpers.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/ddtrace_profiling_native_extension/ruby_helpers.h index b83eda96bd7..85e1be218f0 100644 --- a/ext/ddtrace_profiling_native_extension/ruby_helpers.h +++ b/ext/ddtrace_profiling_native_extension/ruby_helpers.h @@ -57,3 +57,9 @@ NORETURN(void raise_unexpected_type( int line, const char* function_name )); + +// This API is exported as a public symbol by the VM BUT the function header is not defined in any public header, so we +// repeat it here to be able to use in our code. +// +// Queries if the current thread is the owner of the global VM lock. +int ruby_thread_has_gvl_p(void); From d451260a0087111320076f9d52ebc360cbe2c985 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 1 Aug 2022 17:06:32 +0100 Subject: [PATCH 0335/2133] Small improvements to profiling component documentation --- docs/ProfilingDevelopment.md | 11 ++++++++--- .../collectors_cpu_and_wall_time.c | 5 ++++- lib/datadog/profiling/collectors/cpu_and_wall_time.rb | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index f8005a0b156..c9fd3766dfc 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -6,11 +6,18 @@ For a more practical view of getting started with development of `ddtrace`, see ## Profiling components high-level view +Some of the profiling components referenced below are implemented using C code. As much as possible, that C code is still +assigned to Ruby classes and Ruby methods, and the Ruby classes are still created in `.rb` files. + Components below live inside <../lib/datadog/profiling>: * (Deprecated) `Collectors::OldStack`: Collects stack trace samples from Ruby threads for both CPU-time (if available) and wall-clock. Runs on its own background thread. * `Collectors::CodeProvenance`: Collects library metadata to power grouping and categorization of stack traces (e.g. to help distinguish user code, from libraries, from the standard library, etc). +* `Collectors::CpuAndWallTime`: Collects samples of living Ruby threads, recording elapsed CPU and Wall-clock time, and +tagging them with thread id and thread name. Relies on the `Collectors::Stack` for the actual stack sampling. +* `Collectors::Stack`: Used to gather a stack trace from a given Ruby thread. Stores its output on a `StackRecorder`. + * (Deprecated) `Encoding::Profile::Protobuf`: Encodes gathered data into the pprof format. * (Deprecated) `Events::Stack`, `Events::StackSample`: Entity classes used to represent stacks. * `Ext::Forking`: Monkey patches `Kernel#fork`, adding a `Kernel#at_fork` callback mechanism which is used to restore @@ -22,15 +29,13 @@ Components below live inside <../lib/datadog/profiling>: * (Deprecated) `TraceIdentifiers::*`: Used to retrieve trace id and span id from tracers, to be used to connect traces to profiles. * (Deprecated) `BacktraceLocation`: Entity class used to represent an entry in a stack trace. * (Deprecated) `Buffer`: Bounded buffer used to store profiling events. +* (Deprecated) `Event` * `Flush`: Entity class used to represent the payload to be reported for a given profile. * `Profiler`: Profiling entry point, which coordinates collectors and a scheduler. * (Deprecated) `OldRecorder`: Stores profiling events gathered by the `Collector::OldStack`. (To be removed after migration to libddprof aggregation) * `Exporter`: Gathers data from `OldRecorder` and `Collectors::CodeProvenance` to be reported as a profile. * `Scheduler`: Periodically (every 1 minute) takes data from the `Exporter` and pushes them to the configured transport. Runs on its own background thread. -* `Collectors::CpuAndWallTime`: TODO -* `Collectors::Stack`: Used to gather a stack trace from a given Ruby thread. Used to gather a stack trace from a given Ruby thread. - Stores its output on a `StackRecorder`. * `StackRecorder`: Stores stack samples in a native libdatadog data structure and exposes Ruby-level serialization APIs. * `TagBuilder`: Builds a hash of default plus user tags to be included in a profile diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 8d43f66149b..7a3e14182bf 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -7,8 +7,11 @@ #include "stack_recorder.h" #include "collectors_cpu_and_wall_time.h" -// Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. +// Used to periodically sample threads, recording elapsed CPU-time and Wall-time between samples. +// // This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTime class +// +// Triggering of this component (e.g. deciding when to take a sample) is implemented in Collectors::CpuAndWallTimeWorker. #define INVALID_TIME -1 #define THREAD_ID_LIMIT_CHARS 20 diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index ac3a827e35c..54f806a9cef 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -3,8 +3,11 @@ module Datadog module Profiling module Collectors - # Used to periodically (time-based) sample threads, recording elapsed CPU-time and Wall-time between samples. + # Used to periodically sample threads, recording elapsed CPU-time and Wall-time between samples. + # Triggering of this component (e.g. deciding when to take a sample) is implemented in + # Collectors::CpuAndWallTimeWorker. # The stack collection itself is handled using the Datadog::Profiling::Collectors::Stack. + # Almost all of this class is implemented as native code. # # Methods prefixed with _native_ are implemented in `collectors_cpu_and_wall_time.c` class CpuAndWallTime From 1e8f80eba7ed042ced8647b0b77d37042d38f017 Mon Sep 17 00:00:00 2001 From: marocchino Date: Tue, 2 Aug 2022 12:54:38 +0900 Subject: [PATCH 0336/2133] Update graphql related docs Description came from: https://graphql-ruby.org/queries/tracing.html I make list from this code: https://github.com/DataDog/dd-trace-rb/blob/v1.2.0/lib/datadog/tracing/contrib/graphql/patcher.rb#L30-L32 --- docs/GettingStarted.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 31e58789bef..c36cb688cae 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1056,7 +1056,7 @@ To activate your integration, use the `Datadog.configure` method: ```ruby # Inside Rails initializer or equivalent Datadog.configure do |c| - c.tracing.instrument :graphql, schemas: [YourSchema], options + c.tracing.instrument :graphql, schemas: [YourSchema], **options end # Then run a GraphQL query @@ -1068,6 +1068,9 @@ The `use :graphql` method accepts the following parameters. Additional options c | Key | Description | Default | | --- | ----------- | ------- | | `schemas` | Required. Array of `GraphQL::Schema` objects which to trace. Tracing will be added to all the schemas listed, using the options provided to this configuration. If you do not provide any, then tracing will not be activated. | `[]` | +| `service_name` | Service name used for graphql instrumentation | `'ruby-graphql'` | +| `analytics_enabled` | Enable analytics for spans. `true` for on, `nil` to defer to Datadog global setting, `false` for off. | `false` | +| `analytics_sample_rate` | Rate which tracing data should be sampled for Datadog analytics. Must be a float between `0` and `1.0`. | `1.0` | **Manually configuring GraphQL schemas** From 3838a1ed143b3ad4fea92f8a244f7b5758978e27 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Tue, 2 Aug 2022 09:52:16 +0200 Subject: [PATCH 0337/2133] Check respond_to?:fetch_multi --- spec/datadog/tracing/contrib/rails/cache_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/datadog/tracing/contrib/rails/cache_spec.rb b/spec/datadog/tracing/contrib/rails/cache_spec.rb index de8f37293cf..6af75885b76 100644 --- a/spec/datadog/tracing/contrib/rails/cache_spec.rb +++ b/spec/datadog/tracing/contrib/rails/cache_spec.rb @@ -186,8 +186,6 @@ subject(:write_multi) { cache.write_multi(Hash[multi_keys.zip(values)], opt_name: :opt_value) } - it_behaves_like 'a no-op when instrumentation is disabled' - context 'when the method is defined' do before do unless ::ActiveSupport::Cache::Store.public_method_defined?(:write_multi) @@ -195,6 +193,8 @@ end end + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { write_multi } end @@ -321,8 +321,6 @@ describe '#fetch_multi' do subject(:fetch_multi) { cache.fetch_multi(*multi_keys, expires_in: 42) { |key| 50 + key[-1].to_i } } - it_behaves_like 'a no-op when instrumentation is disabled' - context 'when the method is defined' do before do unless ::ActiveSupport::Cache::Store.public_method_defined?(:fetch_multi) @@ -330,6 +328,8 @@ end end + it_behaves_like 'a no-op when instrumentation is disabled' + it_behaves_like 'measured span for integration', false do before { fetch_multi } # Choose either GET or SET span From aa5c8d56841659df121cb50c1d98628a47da58c9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 10:16:38 +0100 Subject: [PATCH 0338/2133] RFC: Refactor how native extension testing methods are exposed This change follows from [this discussion thread](https://github.com/DataDog/dd-trace-rb/pull/2181#discussion_r929383004) on improving how testing-only methods are exposed from the native extension. Here's what I came up with: * All methods exposed only for testing are scoped inside `Testing` modules; e.g. testing methods for `StackRecorder` are inside `StackRecorder::Testing` * Removed the "middlemen" methods on the classes themselves. They existed only for documentation of the existence and objective of those methods, but now that they are scoped under `Testing` the "middlemen" methods seem less interesting to have. * Changed any specs using those methods to directly call the native methods in the `Testing` modules. * Still kept the `_native_` prefix for all native methods that get exposed to Ruby. I'm open to discussing this, but I really like being extremely explicit on when the Ruby/C boundary is being crossed. This doesn't change anything for production code, it only shuffles test code around. I'm opening it as an RFC to make it clear this is an option that seems nice but I'm open to changing it further. --- .../collectors_cpu_and_wall_time.c | 13 ++-- .../collectors_stack.c | 4 +- .../stack_recorder.c | 8 ++- .../profiling/collectors/cpu_and_wall_time.rb | 18 ----- lib/datadog/profiling/collectors/stack.rb | 10 +-- lib/datadog/profiling/stack_recorder.rb | 18 ----- .../collectors/cpu_and_wall_time_spec.rb | 66 +++++++++++-------- .../profiling/collectors/stack_spec.rb | 12 ++-- spec/datadog/profiling/stack_recorder_spec.rb | 33 +++++++--- 9 files changed, 89 insertions(+), 93 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index d1f2ffdedc6..9bc3c4c5c99 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -61,6 +61,8 @@ static long thread_id_for(VALUE thread); void collectors_cpu_and_wall_time_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); VALUE collectors_cpu_and_wall_time_class = rb_define_class_under(collectors_module, "CpuAndWallTime", rb_cObject); + // Hosts methods used for testing the native code using RSpec + VALUE testing_module = rb_define_module_under(collectors_cpu_and_wall_time_class, "Testing"); // Instances of the CpuAndWallTime class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. @@ -73,10 +75,10 @@ void collectors_cpu_and_wall_time_init(VALUE profiling_module) { rb_define_alloc_func(collectors_cpu_and_wall_time_class, _native_new); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_initialize", _native_initialize, 3); - rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_sample", _native_sample, 1); - rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_thread_list", _native_thread_list, 0); rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_inspect", _native_inspect, 1); - rb_define_singleton_method(collectors_cpu_and_wall_time_class, "_native_per_thread_context", _native_per_thread_context, 1); + rb_define_singleton_method(testing_module, "_native_sample", _native_sample, 1); + rb_define_singleton_method(testing_module, "_native_thread_list", _native_thread_list, 0); + rb_define_singleton_method(testing_module, "_native_per_thread_context", _native_per_thread_context, 1); } // This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_collector_state @@ -313,7 +315,10 @@ static int remove_if_dead_thread(st_data_t key_thread, st_data_t value_context, return ST_DELETE; } -// Returns the whole contents of the per_thread_context structs being tracked, for debugging/testing +// This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. +// It SHOULD NOT be used for other purposes. +// +// Returns the whole contents of the per_thread_context structs being tracked. static VALUE _native_per_thread_context(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/ddtrace_profiling_native_extension/collectors_stack.c index 94478f93ed4..0420ef60e4b 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_stack.c +++ b/ext/ddtrace_profiling_native_extension/collectors_stack.c @@ -33,8 +33,10 @@ static void record_placeholder_stack_in_native_code(VALUE recorder_instance, ddp void collectors_stack_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); VALUE collectors_stack_class = rb_define_class_under(collectors_module, "Stack", rb_cObject); + // Hosts methods used for testing the native code using RSpec + VALUE testing_module = rb_define_module_under(collectors_stack_class, "Testing"); - rb_define_singleton_method(collectors_stack_class, "_native_sample", _native_sample, 5); + rb_define_singleton_method(testing_module, "_native_sample", _native_sample, 5); missing_string = rb_str_new2(""); rb_global_variable(&missing_string); diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index d1058a77838..0c2bc1e143d 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -176,6 +176,8 @@ static VALUE test_slot_mutex_state(VALUE recorder_instance, int slot); void stack_recorder_init(VALUE profiling_module) { stack_recorder_class = rb_define_class_under(profiling_module, "StackRecorder", rb_cObject); + // Hosts methods used for testing the native code using RSpec + VALUE testing_module = rb_define_module_under(stack_recorder_class, "Testing"); // Instances of the StackRecorder class are "TypedData" objects. // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. @@ -188,9 +190,9 @@ void stack_recorder_init(VALUE profiling_module) { rb_define_alloc_func(stack_recorder_class, _native_new); rb_define_singleton_method(stack_recorder_class, "_native_serialize", _native_serialize, 1); - rb_define_singleton_method(stack_recorder_class, "_native_active_slot", _native_active_slot, 1); - rb_define_singleton_method(stack_recorder_class, "_native_slot_one_mutex_locked?", _native_is_slot_one_mutex_locked, 1); - rb_define_singleton_method(stack_recorder_class, "_native_slot_two_mutex_locked?", _native_is_slot_two_mutex_locked, 1); + rb_define_singleton_method(testing_module, "_native_active_slot", _native_active_slot, 1); + rb_define_singleton_method(testing_module, "_native_slot_one_mutex_locked?", _native_is_slot_one_mutex_locked, 1); + rb_define_singleton_method(testing_module, "_native_slot_two_mutex_locked?", _native_is_slot_two_mutex_locked, 1); ok_symbol = ID2SYM(rb_intern_const("ok")); error_symbol = ID2SYM(rb_intern_const("error")); diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb index ac3a827e35c..975f210dbe8 100644 --- a/lib/datadog/profiling/collectors/cpu_and_wall_time.rb +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time.rb @@ -12,24 +12,6 @@ def initialize(recorder:, max_frames:) self.class._native_initialize(self, recorder, max_frames) end - # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def sample - self.class._native_sample(self) - end - - # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def thread_list - self.class._native_thread_list - end - - # This method exists only to enable testing Datadog::Profiling::Collectors::CpuAndWallTime behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def per_thread_context - self.class._native_per_thread_context(self) - end - def inspect # Compose Ruby's default inspect with our custom inspect for the native parts result = super() diff --git a/lib/datadog/profiling/collectors/stack.rb b/lib/datadog/profiling/collectors/stack.rb index a1a1ed00feb..680cba89170 100644 --- a/lib/datadog/profiling/collectors/stack.rb +++ b/lib/datadog/profiling/collectors/stack.rb @@ -4,15 +4,9 @@ module Datadog module Profiling module Collectors # Used to gather a stack trace from a given Ruby thread. Stores its output on a `StackRecorder`. - # Almost all of this class is implemented as native code. # - # Methods prefixed with _native_ are implemented in `collectors_stack.c` - class Stack - # This method exists only to enable testing Datadog::Profiling::Collectors::Stack behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames: 400) - self.class._native_sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames) - end + # This class is not empty; all of this class is implemented as native code. + class Stack # rubocop:disable Lint/EmptyClass end end end diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index ef3f66e1231..ea8eac4e83d 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -38,24 +38,6 @@ def serialize def self.ruby_time_from(timespec_seconds, timespec_nanoseconds) Time.at(0).utc + timespec_seconds + (timespec_nanoseconds.to_r / 1_000_000_000) end - - # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def active_slot - self.class._native_active_slot(self) - end - - # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def slot_one_mutex_locked? - self.class._native_slot_one_mutex_locked?(self) - end - - # This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec. - # It SHOULD NOT be used for other purposes. - def slot_two_mutex_locked? - self.class._native_slot_two_mutex_locked?(self) - end end end end diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb index 9b6087a1e8b..aa341b9e7c5 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_spec.rb @@ -42,6 +42,18 @@ end end + def sample + described_class::Testing._native_sample(cpu_and_wall_time_collector) + end + + def thread_list + described_class::Testing._native_thread_list + end + + def per_thread_context + described_class::Testing._native_per_thread_context(cpu_and_wall_time_collector) + end + describe '#sample' do let(:pprof_result) do serialization_result = recorder.serialize @@ -54,14 +66,14 @@ it 'samples all threads' do all_threads = Thread.list - cpu_and_wall_time_collector.sample + sample expect(Thread.list).to eq(all_threads), 'Threads finished during this spec, causing flakiness!' expect(samples.size).to be all_threads.size end it 'tags the samples with the object ids of the Threads they belong to' do - cpu_and_wall_time_collector.sample + sample expect(samples.map { |it| it.fetch(:labels).fetch(:'thread id') }) .to include(*[Thread.main, t1, t2, t3].map(&:object_id).map(&:to_s)) @@ -74,7 +86,7 @@ t2.name = nil t3.name = 'thread t3' - cpu_and_wall_time_collector.sample + sample t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } t2_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t2.object_id.to_s } @@ -92,13 +104,13 @@ end it 'includes the wall time elapsed between samples' do - cpu_and_wall_time_collector.sample + sample wall_time_at_first_sample = - cpu_and_wall_time_collector.per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) + per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) - cpu_and_wall_time_collector.sample + sample wall_time_at_second_sample = - cpu_and_wall_time_collector.per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) + per_thread_context.fetch(t1).fetch(:wall_time_at_previous_sample_ns) t1_samples = samples.select { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } wall_time = t1_samples.first.fetch(:values).fetch(:'wall-time') @@ -110,7 +122,7 @@ end it 'tags samples with how many times they were seen' do - 5.times { cpu_and_wall_time_collector.sample } + 5.times { sample } t1_sample = samples.find { |it| it.fetch(:labels).fetch(:'thread id') == t1.object_id.to_s } @@ -124,7 +136,7 @@ end it 'sets the cpu-time on every sample to zero' do - 5.times { cpu_and_wall_time_collector.sample } + 5.times { sample } expect(samples).to all include(values: include(:'cpu-time' => 0)) end @@ -137,7 +149,7 @@ it 'includes the cpu-time for the samples' do rspec_thread_spent_time = Datadog::Core::Utils::Time.measure(:nanosecond) do - 5.times { cpu_and_wall_time_collector.sample } + 5.times { sample } samples # to trigger serialization end @@ -160,36 +172,36 @@ describe '#thread_list' do it "returns the same as Ruby's Thread.list" do - expect(cpu_and_wall_time_collector.thread_list).to eq Thread.list + expect(thread_list).to eq Thread.list end end describe '#per_thread_context' do context 'before sampling' do it do - expect(cpu_and_wall_time_collector.per_thread_context).to be_empty + expect(per_thread_context).to be_empty end end context 'after sampling' do before do @wall_time_before_sample_ns = Datadog::Core::Utils::Time.get_time(:nanosecond) - cpu_and_wall_time_collector.sample + sample @wall_time_after_sample_ns = Datadog::Core::Utils::Time.get_time(:nanosecond) end it 'contains all the sampled threads' do - expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t2, t3) + expect(per_thread_context.keys).to include(Thread.main, t1, t2, t3) end it 'contains the thread ids (object_ids) of all sampled threads' do - cpu_and_wall_time_collector.per_thread_context.each do |thread, context| + per_thread_context.each do |thread, context| expect(context.fetch(:thread_id)).to eq thread.object_id.to_s end end it 'sets the wall_time_at_previous_sample_ns to the current wall clock value' do - expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + expect(per_thread_context.values).to all( include(wall_time_at_previous_sample_ns: be_between(@wall_time_before_sample_ns, @wall_time_after_sample_ns)) ) end @@ -201,13 +213,13 @@ end it 'sets the cpu_time_at_previous_sample_ns to zero' do - expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + expect(per_thread_context.values).to all( include(cpu_time_at_previous_sample_ns: 0) ) end it 'marks the thread_cpu_time_ids as not valid' do - expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + expect(per_thread_context.values).to all( include(thread_cpu_time_id_valid?: false) ) end @@ -221,7 +233,7 @@ it 'sets the cpu_time_at_previous_sample_ns to the current cpu clock value' do # It's somewhat difficult to validate the actual value since this is an operating system-specific value # which should only be assessed in relation to other values for the same thread, not in absolute - expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + expect(per_thread_context.values).to all( include(cpu_time_at_previous_sample_ns: not_be(0)) ) end @@ -230,10 +242,10 @@ sample_values = [] 3.times do - cpu_and_wall_time_collector.sample + sample sample_values << - cpu_and_wall_time_collector.per_thread_context[Thread.main].fetch(:cpu_time_at_previous_sample_ns) + per_thread_context[Thread.main].fetch(:cpu_time_at_previous_sample_ns) end expect(sample_values.uniq.size).to be(3), 'Every sample is expected to have a differ cpu time value' @@ -241,7 +253,7 @@ end it 'marks the thread_cpu_time_ids as valid' do - expect(cpu_and_wall_time_collector.per_thread_context.values).to all( + expect(per_thread_context.values).to all( include(thread_cpu_time_id_valid?: true) ) end @@ -251,10 +263,10 @@ context 'after sampling multiple times' do it 'contains only the threads still alive' do - cpu_and_wall_time_collector.sample + sample # All alive threads still in there - expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t2, t3) + expect(per_thread_context.keys).to include(Thread.main, t1, t2, t3) # Get rid of t2 t2.kill @@ -262,10 +274,10 @@ # Currently the clean-up gets triggered only every 100th sample, so we need to do this to trigger the # clean-up. This can probably be improved (see TODO on the actual implementation) - 100.times { cpu_and_wall_time_collector.sample } + 100.times { sample } - expect(cpu_and_wall_time_collector.per_thread_context.keys).to_not include(t2) - expect(cpu_and_wall_time_collector.per_thread_context.keys).to include(Thread.main, t1, t3) + expect(per_thread_context.keys).to_not include(t2) + expect(per_thread_context.keys).to include(Thread.main, t1, t3) end end end diff --git a/spec/datadog/profiling/collectors/stack_spec.rb b/spec/datadog/profiling/collectors/stack_spec.rb index 452b9fd5820..1c5c6bac3d0 100644 --- a/spec/datadog/profiling/collectors/stack_spec.rb +++ b/spec/datadog/profiling/collectors/stack_spec.rb @@ -19,6 +19,10 @@ let(:reference_stack) { convert_reference_stack(raw_reference_stack) } let(:gathered_stack) { stacks.fetch(:gathered) } + def sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames: 400) + described_class::Testing._native_sample(thread, recorder_instance, metric_values_hash, labels_array, max_frames) + end + # This spec explicitly tests the main thread because an unpatched rb_profile_frames returns one more frame in the # main thread than the reference Ruby API. This is almost-surely a bug in rb_profile_frames, since the same frame # gets excluded from the reference Ruby API. @@ -311,7 +315,7 @@ def call_sleep context 'when trying to sample something which is not a thread' do it 'raises a TypeError' do expect do - collectors_stack.sample(:not_a_thread, Datadog::Profiling::StackRecorder.new, metric_values, labels) + sample(:not_a_thread, Datadog::Profiling::StackRecorder.new, metric_values, labels) end.to raise_error(TypeError) end end @@ -319,7 +323,7 @@ def call_sleep context 'when max_frames is too small' do it 'raises an ArgumentError' do expect do - collectors_stack.sample(Thread.current, Datadog::Profiling::StackRecorder.new, metric_values, labels, max_frames: 4) + sample(Thread.current, Datadog::Profiling::StackRecorder.new, metric_values, labels, max_frames: 4) end.to raise_error(ArgumentError) end end @@ -327,7 +331,7 @@ def call_sleep context 'when max_frames is too large' do it 'raises an ArgumentError' do expect do - collectors_stack.sample(Thread.current, Datadog::Profiling::StackRecorder.new, metric_values, labels, max_frames: 10_001) + sample(Thread.current, Datadog::Profiling::StackRecorder.new, metric_values, labels, max_frames: 10_001) end.to raise_error(ArgumentError) end end @@ -339,7 +343,7 @@ def convert_reference_stack(raw_reference_stack) end def sample_and_decode(thread, max_frames: 400, recorder: Datadog::Profiling::StackRecorder.new) - collectors_stack.sample(thread, recorder, metric_values, labels, max_frames: max_frames) + sample(thread, recorder, metric_values, labels, max_frames: max_frames) serialization_result = recorder.serialize raise 'Unexpected: Serialization failed' unless serialization_result diff --git a/spec/datadog/profiling/stack_recorder_spec.rb b/spec/datadog/profiling/stack_recorder_spec.rb index fca5cb4d9a2..e65be175e9d 100644 --- a/spec/datadog/profiling/stack_recorder_spec.rb +++ b/spec/datadog/profiling/stack_recorder_spec.rb @@ -11,18 +11,30 @@ # NOTE: A lot of libdatadog integration behaviors are tested in the Collectors::Stack specs, since we need actual # samples in order to observe what comes out of libdatadog + def active_slot + described_class::Testing._native_active_slot(stack_recorder) + end + + def slot_one_mutex_locked? + described_class::Testing._native_slot_one_mutex_locked?(stack_recorder) + end + + def slot_two_mutex_locked? + described_class::Testing._native_slot_two_mutex_locked?(stack_recorder) + end + describe '#initialize' do describe 'locking behavior' do it 'sets slot one as the active slot' do - expect(stack_recorder.active_slot).to be 1 + expect(active_slot).to be 1 end it 'keeps the slot one mutex unlocked' do - expect(stack_recorder.slot_one_mutex_locked?).to be false + expect(slot_one_mutex_locked?).to be false end it 'keeps the slot two mutex locked' do - expect(stack_recorder.slot_two_mutex_locked?).to be true + expect(slot_two_mutex_locked?).to be true end end end @@ -52,15 +64,15 @@ describe 'locking behavior' do context 'when slot one was the active slot' do it 'sets slot two as the active slot' do - expect { serialize }.to change { stack_recorder.active_slot }.from(1).to(2) + expect { serialize }.to change { active_slot }.from(1).to(2) end it 'locks the slot one mutex and keeps it locked' do - expect { serialize }.to change { stack_recorder.slot_one_mutex_locked? }.from(false).to(true) + expect { serialize }.to change { slot_one_mutex_locked? }.from(false).to(true) end it 'unlocks the slot two mutex and keeps it unlocked' do - expect { serialize }.to change { stack_recorder.slot_two_mutex_locked? }.from(true).to(false) + expect { serialize }.to change { slot_two_mutex_locked? }.from(true).to(false) end end @@ -71,15 +83,15 @@ end it 'sets slot one as the active slot' do - expect { serialize }.to change { stack_recorder.active_slot }.from(2).to(1) + expect { serialize }.to change { active_slot }.from(2).to(1) end it 'unlocks the slot one mutex and keeps it unlocked' do - expect { serialize }.to change { stack_recorder.slot_one_mutex_locked? }.from(true).to(false) + expect { serialize }.to change { slot_one_mutex_locked? }.from(true).to(false) end it 'locks the slow two mutex and keeps it locked' do - expect { serialize }.to change { stack_recorder.slot_two_mutex_locked? }.from(false).to(true) + expect { serialize }.to change { slot_two_mutex_locked? }.from(false).to(true) end end end @@ -133,7 +145,8 @@ def sample_types_from(decoded_profile) let(:samples) { samples_from_pprof(encoded_pprof) } before do - collectors_stack.sample(Thread.current, stack_recorder, metric_values, labels) + Datadog::Profiling::Collectors::Stack::Testing + ._native_sample(Thread.current, stack_recorder, metric_values, labels, 400) expect(samples.size).to be 1 end From 2b498c3d951710b84ee73b090d9e1e16f78cf241 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:32:36 +0100 Subject: [PATCH 0339/2133] Extract out `agent_settings` to be used by multiple spec groups --- spec/datadog/core/configuration/components_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 3896893cc21..f75ed7fc66e 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -36,6 +36,7 @@ subject(:components) { described_class.new(settings) } let(:settings) { Datadog::Core::Configuration::Settings.new } + let(:agent_settings) { Datadog::Core::Configuration::AgentSettingsResolver.call(settings, logger: nil) } let(:profiler_setup_task) { Datadog::Profiling.supported? ? instance_double(Datadog::Profiling::Tasks::Setup) : nil } @@ -344,8 +345,6 @@ end describe '::build_tracer' do - let(:agent_settings) { Datadog::Core::Configuration::AgentSettingsResolver.call(settings, logger: nil) } - subject(:build_tracer) { described_class.build_tracer(settings, agent_settings) } context 'given an instance' do @@ -880,7 +879,6 @@ end describe '::build_profiler' do - let(:agent_settings) { Datadog::Core::Configuration::AgentSettingsResolver.call(settings, logger: nil) } let(:profiler) { build_profiler } let(:tracer) { instance_double(Datadog::Tracing::Tracer) } From 2e277325e1e4d258d7a6fc5e832d6e20d0b61abe Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:34:17 +0100 Subject: [PATCH 0340/2133] Simplify specs for profiling being disabled --- .../core/configuration/components_spec.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index f75ed7fc66e..f54a2b9ab31 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -893,10 +893,6 @@ context 'given settings' do before { skip_if_profiling_not_supported(self) } - shared_examples_for 'disabled profiler' do - it { is_expected.to be nil } - end - shared_context 'enabled profiler' do before do allow(settings.profiling) @@ -944,17 +940,19 @@ end context 'by default' do - it_behaves_like 'disabled profiler' + it 'does not build a profiler' do + is_expected.to be nil + end end context 'with :enabled false' do before do - allow(settings.profiling) - .to receive(:enabled) - .and_return(false) + allow(settings.profiling).to receive(:enabled).and_return(false) end - it_behaves_like 'disabled profiler' + it 'does not build a profiler' do + is_expected.to be nil + end end context 'with :enabled true' do From 1943e2101ccaea1de75502fa3e797a180715d7bc Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:37:46 +0100 Subject: [PATCH 0341/2133] Simplify specs for enabling the profiler --- spec/datadog/core/configuration/components_spec.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index f54a2b9ab31..bb1d7a5ce93 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -893,15 +893,6 @@ context 'given settings' do before { skip_if_profiling_not_supported(self) } - shared_context 'enabled profiler' do - before do - allow(settings.profiling) - .to receive(:enabled) - .and_return(true) - allow(profiler_setup_task).to receive(:run) - end - end - shared_examples_for 'profiler with default collectors' do subject(:stack_collector) { profiler.collectors.first } @@ -956,7 +947,10 @@ end context 'with :enabled true' do - include_context 'enabled profiler' + before do + allow(settings.profiling).to receive(:enabled).and_return(true) + allow(profiler_setup_task).to receive(:run) + end context 'by default' do it_behaves_like 'profiler with default collectors' From 18981317d5b895aa5d282cede76e2830198c601f Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:51:21 +0100 Subject: [PATCH 0342/2133] Remove assertions for things that are not controlled from components The components specs are complex enough that I don't want them to be pseudo-integration specs (e.g. that assert behavior that they don't impact). --- spec/datadog/core/configuration/components_spec.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index bb1d7a5ce93..0334d8092c6 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -899,13 +899,7 @@ it 'has a Stack collector' do expect(profiler.collectors).to have(1).item expect(profiler.collectors).to include(kind_of(Datadog::Profiling::Collectors::OldStack)) - is_expected.to have_attributes( - enabled?: true, - started?: false, - ignore_thread: nil, - max_frames: settings.profiling.advanced.max_frames, - max_time_usage_pct: 2.0 - ) + is_expected.to have_attributes(max_frames: settings.profiling.advanced.max_frames) end end @@ -914,11 +908,6 @@ it do is_expected.to be_a_kind_of(Datadog::Profiling::Scheduler) - is_expected.to have_attributes( - enabled?: true, - started?: false, - loop_base_interval: 60.0 - ) end end From ed60c0d73fe47b23646609f4b8c619976b195b88 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:52:08 +0100 Subject: [PATCH 0343/2133] Fix warning by simplifying spec --- spec/datadog/core/configuration/components_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 0334d8092c6..6a69605e44e 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -989,7 +989,7 @@ it 'initializes the exporter with a code provenance collector' do expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) - end.and_call_original + end build_profiler end @@ -1000,7 +1000,7 @@ it 'initializes the exporter with a nil code provenance collector' do expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| expect(code_provenance_collector).to be nil - end.and_call_original + end build_profiler end From d0b7b3bb1e6fbca2585b2c051b9d772bde42fa3d Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:55:05 +0100 Subject: [PATCH 0344/2133] Simplify spec for wiring up HttpTransport --- spec/datadog/core/configuration/components_spec.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 6a69605e44e..919dcd967cf 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -964,13 +964,11 @@ end it 'creates a scheduler with an HttpTransport' do - http_transport = instance_double(Datadog::Profiling::HttpTransport) - - expect(Datadog::Profiling::HttpTransport).to receive(:new).and_return(http_transport) + expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| + expect(transport).to be_a_kind_of(Datadog::Profiling::HttpTransport) + end build_profiler - - expect(profiler.scheduler.send(:transport)).to be http_transport end [true, false].each do |value| From fe43a512af5e6f303d0b5c86ae420e35a6e3e89b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 13:57:08 +0100 Subject: [PATCH 0345/2133] Inline "by default" block one level up --- .../core/configuration/components_spec.rb | 86 +++++++++---------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 919dcd967cf..772ba6a3ab6 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -941,67 +941,65 @@ allow(profiler_setup_task).to receive(:run) end - context 'by default' do - it_behaves_like 'profiler with default collectors' - it_behaves_like 'profiler with default scheduler' - it_behaves_like 'profiler with default recorder' + it_behaves_like 'profiler with default collectors' + it_behaves_like 'profiler with default scheduler' + it_behaves_like 'profiler with default recorder' - it 'runs the setup task to set up any needed extensions for profiling' do - expect(profiler_setup_task).to receive(:run) + it 'runs the setup task to set up any needed extensions for profiling' do + expect(profiler_setup_task).to receive(:run) - build_profiler - end - - it 'builds an HttpTransport with the current settings' do - expect(Datadog::Profiling::HttpTransport).to receive(:new).with( - agent_settings: agent_settings, - site: settings.site, - api_key: settings.api_key, - upload_timeout_seconds: settings.profiling.upload.timeout_seconds, - ) + build_profiler + end - build_profiler - end + it 'builds an HttpTransport with the current settings' do + expect(Datadog::Profiling::HttpTransport).to receive(:new).with( + agent_settings: agent_settings, + site: settings.site, + api_key: settings.api_key, + upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + ) - it 'creates a scheduler with an HttpTransport' do - expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| - expect(transport).to be_a_kind_of(Datadog::Profiling::HttpTransport) - end + build_profiler + end - build_profiler + it 'creates a scheduler with an HttpTransport' do + expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| + expect(transport).to be_a_kind_of(Datadog::Profiling::HttpTransport) end - [true, false].each do |value| - context "when endpoint_collection_enabled is #{value}" do - before { settings.profiling.advanced.endpoint.collection.enabled = value } + build_profiler + end - it "initializes the TraceIdentifiers::Helper with endpoint_collection_enabled: #{value}" do - expect(Datadog::Profiling::TraceIdentifiers::Helper) - .to receive(:new).with(tracer: tracer, endpoint_collection_enabled: value) + [true, false].each do |value| + context "when endpoint_collection_enabled is #{value}" do + before { settings.profiling.advanced.endpoint.collection.enabled = value } - build_profiler - end - end - end + it "initializes the TraceIdentifiers::Helper with endpoint_collection_enabled: #{value}" do + expect(Datadog::Profiling::TraceIdentifiers::Helper) + .to receive(:new).with(tracer: tracer, endpoint_collection_enabled: value) - it 'initializes the exporter with a code provenance collector' do - expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| - expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) + build_profiler end + end + end - build_profiler + it 'initializes the exporter with a code provenance collector' do + expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| + expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) end - context 'when code provenance is disabled' do - before { settings.profiling.advanced.code_provenance_enabled = false } + build_profiler + end - it 'initializes the exporter with a nil code provenance collector' do - expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| - expect(code_provenance_collector).to be nil - end + context 'when code provenance is disabled' do + before { settings.profiling.advanced.code_provenance_enabled = false } - build_profiler + it 'initializes the exporter with a nil code provenance collector' do + expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| + expect(code_provenance_collector).to be nil end + + build_profiler end end From 6dac5fe8fb593aaafee72acb1ea62fd9b053a658 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 14:00:31 +0100 Subject: [PATCH 0346/2133] Simplify tests for custom transport --- .../core/configuration/components_spec.rb | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 772ba6a3ab6..74965999fd7 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -1003,23 +1003,25 @@ end end - context 'and :transport' do - context 'is given' do - let(:transport) { double('Custom transport') } + context 'when a custom transport is provided' do + let(:custom_transport) { double('Custom transport') } - before do - allow(settings.profiling.exporter) - .to receive(:transport) - .and_return(transport) - end + before do + settings.profiling.exporter.transport = custom_transport + end - it_behaves_like 'profiler with default collectors' - it_behaves_like 'profiler with default scheduler' - it_behaves_like 'profiler with default recorder' + it 'does not initialize an HttpTransport' do + expect(Datadog::Profiling::HttpTransport).to_not receive(:new) - it 'uses the custom transport' do - expect(profiler.scheduler.send(:transport)).to be transport + build_profiler + end + + it 'sets up the scheduler to use the custom transport' do + expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| + expect(transport).to be custom_transport end + + build_profiler end end end From 2d27067e72e1a2387aa989bbf24532f66a61218b Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 14:13:52 +0100 Subject: [PATCH 0347/2133] Rewrite specs that previously were inside shared example groups --- .../core/configuration/components_spec.rb | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 74965999fd7..2a6180c4634 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -893,32 +893,6 @@ context 'given settings' do before { skip_if_profiling_not_supported(self) } - shared_examples_for 'profiler with default collectors' do - subject(:stack_collector) { profiler.collectors.first } - - it 'has a Stack collector' do - expect(profiler.collectors).to have(1).item - expect(profiler.collectors).to include(kind_of(Datadog::Profiling::Collectors::OldStack)) - is_expected.to have_attributes(max_frames: settings.profiling.advanced.max_frames) - end - end - - shared_examples_for 'profiler with default scheduler' do - subject(:scheduler) { profiler.scheduler } - - it do - is_expected.to be_a_kind_of(Datadog::Profiling::Scheduler) - end - end - - shared_examples_for 'profiler with default recorder' do - subject(:old_recorder) { profiler.scheduler.send(:exporter).send(:pprof_recorder) } - - it do - is_expected.to have_attributes(max_size: settings.profiling.advanced.max_events) - end - end - context 'by default' do it 'does not build a profiler' do is_expected.to be nil @@ -941,9 +915,32 @@ allow(profiler_setup_task).to receive(:run) end - it_behaves_like 'profiler with default collectors' - it_behaves_like 'profiler with default scheduler' - it_behaves_like 'profiler with default recorder' + it 'sets up the Profiler with the OldStack collector' do + expect(Datadog::Profiling::Profiler).to receive(:new).with( + [instance_of(Datadog::Profiling::Collectors::OldStack)], + anything, + ) + + build_profiler + end + + it 'initializes the OldStack collector with the max_frames setting' do + expect(Datadog::Profiling::Collectors::OldStack).to receive(:new).with( + instance_of(Datadog::Profiling::OldRecorder), + hash_including(max_frames: settings.profiling.advanced.max_frames), + ) + + build_profiler + end + + it 'initializes the OldRecorder with the correct event classes and max_events setting' do + expect(Datadog::Profiling::OldRecorder) + .to receive(:new) + .with([Datadog::Profiling::Events::StackSample], settings.profiling.advanced.max_events) + .and_call_original + + build_profiler + end it 'runs the setup task to set up any needed extensions for profiling' do expect(profiler_setup_task).to receive(:run) From 65f16ccab0338136854e35b331c9b33dc02e0df4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 14:15:28 +0100 Subject: [PATCH 0348/2133] Get rid of an extra context, inlining everything one level above --- .../core/configuration/components_spec.rb | 184 +++++++++--------- 1 file changed, 91 insertions(+), 93 deletions(-) diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 2a6180c4634..a65a6276af1 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -879,6 +879,8 @@ end describe '::build_profiler' do + before { skip_if_profiling_not_supported(self) } + let(:profiler) { build_profiler } let(:tracer) { instance_double(Datadog::Tracing::Tracer) } @@ -890,136 +892,132 @@ it { is_expected.to be nil } end - context 'given settings' do - before { skip_if_profiling_not_supported(self) } + context 'by default' do + it 'does not build a profiler' do + is_expected.to be nil + end + end - context 'by default' do - it 'does not build a profiler' do - is_expected.to be nil - end + context 'with :enabled false' do + before do + allow(settings.profiling).to receive(:enabled).and_return(false) end - context 'with :enabled false' do - before do - allow(settings.profiling).to receive(:enabled).and_return(false) - end + it 'does not build a profiler' do + is_expected.to be nil + end + end - it 'does not build a profiler' do - is_expected.to be nil - end + context 'with :enabled true' do + before do + allow(settings.profiling).to receive(:enabled).and_return(true) + allow(profiler_setup_task).to receive(:run) end - context 'with :enabled true' do - before do - allow(settings.profiling).to receive(:enabled).and_return(true) - allow(profiler_setup_task).to receive(:run) - end + it 'sets up the Profiler with the OldStack collector' do + expect(Datadog::Profiling::Profiler).to receive(:new).with( + [instance_of(Datadog::Profiling::Collectors::OldStack)], + anything, + ) - it 'sets up the Profiler with the OldStack collector' do - expect(Datadog::Profiling::Profiler).to receive(:new).with( - [instance_of(Datadog::Profiling::Collectors::OldStack)], - anything, - ) + build_profiler + end - build_profiler - end + it 'initializes the OldStack collector with the max_frames setting' do + expect(Datadog::Profiling::Collectors::OldStack).to receive(:new).with( + instance_of(Datadog::Profiling::OldRecorder), + hash_including(max_frames: settings.profiling.advanced.max_frames), + ) - it 'initializes the OldStack collector with the max_frames setting' do - expect(Datadog::Profiling::Collectors::OldStack).to receive(:new).with( - instance_of(Datadog::Profiling::OldRecorder), - hash_including(max_frames: settings.profiling.advanced.max_frames), - ) + build_profiler + end - build_profiler - end + it 'initializes the OldRecorder with the correct event classes and max_events setting' do + expect(Datadog::Profiling::OldRecorder) + .to receive(:new) + .with([Datadog::Profiling::Events::StackSample], settings.profiling.advanced.max_events) + .and_call_original - it 'initializes the OldRecorder with the correct event classes and max_events setting' do - expect(Datadog::Profiling::OldRecorder) - .to receive(:new) - .with([Datadog::Profiling::Events::StackSample], settings.profiling.advanced.max_events) - .and_call_original + build_profiler + end - build_profiler - end + it 'runs the setup task to set up any needed extensions for profiling' do + expect(profiler_setup_task).to receive(:run) - it 'runs the setup task to set up any needed extensions for profiling' do - expect(profiler_setup_task).to receive(:run) + build_profiler + end - build_profiler - end + it 'builds an HttpTransport with the current settings' do + expect(Datadog::Profiling::HttpTransport).to receive(:new).with( + agent_settings: agent_settings, + site: settings.site, + api_key: settings.api_key, + upload_timeout_seconds: settings.profiling.upload.timeout_seconds, + ) - it 'builds an HttpTransport with the current settings' do - expect(Datadog::Profiling::HttpTransport).to receive(:new).with( - agent_settings: agent_settings, - site: settings.site, - api_key: settings.api_key, - upload_timeout_seconds: settings.profiling.upload.timeout_seconds, - ) + build_profiler + end - build_profiler + it 'creates a scheduler with an HttpTransport' do + expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| + expect(transport).to be_a_kind_of(Datadog::Profiling::HttpTransport) end - it 'creates a scheduler with an HttpTransport' do - expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| - expect(transport).to be_a_kind_of(Datadog::Profiling::HttpTransport) - end - - build_profiler - end + build_profiler + end - [true, false].each do |value| - context "when endpoint_collection_enabled is #{value}" do - before { settings.profiling.advanced.endpoint.collection.enabled = value } + [true, false].each do |value| + context "when endpoint_collection_enabled is #{value}" do + before { settings.profiling.advanced.endpoint.collection.enabled = value } - it "initializes the TraceIdentifiers::Helper with endpoint_collection_enabled: #{value}" do - expect(Datadog::Profiling::TraceIdentifiers::Helper) - .to receive(:new).with(tracer: tracer, endpoint_collection_enabled: value) + it "initializes the TraceIdentifiers::Helper with endpoint_collection_enabled: #{value}" do + expect(Datadog::Profiling::TraceIdentifiers::Helper) + .to receive(:new).with(tracer: tracer, endpoint_collection_enabled: value) - build_profiler - end + build_profiler end end + end + + it 'initializes the exporter with a code provenance collector' do + expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| + expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) + end + + build_profiler + end + + context 'when code provenance is disabled' do + before { settings.profiling.advanced.code_provenance_enabled = false } - it 'initializes the exporter with a code provenance collector' do + it 'initializes the exporter with a nil code provenance collector' do expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| - expect(code_provenance_collector).to be_a_kind_of(Datadog::Profiling::Collectors::CodeProvenance) + expect(code_provenance_collector).to be nil end build_profiler end + end - context 'when code provenance is disabled' do - before { settings.profiling.advanced.code_provenance_enabled = false } - - it 'initializes the exporter with a nil code provenance collector' do - expect(Datadog::Profiling::Exporter).to receive(:new) do |code_provenance_collector:, **_| - expect(code_provenance_collector).to be nil - end + context 'when a custom transport is provided' do + let(:custom_transport) { double('Custom transport') } - build_profiler - end + before do + settings.profiling.exporter.transport = custom_transport end - context 'when a custom transport is provided' do - let(:custom_transport) { double('Custom transport') } + it 'does not initialize an HttpTransport' do + expect(Datadog::Profiling::HttpTransport).to_not receive(:new) - before do - settings.profiling.exporter.transport = custom_transport - end - - it 'does not initialize an HttpTransport' do - expect(Datadog::Profiling::HttpTransport).to_not receive(:new) + build_profiler + end - build_profiler + it 'sets up the scheduler to use the custom transport' do + expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| + expect(transport).to be custom_transport end - it 'sets up the scheduler to use the custom transport' do - expect(Datadog::Profiling::Scheduler).to receive(:new) do |transport:, **_| - expect(transport).to be custom_transport - end - - build_profiler - end + build_profiler end end end From f31b9db77b846b7a1cad36ee924fcbdf320e0f41 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 2 Aug 2022 14:30:28 +0100 Subject: [PATCH 0349/2133] Refactor profiling components setup in preparation for the new components --- lib/datadog/core/configuration/components.rb | 45 +++++++------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index cb70be95242..227e8a2f9de 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -240,13 +240,14 @@ def build_profiler(settings, agent_settings, tracer) endpoint_collection_enabled: settings.profiling.advanced.endpoint.collection.enabled ) - old_recorder = build_profiler_old_recorder(settings) - exporter = build_profiler_exporter(settings, old_recorder) - collectors = build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) + recorder = build_profiler_old_recorder(settings) + collector = build_profiler_oldstack_collector(settings, recorder, trace_identifiers_helper) + + exporter = build_profiler_exporter(settings, recorder) transport = build_profiler_transport(settings, agent_settings) - scheduler = build_profiler_scheduler(settings, exporter, transport) + scheduler = Profiling::Scheduler.new(exporter: exporter, transport: transport) - Profiling::Profiler.new(collectors, scheduler) + Profiling::Profiler.new([collector], scheduler) end private @@ -279,34 +280,22 @@ def build_test_mode_writer(settings, agent_settings) end def build_profiler_old_recorder(settings) - event_classes = [Profiling::Events::StackSample] - - Profiling::OldRecorder.new( - event_classes, - settings.profiling.advanced.max_events, - ) + Profiling::OldRecorder.new([Profiling::Events::StackSample], settings.profiling.advanced.max_events) end - def build_profiler_exporter(settings, old_recorder) + def build_profiler_exporter(settings, recorder) code_provenance_collector = (Profiling::Collectors::CodeProvenance.new if settings.profiling.advanced.code_provenance_enabled) - Profiling::Exporter.new( - # NOTE: Using the OldRecorder as a pprof_recorder is temporary and will be removed once libpprof is - # being used for aggregation - pprof_recorder: old_recorder, - code_provenance_collector: code_provenance_collector, - ) + Profiling::Exporter.new(pprof_recorder: recorder, code_provenance_collector: code_provenance_collector) end - def build_profiler_collectors(settings, old_recorder, trace_identifiers_helper) - [ - Profiling::Collectors::OldStack.new( - old_recorder, - trace_identifiers_helper: trace_identifiers_helper, - max_frames: settings.profiling.advanced.max_frames - ) - ] + def build_profiler_oldstack_collector(settings, old_recorder, trace_identifiers_helper) + Profiling::Collectors::OldStack.new( + old_recorder, + trace_identifiers_helper: trace_identifiers_helper, + max_frames: settings.profiling.advanced.max_frames + ) end def build_profiler_transport(settings, agent_settings) @@ -330,10 +319,6 @@ def build_profiler_transport(settings, agent_settings) upload_timeout_seconds: settings.profiling.upload.timeout_seconds, ) end - - def build_profiler_scheduler(_settings, exporter, transport) - Profiling::Scheduler.new(exporter: exporter, transport: transport) - end end attr_reader \ From 5919810c4df368bf9d13369d6172cdf06f7a6383 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 3 Aug 2022 10:22:23 +0200 Subject: [PATCH 0350/2133] Failing spec for #inject! --- .../propagation_integration_spec.rb | 59 ++++++++++++++++--- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/spec/datadog/opentracer/propagation_integration_spec.rb b/spec/datadog/opentracer/propagation_integration_spec.rb index d5e0cca090a..a8fba4ca340 100644 --- a/spec/datadog/opentracer/propagation_integration_spec.rb +++ b/spec/datadog/opentracer/propagation_integration_spec.rb @@ -126,6 +126,7 @@ def baggage_to_carrier_format(baggage) let(:receiver_span_name) { 'operation.receiver' } let(:baggage) { { 'account_name' => 'acme' } } let(:carrier) { {} } + let(:another_carrier) { {} } let(:datadog_sender_trace) { datadog_traces.last } let(:datadog_receiver_trace) { datadog_traces.first } @@ -144,6 +145,8 @@ def baggage_to_carrier_format(baggage) tracer.start_active_span(receiver_span_name, child_of: span_context) do |receiver_scope| @receiver_scope = receiver_scope # Do some work. + + tracer.inject(receiver_scope.span.context, OpenTracing::FORMAT_TEXT_MAP, another_carrier) end end end @@ -163,6 +166,27 @@ def baggage_to_carrier_format(baggage) it { expect(receiver_datadog_span.trace_id).to eq(sender_datadog_span.trace_id) } it { expect(receiver_datadog_span.parent_id).to eq(sender_datadog_span.span_id) } it { expect(@receiver_scope.span.context.baggage).to include(baggage) } + + it do + expect(carrier).to include( + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_PARENT_ID => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_SAMPLING_PRIORITY => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_ORIGIN => a_kind_of(String), + 'ot-baggage-account_name' => 'acme' + ) + end + + it do + expect(another_carrier).to include( + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_PARENT_ID => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_SAMPLING_PRIORITY => a_kind_of(Integer), + Datadog::OpenTracer::TextMapPropagator::HTTP_HEADER_ORIGIN => a_kind_of(String), + 'ot-baggage-account_name' => 'acme' + ) + end + end end @@ -287,19 +311,18 @@ def baggage_to_carrier_format(baggage) sender_scope.span.context.datadog_context.active_trace.origin = 'synthetics' baggage.each { |k, v| sender_scope.span.set_baggage_item(k, v) } - carrier = {} - tracer.inject( - sender_scope.span.context, - OpenTracing::FORMAT_RACK, - carrier - ) - - carrier = carrier_to_rack_format(carrier) + @carrier = {}.tap do |c| + tracer.inject(sender_scope.span.context, OpenTracing::FORMAT_RACK, c) + end - span_context = tracer.extract(OpenTracing::FORMAT_RACK, carrier) + span_context = tracer.extract(OpenTracing::FORMAT_RACK, carrier_to_rack_format(@carrier)) tracer.start_active_span(receiver_span_name, child_of: span_context) do |receiver_scope| @receiver_scope = receiver_scope # Do some work. + + @another_carrier = {}.tap do |c| + tracer.inject(receiver_scope.span.context, OpenTracing::FORMAT_RACK, c) + end end end end @@ -317,6 +340,24 @@ def baggage_to_carrier_format(baggage) it { expect(receiver_datadog_span.trace_id).to eq(sender_datadog_span.trace_id) } it { expect(receiver_datadog_span.parent_id).to eq(sender_datadog_span.span_id) } it { expect(@receiver_scope.span.context.baggage).to include(baggage) } + it do + expect(@carrier).to include( + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_PARENT_ID => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_SAMPLING_PRIORITY => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_ORIGIN => a_kind_of(String), + 'ot-baggage-account_name' => 'acme' + ) + end + it do + expect(@another_carrier).to include( + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_PARENT_ID => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_SAMPLING_PRIORITY => a_kind_of(String), + Datadog::OpenTracer::RackPropagator::HTTP_HEADER_ORIGIN => a_kind_of(String), + 'ot-baggage-account_name' => 'acme' + ) + end end end end From b25991afefb4953ce9d375d127c70161095bd5e5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 3 Aug 2022 10:29:56 +0200 Subject: [PATCH 0351/2133] Fix propagator --- lib/datadog/opentracer/rack_propagator.rb | 8 +- lib/datadog/opentracer/text_map_propagator.rb | 7 +- .../propagation_integration_spec.rb | 3 +- .../opentracer/rack_propagator_spec.rb | 80 +++++++---- .../opentracer/text_map_propagator_spec.rb | 127 +++++++++++------- 5 files changed, 145 insertions(+), 80 deletions(-) diff --git a/lib/datadog/opentracer/rack_propagator.rb b/lib/datadog/opentracer/rack_propagator.rb index 13897e3dfb7..a0ccb285192 100644 --- a/lib/datadog/opentracer/rack_propagator.rb +++ b/lib/datadog/opentracer/rack_propagator.rb @@ -23,10 +23,14 @@ class << self # @param span_context [SpanContext] # @param carrier [Carrier] A carrier object of Rack type def inject(span_context, carrier) - active_trace = span_context.datadog_context.active_trace + digest = if span_context.datadog_context && span_context.datadog_context.active_trace + span_context.datadog_context.active_trace.to_digest + else + span_context.datadog_trace_digest + end # Inject Datadog trace properties - Tracing::Propagation::HTTP.inject!(active_trace, carrier) + Tracing::Propagation::HTTP.inject!(digest, carrier) # Inject baggage span_context.baggage.each do |key, value| diff --git a/lib/datadog/opentracer/text_map_propagator.rb b/lib/datadog/opentracer/text_map_propagator.rb index f6a58d0ea28..7f3631a9133 100644 --- a/lib/datadog/opentracer/text_map_propagator.rb +++ b/lib/datadog/opentracer/text_map_propagator.rb @@ -27,8 +27,11 @@ def inject(span_context, carrier) end # Inject Datadog trace properties - active_trace = span_context.datadog_context.active_trace - digest = active_trace.to_digest if active_trace + digest = if span_context.datadog_context && span_context.datadog_context.active_trace + span_context.datadog_context.active_trace.to_digest + else + span_context.datadog_trace_digest + end return unless digest carrier[HTTP_HEADER_ORIGIN] = digest.trace_origin diff --git a/spec/datadog/opentracer/propagation_integration_spec.rb b/spec/datadog/opentracer/propagation_integration_spec.rb index a8fba4ca340..a4eff6a5935 100644 --- a/spec/datadog/opentracer/propagation_integration_spec.rb +++ b/spec/datadog/opentracer/propagation_integration_spec.rb @@ -186,7 +186,6 @@ def baggage_to_carrier_format(baggage) 'ot-baggage-account_name' => 'acme' ) end - end end @@ -340,6 +339,7 @@ def baggage_to_carrier_format(baggage) it { expect(receiver_datadog_span.trace_id).to eq(sender_datadog_span.trace_id) } it { expect(receiver_datadog_span.parent_id).to eq(sender_datadog_span.span_id) } it { expect(@receiver_scope.span.context.baggage).to include(baggage) } + it do expect(@carrier).to include( Datadog::OpenTracer::RackPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(String), @@ -349,6 +349,7 @@ def baggage_to_carrier_format(baggage) 'ot-baggage-account_name' => 'acme' ) end + it do expect(@another_carrier).to include( Datadog::OpenTracer::RackPropagator::HTTP_HEADER_TRACE_ID => a_kind_of(String), diff --git a/spec/datadog/opentracer/rack_propagator_spec.rb b/spec/datadog/opentracer/rack_propagator_spec.rb index c58695bbbfd..0d22eac01db 100644 --- a/spec/datadog/opentracer/rack_propagator_spec.rb +++ b/spec/datadog/opentracer/rack_propagator_spec.rb @@ -13,30 +13,6 @@ describe '#inject' do subject { described_class.inject(span_context, carrier) } - let(:span_context) do - instance_double( - Datadog::OpenTracer::SpanContext, - datadog_context: datadog_context, - baggage: baggage - ) - end - - let(:datadog_context) do - instance_double( - Datadog::Tracing::Context, - active_trace: datadog_trace - ) - end - - let(:datadog_trace) do - Datadog::Tracing::TraceOperation.new( - id: trace_id, - parent_span_id: span_id, - sampling_priority: sampling_priority, - origin: origin - ) - end - let(:trace_id) { double('trace ID') } let(:span_id) { double('span ID') } let(:sampling_priority) { double('sampling priority') } @@ -46,8 +22,8 @@ let(:carrier) { instance_double(Datadog::OpenTracer::Carrier) } - # Expect carrier to be set with Datadog trace properties before do + # Expect carrier to be set with Datadog trace properties expect(carrier).to receive(:[]=) .with(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_TRACE_ID, trace_id.to_s) expect(carrier).to receive(:[]=) @@ -56,17 +32,63 @@ .with(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_SAMPLING_PRIORITY, sampling_priority.to_s) expect(carrier).to receive(:[]=) .with(Datadog::Tracing::Distributed::Headers::Ext::HTTP_HEADER_ORIGIN, origin.to_s) - end - # Expect carrier to be set with OpenTracing baggage - before do + # Expect carrier to be set with OpenTracing baggage baggage.each do |key, value| expect(carrier).to receive(:[]=) .with(described_class::BAGGAGE_PREFIX + key, value) end end - it { is_expected.to be nil } + context 'when given span context with datadog context' do + let(:span_context) do + instance_double( + Datadog::OpenTracer::SpanContext, + datadog_context: datadog_context, + baggage: baggage + ) + end + + let(:datadog_context) do + instance_double( + Datadog::Tracing::Context, + active_trace: datadog_trace + ) + end + + let(:datadog_trace) do + Datadog::Tracing::TraceOperation.new( + id: trace_id, + parent_span_id: span_id, + sampling_priority: sampling_priority, + origin: origin + ) + end + + it { is_expected.to be nil } + end + + context 'when given span context with datadog trace digest' do + let(:span_context) do + instance_double( + Datadog::OpenTracer::SpanContext, + datadog_context: nil, + datadog_trace_digest: datadog_trace_digest, + baggage: baggage + ) + end + + let(:datadog_trace_digest) do + instance_double( + Datadog::Tracing::TraceDigest, + span_id: span_id, + trace_id: trace_id, + trace_origin: origin, + trace_sampling_priority: sampling_priority + ) + end + it { is_expected.to be nil } + end end describe '#extract' do diff --git a/spec/datadog/opentracer/text_map_propagator_spec.rb b/spec/datadog/opentracer/text_map_propagator_spec.rb index c8be46c5673..533dc8bee2a 100644 --- a/spec/datadog/opentracer/text_map_propagator_spec.rb +++ b/spec/datadog/opentracer/text_map_propagator_spec.rb @@ -8,63 +8,98 @@ RSpec.describe Datadog::OpenTracer::TextMapPropagator do describe '#inject' do - subject { described_class.inject(span_context, carrier) } - - let(:span_context) do - instance_double( - Datadog::OpenTracer::SpanContext, - datadog_context: datadog_context, - baggage: baggage - ) - end + let(:trace_id) { 4363611732769921584 } + let(:span_id) { 2352279000849524039 } + let(:sampling_priority) { 1 } + let(:origin) { 'synthetics' } - let(:datadog_context) do - instance_double( - Datadog::Tracing::Context, - active_trace: datadog_trace - ) - end + let(:baggage) { { 'account_name' => 'acme' } } - let(:datadog_trace) do - Datadog::Tracing::TraceOperation.new( - id: trace_id, - parent_span_id: span_id, - sampling_priority: sampling_priority, - origin: origin - ) - end + context 'when given span context with datadog context' do + let(:span_context) do + instance_double( + Datadog::OpenTracer::SpanContext, + datadog_context: datadog_context, + baggage: baggage + ) + end - let(:trace_id) { double('trace ID') } - let(:span_id) { double('span ID') } - let(:sampling_priority) { double('sampling priority') } - let(:origin) { double('synthetics') } + let(:datadog_context) do + instance_double( + Datadog::Tracing::Context, + active_trace: datadog_trace + ) + end - let(:baggage) { { 'account_name' => 'acme' } } + let(:datadog_trace) do + Datadog::Tracing::TraceOperation.new( + id: trace_id, + parent_span_id: span_id, + sampling_priority: sampling_priority, + origin: origin + ) + end - let(:carrier) { Datadog::OpenTracer::Carrier.new } + it 'sets the carrier correctly' do + carrier = double.tap { |d| allow(d).to receive(:[]=) } - # Allow carrier to be set with properties - before do - allow(carrier).to receive(:[]=) - end + described_class.inject(span_context, carrier) - it do - is_expected.to be nil + baggage.each do |key, value| + expect(carrier).to have_received(:[]=) + .with(described_class::BAGGAGE_PREFIX + key, value) + end - baggage.each do |key, value| expect(carrier).to have_received(:[]=) - .with(described_class::BAGGAGE_PREFIX + key, value) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_TRACE_ID, trace_id) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_PARENT_ID, span_id) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_SAMPLING_PRIORITY, sampling_priority) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_ORIGIN, origin) end + end + + context 'when given span context with datadog trace digest' do + let(:span_context) do + instance_double( + Datadog::OpenTracer::SpanContext, + datadog_context: nil, + datadog_trace_digest: datadog_trace_digest, + baggage: baggage + ) + end + + let(:datadog_trace_digest) do + instance_double( + Datadog::Tracing::TraceDigest, + span_id: span_id, + trace_id: trace_id, + trace_origin: origin, + trace_sampling_priority: sampling_priority + ) + end + + it 'sets the carrier correctly' do + carrier = double.tap { |d| allow(d).to receive(:[]=) } + + described_class.inject(span_context, carrier) - expect(carrier).to have_received(:[]=) - .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_TRACE_ID, trace_id) - expect(carrier).to have_received(:[]=) - .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_PARENT_ID, span_id) - expect(carrier).to have_received(:[]=) - .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_SAMPLING_PRIORITY, sampling_priority) - # TODO: For some reason this breaks, and only this one. - # expect(carrier).to have_received(:[]=) - # .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_ORIGIN, origin) + baggage.each do |key, value| + expect(carrier).to have_received(:[]=) + .with(described_class::BAGGAGE_PREFIX + key, value) + end + + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_TRACE_ID, trace_id) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_PARENT_ID, span_id) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_SAMPLING_PRIORITY, sampling_priority) + expect(carrier).to have_received(:[]=) + .with(Datadog::OpenTracer::DistributedHeaders::HTTP_HEADER_ORIGIN, origin) + end end end From 3f651f349d460e4c0e92b8877f4a772b008653a0 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 3 Aug 2022 13:31:40 +0200 Subject: [PATCH 0352/2133] Add .envrc sample --- integration/apps/sinatra2-classic/.envrc.sample | 1 + integration/apps/sinatra2-modular/.envrc.sample | 1 + 2 files changed, 2 insertions(+) create mode 100644 integration/apps/sinatra2-classic/.envrc.sample create mode 100644 integration/apps/sinatra2-modular/.envrc.sample diff --git a/integration/apps/sinatra2-classic/.envrc.sample b/integration/apps/sinatra2-classic/.envrc.sample new file mode 100644 index 00000000000..633bf257687 --- /dev/null +++ b/integration/apps/sinatra2-classic/.envrc.sample @@ -0,0 +1 @@ +export DD_API_KEY= diff --git a/integration/apps/sinatra2-modular/.envrc.sample b/integration/apps/sinatra2-modular/.envrc.sample new file mode 100644 index 00000000000..633bf257687 --- /dev/null +++ b/integration/apps/sinatra2-modular/.envrc.sample @@ -0,0 +1 @@ +export DD_API_KEY= From 144ea501732174b5037cd954e0590f7683fb490e Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 3 Aug 2022 13:32:02 +0200 Subject: [PATCH 0353/2133] Add sinatra in README.md --- integration/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration/README.md b/integration/README.md index 97e442b8890..324507c9785 100644 --- a/integration/README.md +++ b/integration/README.md @@ -26,6 +26,8 @@ See `README.md` in each directory for more information: - `apps/rails-seven`: Rails 7 application - `apps/rspec`: RSpec test suite (CI) - `apps/ruby`: Generic Ruby application +- `apps/sinatra2-classic`: Sinatra classic application +- `apps/sinatra2-modular`: Sintara modular application ### Base images From a4c2d2b26dae04e37a5bd4bd3c8686b83f57e98e Mon Sep 17 00:00:00 2001 From: TonyCTHsu Date: Wed, 3 Aug 2022 20:11:49 +0200 Subject: [PATCH 0354/2133] Update integration/README.md Co-authored-by: Ivo Anjo --- integration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/README.md b/integration/README.md index 324507c9785..b4951daa1d4 100644 --- a/integration/README.md +++ b/integration/README.md @@ -27,7 +27,7 @@ See `README.md` in each directory for more information: - `apps/rspec`: RSpec test suite (CI) - `apps/ruby`: Generic Ruby application - `apps/sinatra2-classic`: Sinatra classic application -- `apps/sinatra2-modular`: Sintara modular application +- `apps/sinatra2-modular`: Sinatra modular application ### Base images From 7be2ae718059e3752bcf9929eeb340b695c3c5ac Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 3 Aug 2022 14:08:35 -0700 Subject: [PATCH 0355/2133] Doc:Instrumentation options are keyword arguments --- docs/GettingStarted.md | 158 ++++++++++++++++++++--------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index c36cb688cae..7c41d56c974 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -345,7 +345,7 @@ If you aren't using a supported framework instrumentation, you may want to manua To trace any Ruby code, you can use the `Datadog::Tracing.trace` method: ```ruby -Datadog::Tracing.trace(name, options) do |span, trace| +Datadog::Tracing.trace(name, **options) do |span, trace| # Wrap this block around the code you want to instrument # Additionally, you can modify the span here. # e.g. Change the resource name, set tags, etc... @@ -354,7 +354,7 @@ end Where `name` should be a `String` that describes the generic kind of operation being done (e.g. `'web.request'`, or `'request.parse'`) -And `options` is an optional `Hash` that accepts the following parameters: +And `options` the following are optional keyword arguments: | Key | Type | Description | Default | | --------------- | ----------------------- | --- | --- | @@ -455,11 +455,11 @@ Many popular libraries and frameworks are supported out-of-the-box, which can be ```ruby Datadog.configure do |c| # Activates and configures an integration - c.tracing.instrument :integration_name, options + c.tracing.instrument :integration_name, **options end ``` -`options` is a `Hash` of integration-specific configuration settings. +`options` are keyword arguments for integration-specific configuration. For a list of available integrations, and their configuration options, please refer to the following: @@ -523,11 +523,11 @@ For Datadog CI Visibility, library instrumentation can be activated and configur ```ruby Datadog.configure do |c| # Activates and configures an integration - c.ci.instrument :integration_name, options + c.ci.instrument :integration_name, **options end ``` -`options` is a `Hash` of integration-specific configuration settings. +`options` are keyword arguments for integration-specific configuration. These are the available CI Visibility integrations: @@ -559,11 +559,11 @@ You can enable it through `Datadog.configure`: ```ruby require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :action_mailer, options + c.tracing.instrument :action_mailer, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -592,11 +592,11 @@ require 'actionview' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :action_view, options + c.tracing.instrument :action_view, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | ---| --- | --- | @@ -644,7 +644,7 @@ require 'active_record' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :active_record, options + c.tracing.instrument :active_record, **options end Dir::Tmpname.create(['test', '.sqlite']) do |db| @@ -654,7 +654,7 @@ Dir::Tmpname.create(['test', '.sqlite']) do |db| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | ---| --- | --- | @@ -735,14 +735,14 @@ require 'activesupport' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :active_support, options + c.tracing.instrument :active_support, **options end cache = ActiveSupport::Cache::MemoryStore.new cache.read('city') ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | ---| --- | --- | @@ -757,14 +757,14 @@ require 'aws-sdk' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :aws, options + c.tracing.instrument :aws, **options end # Perform traced call Aws::S3::Client.new.list_buckets ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -802,7 +802,7 @@ require 'ddtrace' # Configure default Cucumber integration Datadog.configure do |c| - c.ci.instrument :cucumber, options + c.ci.instrument :cucumber, **options end # Example of how to attach tags from scenario to active span @@ -817,7 +817,7 @@ Around do |scenario, block| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -835,15 +835,15 @@ require 'ddtrace' # Configure default Dalli tracing behavior Datadog.configure do |c| - c.tracing.instrument :dalli, options + c.tracing.instrument :dalli, **options end # Configure Dalli tracing behavior for single client -client = Dalli::Client.new('localhost:11211', options) +client = Dalli::Client.new('localhost:11211', **options) client.set('abc', 123) ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -859,11 +859,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :delayed_job, options + c.tracing.instrument :delayed_job, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -878,7 +878,7 @@ require 'elasticsearch/transport' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :elasticsearch, options + c.tracing.instrument :elasticsearch, **options end # Perform a query to Elasticsearch @@ -889,7 +889,7 @@ response = client.perform_request 'GET', '_cluster/health' Datadog.configure_onto(client.transport, **options) ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -904,7 +904,7 @@ The `ethon` integration will trace any HTTP request through `Easy` or `Multi` ob require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :ethon, options + c.tracing.instrument :ethon, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :ethon, describes: /user-[^.]+\.example\.com/ do |ethon| @@ -914,7 +914,7 @@ Datadog.configure do |c| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -932,7 +932,7 @@ require 'ddtrace' # Configure default Excon tracing behavior Datadog.configure do |c| - c.tracing.instrument :excon, options + c.tracing.instrument :excon, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :excon, describes: /user-[^.]+\.example\.com/ do |excon| @@ -945,7 +945,7 @@ connection = Excon.new('https://example.com') connection.get ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -989,7 +989,7 @@ require 'ddtrace' # Configure default Faraday tracing behavior Datadog.configure do |c| - c.tracing.instrument :faraday, options + c.tracing.instrument :faraday, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :faraday, describes: /user-[^.]+\.example\.com/ do |faraday| @@ -1000,14 +1000,14 @@ end # In case you want to override the global configuration for a certain client instance connection = Faraday.new('https://example.com') do |builder| - builder.use(:ddtrace, options) + builder.use(:ddtrace, **options) builder.adapter Faraday.default_adapter end connection.get('/foo') ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1028,7 +1028,7 @@ require 'grape' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :grape, options + c.tracing.instrument :grape, **options end # Then define your application @@ -1040,7 +1040,7 @@ class RackTestingAPI < Grape::API end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1129,7 +1129,7 @@ require 'grpc' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :grpc, options + c.tracing.instrument :grpc, **options end # Server side @@ -1143,7 +1143,7 @@ client = Demo.rpc_stub_class.new('localhost:50051', :this_channel_is_insecure) client.my_endpoint(DemoMessage.new(contents: 'hello!')) ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1177,7 +1177,7 @@ The http.rb integration will trace any HTTP call using the Http.rb gem. require 'http' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :httprb, options + c.tracing.instrument :httprb, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :httprb, describes: /user-[^.]+\.example\.com/ do |httprb| httprb.service_name = 'user.example.com' @@ -1186,7 +1186,7 @@ Datadog.configure do |c| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1202,7 +1202,7 @@ The httpclient integration will trace any HTTP call using the httpclient gem. require 'httpclient' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :httpclient, options + c.tracing.instrument :httpclient, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :httpclient, describes: /user-[^.]+\.example\.com/ do |httpclient| httpclient.service_name = 'user.example.com' @@ -1211,7 +1211,7 @@ Datadog.configure do |c| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1263,7 +1263,7 @@ require 'mongo' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :mongo, options + c.tracing.instrument :mongo, **options end # Create a MongoDB client and use it as usual @@ -1275,7 +1275,7 @@ collection.insert_one({ name: 'Steve' }) Datadog.configure_onto(client, **options) ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1322,14 +1322,14 @@ require 'mysql2' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :mysql2, options + c.tracing.instrument :mysql2, **options end client = Mysql2::Client.new(:host => "localhost", :username => "root") client.query("SELECT * FROM users WHERE group='x'") ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1344,7 +1344,7 @@ require 'net/http' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :http, options + c.tracing.instrument :http, **options # optionally, specify a different service name for hostnames matching a regex c.tracing.instrument :http, describes: /user-[^.]+\.example\.com/ do |http| @@ -1361,7 +1361,7 @@ end content = Net::HTTP.get(URI('http://127.0.0.1/index.html')) ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1387,11 +1387,11 @@ require 'pg' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :pg, options + c.tracing.instrument :pg, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1406,7 +1406,7 @@ require 'presto-client' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :presto, options + c.tracing.instrument :presto, **options end client = Presto::Client.new( @@ -1422,7 +1422,7 @@ client = Presto::Client.new( client.run("select * from system.nodes") ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1438,11 +1438,11 @@ To add tracing to a Qless job: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :qless, options + c.tracing.instrument :qless, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1459,11 +1459,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :que, options + c.tracing.instrument :que, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1482,11 +1482,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :racecar, options + c.tracing.instrument :racecar, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1503,7 +1503,7 @@ This integration is automatically activated with web frameworks like Rails. If y require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :rack, options + c.tracing.instrument :rack, **options end use Datadog::Tracing::Contrib::Rack::TraceMiddleware @@ -1515,7 +1515,7 @@ end run app ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1572,11 +1572,11 @@ To enable the Rails instrumentation, create an initializer file in your `config/ require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :rails, options + c.tracing.instrument :rails, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1627,7 +1627,7 @@ end Rake::Task['my_task'].invoke ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1679,7 +1679,7 @@ require 'redis' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :redis, options + c.tracing.instrument :redis, **options end # Perform Redis commands @@ -1687,7 +1687,7 @@ redis = Redis.new redis.set 'foo', 'bar' ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1765,7 +1765,7 @@ Datadog.configure do |c| end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1780,11 +1780,11 @@ require 'rest_client' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :rest_client, options + c.tracing.instrument :rest_client, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1804,11 +1804,11 @@ require 'ddtrace' # Configure default RSpec integration Datadog.configure do |c| - c.ci.instrument :rspec, options + c.ci.instrument :rspec, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1834,7 +1834,7 @@ database.create_table :articles do end Datadog.configure do |c| - c.tracing.instrument :sequel, options + c.tracing.instrument :sequel, **options end # Perform a query @@ -1842,7 +1842,7 @@ articles = database[:articles] articles.all ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1871,11 +1871,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :shoryuken, options + c.tracing.instrument :shoryuken, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1892,11 +1892,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :sidekiq, options + c.tracing.instrument :sidekiq, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1917,7 +1917,7 @@ require 'sinatra' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :sinatra, options + c.tracing.instrument :sinatra, **options end get '/' do @@ -1932,7 +1932,7 @@ require 'sinatra/base' require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :sinatra, options + c.tracing.instrument :sinatra, **options end class NestedApp < Sinatra::Base @@ -1958,7 +1958,7 @@ Ensure you register `Datadog::Tracing::Contrib::Sinatra::Tracer` as a middleware #### Instrumentation options -`options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | @@ -1976,11 +1976,11 @@ You can enable it through `Datadog.configure`: require 'ddtrace' Datadog.configure do |c| - c.tracing.instrument :sneakers, options + c.tracing.instrument :sneakers, **options end ``` -Where `options` is an optional `Hash` that accepts the following parameters: +`options` are the following keyword arguments: | Key | Description | Default | | --- | ----------- | ------- | From 382a32e6b786c0a2f145ba23433ea1d96961f357 Mon Sep 17 00:00:00 2001 From: TonyCTHsu Date: Thu, 4 Aug 2022 09:54:22 +0200 Subject: [PATCH 0356/2133] Update docs/GettingStarted.md Co-authored-by: Ivo Anjo --- docs/GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 7c41d56c974..7f448faab60 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -354,7 +354,7 @@ end Where `name` should be a `String` that describes the generic kind of operation being done (e.g. `'web.request'`, or `'request.parse'`) -And `options` the following are optional keyword arguments: +And `options` are the following optional keyword arguments: | Key | Type | Description | Default | | --------------- | ----------------------- | --- | --- | From bfa336651b1698f9c91bc2761dead5a118f057e9 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 4 Aug 2022 10:35:43 +0100 Subject: [PATCH 0357/2133] Minor improvement to timeout documentation As raised in #818, the default `timeout` example is rather far away from the actual default being used, which may lead customers that copy-paste the example to have a bad experience. I also discovered we had an incorrect constant with the default timeout which was not even being used anywhere (you can grep for it to confirm!). Thanks @benjaminwood for the awesome suggestion! --- docs/GettingStarted.md | 2 +- lib/ddtrace/transport/ext.rb | 1 - lib/ddtrace/transport/http/adapters/net.rb | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 7f448faab60..d1290f81410 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2523,7 +2523,7 @@ The `Net` adapter submits traces using `Net::HTTP` over TCP. It is the default t Datadog.configure do |c| c.tracing.transport_options = proc { |t| # Hostname, port, and additional options. :timeout is in seconds. - t.adapter :net_http, '127.0.0.1', 8126, { timeout: 1 } + t.adapter :net_http, '127.0.0.1', 8126, timeout: 30 } end ``` diff --git a/lib/ddtrace/transport/ext.rb b/lib/ddtrace/transport/ext.rb index 703997225d6..8e41f796b22 100644 --- a/lib/ddtrace/transport/ext.rb +++ b/lib/ddtrace/transport/ext.rb @@ -9,7 +9,6 @@ module HTTP ADAPTER = :net_http # DEV: Rename to simply `:http`, as Net::HTTP is an implementation detail. DEFAULT_HOST = '127.0.0.1'.freeze DEFAULT_PORT = 8126 - DEFAULT_TIMEOUT_SECONDS = 1 HEADER_CONTAINER_ID = 'Datadog-Container-ID'.freeze HEADER_DD_API_KEY = 'DD-API-KEY'.freeze diff --git a/lib/ddtrace/transport/http/adapters/net.rb b/lib/ddtrace/transport/http/adapters/net.rb index 2cd1c0a45e2..5e7e0ca5764 100644 --- a/lib/ddtrace/transport/http/adapters/net.rb +++ b/lib/ddtrace/transport/http/adapters/net.rb @@ -15,6 +15,7 @@ class Net :timeout, :ssl + # in seconds DEFAULT_TIMEOUT = 30 # @deprecated Positional parameters are deprecated. Use named parameters instead. From 2412140a230f09ed8dede275c7bd1a426d741db3 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 4 Aug 2022 14:46:41 +0200 Subject: [PATCH 0358/2133] Fix CI with rubocop verison --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 07e5d7e7a65..8874cbac957 100644 --- a/Gemfile +++ b/Gemfile @@ -57,7 +57,7 @@ gem 'webrick', '>= 1.7.0' if RUBY_VERSION >= '3.0.0' # No longer bundled by defa gem 'yard', '~> 0.9' if RUBY_VERSION >= '2.4.0' - gem 'rubocop', '~> 1.10', require: false + gem 'rubocop', ['~> 1.10', '< 1.33.0'], require: false gem 'rubocop-packaging', '~> 0.5', require: false gem 'rubocop-performance', '~> 1.9', require: false gem 'rubocop-rspec', '~> 2.2', require: false From b56ad10ed6a9913a4ecb2f151616b09ae95ce79a Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:50:21 -0400 Subject: [PATCH 0359/2133] Define app-started payload object (#2071) * Define classes relevant to app_started event * Add more tests and base classes * Use kwargs and invert naming * Format multi-line blocks and sort parameters * Add validation and unit tests * Add documentaiton for param types and description * fixup! Add validation and unit tests * Condense namespace to Telemetry::V1:: * fixup! Condense namespace to Telemetry::V1:: * Remove type checking --- lib/datadog/core/telemetry/v1/app_started.rb | 29 +++ lib/datadog/core/telemetry/v1/application.rb | 65 +++++++ lib/datadog/core/telemetry/v1/appsec.rb | 21 +++ .../core/telemetry/v1/configuration.rb | 25 +++ lib/datadog/core/telemetry/v1/dependency.rb | 28 +++ lib/datadog/core/telemetry/v1/host.rb | 37 ++++ lib/datadog/core/telemetry/v1/integration.rb | 47 +++++ lib/datadog/core/telemetry/v1/product.rb | 21 +++ lib/datadog/core/telemetry/v1/profiler.rb | 21 +++ .../core/telemetry/v1/telemetry_request.rb | 75 ++++++++ .../core/telemetry/v1/app_started_spec.rb | 125 +++++++++++++ .../core/telemetry/v1/application_spec.rb | 110 ++++++++++++ spec/datadog/core/telemetry/v1/appsec_spec.rb | 18 ++ .../core/telemetry/v1/configuration_spec.rb | 40 +++++ .../core/telemetry/v1/dependency_spec.rb | 28 +++ spec/datadog/core/telemetry/v1/host_spec.rb | 68 +++++++ .../core/telemetry/v1/integration_spec.rb | 61 +++++++ .../datadog/core/telemetry/v1/product_spec.rb | 42 +++++ .../core/telemetry/v1/profiler_spec.rb | 18 ++ .../core/telemetry/v1/shared_examples.rb | 59 +++++++ .../telemetry/v1/telemetry_request_spec.rb | 167 ++++++++++++++++++ 21 files changed, 1105 insertions(+) create mode 100644 lib/datadog/core/telemetry/v1/app_started.rb create mode 100644 lib/datadog/core/telemetry/v1/application.rb create mode 100644 lib/datadog/core/telemetry/v1/appsec.rb create mode 100644 lib/datadog/core/telemetry/v1/configuration.rb create mode 100644 lib/datadog/core/telemetry/v1/dependency.rb create mode 100644 lib/datadog/core/telemetry/v1/host.rb create mode 100644 lib/datadog/core/telemetry/v1/integration.rb create mode 100644 lib/datadog/core/telemetry/v1/product.rb create mode 100644 lib/datadog/core/telemetry/v1/profiler.rb create mode 100644 lib/datadog/core/telemetry/v1/telemetry_request.rb create mode 100644 spec/datadog/core/telemetry/v1/app_started_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/application_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/appsec_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/configuration_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/dependency_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/host_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/integration_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/product_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/profiler_spec.rb create mode 100644 spec/datadog/core/telemetry/v1/shared_examples.rb create mode 100644 spec/datadog/core/telemetry/v1/telemetry_request_spec.rb diff --git a/lib/datadog/core/telemetry/v1/app_started.rb b/lib/datadog/core/telemetry/v1/app_started.rb new file mode 100644 index 00000000000..9af8640fccb --- /dev/null +++ b/lib/datadog/core/telemetry/v1/app_started.rb @@ -0,0 +1,29 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes payload for telemetry V1 API app_started event + class AppStarted + attr_reader \ + :additional_payload, + :configuration, + :dependencies, + :integrations + + # @param additional_payload [Array] List of Additional payload to track (any key + # value not mentioned and doesn't fit under a metric) + # @param configuration [Array] List of Tracer related configuration data + # @param dependencies [Array] List of all loaded modules requested by the app + # @param integrations [Array] List of integrations that are available within the app + # and applicable to be traced + def initialize(additional_payload: nil, configuration: nil, dependencies: nil, integrations: nil) + @additional_payload = additional_payload + @configuration = configuration + @dependencies = dependencies + @integrations = integrations + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/application.rb b/lib/datadog/core/telemetry/v1/application.rb new file mode 100644 index 00000000000..81cd29f408f --- /dev/null +++ b/lib/datadog/core/telemetry/v1/application.rb @@ -0,0 +1,65 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for application environment object + class Application + ERROR_NIL_LANGUAGE_NAME_MESSAGE = ':language_name must not be nil'.freeze + ERROR_NIL_LANGUAGE_VERSION_MESSAGE = ':language_version must not be nil'.freeze + ERROR_NIL_SERVICE_NAME_MESSAGE = ':service_name must not be nil'.freeze + ERROR_NIL_TRACER_VERSION_MESSAGE = ':tracer_version must not be nil'.freeze + + attr_reader \ + :env, + :language_name, + :language_version, + :products, + :runtime_name, + :runtime_patches, + :runtime_version, + :service_name, + :service_version, + :tracer_version + + # @param env [String] Service's environment + # @param language_name [String] 'ruby' + # @param language_version [String] Version of language used + # @param products [Telemetry::V1::Product] Contains information about specific products added to the environment + # @param runtime_name [String] Runtime being used + # @param runtime_patches [String] String of patches applied to the runtime + # @param runtime_version [String] Runtime version; potentially the same as :language_version + # @param service_name [String] Service’s name (DD_SERVICE) + # @param service_version [String] Service’s version (DD_VERSION) + # @param tracer_version [String] Version of the used tracer + def initialize(language_name:, language_version:, service_name:, tracer_version:, env: nil, products: nil, + runtime_name: nil, runtime_patches: nil, runtime_version: nil, service_version: nil) + validate(language_name: language_name, language_version: language_version, service_name: service_name, + tracer_version: tracer_version) + @env = env + @language_name = language_name + @language_version = language_version + @products = products + @runtime_name = runtime_name + @runtime_patches = runtime_patches + @runtime_version = runtime_version + @service_name = service_name + @service_version = service_version + @tracer_version = tracer_version + end + + private + + # Validates required arguments passed to the class on initialization are not nil + # + # @!visibility private + def validate(language_name:, language_version:, service_name:, tracer_version:) + raise ArgumentError, ERROR_NIL_LANGUAGE_NAME_MESSAGE if language_name.nil? + raise ArgumentError, ERROR_NIL_LANGUAGE_VERSION_MESSAGE if language_version.nil? + raise ArgumentError, ERROR_NIL_SERVICE_NAME_MESSAGE if service_name.nil? + raise ArgumentError, ERROR_NIL_TRACER_VERSION_MESSAGE if tracer_version.nil? + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/appsec.rb b/lib/datadog/core/telemetry/v1/appsec.rb new file mode 100644 index 00000000000..14075a44689 --- /dev/null +++ b/lib/datadog/core/telemetry/v1/appsec.rb @@ -0,0 +1,21 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for appsec object + class AppSec + ERROR_NIL_VERSION_MESSAGE = ':version must not be nil'.freeze + + attr_reader :version + + # @param version [String] Version of the appsec product + def initialize(version:) + raise ArgumentError, ERROR_NIL_VERSION_MESSAGE if version.nil? + + @version = version + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/configuration.rb b/lib/datadog/core/telemetry/v1/configuration.rb new file mode 100644 index 00000000000..bb95d1575ba --- /dev/null +++ b/lib/datadog/core/telemetry/v1/configuration.rb @@ -0,0 +1,25 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for additional payload or configuration object + class Configuration + ERROR_NIL_NAME_MESSAGE = ':name must not be nil'.freeze + + attr_reader \ + :name, + :value + + # @param name [String] Configuration/additional payload attribute name + # @param value [String, Integer, Boolean] Corresponding value + def initialize(name:, value: nil) + raise ArgumentError, ERROR_NIL_NAME_MESSAGE if name.nil? + + @name = name + @value = value + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/dependency.rb b/lib/datadog/core/telemetry/v1/dependency.rb new file mode 100644 index 00000000000..cf516331b25 --- /dev/null +++ b/lib/datadog/core/telemetry/v1/dependency.rb @@ -0,0 +1,28 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for dependency object + class Dependency + ERROR_NIL_NAME_MESSAGE = ':name must not be nil'.freeze + + attr_reader \ + :hash, + :name, + :version + + # @param name [String] Module name + # @param version [String] Version of resolved module + # @param hash [String] Dependency hash + def initialize(name:, version: nil, hash: nil) + raise ArgumentError, ERROR_NIL_NAME_MESSAGE if name.nil? + + @hash = hash + @name = name + @version = version + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/host.rb b/lib/datadog/core/telemetry/v1/host.rb new file mode 100644 index 00000000000..850b01e457b --- /dev/null +++ b/lib/datadog/core/telemetry/v1/host.rb @@ -0,0 +1,37 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for host object + class Host + attr_reader \ + :container_id, + :hostname, + :kernel_name, + :kernel_release, + :kernel_version, + :os_version, + :os + + # @param container_id [String] Docker container ID + # @param hostname [String] uname -n + # @param kernel_name [String] uname -s + # @param kernel_release [String] uname -r + # @param kernel_version [String] uname -v + # @param os [String] uname -o + # @param os_version [String] Version of OS running + def initialize(container_id: nil, hostname: nil, kernel_name: nil, kernel_release: nil, kernel_version: nil, + os_version: nil, os: nil) + @container_id = container_id + @hostname = hostname + @kernel_name = kernel_name + @kernel_release = kernel_release + @kernel_version = kernel_version + @os = os + @os_version = os_version + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/integration.rb b/lib/datadog/core/telemetry/v1/integration.rb new file mode 100644 index 00000000000..a9c77689fe7 --- /dev/null +++ b/lib/datadog/core/telemetry/v1/integration.rb @@ -0,0 +1,47 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for integration object + class Integration + ERROR_NIL_ENABLED_MESSAGE = ':enabled must not be nil'.freeze + ERROR_NIL_NAME_MESSAGE = ':name must not be nil'.freeze + + attr_reader \ + :auto_enabled, + :compatible, + :enabled, + :error, + :name, + :version + + # @param enabled [Boolean] Whether integration is enabled at time of request + # @param name [String] Integration name + # @param auto_enabled [Boolean] If integration is not enabled by default, but by user choice + # @param compatible [Boolean] If integration is available, but incompatible + # @param error [String] Error message if integration fails to load + # @param version [String] Integration version (if specified in app-started, it should be for other events too) + def initialize(enabled:, name:, auto_enabled: nil, compatible: nil, error: nil, version: nil) + validate(enabled: enabled, name: name) + @auto_enabled = auto_enabled + @compatible = compatible + @enabled = enabled + @error = error + @name = name + @version = version + end + + private + + # Validates all required arguments passed to the class on initialization are not nil + # + # @!visibility private + def validate(enabled:, name:) + raise ArgumentError, ERROR_NIL_ENABLED_MESSAGE if enabled.nil? + raise ArgumentError, ERROR_NIL_NAME_MESSAGE if name.nil? + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/product.rb b/lib/datadog/core/telemetry/v1/product.rb new file mode 100644 index 00000000000..6a91833a56e --- /dev/null +++ b/lib/datadog/core/telemetry/v1/product.rb @@ -0,0 +1,21 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for products object + class Product + attr_reader \ + :appsec, + :profiler + + # @param appsec [Telemetry::V1::AppSec] Holds custom information about the appsec product + # @param profiler [Telemetry::V1::Profiler] Holds custom information about the profiler product + def initialize(appsec: nil, profiler: nil) + @appsec = appsec + @profiler = profiler + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/profiler.rb b/lib/datadog/core/telemetry/v1/profiler.rb new file mode 100644 index 00000000000..729f35db56d --- /dev/null +++ b/lib/datadog/core/telemetry/v1/profiler.rb @@ -0,0 +1,21 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for profiler object + class Profiler + ERROR_NIL_VERSION_MESSAGE = ':version must not be nil'.freeze + + attr_reader :version + + # @param version [String] version of the profiler product + def initialize(version:) + raise ArgumentError, ERROR_NIL_VERSION_MESSAGE if version.nil? + + @version = version + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/v1/telemetry_request.rb b/lib/datadog/core/telemetry/v1/telemetry_request.rb new file mode 100644 index 00000000000..ae8a9f8260d --- /dev/null +++ b/lib/datadog/core/telemetry/v1/telemetry_request.rb @@ -0,0 +1,75 @@ +module Datadog + module Core + module Telemetry + module V1 + # Describes attributes for telemetry API request + class TelemetryRequest + ERROR_NIL_API_VERSION_MESSAGE = ':api_version must not be nil'.freeze + ERROR_NIL_APPLICATION_MESSAGE = ':application must not be nil'.freeze + ERROR_NIL_HOST_MESSAGE = ':host must not be nil'.freeze + ERROR_NIL_PAYLOAD_MESSAGE = ':payload must not be nil'.freeze + ERROR_NIL_REQUEST_TYPE_MESSAGE = ':request_type must not be nil'.freeze + ERROR_NIL_RUNTIME_ID_MESSAGE = ':runtime_id must not be nil'.freeze + ERROR_NIL_SEQ_ID_MESSAGE = ':seq_id must not be nil'.freeze + ERROR_NIL_TRACER_TIME_MESSAGE = ':tracer_time must not be nil'.freeze + + attr_reader \ + :api_version, + :application, + :debug, + :host, + :payload, + :request_type, + :runtime_id, + :seq_id, + :session_id, + :tracer_time + + # @param api_version [String] Requested API version, `v1` + # @param application [Telemetry::V1::Application] Object that contains information about the environment of the + # application + # @param host [Telemetry::V1::Host] Object that holds host related information + # @param payload [Telemetry::V1::AppStarted] The payload of the request, type impacted by :request_type + # @param request_type [String] Requested API function impacting the Payload type, `app-started` + # @param runtime_id [String] V4 UUID that represents a tracer session + # @param seq_id [Integer] Counter that should be auto incremented every time an API call is being made + # @param tracer_time [Integer] Unix timestamp (in seconds) of when the message is being sent + # @param debug [Boolean] Flag that enables payload debug mode + # @param session_id [String] V4 UUID that represents the session of the top level tracer process, often same\ + # as runtime_id + def initialize(api_version:, application:, host:, payload:, request_type:, runtime_id:, seq_id:, tracer_time:, + debug: nil, session_id: nil) + validate(api_version: api_version, application: application, host: host, payload: payload, + request_type: request_type, runtime_id: runtime_id, seq_id: seq_id, tracer_time: tracer_time) + @api_version = api_version + @application = application + @debug = debug + @host = host + @payload = payload + @request_type = request_type + @runtime_id = runtime_id + @seq_id = seq_id + @session_id = session_id + @tracer_time = tracer_time + end + + private + + # Validates all required arguments passed to the class on initialization are not nil + # + # @!visibility private + def validate(api_version:, application:, host:, payload:, request_type:, runtime_id:, seq_id:, tracer_time:) + raise ArgumentError, ERROR_NIL_API_VERSION_MESSAGE if api_version.nil? + raise ArgumentError, ERROR_NIL_APPLICATION_MESSAGE if application.nil? + raise ArgumentError, ERROR_NIL_HOST_MESSAGE if host.nil? + raise ArgumentError, ERROR_NIL_PAYLOAD_MESSAGE if payload.nil? + raise ArgumentError, ERROR_NIL_REQUEST_TYPE_MESSAGE if request_type.nil? + raise ArgumentError, ERROR_NIL_RUNTIME_ID_MESSAGE if runtime_id.nil? + raise ArgumentError, ERROR_NIL_SEQ_ID_MESSAGE if seq_id.nil? + raise ArgumentError, ERROR_NIL_TRACER_TIME_MESSAGE if tracer_time.nil? + end + end + end + end + end +end diff --git a/spec/datadog/core/telemetry/v1/app_started_spec.rb b/spec/datadog/core/telemetry/v1/app_started_spec.rb new file mode 100644 index 00000000000..ed8c8a0d4bb --- /dev/null +++ b/spec/datadog/core/telemetry/v1/app_started_spec.rb @@ -0,0 +1,125 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/configuration' +require 'datadog/core/telemetry/v1/dependency' +require 'datadog/core/telemetry/v1/integration' + +RSpec.describe Datadog::Core::Telemetry::V1::AppStarted do + subject(:app_started) do + described_class.new( + additional_payload: additional_payload, + configuration: configuration, + dependencies: dependencies, + integrations: integrations, + ) + end + + let(:additional_payload) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE')] } + let(:configuration) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG')] } + let(:dependencies) { [Datadog::Core::Telemetry::V1::Dependency.new(name: 'pg')] } + let(:integrations) { [Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true)] } + + it do + is_expected.to have_attributes( + additional_payload: additional_payload, + configuration: configuration, + dependencies: dependencies, + integrations: integrations, + ) + end + + describe '#initialize' do + context 'when :additional_payload' do + context 'is nil' do + let(:additional_payload) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Configuration' do + let(:additional_payload) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE')] } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Configurations with multiple elements' do + let(:additional_payload) do + [ + Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE'), + Datadog::Core::Telemetry::V1::Configuration.new(name: 'ANOTHER_VAR'), + Datadog::Core::Telemetry::V1::Configuration.new(name: 'SOME_OTHER_VARIABLE') + ] + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :configuration' do + context 'is nil' do + let(:configuration) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Configuration' do + let(:configuration) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG')] } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Configurations with multiple elements' do + let(:configuration) do + [ + Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG'), + Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_SERVICE_NAME'), + Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_ENV') + ] + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :dependencies' do + context 'is nil' do + let(:dependencies) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Dependency' do + let(:dependencies) { [Datadog::Core::Telemetry::V1::Dependency.new(name: 'pg')] } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Dependencies with multiple elements' do + let(:dependencies) do + [ + Datadog::Core::Telemetry::V1::Dependency.new(name: 'pg'), + Datadog::Core::Telemetry::V1::Dependency.new(name: 'kafka'), + Datadog::Core::Telemetry::V1::Dependency.new(name: 'mongodb') + ] + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :integrations' do + context 'is nil' do + let(:integrations) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Integration' do + let(:integrations) { [Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true)] } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is array of Integrations with multiple elements' do + let(:integrations) do + [ + Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true), + Datadog::Core::Telemetry::V1::Integration.new(name: 'kafka', enabled: true), + Datadog::Core::Telemetry::V1::Integration.new(name: 'mongodb', enabled: false) + ] + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + end +end diff --git a/spec/datadog/core/telemetry/v1/application_spec.rb b/spec/datadog/core/telemetry/v1/application_spec.rb new file mode 100644 index 00000000000..0275e7f8fbe --- /dev/null +++ b/spec/datadog/core/telemetry/v1/application_spec.rb @@ -0,0 +1,110 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/shared_examples' +require 'datadog/core/telemetry/v1/application' +require 'datadog/core/telemetry/v1/product' +require 'datadog/core/telemetry/v1/appsec' +require 'datadog/core/telemetry/v1/profiler' + +RSpec.describe Datadog::Core::Telemetry::V1::Application do + subject(:application) do + described_class.new( + env: env, + language_name: language_name, + language_version: language_version, + products: products, + runtime_name: runtime_name, + runtime_patches: runtime_patches, + runtime_version: runtime_version, + service_name: service_name, + service_version: service_version, + tracer_version: tracer_version + ) + end + + let(:env) { 'prod' } + let(:language_name) { 'ruby' } + let(:language_version) { '3.0' } + let(:products) do + Datadog::Core::Telemetry::V1::Product.new( + appsec: Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0'), + profiler: Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') + ) + end + let(:runtime_name) { 'ruby30' } + let(:runtime_patches) { 'patch' } + let(:runtime_version) { '3.2.1' } + let(:service_name) { 'myapp' } + let(:service_version) { '1.2.3' } + let(:tracer_version) { '1.0' } + + it do + is_expected.to have_attributes( + env: env, + language_name: language_name, + language_version: language_version, + products: products, + runtime_name: runtime_name, + runtime_patches: runtime_patches, + runtime_version: runtime_version, + service_name: service_name, + service_version: service_version, + tracer_version: tracer_version + ) + end + + describe '#initialize' do + context ':language_name' do + it_behaves_like 'a required string parameter', 'language_name' + end + + context ':language_version' do + it_behaves_like 'a required string parameter', 'language_version' + end + + context ':service_name' do + it_behaves_like 'a required string parameter', 'service_name' + end + + context ':tracer_version' do + it_behaves_like 'a required string parameter', 'tracer_version' + end + + context ':env' do + it_behaves_like 'an optional string parameter', 'env' + end + + context ':runtime_name' do + it_behaves_like 'an optional string parameter', 'runtime_name' + end + + context ':runtime_patches' do + it_behaves_like 'an optional string parameter', 'runtime_patches' + end + + context ':runtime_version' do + it_behaves_like 'an optional string parameter', 'runtime_version' + end + + context ':service_version' do + it_behaves_like 'an optional string parameter', 'service_version' + end + + context 'when :products' do + context 'is nil' do + let(:products) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is valid' do + let(:products) do + Datadog::Core::Telemetry::V1::Product.new( + appsec: Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0'), + profiler: Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') + ) + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + end +end diff --git a/spec/datadog/core/telemetry/v1/appsec_spec.rb b/spec/datadog/core/telemetry/v1/appsec_spec.rb new file mode 100644 index 00000000000..2aad7941535 --- /dev/null +++ b/spec/datadog/core/telemetry/v1/appsec_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/appsec' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::AppSec do + subject(:appsec) { described_class.new(version: version) } + + let(:version) { '1.0' } + + it { is_expected.to have_attributes(version: version) } + + describe '#initialize' do + context ':version' do + it_behaves_like 'a required string parameter', 'version' + end + end +end diff --git a/spec/datadog/core/telemetry/v1/configuration_spec.rb b/spec/datadog/core/telemetry/v1/configuration_spec.rb new file mode 100644 index 00000000000..1c2ce15c7ba --- /dev/null +++ b/spec/datadog/core/telemetry/v1/configuration_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/configuration' + +RSpec.describe Datadog::Core::Telemetry::V1::Configuration do + subject(:configuration) { described_class.new(name: name, value: value) } + + let(:name) { 'DD_TRACE_DEBUG' } + let(:value) { true } + + it { is_expected.to have_attributes(name: name, value: value) } + + describe '#initialize' do + context ':name' do + it_behaves_like 'a required string parameter', 'name' + end + + context 'when :value' do + context 'is nil' do + let(:value) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is string' do + let(:value) { 'true' } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is bool' do + let(:value) { true } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is int' do + let(:value) { 1 } + it { is_expected.to be_a_kind_of(described_class) } + end + end + end +end diff --git a/spec/datadog/core/telemetry/v1/dependency_spec.rb b/spec/datadog/core/telemetry/v1/dependency_spec.rb new file mode 100644 index 00000000000..eda41dff337 --- /dev/null +++ b/spec/datadog/core/telemetry/v1/dependency_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/dependency' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::Dependency do + subject(:dependency) { described_class.new(name: name, version: version, hash: hash) } + + let(:hash) { '3e2e2c2362c89aa01bc0e004681e' } + let(:name) { 'mongodb' } + let(:version) { '2.2.5' } + + it { is_expected.to have_attributes(name: name, hash: hash, version: version) } + + describe '#initialize' do + context ':name' do + it_behaves_like 'a required string parameter', 'name' + end + + context ':version' do + it_behaves_like 'an optional string parameter', 'version' + end + + context ':hash' do + it_behaves_like 'an optional string parameter', 'hash' + end + end +end diff --git a/spec/datadog/core/telemetry/v1/host_spec.rb b/spec/datadog/core/telemetry/v1/host_spec.rb new file mode 100644 index 00000000000..15802f386aa --- /dev/null +++ b/spec/datadog/core/telemetry/v1/host_spec.rb @@ -0,0 +1,68 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/host' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::Host do + subject(:host) do + described_class.new( + container_id: container_id, + hostname: hostname, + kernel_name: kernel_name, + kernel_release: kernel_release, + kernel_version: kernel_version, + os_version: os_version, + os: os + ) + end + + let(:container_id) { 'd39b145254d1f9c337fdd2be132f6' } + let(:hostname) { 'i-09ecf74c319c49be8' } + let(:kernel_name) { 'Linux' } + let(:kernel_release) { '5.4.0-1037-gcp' } + let(:kernel_version) { '#40~18.04.1-Ubuntu SMP Fri Feb 5 15:41:35 UTC 2021' } + let(:os_version) { 'ubuntu 18.04.5 LTS (Bionic Beaver)' } + let(:os) { 'GNU/Linux' } + + it do + is_expected.to have_attributes( + container_id: container_id, + hostname: hostname, + kernel_name: kernel_name, + kernel_release: kernel_release, + kernel_version: kernel_version, + os_version: os_version, + os: os + ) + end + + describe '#initialize' do + context ':container_id' do + it_behaves_like 'an optional string parameter', 'container_id' + end + + context ':hostname' do + it_behaves_like 'an optional string parameter', 'hostname' + end + + context ':kernel_name' do + it_behaves_like 'an optional string parameter', 'kernel_name' + end + + context ':kernel_release' do + it_behaves_like 'an optional string parameter', 'kernel_release' + end + + context ':kernel_version' do + it_behaves_like 'an optional string parameter', 'kernel_version' + end + + context ':os_version' do + it_behaves_like 'an optional string parameter', 'os_version' + end + + context ':os' do + it_behaves_like 'an optional string parameter', 'os' + end + end +end diff --git a/spec/datadog/core/telemetry/v1/integration_spec.rb b/spec/datadog/core/telemetry/v1/integration_spec.rb new file mode 100644 index 00000000000..533f6e88b65 --- /dev/null +++ b/spec/datadog/core/telemetry/v1/integration_spec.rb @@ -0,0 +1,61 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/integration' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::Integration do + subject(:integration) do + described_class.new( + auto_enabled: auto_enabled, + compatible: compatible, + enabled: enabled, + error: error, + name: name, + version: version + ) + end + + let(:auto_enabled) { false } + let(:compatible) { true } + let(:enabled) { false } + let(:error) { 'Failed to enable' } + let(:name) { 'pg' } + let(:version) { '1.7.0' } + + it do + is_expected.to have_attributes( + auto_enabled: auto_enabled, + compatible: compatible, + enabled: enabled, + error: error, + name: name, + version: version + ) + end + + describe '#initialize' do + context ':auto_enabled' do + it_behaves_like 'an optional boolean parameter', 'auto_enabled' + end + + context ':compatible' do + it_behaves_like 'an optional boolean parameter', 'compatible' + end + + context ':enabled' do + it_behaves_like 'a required boolean parameter', 'enabled' + end + + context ':error' do + it_behaves_like 'an optional string parameter', 'error' + end + + context ':name' do + it_behaves_like 'a required string parameter', 'name' + end + + context ':version' do + it_behaves_like 'an optional string parameter', 'version' + end + end +end diff --git a/spec/datadog/core/telemetry/v1/product_spec.rb b/spec/datadog/core/telemetry/v1/product_spec.rb new file mode 100644 index 00000000000..9ca33f448bc --- /dev/null +++ b/spec/datadog/core/telemetry/v1/product_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/product' +require 'datadog/core/telemetry/v1/appsec' +require 'datadog/core/telemetry/v1/profiler' + +RSpec.describe Datadog::Core::Telemetry::V1::Product do + subject(:product) { described_class.new(appsec: appsec, profiler: profiler) } + + let(:appsec) { Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0') } + let(:profiler) { Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') } + + it { is_expected.to have_attributes(appsec: appsec, profiler: profiler) } + + describe '#initialize' do + context 'when :appsec' do + context 'is nil' do + let(:appsec) { nil } + it { is_expected.to have_attributes(appsec: nil, profiler: profiler) } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is valid' do + let(:appsec) { Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0') } + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :profiler' do + context 'is nil' do + let(:profiler) { nil } + it { is_expected.to have_attributes(appsec: appsec, profiler: nil) } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'is valid' do + let(:profiler) { Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') } + it { is_expected.to be_a_kind_of(described_class) } + end + end + end +end diff --git a/spec/datadog/core/telemetry/v1/profiler_spec.rb b/spec/datadog/core/telemetry/v1/profiler_spec.rb new file mode 100644 index 00000000000..5c295cc082b --- /dev/null +++ b/spec/datadog/core/telemetry/v1/profiler_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/profiler' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::Profiler do + subject(:profiler) { described_class.new(version: version) } + + let(:version) { '1.0' } + + it { is_expected.to have_attributes(version: version) } + + describe '#initialize' do + context ':version' do + it_behaves_like 'a required string parameter', 'version' + end + end +end diff --git a/spec/datadog/core/telemetry/v1/shared_examples.rb b/spec/datadog/core/telemetry/v1/shared_examples.rb new file mode 100644 index 00000000000..f8432b229dd --- /dev/null +++ b/spec/datadog/core/telemetry/v1/shared_examples.rb @@ -0,0 +1,59 @@ +require 'spec_helper' + +RSpec.shared_examples 'an optional string parameter' do |argument| + context 'when argument is nil' do + let(argument.to_sym) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'when argument is valid' do + let(argument.to_sym) { 'valid string' } + it { is_expected.to be_a_kind_of(described_class) } + end +end + +RSpec.shared_examples 'a required string parameter' do |argument| + context 'when argument is nil' do + let(argument.to_sym) { nil } + it { expect { subject }.to raise_error(ArgumentError) } + end + + context 'when argument is valid' do + let(argument.to_sym) { 'valid string' } + it { is_expected.to be_a_kind_of(described_class) } + end +end + +RSpec.shared_examples 'a required boolean parameter' do |argument| + context 'when argument is nil' do + let(argument.to_sym) { nil } + it { expect { subject }.to raise_error(ArgumentError) } + end + + context 'when argument is true' do + let(argument.to_sym) { true } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'when argument is false' do + let(argument.to_sym) { false } + it { is_expected.to be_a_kind_of(described_class) } + end +end + +RSpec.shared_examples 'an optional boolean parameter' do |argument| + context 'when argument is nil' do + let(argument.to_sym) { nil } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'when argument is true' do + let(argument.to_sym) { true } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'when argument is false' do + let(argument.to_sym) { false } + it { is_expected.to be_a_kind_of(described_class) } + end +end diff --git a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb new file mode 100644 index 00000000000..57e2b9f561d --- /dev/null +++ b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb @@ -0,0 +1,167 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/v1/telemetry_request' +require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/application' +require 'datadog/core/telemetry/v1/host' +require 'datadog/core/telemetry/v1/integration' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::V1::TelemetryRequest do + subject(:telemetry_request) do + described_class.new( + api_version: api_version, + application: application, + debug: debug, + host: host, + payload: payload, + request_type: request_type, + runtime_id: runtime_id, + seq_id: seq_id, + session_id: session_id, + tracer_time: tracer_time + ) + end + + let(:api_version) { 'v1' } + let(:application) do + Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', + service_name: 'myapp', tracer_version: '1.0') + end + let(:debug) { false } + let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } + let(:payload) do + Datadog::Core::Telemetry::V1::AppStarted.new( + integrations: [Datadog::Core::Telemetry::V1::Integration.new( + name: 'pg', enabled: true + )] + ) + end + let(:request_type) { 'app-started' } + let(:runtime_id) { '20338dfd-f700-0d470f054ae8' } + let(:seq_id) { 42 } + let(:session_id) { '20338dfd-f700-0d470f054ae8' } + let(:tracer_time) { 1654805621 } + + it do + is_expected.to have_attributes( + api_version: api_version, + application: application, + debug: debug, + host: host, + payload: payload, + request_type: request_type, + runtime_id: runtime_id, + seq_id: seq_id, + session_id: session_id, + tracer_time: tracer_time + ) + end + + describe '#initialize' do + context 'when :api_version' do + context 'is nil' do + let(:api_version) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is string' do + let(:api_version) { 'v1' } + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :application' do + context 'is nil' do + let(:application) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid' do + let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context ':debug' do + it_behaves_like 'an optional boolean parameter', 'debug' + end + + context 'when :host' do + context 'is nil' do + let(:host) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid' do + let(:application) do + Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', + service_name: 'myapp', tracer_version: '1.0') + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :payload' do + context 'is nil' do + let(:payload) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid' do + let(:payload) do + Datadog::Core::Telemetry::V1::AppStarted.new( + integrations: [Datadog::Core::Telemetry::V1::Integration.new( + name: 'pg', enabled: true + )] + ) + end + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context 'when :request_type' do + context 'is nil' do + let(:request_type) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid string' do + let(:request_type) { 'app-started' } + it { is_expected.to be_a_kind_of(described_class) } + end + + context ':runtime_id' do + it_behaves_like 'a required string parameter', 'runtime_id' + end + + context 'when :seq_id' do + context 'is nil' do + let(:seq_id) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid int' do + let(:seq_id) { 42 } + it { is_expected.to be_a_kind_of(described_class) } + end + end + + context ':session_id' do + it_behaves_like 'an optional string parameter', 'session_id' + end + + context 'when :tracer_time' do + context 'is nil' do + let(:tracer_time) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid int' do + let(:tracer_time) { 1654805621 } + it { is_expected.to be_a_kind_of(described_class) } + end + end + end + end +end From 184face9758a5e3024a4283ed8d4e4bf705a437b Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Wed, 29 Jun 2022 13:34:21 -0400 Subject: [PATCH 0360/2133] Collect metadata for app-started event (#2102) * Collect loaded integrations and dependencies * fixup! Collect loaded integrations and dependencies * Collect system info * Use stdlib etc * Add top-level request method * Add test cases for payload + fixups * fixup! Add test cases for payload + fixups * Fix sorbet errors * Refactor collector module * fixup! Refactor collector module * Sort initialization args alphabetically * Get configuration values from Datadog.configuration * Use platform util for host information * Collect only boolean configurations * Reorganize collector module * Store patch result when patch is called * Capture patch errors for telemetry * fixup! Capture patch errors for telemetry * Update config variables based on standardized spec * Implement configuration.to_hash to collect config variables * Add dig function to configuration base * fixup! Add dig function to configuration base --- lib/datadog/core.rb | 1 + lib/datadog/core/configuration/base.rb | 9 + lib/datadog/core/telemetry/collector.rb | 248 +++++++++++++ lib/datadog/tracing/contrib/patcher.rb | 11 + lib/ddtrace/auto_instrument.rb | 7 + spec/datadog/core/configuration/base_spec.rb | 26 ++ spec/datadog/core/telemetry/collector_spec.rb | 342 ++++++++++++++++++ spec/datadog/tracing/contrib/patcher_spec.rb | 6 +- spec/ddtrace/auto_instrument_spec.rb | 8 + 9 files changed, 655 insertions(+), 3 deletions(-) create mode 100644 lib/datadog/core/telemetry/collector.rb create mode 100644 spec/datadog/core/telemetry/collector_spec.rb diff --git a/lib/datadog/core.rb b/lib/datadog/core.rb index f3d4621a1fd..3e20d7b7a3a 100644 --- a/lib/datadog/core.rb +++ b/lib/datadog/core.rb @@ -55,6 +55,7 @@ # require_relative 'core/workers/runtime_metrics' require_relative 'core/extensions' +require_relative 'core/telemetry/collector' # We must load core extensions to make certain global APIs # accessible: both for Datadog features and the core itself. diff --git a/lib/datadog/core/configuration/base.rb b/lib/datadog/core/configuration/base.rb index 99a17a746e5..f6ab1fbb71c 100644 --- a/lib/datadog/core/configuration/base.rb +++ b/lib/datadog/core/configuration/base.rb @@ -79,6 +79,15 @@ def to_h options_hash end + # Retrieves a nested option from a list of symbols + def dig(*options) + raise ArgumentError, 'expected at least one option' if options.empty? + + options.inject(self) do |receiver, option| + receiver.send(option) + end + end + def reset! reset_options! end diff --git a/lib/datadog/core/telemetry/collector.rb b/lib/datadog/core/telemetry/collector.rb new file mode 100644 index 00000000000..8665b73ceda --- /dev/null +++ b/lib/datadog/core/telemetry/collector.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +# typed: true + +require 'etc' + +require 'datadog/core/configuration/agent_settings_resolver' +require 'datadog/core/environment/ext' +require 'datadog/core/environment/platform' +require 'datadog/core/telemetry/v1/application' +require 'datadog/core/telemetry/v1/appsec' +require 'datadog/core/telemetry/v1/dependency' +require 'datadog/core/telemetry/v1/host' +require 'datadog/core/telemetry/v1/integration' +require 'datadog/core/telemetry/v1/product' +require 'datadog/core/telemetry/v1/profiler' +require 'ddtrace/transport/ext' + +module Datadog + module Core + module Telemetry + # Module defining methods for collecting metadata for telemetry + # rubocop:disable Metrics/ModuleLength + module Collector + include Datadog::Core::Configuration + + # Forms a hash of configuration key value pairs to be sent in the additional payload + def additional_payload + additional_payload_variables + end + + # Forms a telemetry application object + def application + Telemetry::V1::Application.new( + env: env, + language_name: Datadog::Core::Environment::Ext::LANG, + language_version: Datadog::Core::Environment::Ext::LANG_VERSION, + products: products, + runtime_name: Datadog::Core::Environment::Ext::RUBY_ENGINE, + runtime_version: Datadog::Core::Environment::Ext::ENGINE_VERSION, + service_name: service_name, + service_version: service_version, + tracer_version: tracer_version + ) + end + + # Forms a hash of standard key value pairs to be sent in the app-started event configuration + def configurations + configurations = { + DD_AGENT_HOST: Datadog.configuration.agent.host, + DD_AGENT_TRANSPORT: agent_transport, + DD_TRACE_SAMPLE_RATE: format_configuration_value(Datadog.configuration.tracing.sampling.default_rate), + } + compact_hash(configurations) + end + + # Forms a telemetry app-started dependencies object + def dependencies + Gem.loaded_specs.collect do |name, loaded_gem| + Datadog::Core::Telemetry::V1::Dependency.new( + name: name, version: loaded_gem.version.to_s, hash: loaded_gem.hash.to_s + ) + end + end + + # Forms a telemetry host object + def host + Telemetry::V1::Host.new( + container_id: Core::Environment::Container.container_id, + hostname: Core::Environment::Platform.hostname, + kernel_name: Core::Environment::Platform.kernel_name, + kernel_release: Core::Environment::Platform.kernel_release, + kernel_version: Core::Environment::Platform.kernel_version + ) + end + + # Forms a telemetry app-started integrations object + def integrations + Datadog.registry.map do |integration| + is_instrumented = instrumented?(integration) + is_enabled = is_instrumented && patched?(integration) + Telemetry::V1::Integration.new( + name: integration.name.to_s, + enabled: is_enabled, + version: integration_version(integration), + compatible: integration_compatible?(integration), + error: (patch_error(integration) if is_instrumented && !is_enabled), + auto_enabled: is_enabled ? integration_auto_instrument?(integration) : nil + ) + end + end + + # Returns the runtime ID of the current process + def runtime_id + Datadog::Core::Environment::Identity.id + end + + # Returns the current as a UNIX timestamp in seconds + def tracer_time + Time.now.to_i + end + + private + + TARGET_OPTIONS = [ + 'ci.enabled', + 'logger.level', + 'profiling.advanced.code_provenance_enabled', + 'profiling.advanced.endpoint.collection.enabled', + 'profiling.enabled', + 'runtime_metrics.enabled', + 'tracing.analytics.enabled', + 'tracing.distributed_tracing.propagation_inject_style', + 'tracing.distributed_tracing.propagation_extract_style', + 'tracing.enabled', + 'tracing.log_injection', + 'tracing.partial_flush.enabled', + 'tracing.partial_flush.min_spans_threshold', + 'tracing.priority_sampling', + 'tracing.report_hostname', + 'tracing.sampling.default_rate', + 'tracing.sampling.rate_limit' + ].freeze + + def additional_payload_variables + # Whitelist of configuration options to send in additional payload object + configuration = Datadog.configuration + options = TARGET_OPTIONS.each_with_object({}) do |option, hash| + split_option = option.split('.') + hash[option] = format_configuration_value(configuration.dig(*split_option)) + end + + # Add some more custom additional payload values here + options['tracing.auto_instrument.enabled'] = !defined?(Datadog::AutoInstrument::LOADED).nil? + options['tracing.writer_options.buffer_size'] = + format_configuration_value(configuration.tracing.writer_options[:buffer_size]) + options['tracing.writer_options.flush_interval'] = + format_configuration_value(configuration.tracing.writer_options[:flush_interval]) + options['logger.instance'] = configuration.logger.instance.class.to_s + + compact_hash(options) + end + + def format_configuration_value(value) + # TODO: Add float if telemetry starts accepting it + case value + when Integer, String, true, false, nil + value + else + value.to_s + end + end + + # Manual implementation of hash.compact used because it is unsupported by older Ruby versions (<2.4) + def compact_hash(hash) + hash.delete_if { |_k, v| v.nil? } + end + + def env + Datadog.configuration.env + end + + def service_name + Datadog.configuration.service + end + + def service_version + Datadog.configuration.version + end + + def tracer_version + Core::Environment::Identity.tracer_version + end + + def products + profiler_obj = profiler + appsec_obj = appsec + profiler_obj || appsec_obj ? Telemetry::V1::Product.new(profiler: profiler_obj, appsec: appsec_obj) : nil + end + + def profiler + version = profiler_version + Telemetry::V1::Profiler.new(version: version) if version + end + + def profiler_version + tracer_version if Datadog.configuration.profiling.enabled + end + + def appsec + version = appsec_version + Telemetry::V1::AppSec.new(version: version) if version + end + + def appsec_version + tracer_version if Datadog.configuration.appsec.enabled + end + + def agent_transport + adapter = Core::Configuration::AgentSettingsResolver.call(Datadog.configuration).adapter + if adapter == Datadog::Transport::Ext::UnixSocket::ADAPTER + 'UDS' + else + 'TCP' + end + end + + def instrumented_integrations + Datadog.configuration.tracing.instrumented_integrations + end + + def instrumented?(integration) + instrumented_integrations.include?(integration.name) + end + + def patched?(integration) + !!integration.klass.patcher.patch_successful + end + + def integration_auto_instrument?(integration) + integration.klass.auto_instrument? + end + + def integration_compatible?(integration) + integration.klass.class.compatible? + end + + def integration_version(integration) + integration.klass.class.version ? integration.klass.class.version.to_s : nil + end + + def patch_error(integration) + patch_error_result = integration.klass.patcher.patch_error_result + if patch_error_result.nil? # if no error occurred during patching, but integration is still not instrumented + desc = "Available?: #{integration.klass.class.available?}" + desc += ", Loaded? #{integration.klass.class.loaded?}" + desc += ", Compatible? #{integration.klass.class.compatible?}" + desc += ", Patchable? #{integration.klass.class.patchable?}" + desc + else + patch_error_result.to_s + end + end + end + # rubocop:enable Metrics/ModuleLength + end + end +end diff --git a/lib/datadog/tracing/contrib/patcher.rb b/lib/datadog/tracing/contrib/patcher.rb index b8d1a98bee8..1ead29358bb 100644 --- a/lib/datadog/tracing/contrib/patcher.rb +++ b/lib/datadog/tracing/contrib/patcher.rb @@ -19,6 +19,10 @@ def self.included(base) # Prepended instance methods for all patchers # @public_api module CommonMethods + attr_accessor \ + :patch_error_result, + :patch_successful + def patch_name self.class != Class && self.class != Module ? self.class.name : name end @@ -35,6 +39,7 @@ def patch super.tap do # Emit a metric Datadog.health_metrics.instrumentation_patched(1, tags: default_tags) + @patch_successful = true end rescue StandardError => e on_patch_error(e) @@ -48,6 +53,12 @@ def on_patch_error(e) # Log the error Datadog.logger.error("Failed to apply #{patch_name} patch. Cause: #{e} Location: #{Array(e.backtrace).first}") + @patch_error_result = { + type: e.class.name, + message: e.message, + line: Array(e.backtrace).first + } + # Emit a metric tags = default_tags tags << "error:#{e.class.name}" diff --git a/lib/ddtrace/auto_instrument.rb b/lib/ddtrace/auto_instrument.rb index 0034a6c4d30..84cc1db762f 100644 --- a/lib/ddtrace/auto_instrument.rb +++ b/lib/ddtrace/auto_instrument.rb @@ -7,3 +7,10 @@ require_relative '../datadog/tracing/contrib/auto_instrument' Datadog::Profiling.start_if_enabled + +module Datadog + module AutoInstrument + # Flag to determine if Auto Instrumentation was used + LOADED = true + end +end diff --git a/spec/datadog/core/configuration/base_spec.rb b/spec/datadog/core/configuration/base_spec.rb index 89901f8f16a..f1a725d81c4 100644 --- a/spec/datadog/core/configuration/base_spec.rb +++ b/spec/datadog/core/configuration/base_spec.rb @@ -106,6 +106,32 @@ end end + describe '#dig' do + subject(:dig) { base_object.dig(*options) } + let(:options) { 'debug' } + + let(:settings) { base_class.send(:settings, name, &block) } + let(:name) { :debug } + let(:block) { proc { option :enabled, default: true } } + let(:definition) { base_class.options[name] } + + before do + settings + definition + end + + context 'when given one arg' do + let(:options) { 'debug' } + it { is_expected.to be_a_kind_of(Datadog::Core::Configuration::Options) } + end + + context 'when given more than one arg' do + let(:options) { %w[debug enabled] } + + it { is_expected.to be(true) } + end + end + describe '#reset!' do subject(:reset!) { base_object.reset! } diff --git a/spec/datadog/core/telemetry/collector_spec.rb b/spec/datadog/core/telemetry/collector_spec.rb new file mode 100644 index 00000000000..aa3b3bac214 --- /dev/null +++ b/spec/datadog/core/telemetry/collector_spec.rb @@ -0,0 +1,342 @@ +require 'spec_helper' + +require 'datadog/appsec' +require 'datadog/core/configuration' +require 'datadog/core/configuration/agent_settings_resolver' +require 'datadog/core/environment/ext' +require 'datadog/core/telemetry/collector' +require 'datadog/core/telemetry/v1/application' +require 'datadog/core/telemetry/v1/appsec' +require 'datadog/core/telemetry/v1/configuration' +require 'datadog/core/telemetry/v1/dependency' +require 'datadog/core/telemetry/v1/host' +require 'datadog/core/telemetry/v1/integration' +require 'datadog/core/telemetry/v1/product' +require 'datadog/core/telemetry/v1/profiler' +require 'ddtrace/transport/ext' + +require 'ddtrace' +require 'ddtrace/version' + +RSpec.describe Datadog::Core::Telemetry::Collector do + let(:dummy_class) { Class.new { extend(Datadog::Core::Telemetry::Collector) } } + + describe '#application' do + subject(:application) { dummy_class.application } + let(:env_service) { 'default-service' } + + around do |example| + ClimateControl.modify(Datadog::Core::Environment::Ext::ENV_SERVICE => env_service) do + example.run + end + end + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Application) } + + describe ':env' do + subject(:env) { application.env } + + context 'when DD_ENV not set' do + it { is_expected.to be_nil } + end + + context 'when DD_env set' do + around do |example| + ClimateControl.modify(Datadog::Core::Environment::Ext::ENV_ENVIRONMENT => 'test_env') do + example.run + end + end + + it { is_expected.to be_a_kind_of(String) } + it('reads value correctly') { is_expected.to eql('test_env') } + end + end + + describe ':service_name' do + subject(:service_name) { application.service_name } + let(:env_service) { 'test-service' } + + it { is_expected.to be_a_kind_of(String) } + it('reads value correctly') { is_expected.to eql('test-service') } + end + + describe ':service_version' do + subject(:service_version) { application.service_version } + + context 'when DD_VERSION not set' do + it { is_expected.to be_nil } + end + + context 'when DD_VERSION set' do + around do |example| + ClimateControl.modify(Datadog::Core::Environment::Ext::ENV_VERSION => '4.2.0') do + example.run + end + end + + it { is_expected.to be_a_kind_of(String) } + it('reads value correctly') { is_expected.to eql('4.2.0') } + end + end + + describe ':products' do + subject(:products) { application.products } + + context 'when profiling and appsec are disabled' do + before do + Datadog.configuration.profiling.enabled = false + Datadog.configuration.appsec.enabled = false + end + after do + Datadog.configuration.profiling.send(:reset!) + Datadog.configuration.appsec.send(:reset!) + end + it { is_expected.to be_nil } + end + + context 'when profiling is enabled' do + before do + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') + Datadog.configure do |c| + c.profiling.enabled = true + end + end + after { Datadog.configuration.profiling.send(:reset!) } + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } + it { expect(products.profiler).to be_a_kind_of(Datadog::Core::Telemetry::V1::Profiler) } + it { expect(products.profiler.version).to be_a_kind_of(String) } + it { expect(products.profiler).to have_attributes(version: '4.2') } + end + + context 'when appsec is enabled' do + before do + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') + Datadog.configure do |c| + c.appsec.enabled = true + end + end + after { Datadog.configuration.appsec.send(:reset!) } + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } + it { expect(products.appsec).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppSec) } + it { expect(products.appsec.version).to be_a_kind_of(String) } + it { expect(products.appsec).to have_attributes(version: '4.2') } + end + + context 'when both profiler and appsec are enabled' do + before do + Datadog.configure do |c| + c.profiling.enabled = true + c.appsec.enabled = true + end + end + after do + Datadog.configuration.profiling.send(:reset!) + Datadog.configuration.appsec.send(:reset!) + end + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } + it { expect(products.profiler).to be_a_kind_of(Datadog::Core::Telemetry::V1::Profiler) } + it { expect(products.appsec).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppSec) } + end + end + end + + describe '#configurations' do + subject(:configurations) { dummy_class.configurations } + + it { is_expected.to be_a_kind_of(Hash) } + it { expect(configurations.values).to_not include(nil) } + it { expect(configurations.values).to_not include({}) } + + context 'DD_AGENT_HOST' do + let(:dd_agent_host) { 'ddagent' } + + context 'when set via configuration' do + before do + Datadog.configure do |c| + c.agent.host = dd_agent_host + end + end + + it { is_expected.to include(:DD_AGENT_HOST => dd_agent_host) } + end + + context 'when no value set' do + let(:dd_agent_host) { nil } + it { is_expected.to_not include(:DD_AGENT_HOST) } + end + end + + context 'DD_AGENT_TRANSPORT' do + context 'when no configuration variables set' do + it { is_expected.to include(:DD_AGENT_TRANSPORT => 'TCP') } + end + + context 'when adapter is type :unix' do + let(:adapter_type) { Datadog::Transport::Ext::UnixSocket::ADAPTER } + + before do + allow(Datadog::Core::Configuration::AgentSettingsResolver) + .to receive(:call).and_return(double('agent settings', :adapter => adapter_type)) + end + it { is_expected.to include(:DD_AGENT_TRANSPORT => 'UDS') } + end + end + + context 'DD_TRACE_SAMPLE_RATE' do + around do |example| + ClimateControl.modify DD_TRACE_SAMPLE_RATE: dd_trace_sample_rate do + example.run + end + end + + let(:dd_trace_sample_rate) { nil } + context 'when set' do + let(:dd_trace_sample_rate) { '0.2' } + it { is_expected.to include(:DD_TRACE_SAMPLE_RATE => '0.2') } + end + + context 'when nil' do + let(:dd_trace_sample_rate) { nil } + it { is_expected.to_not include(:DD_TRACE_SAMPLE_RATE) } + end + end + end + + describe '#additional_payload' do + subject(:additional_payload) { dummy_class.additional_payload } + + it { is_expected.to be_a_kind_of(Hash) } + it { expect(additional_payload.values).to_not include(nil) } + it { expect(additional_payload.values).to_not include({}) } + + context 'when environment variable configuration' do + let(:dd_tracing_analytics_enabled) { 'true' } + around do |example| + ClimateControl.modify DD_TRACE_ANALYTICS_ENABLED: dd_tracing_analytics_enabled do + example.run + end + end + + context 'is set' do + let(:dd_tracing_analytics_enabled) { 'true' } + it do + is_expected.to include( + 'tracing.analytics.enabled' => true + ) + end + end + + context 'is nil' do + let(:dd_tracing_analytics_enabled) { nil } + it { is_expected.to_not include('tracing.analytics.enabled') } + end + end + end + + describe '#dependencies' do + subject(:dependencies) { dummy_class.dependencies } + + it { is_expected.to be_a_kind_of(Array) } + it { is_expected.to all(be_a(Datadog::Core::Telemetry::V1::Dependency)) } + end + + describe '#host' do + subject(:host) { dummy_class.host } + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Host) } + end + + describe '#integrations' do + subject(:integrations) { dummy_class.integrations } + + it { is_expected.to be_a_kind_of(Array) } + it { is_expected.to all(be_a(Datadog::Core::Telemetry::V1::Integration)) } + it('contains list of all integrations') { expect(integrations.length).to eq(Datadog.registry.entries.length) } + + context 'when a configure block is called' do + around do |example| + Datadog.registry[:rake].reset_configuration! + Datadog.registry[:pg].reset_configuration! + example.run + Datadog.registry[:rake].reset_configuration! + Datadog.registry[:pg].reset_configuration! + end + before do + require 'rake' + Datadog.configure do |c| + c.tracing.instrument :rake + c.tracing.instrument :pg + end + end + + it 'sets integration as enabled' do + expect(integrations).to include( + an_object_having_attributes(name: 'rake', enabled: true, compatible: true, error: nil) + ) + end + + it 'propogates errors with configuration' do + expect(integrations) + .to include( + an_object_having_attributes( + name: 'pg', + enabled: false, + compatible: false, + error: 'Available?: false, Loaded? false, Compatible? false, Patchable? false' + ) + ) + end + end + + context 'when error is raised in patching' do + let(:error) { instance_double('error', class: StandardError, message: nil, backtrace: []) } + before do + Datadog::Tracing::Contrib::Redis::Patcher.on_patch_error(error) + Datadog.configure do |c| + c.tracing.instrument :redis + end + end + after { Datadog::Tracing::Contrib::Redis::Patcher.patch_error_result = nil } + around do |example| + Datadog.registry[:redis].reset_configuration! + example.run + Datadog.registry[:redis].reset_configuration! + end + it do + expect(integrations) + .to include( + an_object_having_attributes( + name: 'redis', + enabled: false, + compatible: false, + error: { type: 'StandardError', message: nil, line: nil }.to_s + ) + ) + end + end + end + + describe '#runtime_id' do + subject(:runtime_id) { dummy_class.runtime_id } + + it { is_expected.to be_a_kind_of(String) } + + context 'when invoked twice' do + it { is_expected.to eq(runtime_id) } + end + end + + describe '#tracer_time' do + subject(:tracer_time) { dummy_class.tracer_time } + + before do + allow(Time).to receive(:now).and_return(Time.new(2020)) + end + + it { is_expected.to be_a_kind_of(Integer) } + it('captures time with Time.now') { is_expected.to eq(1577836800) } + end +end diff --git a/spec/datadog/tracing/contrib/patcher_spec.rb b/spec/datadog/tracing/contrib/patcher_spec.rb index aeecbe57d49..3898d4b21c6 100644 --- a/spec/datadog/tracing/contrib/patcher_spec.rb +++ b/spec/datadog/tracing/contrib/patcher_spec.rb @@ -195,7 +195,7 @@ def self.patch subject(:on_patch_error) { patcher.on_patch_error(error) } - let(:error) { instance_double('error', class: StandardError, backtrace: []) } + let(:error) { instance_double('error', class: StandardError, message: nil, backtrace: []) } before do allow(Datadog.logger).to receive(:error) @@ -282,7 +282,7 @@ def patch subject(:on_patch_error) { patcher.on_patch_error(error) } - let(:error) { instance_double('error', class: StandardError, backtrace: []) } + let(:error) { instance_double('error', class: StandardError, message: nil, backtrace: []) } before do allow(Datadog.logger).to receive(:error) @@ -508,7 +508,7 @@ def self.patch subject(:on_patch_error) { patcher.on_patch_error(error) } - let(:error) { instance_double('error', class: StandardError, backtrace: []) } + let(:error) { instance_double('error', class: StandardError, message: nil, backtrace: []) } before do allow(Datadog.logger).to receive(:error) diff --git a/spec/ddtrace/auto_instrument_spec.rb b/spec/ddtrace/auto_instrument_spec.rb index c11c6ccb07b..236aa7af399 100644 --- a/spec/ddtrace/auto_instrument_spec.rb +++ b/spec/ddtrace/auto_instrument_spec.rb @@ -105,6 +105,14 @@ def migrate_db end end +RSpec.describe 'LOADED variable' do + subject(:auto_instrument) { load 'ddtrace/auto_instrument.rb' } + it do + auto_instrument + expect(Datadog::AutoInstrument::LOADED).to eq(true) + end +end + RSpec.describe 'Profiler startup' do subject(:auto_instrument) { load 'ddtrace/auto_instrument.rb' } From 2d450f75d48696d3acc30a4ee79a54769a014b5f Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Wed, 29 Jun 2022 19:08:26 -0400 Subject: [PATCH 0361/2133] Create Telemetry Event class (#2117) * Create Event class to instantiate TelemetryRequest * Remove request_type, seq_id from Event init * Run linter * Remove validation tests * Update request name * Pass in seq_id as argument * Remove api_version param from init --- lib/datadog/core/telemetry/collector.rb | 2 +- lib/datadog/core/telemetry/event.rb | 63 +++++++++++++++++++ spec/datadog/core/telemetry/collector_spec.rb | 5 +- spec/datadog/core/telemetry/event_spec.rb | 62 ++++++++++++++++++ 4 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 lib/datadog/core/telemetry/event.rb create mode 100644 spec/datadog/core/telemetry/event_spec.rb diff --git a/lib/datadog/core/telemetry/collector.rb b/lib/datadog/core/telemetry/collector.rb index 8665b73ceda..3baada58cc0 100644 --- a/lib/datadog/core/telemetry/collector.rb +++ b/lib/datadog/core/telemetry/collector.rb @@ -193,7 +193,7 @@ def appsec end def appsec_version - tracer_version if Datadog.configuration.appsec.enabled + tracer_version if Datadog.configuration.respond_to?(:appsec) && Datadog.configuration.appsec.enabled end def agent_transport diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb new file mode 100644 index 00000000000..f705414d0ab --- /dev/null +++ b/lib/datadog/core/telemetry/event.rb @@ -0,0 +1,63 @@ +# typed: true + +require 'datadog/core/telemetry/collector' +require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/telemetry_request' + +module Datadog + module Core + module Telemetry + # Class defining methods to construct a Telemetry event + class Event + include Kernel + + include Telemetry::Collector + + API_VERSION = 'v1'.freeze + + attr_reader \ + :api_version + + def initialize + @api_version = API_VERSION + end + + # Forms a TelemetryRequest object based on the event request_type + # @param request_type [String] the type of telemetry request to collect data for + # @param seq_id [Integer] the ID of the request; incremented each time a telemetry request is sent to the API + def telemetry_request(request_type:, seq_id:) + Telemetry::V1::TelemetryRequest.new( + api_version: @api_version, + application: application, + host: host, + payload: payload(request_type), + request_type: request_type, + runtime_id: runtime_id, + seq_id: seq_id, + tracer_time: tracer_time, + ) + end + + private + + def payload(request_type) + case request_type + when 'app-started' + app_started + else + raise ArgumentError, "Request type invalid, received request_type: #{@request_type}" + end + end + + def app_started + Telemetry::V1::AppStarted.new( + dependencies: dependencies, + integrations: integrations, + configuration: configurations, + additional_payload: additional_payload + ) + end + end + end + end +end diff --git a/spec/datadog/core/telemetry/collector_spec.rb b/spec/datadog/core/telemetry/collector_spec.rb index aa3b3bac214..8042ad0e53c 100644 --- a/spec/datadog/core/telemetry/collector_spec.rb +++ b/spec/datadog/core/telemetry/collector_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' -require 'datadog/appsec' require 'datadog/core/configuration' require 'datadog/core/configuration/agent_settings_resolver' require 'datadog/core/environment/ext' @@ -111,6 +110,8 @@ context 'when appsec is enabled' do before do + require 'datadog/appsec' + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') Datadog.configure do |c| c.appsec.enabled = true @@ -125,6 +126,8 @@ end context 'when both profiler and appsec are enabled' do + require 'datadog/appsec' + before do Datadog.configure do |c| c.profiling.enabled = true diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb new file mode 100644 index 00000000000..2db9a92486f --- /dev/null +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -0,0 +1,62 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/event' +require 'datadog/core/telemetry/v1/shared_examples' + +RSpec.describe Datadog::Core::Telemetry::Event do + subject(:event) { described_class.new } + + describe '#initialize' do + subject(:event) { described_class.new } + + it { is_expected.to be_a_kind_of(described_class) } + it { is_expected.to have_attributes(api_version: 'v1') } + end + + describe '#telemetry_request' do + subject(:telemetry_request) { event.telemetry_request(request_type: request_type, seq_id: seq_id) } + + let(:request_type) { 'app-started' } + let(:seq_id) { 1 } + + it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::TelemetryRequest) } + it { expect(telemetry_request.api_version).to eql('v1') } + it { expect(telemetry_request.request_type).to eql(request_type) } + it { expect(telemetry_request.seq_id).to be(1) } + + context 'when :request_type' do + context 'is app-started' do + let(:request_type) { 'app-started' } + + it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppStarted) } + end + + context 'is nil' do + let(:request_type) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is empty string' do + let(:request_type) { '' } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is invalid option' do + let(:request_type) { 'some-request-type' } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + end + + context 'when :seq_id' do + context 'is nil' do + let(:seq_id) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } + end + + context 'is valid' do + let(:seq_id) { 2 } + it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppStarted) } + end + end + end +end From 7e5434c41a45afe89e663027a5eb9b764db4c881 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Mon, 4 Jul 2022 16:03:00 -0400 Subject: [PATCH 0362/2133] Add telemetry environment flag (#2122) * Add telemetry enabled env flag * Set DD_INSTRUMENTATION_TELEMETRY_ENABLED false in ci * fixup! Set DD_INSTRUMENTATION_TELEMETRY_ENABLED false in ci * Update GettingStarted doc * Trigger CI * Disable telemetry in test-head workflow --- .github/workflows/test-head.yaml | 1 + .github/workflows/test-macos.yaml | 1 + docs/GettingStarted.md | 1 + lib/datadog/core/configuration/settings.rb | 14 +++++++ lib/datadog/core/telemetry/ext.rb | 11 ++++++ .../core/configuration/settings_spec.rb | 39 +++++++++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 lib/datadog/core/telemetry/ext.rb diff --git a/.github/workflows/test-head.yaml b/.github/workflows/test-head.yaml index 7bfd2d54494..2eead883014 100644 --- a/.github/workflows/test-head.yaml +++ b/.github/workflows/test-head.yaml @@ -10,6 +10,7 @@ jobs: env: SKIP_SIMPLECOV: 1 JRUBY_OPTS: --dev + DD_INSTRUMENTATION_TELEMETRY_ENABLED: false steps: - uses: actions/checkout@v2 # bundler appears to match both prerelease and release rubies when we diff --git a/.github/workflows/test-macos.yaml b/.github/workflows/test-macos.yaml index db33b54a161..231db32f823 100644 --- a/.github/workflows/test-macos.yaml +++ b/.github/workflows/test-macos.yaml @@ -10,6 +10,7 @@ jobs: runs-on: ${{ matrix.os }} env: SKIP_SIMPLECOV: 1 + DD_INSTRUMENTATION_TELEMETRY_ENABLED: false steps: - uses: actions/checkout@v2 # bundler appears to match both prerelease and release rubies when we diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 7f448faab60..10ce8f61a80 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2032,6 +2032,7 @@ end | `tags` | `DD_TAGS` | `nil` | Custom tags in value pairs separated by `,` (e.g. `layer:api,team:intake`) These tags are set on all traces. See [Environment and tags](#environment-and-tags) for more details. | | `time_now_provider` | | `->{ Time.now }` | Changes how time is retrieved. See [Setting the time provider](#Setting the time provider) for more details. | | `version` | `DD_VERSION` | `nil` | Your application version (e.g. `2.5`, `202003181415`, `1.3-alpha`, etc.) This value is set as a tag on all traces. | +| `telemetry.enabled` | `DD_INSTRUMENTATION_TELEMETRY_ENABLED` | `true` | Allows you to opt-out of sending telemetry data to Datadog. | | **Tracing** | | | | | `tracing.analytics.enabled` | `DD_TRACE_ANALYTICS_ENABLED` | `nil` | Enables or disables trace analytics. See [Sampling](#sampling) for more details. | | `tracing.distributed_tracing.propagation_extract_style` | `DD_PROPAGATION_STYLE_EXTRACT` | `['Datadog','B3','B3 single header']` | Distributed tracing header formats to extract. See [Distributed Tracing](#distributed-tracing) for more details. | diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index 36ff7d98a29..b293c0780eb 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -5,6 +5,7 @@ require_relative 'base' require_relative '../environment/ext' require_relative '../runtime/ext' +require_relative '../telemetry/ext' require_relative '../../profiling/ext' require_relative '../../tracing/configuration/ext' @@ -618,6 +619,19 @@ def initialize(*_) o.default { ENV.fetch(Core::Environment::Ext::ENV_VERSION, nil) } o.lazy end + + # Client-side telemetry configuration + # @public_api + settings :telemetry do + # Enable telemetry collection. This allows telemetry events to be emitted to the telemetry API. + # + # @default `DD_INSTRUMENTATION_TELEMETRY_ENABLED` environment variable, otherwise `true` + # @return [Boolean] + option :enabled do |o| + o.default { env_to_bool(Core::Telemetry::Ext::ENV_ENABLED, true) } + o.lazy + end + end end # rubocop:enable Metrics/BlockLength # rubocop:enable Metrics/ClassLength diff --git a/lib/datadog/core/telemetry/ext.rb b/lib/datadog/core/telemetry/ext.rb new file mode 100644 index 00000000000..19d1c0f3635 --- /dev/null +++ b/lib/datadog/core/telemetry/ext.rb @@ -0,0 +1,11 @@ +# typed: true + +module Datadog + module Core + module Telemetry + module Ext + ENV_ENABLED = 'DD_INSTRUMENTATION_TELEMETRY_ENABLED'.freeze + end + end + end +end diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index cc44712d74b..de93af010bf 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -1418,4 +1418,43 @@ it { expect(settings.version).to eq(version) } end end + + describe '#telemetry' do + around do |example| + ClimateControl.modify(Datadog::Core::Telemetry::Ext::ENV_ENABLED => environment) do + example.run + end + end + let(:environment) { 'true' } + + describe '#enabled' do + subject(:enabled) { settings.telemetry.enabled } + + context "when #{Datadog::Core::Telemetry::Ext::ENV_ENABLED}" do + context 'is not defined' do + let(:environment) { nil } + + it { is_expected.to be true } + end + + { 'true' => true, 'false' => false }.each do |string, value| + context "is defined as #{string}" do + let(:environment) { string } + + it { is_expected.to be value } + end + end + end + end + + describe '#enabled=' do + let(:environment) { 'true' } + it 'updates the #enabled setting' do + expect { settings.telemetry.enabled = false } + .to change { settings.telemetry.enabled } + .from(true) + .to(false) + end + end + end end From c78088824cad7e0233d77ba8e52b77f242944bfc Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Mon, 4 Jul 2022 16:07:00 -0400 Subject: [PATCH 0363/2133] Set up transport for telemetry (#2121) * Setup basic http post request methods * Create env class * Lint files * Add basic transport tests * Remove references to agentless * Update transport tests * Format files * Use agent settings resolver to get agent url * Rename file to http/transport * Remove self.build method from net.rb * Include Kernel to fix typechecking issue --- lib/datadog/core.rb | 1 - .../core/telemetry/http/adapters/net.rb | 108 ++++++++ lib/datadog/core/telemetry/http/env.rb | 20 ++ lib/datadog/core/telemetry/http/ext.rb | 20 ++ lib/datadog/core/telemetry/http/response.rb | 68 +++++ lib/datadog/core/telemetry/http/transport.rb | 53 ++++ .../core/telemetry/http/adapters/net_spec.rb | 261 ++++++++++++++++++ spec/datadog/core/telemetry/http/env_spec.rb | 22 ++ .../core/telemetry/http/response_spec.rb | 73 +++++ .../core/telemetry/http/transport_spec.rb | 65 +++++ 10 files changed, 690 insertions(+), 1 deletion(-) create mode 100644 lib/datadog/core/telemetry/http/adapters/net.rb create mode 100644 lib/datadog/core/telemetry/http/env.rb create mode 100644 lib/datadog/core/telemetry/http/ext.rb create mode 100644 lib/datadog/core/telemetry/http/response.rb create mode 100644 lib/datadog/core/telemetry/http/transport.rb create mode 100644 spec/datadog/core/telemetry/http/adapters/net_spec.rb create mode 100644 spec/datadog/core/telemetry/http/env_spec.rb create mode 100644 spec/datadog/core/telemetry/http/response_spec.rb create mode 100644 spec/datadog/core/telemetry/http/transport_spec.rb diff --git a/lib/datadog/core.rb b/lib/datadog/core.rb index 3e20d7b7a3a..f3d4621a1fd 100644 --- a/lib/datadog/core.rb +++ b/lib/datadog/core.rb @@ -55,7 +55,6 @@ # require_relative 'core/workers/runtime_metrics' require_relative 'core/extensions' -require_relative 'core/telemetry/collector' # We must load core extensions to make certain global APIs # accessible: both for Datadog features and the core itself. diff --git a/lib/datadog/core/telemetry/http/adapters/net.rb b/lib/datadog/core/telemetry/http/adapters/net.rb new file mode 100644 index 00000000000..e48b9b70a71 --- /dev/null +++ b/lib/datadog/core/telemetry/http/adapters/net.rb @@ -0,0 +1,108 @@ +# typed: true + +require 'datadog/core/telemetry/http/response' + +module Datadog + module Core + module Telemetry + module Http + module Adapters + # Class defining methods to make http requests via NET + class Net + attr_reader \ + :hostname, + :port, + :timeout, + :ssl + + DEFAULT_TIMEOUT = 30 + + def initialize(hostname:, port: nil, timeout: DEFAULT_TIMEOUT, ssl: true) + @hostname = hostname + @port = port + @timeout = timeout + @ssl = ssl.nil? ? true : ssl + end + + def open(&block) + req = ::Net::HTTP.new(@hostname, @port) + + req.use_ssl = @ssl + req.open_timeout = req.read_timeout = @timeout + + req.start(&block) + end + + def post(env) + post = ::Net::HTTP::Post.new(env.path, env.headers) + post.body = env.body + + http_response = open do |http| + http.request(post) + end + + Response.new(http_response) + end + + # Data structure for an HTTP Response + class Response + include Datadog::Core::Telemetry::Http::Response + + attr_reader :http_response + + def initialize(http_response) + @http_response = http_response + end + + def payload + return super if http_response.nil? + + http_response.body + end + + def code + return super if http_response.nil? + + http_response.code.to_i + end + + def ok? + return super if http_response.nil? + + code.between?(200, 299) + end + + def unsupported? + return super if http_response.nil? + + code == 415 + end + + def not_found? + return super if http_response.nil? + + code == 404 + end + + def client_error? + return super if http_response.nil? + + code.between?(400, 499) + end + + def server_error? + return super if http_response.nil? + + code.between?(500, 599) + end + + def inspect + "#{super}, http_response:#{http_response}" + end + end + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/http/env.rb b/lib/datadog/core/telemetry/http/env.rb new file mode 100644 index 00000000000..12dd63cf2ca --- /dev/null +++ b/lib/datadog/core/telemetry/http/env.rb @@ -0,0 +1,20 @@ +# typed: true + +module Datadog + module Core + module Telemetry + module Http + # Data structure for an HTTP request + class Env + attr_accessor :path, :body + + attr_writer :headers + + def headers + @headers ||= {} + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/http/ext.rb b/lib/datadog/core/telemetry/http/ext.rb new file mode 100644 index 00000000000..359d1f75365 --- /dev/null +++ b/lib/datadog/core/telemetry/http/ext.rb @@ -0,0 +1,20 @@ +module Datadog + module Core + module Telemetry + module Http + module Ext + HEADER_DD_API_KEY = 'DD-API-KEY'.freeze + HEADER_CONTENT_TYPE = 'Content-Type'.freeze + HEADER_CONTENT_LENGTH = 'Content-Length'.freeze + HEADER_DD_TELEMETRY_API_VERSION = 'DD-Telemetry-API-Version'.freeze + HEADER_DD_TELEMETRY_REQUEST_TYPE = 'DD-Telemetry-Request-Type'.freeze + + CONTENT_TYPE_APPLICATION_JSON = 'application/json'.freeze + API_VERSION = 'v1'.freeze + + AGENT_ENDPOINT = '/telemetry/proxy/api/v2/apmtelemetry'.freeze + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/http/response.rb b/lib/datadog/core/telemetry/http/response.rb new file mode 100644 index 00000000000..f82257ce979 --- /dev/null +++ b/lib/datadog/core/telemetry/http/response.rb @@ -0,0 +1,68 @@ +# typed: true + +module Datadog + module Core + module Telemetry + module Http + # Module for base HTTP response + module Response + include Kernel + + def payload + nil + end + + def ok? + nil + end + + def unsupported? + nil + end + + def not_found? + nil + end + + def client_error? + nil + end + + def server_error? + nil + end + + def internal_error? + nil + end + + def inspect + "#{self.class} ok?:#{ok?} unsupported?:#{unsupported?}, " \ + "not_found?:#{not_found?}, client_error?:#{client_error?}, " \ + "server_error?:#{server_error?}, internal_error?:#{internal_error?}, " \ + "payload:#{payload}" + end + end + + # A generic error response for internal errors + class InternalErrorResponse + include Response + + attr_reader :error + + def initialize(error) + @error = error + end + + def internal_error? + true + end + + def inspect + "#{super}, error_type:#{error.class} error:#{error}" + end + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/http/transport.rb b/lib/datadog/core/telemetry/http/transport.rb new file mode 100644 index 00000000000..e9161c012c1 --- /dev/null +++ b/lib/datadog/core/telemetry/http/transport.rb @@ -0,0 +1,53 @@ +# typed: true + +require 'datadog/core/configuration/settings' +require 'datadog/core/telemetry/http/env' +require 'datadog/core/telemetry/http/ext' +require 'datadog/core/telemetry/http/adapters/net' + +module Datadog + module Core + module Telemetry + module Http + # Class to send telemetry data to Telemetry API + class Transport + attr_reader \ + :host, + :port, + :ssl, + :path + + def initialize + agent_settings = Configuration::AgentSettingsResolver.call(Datadog.configuration) + @host = agent_settings.hostname + @port = agent_settings.port + @ssl = false + @path = Http::Ext::AGENT_ENDPOINT + end + + def request(request_type:, payload:) + env = Http::Env.new + env.path = @path + env.body = payload + env.headers = headers(request_type: request_type) + adapter.post(env) + end + + private + + def headers(request_type:, api_version: Http::Ext::API_VERSION) + { + Http::Ext::HEADER_CONTENT_TYPE => Http::Ext::CONTENT_TYPE_APPLICATION_JSON, + Http::Ext::HEADER_DD_TELEMETRY_API_VERSION => api_version, + Http::Ext::HEADER_DD_TELEMETRY_REQUEST_TYPE => request_type, + } + end + + def adapter + @adapter ||= Http::Adapters::Net.new(hostname: @host, port: @port, ssl: @ssl) + end + end + end + end + end +end diff --git a/spec/datadog/core/telemetry/http/adapters/net_spec.rb b/spec/datadog/core/telemetry/http/adapters/net_spec.rb new file mode 100644 index 00000000000..f741c849522 --- /dev/null +++ b/spec/datadog/core/telemetry/http/adapters/net_spec.rb @@ -0,0 +1,261 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/core/telemetry/http/adapters/net' + +RSpec.describe Datadog::Core::Telemetry::Http::Adapters::Net do + subject(:adapter) { described_class.new(hostname: hostname, port: port, **options) } + + let(:hostname) { double('hostname') } + let(:port) { double('port') } + let(:timeout) { double('timeout') } + let(:options) { { timeout: timeout } } + + shared_context 'HTTP connection stub' do + let(:http_connection) { instance_double(::Net::HTTP) } + + before do + allow(::Net::HTTP).to receive(:new) + .with( + adapter.hostname, + adapter.port, + ).and_return(http_connection) + + allow(http_connection).to receive(:open_timeout=).with(adapter.timeout) + allow(http_connection).to receive(:read_timeout=).with(adapter.timeout) + allow(http_connection).to receive(:use_ssl=).with(adapter.ssl) + + allow(http_connection).to receive(:start).and_yield(http_connection) + end + end + + shared_context 'HTTP Env' do + let(:env) do + instance_double( + Datadog::Core::Telemetry::Http::Env, + path: path, + body: body, + headers: headers, + ) + end + + let(:path) { '/foo' } + let(:body) { '{}' } + let(:headers) { {} } + end + + describe '#initialize' do + context 'given no options' do + let(:options) { {} } + + it do + is_expected.to have_attributes( + hostname: hostname, + port: port, + timeout: Datadog::Core::Telemetry::Http::Adapters::Net::DEFAULT_TIMEOUT, + ssl: true + ) + end + end + + context 'given a :timeout option' do + let(:options) { { timeout: timeout } } + let(:timeout) { double('timeout') } + + it { is_expected.to have_attributes(timeout: timeout) } + end + + context 'given a :ssl option' do + let(:options) { { ssl: ssl } } + + context 'with nil' do + let(:ssl) { nil } + + it { is_expected.to have_attributes(ssl: true) } + end + + context 'with false' do + let(:ssl) { false } + + it { is_expected.to have_attributes(ssl: false) } + end + end + end + + describe '#open' do + include_context 'HTTP connection stub' + + it 'opens and yields a Net::HTTP connection' do + expect { |b| adapter.open(&b) }.to yield_with_args(http_connection) + end + end + + describe '#post' do + include_context 'HTTP connection stub' + include_context 'HTTP Env' + + subject(:post) { adapter.post(env) } + + let(:http_response) { double('http_response') } + + before { expect(http_connection).to receive(:request).and_return(http_response) } + + it 'produces a response' do + is_expected.to be_a_kind_of(described_class::Response) + expect(post.http_response).to be(http_response) + end + end +end + +RSpec.describe Datadog::Core::Telemetry::Http::Adapters::Net::Response do + subject(:response) { described_class.new(http_response) } + + let(:http_response) { instance_double(::Net::HTTPResponse) } + + describe '#initialize' do + it { is_expected.to have_attributes(http_response: http_response) } + end + + describe '#payload' do + subject(:payload) { response.payload } + + let(:http_response) { instance_double(::Net::HTTPResponse, body: double('body')) } + + it { is_expected.to be(http_response.body) } + end + + describe '#code' do + subject(:code) { response.code } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: '200') } + + it { is_expected.to eq(200) } + end + + describe '#ok?' do + subject(:ok?) { response.ok? } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: code) } + + context 'when code not 2xx' do + let(:code) { 199 } + + it { is_expected.to be false } + end + + context 'when code is 200' do + let(:code) { 200 } + + it { is_expected.to be true } + end + + context 'when code is 299' do + let(:code) { 299 } + + it { is_expected.to be true } + end + + context 'when code is greater than 299' do + let(:code) { 300 } + + it { is_expected.to be false } + end + end + + describe '#unsupported?' do + subject(:unsupported?) { response.unsupported? } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: code) } + + context 'when code is 400' do + let(:code) { 400 } + + it { is_expected.to be false } + end + + context 'when code is 415' do + let(:code) { 415 } + + it { is_expected.to be true } + end + end + + describe '#not_found?' do + subject(:not_found?) { response.not_found? } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: code) } + + context 'when code is 400' do + let(:code) { 400 } + + it { is_expected.to be false } + end + + context 'when code is 404' do + let(:code) { 404 } + + it { is_expected.to be true } + end + end + + describe '#client_error?' do + subject(:client_error?) { response.client_error? } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: code) } + + context 'when code is 399' do + let(:code) { 399 } + + it { is_expected.to be false } + end + + context 'when code is 400' do + let(:code) { 400 } + + it { is_expected.to be true } + end + + context 'when code is 499' do + let(:code) { 499 } + + it { is_expected.to be true } + end + + context 'when code is 500' do + let(:code) { 500 } + + it { is_expected.to be false } + end + end + + describe '#server_error?' do + subject(:server_error?) { response.server_error? } + + let(:http_response) { instance_double(::Net::HTTPResponse, code: code) } + + context 'when code is 499' do + let(:code) { 499 } + + it { is_expected.to be false } + end + + context 'when code is 500' do + let(:code) { 500 } + + it { is_expected.to be true } + end + + context 'when code is 599' do + let(:code) { 599 } + + it { is_expected.to be true } + end + + context 'when code is 600' do + let(:code) { 600 } + + it { is_expected.to be false } + end + end +end diff --git a/spec/datadog/core/telemetry/http/env_spec.rb b/spec/datadog/core/telemetry/http/env_spec.rb new file mode 100644 index 00000000000..144225ea2ec --- /dev/null +++ b/spec/datadog/core/telemetry/http/env_spec.rb @@ -0,0 +1,22 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/core/telemetry/http/env' + +RSpec.describe Datadog::Core::Telemetry::Http::Env do + subject(:env) { described_class.new } + + describe '#initialize' do + it { is_expected.to have_attributes(headers: {}) } + end + + it 'has request attributes' do + is_expected.to respond_to(:path) + is_expected.to respond_to(:path=) + is_expected.to respond_to(:body) + is_expected.to respond_to(:body=) + is_expected.to respond_to(:headers) + is_expected.to respond_to(:headers=) + end +end diff --git a/spec/datadog/core/telemetry/http/response_spec.rb b/spec/datadog/core/telemetry/http/response_spec.rb new file mode 100644 index 00000000000..b25d9b7387e --- /dev/null +++ b/spec/datadog/core/telemetry/http/response_spec.rb @@ -0,0 +1,73 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/core/telemetry/http/response' + +RSpec.describe Datadog::Core::Telemetry::Http::Response do + context 'when implemented by a class' do + subject(:response) { response_class.new } + + let(:response_class) do + stub_const('TestResponse', Class.new { include Datadog::Core::Telemetry::Http::Response }) + end + + describe '#payload' do + subject(:payload) { response.payload } + + it { is_expected.to be nil } + end + + describe '#ok?' do + subject(:ok?) { response.ok? } + + it { is_expected.to be nil } + end + + describe '#unsupported?' do + subject(:unsupported?) { response.unsupported? } + + it { is_expected.to be nil } + end + + describe '#not_found?' do + subject(:not_found?) { response.not_found? } + + it { is_expected.to be nil } + end + + describe '#client_error?' do + subject(:client_error?) { response.client_error? } + + it { is_expected.to be nil } + end + + describe '#server_error?' do + subject(:server_error?) { response.server_error? } + + it { is_expected.to be nil } + end + + describe '#internal_error?' do + subject(:internal_error?) { response.internal_error? } + + it { is_expected.to be nil } + end + end +end + +RSpec.describe Datadog::Core::Telemetry::Http::InternalErrorResponse do + subject(:response) { described_class.new(error) } + + let(:error) { instance_double(StandardError) } + + describe '#initialize' do + it { is_expected.to have_attributes(error: error) } + end + + describe '#internal_error?' do + subject(:internal_error?) { response.internal_error? } + + it { is_expected.to be true } + end +end diff --git a/spec/datadog/core/telemetry/http/transport_spec.rb b/spec/datadog/core/telemetry/http/transport_spec.rb new file mode 100644 index 00000000000..95625271e68 --- /dev/null +++ b/spec/datadog/core/telemetry/http/transport_spec.rb @@ -0,0 +1,65 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/core/telemetry/http/transport' +require 'datadog/core/telemetry/http/adapters/net' + +RSpec.describe Datadog::Core::Telemetry::Http::Transport do + subject(:transport) { described_class.new } + + let(:hostname) { 'foo' } + let(:port) { 1234 } + + describe '#initialize' do + before do + Datadog.configuration.agent.host = hostname + Datadog.configuration.agent.port = port + end + it { expect(transport.host).to eq(hostname) } + it { expect(transport.port).to eq(port) } + it { expect(transport.ssl).to eq(false) } + it { expect(transport.path).to eq(Datadog::Core::Telemetry::Http::Ext::AGENT_ENDPOINT) } + end + + describe '#request' do + subject(:request) { transport.request(request_type: request_type, payload: payload) } + + let(:adapter) { instance_double(Datadog::Core::Telemetry::Http::Adapters::Net, post: response) } + let(:env) { instance_double(Datadog::Core::Telemetry::Http::Env, body: payload, path: path) } + let(:headers) do + { + Datadog::Core::Telemetry::Http::Ext::HEADER_CONTENT_TYPE => 'application/json', + Datadog::Core::Telemetry::Http::Ext::HEADER_DD_TELEMETRY_API_VERSION => 'v1', + Datadog::Core::Telemetry::Http::Ext::HEADER_DD_TELEMETRY_REQUEST_TYPE => request_type, + } + end + let(:hostname) { 'foo' } + let(:http_connection) { instance_double(::Net::HTTP) } + let(:path) { Datadog::Core::Telemetry::Http::Ext::AGENT_ENDPOINT } + let(:payload) { '{"foo":"bar"}' } + let(:port) { 1234 } + let(:request_type) { 'app-started' } + let(:response) { instance_double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } + let(:ssl) { false } + + before do + Datadog.configuration.agent.host = hostname + Datadog.configuration.agent.port = port + + allow(Datadog::Core::Telemetry::Http::Env).to receive(:new).and_return(env) + allow(env).to receive(:path=).with(path) + allow(env).to receive(:body=).with(payload) + allow(env).to receive(:headers=).with(headers) + + allow(Datadog::Core::Telemetry::Http::Adapters::Net).to receive(:new) + .with( + hostname: hostname, + port: port, + ssl: ssl + ).and_return(adapter) + end + + it { is_expected.to be(response) } + end +end From 5a8c425c3af3decce67d6bb33afaf2d3b42b3477 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:29:58 -0400 Subject: [PATCH 0364/2133] Add to_h Method to Telemetry V1 Classes (#2124) * Define to_h functions for telemetry objects * Add tests for to_h function * fixup! Add tests for to_h function * Remove appsec and profiler classes * Change test dummy runtime session ID values --- lib/datadog/core/telemetry/collector.rb | 8 +- lib/datadog/core/telemetry/v1/app_started.rb | 23 ++++ lib/datadog/core/telemetry/v1/application.rb | 15 +++ lib/datadog/core/telemetry/v1/appsec.rb | 21 --- lib/datadog/core/telemetry/v1/dependency.rb | 8 ++ lib/datadog/core/telemetry/v1/host.rb | 12 ++ lib/datadog/core/telemetry/v1/integration.rb | 11 ++ lib/datadog/core/telemetry/v1/product.rb | 7 + lib/datadog/core/telemetry/v1/profiler.rb | 21 --- .../core/telemetry/v1/telemetry_request.rb | 15 +++ spec/datadog/core/telemetry/collector_spec.rb | 16 +-- .../core/telemetry/v1/app_started_spec.rb | 37 ++++++ .../core/telemetry/v1/application_spec.rb | 45 ++++++- spec/datadog/core/telemetry/v1/appsec_spec.rb | 18 --- .../core/telemetry/v1/dependency_spec.rb | 16 +++ spec/datadog/core/telemetry/v1/host_spec.rb | 24 ++++ .../core/telemetry/v1/integration_spec.rb | 22 ++++ .../datadog/core/telemetry/v1/product_spec.rb | 24 +++- .../core/telemetry/v1/profiler_spec.rb | 18 --- .../telemetry/v1/telemetry_request_spec.rb | 121 +++++++++++++----- 20 files changed, 347 insertions(+), 135 deletions(-) delete mode 100644 lib/datadog/core/telemetry/v1/appsec.rb delete mode 100644 lib/datadog/core/telemetry/v1/profiler.rb delete mode 100644 spec/datadog/core/telemetry/v1/appsec_spec.rb delete mode 100644 spec/datadog/core/telemetry/v1/profiler_spec.rb diff --git a/lib/datadog/core/telemetry/collector.rb b/lib/datadog/core/telemetry/collector.rb index 3baada58cc0..2242241e1c0 100644 --- a/lib/datadog/core/telemetry/collector.rb +++ b/lib/datadog/core/telemetry/collector.rb @@ -8,12 +8,10 @@ require 'datadog/core/environment/ext' require 'datadog/core/environment/platform' require 'datadog/core/telemetry/v1/application' -require 'datadog/core/telemetry/v1/appsec' require 'datadog/core/telemetry/v1/dependency' require 'datadog/core/telemetry/v1/host' require 'datadog/core/telemetry/v1/integration' require 'datadog/core/telemetry/v1/product' -require 'datadog/core/telemetry/v1/profiler' require 'ddtrace/transport/ext' module Datadog @@ -179,8 +177,7 @@ def products end def profiler - version = profiler_version - Telemetry::V1::Profiler.new(version: version) if version + { version: profiler_version } if profiler_version end def profiler_version @@ -188,8 +185,7 @@ def profiler_version end def appsec - version = appsec_version - Telemetry::V1::AppSec.new(version: version) if version + { version: appsec_version } if appsec_version end def appsec_version diff --git a/lib/datadog/core/telemetry/v1/app_started.rb b/lib/datadog/core/telemetry/v1/app_started.rb index 9af8640fccb..ee1bbe86fcb 100644 --- a/lib/datadog/core/telemetry/v1/app_started.rb +++ b/lib/datadog/core/telemetry/v1/app_started.rb @@ -4,6 +4,8 @@ module Telemetry module V1 # Describes payload for telemetry V1 API app_started event class AppStarted + include Kernel + attr_reader \ :additional_payload, :configuration, @@ -22,6 +24,27 @@ def initialize(additional_payload: nil, configuration: nil, dependencies: nil, i @dependencies = dependencies @integrations = integrations end + + def to_h + { + additional_payload: map_hash(Hash(@additional_payload)), + configuration: map_hash(Hash(@configuration)), + dependencies: map_array(Array(@dependencies)), + integrations: map_array(Array(@integrations)), + } + end + + private + + def map_hash(hash) + hash.map do |k, v| + { name: k.to_s, value: v } + end + end + + def map_array(arr) + arr.map(&:to_h) + end end end end diff --git a/lib/datadog/core/telemetry/v1/application.rb b/lib/datadog/core/telemetry/v1/application.rb index 81cd29f408f..f5f77499152 100644 --- a/lib/datadog/core/telemetry/v1/application.rb +++ b/lib/datadog/core/telemetry/v1/application.rb @@ -47,6 +47,21 @@ def initialize(language_name:, language_version:, service_name:, tracer_version: @tracer_version = tracer_version end + def to_h + { + env: @env, + language_name: @language_name, + language_version: @language_version, + products: @products.to_h, + runtime_name: @runtime_name, + runtime_patches: @runtime_patches, + runtime_version: @runtime_version, + service_name: @service_name, + service_version: @service_version, + tracer_version: @tracer_version + } + end + private # Validates required arguments passed to the class on initialization are not nil diff --git a/lib/datadog/core/telemetry/v1/appsec.rb b/lib/datadog/core/telemetry/v1/appsec.rb deleted file mode 100644 index 14075a44689..00000000000 --- a/lib/datadog/core/telemetry/v1/appsec.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Datadog - module Core - module Telemetry - module V1 - # Describes attributes for appsec object - class AppSec - ERROR_NIL_VERSION_MESSAGE = ':version must not be nil'.freeze - - attr_reader :version - - # @param version [String] Version of the appsec product - def initialize(version:) - raise ArgumentError, ERROR_NIL_VERSION_MESSAGE if version.nil? - - @version = version - end - end - end - end - end -end diff --git a/lib/datadog/core/telemetry/v1/dependency.rb b/lib/datadog/core/telemetry/v1/dependency.rb index cf516331b25..f7c7a983728 100644 --- a/lib/datadog/core/telemetry/v1/dependency.rb +++ b/lib/datadog/core/telemetry/v1/dependency.rb @@ -21,6 +21,14 @@ def initialize(name:, version: nil, hash: nil) @name = name @version = version end + + def to_h + { + hash: @hash, + name: @name, + version: @version + } + end end end end diff --git a/lib/datadog/core/telemetry/v1/host.rb b/lib/datadog/core/telemetry/v1/host.rb index 850b01e457b..720a96d5389 100644 --- a/lib/datadog/core/telemetry/v1/host.rb +++ b/lib/datadog/core/telemetry/v1/host.rb @@ -30,6 +30,18 @@ def initialize(container_id: nil, hostname: nil, kernel_name: nil, kernel_releas @os = os @os_version = os_version end + + def to_h + { + container_id: @container_id, + hostname: @hostname, + kernel_name: @kernel_name, + kernel_release: @kernel_release, + kernel_version: @kernel_version, + os: @os, + os_version: @os_version, + } + end end end end diff --git a/lib/datadog/core/telemetry/v1/integration.rb b/lib/datadog/core/telemetry/v1/integration.rb index a9c77689fe7..4df09ce56eb 100644 --- a/lib/datadog/core/telemetry/v1/integration.rb +++ b/lib/datadog/core/telemetry/v1/integration.rb @@ -31,6 +31,17 @@ def initialize(enabled:, name:, auto_enabled: nil, compatible: nil, error: nil, @version = version end + def to_h + { + auto_enabled: @auto_enabled, + compatible: @compatible, + enabled: @enabled, + error: @error, + name: @name, + version: @version + } + end + private # Validates all required arguments passed to the class on initialization are not nil diff --git a/lib/datadog/core/telemetry/v1/product.rb b/lib/datadog/core/telemetry/v1/product.rb index 6a91833a56e..2394a81431e 100644 --- a/lib/datadog/core/telemetry/v1/product.rb +++ b/lib/datadog/core/telemetry/v1/product.rb @@ -14,6 +14,13 @@ def initialize(appsec: nil, profiler: nil) @appsec = appsec @profiler = profiler end + + def to_h + { + appsec: @appsec, + profiler: @profiler + } + end end end end diff --git a/lib/datadog/core/telemetry/v1/profiler.rb b/lib/datadog/core/telemetry/v1/profiler.rb deleted file mode 100644 index 729f35db56d..00000000000 --- a/lib/datadog/core/telemetry/v1/profiler.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Datadog - module Core - module Telemetry - module V1 - # Describes attributes for profiler object - class Profiler - ERROR_NIL_VERSION_MESSAGE = ':version must not be nil'.freeze - - attr_reader :version - - # @param version [String] version of the profiler product - def initialize(version:) - raise ArgumentError, ERROR_NIL_VERSION_MESSAGE if version.nil? - - @version = version - end - end - end - end - end -end diff --git a/lib/datadog/core/telemetry/v1/telemetry_request.rb b/lib/datadog/core/telemetry/v1/telemetry_request.rb index ae8a9f8260d..5d5dff2a1f3 100644 --- a/lib/datadog/core/telemetry/v1/telemetry_request.rb +++ b/lib/datadog/core/telemetry/v1/telemetry_request.rb @@ -53,6 +53,21 @@ def initialize(api_version:, application:, host:, payload:, request_type:, runti @tracer_time = tracer_time end + def to_h + { + api_version: @api_version, + application: @application.to_h, + debug: @debug, + host: @host.to_h, + payload: @payload.to_h, + request_type: @request_type, + runtime_id: @runtime_id, + seq_id: @seq_id, + session_id: @session_id, + tracer_time: @tracer_time + } + end + private # Validates all required arguments passed to the class on initialization are not nil diff --git a/spec/datadog/core/telemetry/collector_spec.rb b/spec/datadog/core/telemetry/collector_spec.rb index 8042ad0e53c..b7423b75770 100644 --- a/spec/datadog/core/telemetry/collector_spec.rb +++ b/spec/datadog/core/telemetry/collector_spec.rb @@ -5,13 +5,11 @@ require 'datadog/core/environment/ext' require 'datadog/core/telemetry/collector' require 'datadog/core/telemetry/v1/application' -require 'datadog/core/telemetry/v1/appsec' require 'datadog/core/telemetry/v1/configuration' require 'datadog/core/telemetry/v1/dependency' require 'datadog/core/telemetry/v1/host' require 'datadog/core/telemetry/v1/integration' require 'datadog/core/telemetry/v1/product' -require 'datadog/core/telemetry/v1/profiler' require 'ddtrace/transport/ext' require 'ddtrace' @@ -103,9 +101,8 @@ after { Datadog.configuration.profiling.send(:reset!) } it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.profiler).to be_a_kind_of(Datadog::Core::Telemetry::V1::Profiler) } - it { expect(products.profiler.version).to be_a_kind_of(String) } - it { expect(products.profiler).to have_attributes(version: '4.2') } + it { expect(products.profiler).to be_a_kind_of(Hash) } + it { expect(products.profiler).to eq(version: '4.2') } end context 'when appsec is enabled' do @@ -120,9 +117,8 @@ after { Datadog.configuration.appsec.send(:reset!) } it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.appsec).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppSec) } - it { expect(products.appsec.version).to be_a_kind_of(String) } - it { expect(products.appsec).to have_attributes(version: '4.2') } + it { expect(products.appsec).to be_a_kind_of(Hash) } + it { expect(products.appsec).to eq(version: '4.2') } end context 'when both profiler and appsec are enabled' do @@ -140,8 +136,8 @@ end it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.profiler).to be_a_kind_of(Datadog::Core::Telemetry::V1::Profiler) } - it { expect(products.appsec).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppSec) } + it { expect(products.profiler).to be_a_kind_of(Hash) } + it { expect(products.appsec).to be_a_kind_of(Hash) } end end end diff --git a/spec/datadog/core/telemetry/v1/app_started_spec.rb b/spec/datadog/core/telemetry/v1/app_started_spec.rb index ed8c8a0d4bb..65f1e3ea431 100644 --- a/spec/datadog/core/telemetry/v1/app_started_spec.rb +++ b/spec/datadog/core/telemetry/v1/app_started_spec.rb @@ -122,4 +122,41 @@ end end end + + describe '#to_h' do + subject(:to_h) { app_started.to_h } + + context 'when attributes are all nil' do + let(:additional_payload) { nil } + let(:configuration) { nil } + let(:dependencies) { nil } + let(:integrations) { nil } + it do + is_expected.to eq( + additional_payload: [], + configuration: [], + dependencies: [], + integrations: [], + ) + end + end + + context 'when attributes are all defined' do + let(:additional_payload) { { 'tracing.enabled' => true, 'profiling.enabled' => false } } + let(:configuration) { { DD_AGENT_HOST: 'localhost', DD_TRACE_SAMPLE_RATE: '1' } } + let(:dependencies) { [Datadog::Core::Telemetry::V1::Dependency.new(name: 'pg')] } + let(:integrations) { [Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true)] } + + it do + is_expected.to eq( + additional_payload: [{ name: 'tracing.enabled', value: true }, + { name: 'profiling.enabled', value: false }], + configuration: [{ name: 'DD_AGENT_HOST', value: 'localhost' }, + { name: 'DD_TRACE_SAMPLE_RATE', value: '1' }], + dependencies: [{ hash: nil, name: 'pg', version: nil }], + integrations: [{ auto_enabled: nil, compatible: nil, enabled: true, error: nil, name: 'pg', version: nil }] + ) + end + end + end end diff --git a/spec/datadog/core/telemetry/v1/application_spec.rb b/spec/datadog/core/telemetry/v1/application_spec.rb index 0275e7f8fbe..f15fb2c8dbd 100644 --- a/spec/datadog/core/telemetry/v1/application_spec.rb +++ b/spec/datadog/core/telemetry/v1/application_spec.rb @@ -3,8 +3,6 @@ require 'datadog/core/telemetry/v1/shared_examples' require 'datadog/core/telemetry/v1/application' require 'datadog/core/telemetry/v1/product' -require 'datadog/core/telemetry/v1/appsec' -require 'datadog/core/telemetry/v1/profiler' RSpec.describe Datadog::Core::Telemetry::V1::Application do subject(:application) do @@ -27,8 +25,8 @@ let(:language_version) { '3.0' } let(:products) do Datadog::Core::Telemetry::V1::Product.new( - appsec: Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0'), - profiler: Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') + appsec: { version: '1.0' }, + profiler: { version: '1.0' } ) end let(:runtime_name) { 'ruby30' } @@ -99,12 +97,47 @@ context 'is valid' do let(:products) do Datadog::Core::Telemetry::V1::Product.new( - appsec: Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0'), - profiler: Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') + appsec: { version: '1.0' }, + profiler: { version: '1.0' } ) end it { is_expected.to be_a_kind_of(described_class) } end end end + + describe '#to_h' do + subject(:to_h) { application.to_h } + + let(:env) { 'prod' } + let(:language_name) { 'ruby' } + let(:language_version) { '3.0' } + let(:products) do + Datadog::Core::Telemetry::V1::Product.new( + appsec: { version: '1.0' }, + profiler: { version: '1.0' } + ) + end + let(:runtime_name) { 'ruby30' } + let(:runtime_patches) { 'patch' } + let(:runtime_version) { '3.2.1' } + let(:service_name) { 'myapp' } + let(:service_version) { '1.2.3' } + let(:tracer_version) { '1.0' } + + it do + is_expected.to eq( + env: env, + language_name: language_name, + language_version: language_version, + products: { profiler: { version: '1.0' }, appsec: { version: '1.0' } }, + runtime_name: runtime_name, + runtime_patches: runtime_patches, + runtime_version: runtime_version, + service_name: service_name, + service_version: service_version, + tracer_version: tracer_version + ) + end + end end diff --git a/spec/datadog/core/telemetry/v1/appsec_spec.rb b/spec/datadog/core/telemetry/v1/appsec_spec.rb deleted file mode 100644 index 2aad7941535..00000000000 --- a/spec/datadog/core/telemetry/v1/appsec_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' - -require 'datadog/core/telemetry/v1/appsec' -require 'datadog/core/telemetry/v1/shared_examples' - -RSpec.describe Datadog::Core::Telemetry::V1::AppSec do - subject(:appsec) { described_class.new(version: version) } - - let(:version) { '1.0' } - - it { is_expected.to have_attributes(version: version) } - - describe '#initialize' do - context ':version' do - it_behaves_like 'a required string parameter', 'version' - end - end -end diff --git a/spec/datadog/core/telemetry/v1/dependency_spec.rb b/spec/datadog/core/telemetry/v1/dependency_spec.rb index eda41dff337..88d6fabacb3 100644 --- a/spec/datadog/core/telemetry/v1/dependency_spec.rb +++ b/spec/datadog/core/telemetry/v1/dependency_spec.rb @@ -25,4 +25,20 @@ it_behaves_like 'an optional string parameter', 'hash' end end + + describe '#to_h' do + subject(:to_h) { dependency.to_h } + + let(:hash) { '3e2e2c2362c89aa01bc0e004681e' } + let(:name) { 'mongodb' } + let(:version) { '2.2.5' } + + it do + is_expected.to eq( + hash: hash, + name: name, + version: version + ) + end + end end diff --git a/spec/datadog/core/telemetry/v1/host_spec.rb b/spec/datadog/core/telemetry/v1/host_spec.rb index 15802f386aa..76cd001c617 100644 --- a/spec/datadog/core/telemetry/v1/host_spec.rb +++ b/spec/datadog/core/telemetry/v1/host_spec.rb @@ -65,4 +65,28 @@ it_behaves_like 'an optional string parameter', 'os' end end + + describe '#to_h' do + subject(:to_h) { host.to_h } + + let(:container_id) { 'd39b145254d1f9c337fdd2be132f6' } + let(:hostname) { 'i-09ecf74c319c49be8' } + let(:kernel_name) { 'Linux' } + let(:kernel_release) { '5.4.0-1037-gcp' } + let(:kernel_version) { '#40~18.04.1-Ubuntu SMP Fri Feb 5 15:41:35 UTC 2021' } + let(:os_version) { 'ubuntu 18.04.5 LTS (Bionic Beaver)' } + let(:os) { 'GNU/Linux' } + + it do + is_expected.to eq( + container_id: container_id, + hostname: hostname, + kernel_name: kernel_name, + kernel_release: kernel_release, + kernel_version: kernel_version, + os_version: os_version, + os: os + ) + end + end end diff --git a/spec/datadog/core/telemetry/v1/integration_spec.rb b/spec/datadog/core/telemetry/v1/integration_spec.rb index 533f6e88b65..ed3ab35dfda 100644 --- a/spec/datadog/core/telemetry/v1/integration_spec.rb +++ b/spec/datadog/core/telemetry/v1/integration_spec.rb @@ -58,4 +58,26 @@ it_behaves_like 'an optional string parameter', 'version' end end + + describe '#to_h' do + subject(:to_h) { integration.to_h } + + let(:auto_enabled) { false } + let(:compatible) { true } + let(:enabled) { false } + let(:error) { 'Failed to enable' } + let(:name) { 'pg' } + let(:version) { '1.7.0' } + + it do + is_expected.to eq( + auto_enabled: auto_enabled, + compatible: compatible, + enabled: enabled, + error: error, + name: name, + version: version + ) + end + end end diff --git a/spec/datadog/core/telemetry/v1/product_spec.rb b/spec/datadog/core/telemetry/v1/product_spec.rb index 9ca33f448bc..d1b3a4cbfb9 100644 --- a/spec/datadog/core/telemetry/v1/product_spec.rb +++ b/spec/datadog/core/telemetry/v1/product_spec.rb @@ -1,14 +1,12 @@ require 'spec_helper' require 'datadog/core/telemetry/v1/product' -require 'datadog/core/telemetry/v1/appsec' -require 'datadog/core/telemetry/v1/profiler' RSpec.describe Datadog::Core::Telemetry::V1::Product do subject(:product) { described_class.new(appsec: appsec, profiler: profiler) } - let(:appsec) { Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0') } - let(:profiler) { Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') } + let(:appsec) { { version: '1.0' } } + let(:profiler) { { version: '1.0' } } it { is_expected.to have_attributes(appsec: appsec, profiler: profiler) } @@ -21,7 +19,7 @@ end context 'is valid' do - let(:appsec) { Datadog::Core::Telemetry::V1::AppSec.new(version: '1.0') } + let(:appsec) { { version: '1.0' } } it { is_expected.to be_a_kind_of(described_class) } end end @@ -34,9 +32,23 @@ end context 'is valid' do - let(:profiler) { Datadog::Core::Telemetry::V1::Profiler.new(version: '1.0') } + let(:profiler) { { version: '1.0' } } it { is_expected.to be_a_kind_of(described_class) } end end end + + describe '#to_h' do + subject(:to_h) { product.to_h } + + let(:appsec) { { version: '1.0' } } + let(:profiler) { { version: '1.0' } } + + it do + is_expected.to eq( + appsec: { version: '1.0' }, + profiler: { version: '1.0' } + ) + end + end end diff --git a/spec/datadog/core/telemetry/v1/profiler_spec.rb b/spec/datadog/core/telemetry/v1/profiler_spec.rb deleted file mode 100644 index 5c295cc082b..00000000000 --- a/spec/datadog/core/telemetry/v1/profiler_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' - -require 'datadog/core/telemetry/v1/profiler' -require 'datadog/core/telemetry/v1/shared_examples' - -RSpec.describe Datadog::Core::Telemetry::V1::Profiler do - subject(:profiler) { described_class.new(version: version) } - - let(:version) { '1.0' } - - it { is_expected.to have_attributes(version: version) } - - describe '#initialize' do - context ':version' do - it_behaves_like 'a required string parameter', 'version' - end - end -end diff --git a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb index 57e2b9f561d..5e215453bbf 100644 --- a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb +++ b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb @@ -16,9 +16,9 @@ host: host, payload: payload, request_type: request_type, - runtime_id: runtime_id, + runtime_id: dummy_runtime_id, seq_id: seq_id, - session_id: session_id, + session_id: dummy_session_id, tracer_time: tracer_time ) end @@ -38,9 +38,9 @@ ) end let(:request_type) { 'app-started' } - let(:runtime_id) { '20338dfd-f700-0d470f054ae8' } + let(:dummy_runtime_id) { 'dummy_runtime_id' } let(:seq_id) { 42 } - let(:session_id) { '20338dfd-f700-0d470f054ae8' } + let(:dummy_session_id) { 'dummy_session_id' } let(:tracer_time) { 1654805621 } it do @@ -51,9 +51,9 @@ host: host, payload: payload, request_type: request_type, - runtime_id: runtime_id, + runtime_id: dummy_runtime_id, seq_id: seq_id, - session_id: session_id, + session_id: dummy_session_id, tracer_time: tracer_time ) end @@ -130,38 +130,101 @@ let(:request_type) { 'app-started' } it { is_expected.to be_a_kind_of(described_class) } end + end + + context ':runtime_id' do + it_behaves_like 'a required string parameter', 'dummy_runtime_id' + end - context ':runtime_id' do - it_behaves_like 'a required string parameter', 'runtime_id' + context 'when :seq_id' do + context 'is nil' do + let(:seq_id) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } end - context 'when :seq_id' do - context 'is nil' do - let(:seq_id) { nil } - it { expect { telemetry_request }.to raise_error(ArgumentError) } - end + context 'is valid int' do + let(:seq_id) { 42 } + it { is_expected.to be_a_kind_of(described_class) } + end + end - context 'is valid int' do - let(:seq_id) { 42 } - it { is_expected.to be_a_kind_of(described_class) } - end + context ':session_id' do + it_behaves_like 'an optional string parameter', 'dummy_session_id' + end + + context 'when :tracer_time' do + context 'is nil' do + let(:tracer_time) { nil } + it { expect { telemetry_request }.to raise_error(ArgumentError) } end - context ':session_id' do - it_behaves_like 'an optional string parameter', 'session_id' + context 'is valid int' do + let(:tracer_time) { 1654805621 } + it { is_expected.to be_a_kind_of(described_class) } end + end + end - context 'when :tracer_time' do - context 'is nil' do - let(:tracer_time) { nil } - it { expect { telemetry_request }.to raise_error(ArgumentError) } - end + describe '#to_h' do + subject(:to_h) { telemetry_request.to_h } - context 'is valid int' do - let(:tracer_time) { 1654805621 } - it { is_expected.to be_a_kind_of(described_class) } - end - end + let(:api_version) { 'v1' } + let(:application) do + Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', + service_name: 'myapp', tracer_version: '1.0') + end + let(:debug) { false } + let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } + let(:payload) do + Datadog::Core::Telemetry::V1::AppStarted.new( + integrations: [Datadog::Core::Telemetry::V1::Integration.new( + name: 'pg', enabled: true + )] + ) + end + let(:request_type) { 'app-started' } + let(:dummy_runtime_id) { 'dummy_runtime_id' } + let(:seq_id) { 42 } + let(:dummy_session_id) { 'dummy_session_id' } + let(:tracer_time) { 1654805621 } + + it do + is_expected.to eq( + api_version: api_version, + application: { + env: nil, + language_name: 'ruby', + language_version: '3.0', + products: {}, + runtime_name: nil, + runtime_patches: nil, + runtime_version: nil, + service_name: 'myapp', + service_version: nil, + tracer_version: '1.0' + }, + debug: debug, + host: { + container_id: 'd39b145254d1f9c337fdd2be132f6', + hostname: nil, + kernel_name: nil, + kernel_release: nil, + kernel_version: nil, + os: nil, + os_version: nil + }, + payload: { + additional_payload: [], + configuration: [], + dependencies: [], + integrations: [{ auto_enabled: nil, compatible: nil, enabled: true, error: nil, name: 'pg', version: nil }] + }, + request_type: request_type, + runtime_id: dummy_runtime_id, + seq_id: seq_id, + session_id: dummy_session_id, + tracer_time: tracer_time, + ) end end end From a3a16586652253b0351f78eff1c2a2b526dffb4a Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:58:24 -0400 Subject: [PATCH 0365/2133] Clean-up for Telemetry (#2126) * Remove Configuration class * Change products to always send appsec/profiler version --- lib/datadog/core/telemetry/collector.rb | 22 ++---- spec/datadog/core/telemetry/collector_spec.rb | 74 +++++++++++-------- .../core/telemetry/v1/app_started_spec.rb | 27 ++++--- .../core/telemetry/v1/configuration_spec.rb | 40 ---------- 4 files changed, 61 insertions(+), 102 deletions(-) delete mode 100644 spec/datadog/core/telemetry/v1/configuration_spec.rb diff --git a/lib/datadog/core/telemetry/collector.rb b/lib/datadog/core/telemetry/collector.rb index 2242241e1c0..fb2d92ab97e 100644 --- a/lib/datadog/core/telemetry/collector.rb +++ b/lib/datadog/core/telemetry/collector.rb @@ -38,7 +38,7 @@ def application runtime_version: Datadog::Core::Environment::Ext::ENGINE_VERSION, service_name: service_name, service_version: service_version, - tracer_version: tracer_version + tracer_version: library_version ) end @@ -135,7 +135,7 @@ def additional_payload_variables options['tracing.writer_options.flush_interval'] = format_configuration_value(configuration.tracing.writer_options[:flush_interval]) options['logger.instance'] = configuration.logger.instance.class.to_s - + options['appsec.enabled'] = configuration.dig('appsec', 'enabled') if configuration.respond_to?('appsec') compact_hash(options) end @@ -166,30 +166,20 @@ def service_version Datadog.configuration.version end - def tracer_version + def library_version Core::Environment::Identity.tracer_version end def products - profiler_obj = profiler - appsec_obj = appsec - profiler_obj || appsec_obj ? Telemetry::V1::Product.new(profiler: profiler_obj, appsec: appsec_obj) : nil + Telemetry::V1::Product.new(profiler: profiler, appsec: appsec) end def profiler - { version: profiler_version } if profiler_version - end - - def profiler_version - tracer_version if Datadog.configuration.profiling.enabled + { version: library_version } end def appsec - { version: appsec_version } if appsec_version - end - - def appsec_version - tracer_version if Datadog.configuration.respond_to?(:appsec) && Datadog.configuration.appsec.enabled + { version: library_version } end def agent_transport diff --git a/spec/datadog/core/telemetry/collector_spec.rb b/spec/datadog/core/telemetry/collector_spec.rb index b7423b75770..4bbc8f47805 100644 --- a/spec/datadog/core/telemetry/collector_spec.rb +++ b/spec/datadog/core/telemetry/collector_spec.rb @@ -5,7 +5,6 @@ require 'datadog/core/environment/ext' require 'datadog/core/telemetry/collector' require 'datadog/core/telemetry/v1/application' -require 'datadog/core/telemetry/v1/configuration' require 'datadog/core/telemetry/v1/dependency' require 'datadog/core/telemetry/v1/host' require 'datadog/core/telemetry/v1/integration' @@ -83,42 +82,15 @@ before do Datadog.configuration.profiling.enabled = false Datadog.configuration.appsec.enabled = false + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') end after do Datadog.configuration.profiling.send(:reset!) Datadog.configuration.appsec.send(:reset!) end - it { is_expected.to be_nil } - end - - context 'when profiling is enabled' do - before do - stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') - Datadog.configure do |c| - c.profiling.enabled = true - end - end - after { Datadog.configuration.profiling.send(:reset!) } - - it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.profiler).to be_a_kind_of(Hash) } - it { expect(products.profiler).to eq(version: '4.2') } - end - - context 'when appsec is enabled' do - before do - require 'datadog/appsec' - - stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') - Datadog.configure do |c| - c.appsec.enabled = true - end - end - after { Datadog.configuration.appsec.send(:reset!) } - it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.appsec).to be_a_kind_of(Hash) } - it { expect(products.appsec).to eq(version: '4.2') } + it { expect(products.appsec).to eq({ version: '4.2' }) } + it { expect(products.profiler).to eq({ version: '4.2' }) } end context 'when both profiler and appsec are enabled' do @@ -136,8 +108,8 @@ end it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::Product) } - it { expect(products.profiler).to be_a_kind_of(Hash) } it { expect(products.appsec).to be_a_kind_of(Hash) } + it { expect(products.profiler).to be_a_kind_of(Hash) } end end end @@ -233,6 +205,44 @@ it { is_expected.to_not include('tracing.analytics.enabled') } end end + + context 'when profiling is disabled' do + before do + Datadog.configuration.profiling.enabled = false + Datadog.configuration.appsec.enabled = false + end + after do + Datadog.configuration.profiling.send(:reset!) + Datadog.configuration.appsec.send(:reset!) + end + it { is_expected.to include('profiling.enabled' => false) } + end + + context 'when profiling is enabled' do + before do + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') + Datadog.configure do |c| + c.profiling.enabled = true + end + end + after { Datadog.configuration.profiling.send(:reset!) } + + it { is_expected.to include('profiling.enabled' => true) } + end + + context 'when appsec is enabled' do + before do + require 'datadog/appsec' + + stub_const('Datadog::Core::Environment::Ext::TRACER_VERSION', '4.2') + Datadog.configure do |c| + c.appsec.enabled = true + end + end + after { Datadog.configuration.appsec.send(:reset!) } + + it { is_expected.to include('appsec.enabled' => true) } + end end describe '#dependencies' do diff --git a/spec/datadog/core/telemetry/v1/app_started_spec.rb b/spec/datadog/core/telemetry/v1/app_started_spec.rb index 65f1e3ea431..64d22bd0beb 100644 --- a/spec/datadog/core/telemetry/v1/app_started_spec.rb +++ b/spec/datadog/core/telemetry/v1/app_started_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' require 'datadog/core/telemetry/v1/app_started' -require 'datadog/core/telemetry/v1/configuration' require 'datadog/core/telemetry/v1/dependency' require 'datadog/core/telemetry/v1/integration' @@ -15,8 +14,8 @@ ) end - let(:additional_payload) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE')] } - let(:configuration) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG')] } + let(:additional_payload) { [{ name: 'logger.level', value: 1 }] } + let(:configuration) { [{ name: 'DD_TRACE_DEBUG', value: false }] } let(:dependencies) { [Datadog::Core::Telemetry::V1::Dependency.new(name: 'pg')] } let(:integrations) { [Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true)] } @@ -36,17 +35,17 @@ it { is_expected.to be_a_kind_of(described_class) } end - context 'is array of Configuration' do - let(:additional_payload) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE')] } + context 'is array of one Hash' do + let(:additional_payload) { [{ name: 'logger.level', value: 1 }] } it { is_expected.to be_a_kind_of(described_class) } end - context 'is array of Configurations with multiple elements' do + context 'is array of multiple Hashes' do let(:additional_payload) do [ - Datadog::Core::Telemetry::V1::Configuration.new(name: 'ENV_VARIABLE'), - Datadog::Core::Telemetry::V1::Configuration.new(name: 'ANOTHER_VAR'), - Datadog::Core::Telemetry::V1::Configuration.new(name: 'SOME_OTHER_VARIABLE') + { name: 'logger.level', value: 1 }, + { name: 'profiling.enabled', value: true }, + { name: 'tracing.enabled', value: true }, ] end it { is_expected.to be_a_kind_of(described_class) } @@ -59,17 +58,17 @@ it { is_expected.to be_a_kind_of(described_class) } end - context 'is array of Configuration' do - let(:configuration) { [Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG')] } + context 'is array of one Hash' do + let(:configuration) { [{ name: 'DD_AGENT_HOST', value: 'localhost' }] } it { is_expected.to be_a_kind_of(described_class) } end context 'is array of Configurations with multiple elements' do let(:configuration) do [ - Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_TRACE_DEBUG'), - Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_SERVICE_NAME'), - Datadog::Core::Telemetry::V1::Configuration.new(name: 'DD_ENV') + { name: 'DD_AGENT_HOST', value: 'localhost' }, + { name: 'DD_AGENT_TRANSPORT', value: 'http' }, + { name: 'DD_TRACE_SAMPLE_RATE', value: '0.7' }, ] end it { is_expected.to be_a_kind_of(described_class) } diff --git a/spec/datadog/core/telemetry/v1/configuration_spec.rb b/spec/datadog/core/telemetry/v1/configuration_spec.rb deleted file mode 100644 index 1c2ce15c7ba..00000000000 --- a/spec/datadog/core/telemetry/v1/configuration_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'spec_helper' - -require 'datadog/core/telemetry/v1/configuration' - -RSpec.describe Datadog::Core::Telemetry::V1::Configuration do - subject(:configuration) { described_class.new(name: name, value: value) } - - let(:name) { 'DD_TRACE_DEBUG' } - let(:value) { true } - - it { is_expected.to have_attributes(name: name, value: value) } - - describe '#initialize' do - context ':name' do - it_behaves_like 'a required string parameter', 'name' - end - - context 'when :value' do - context 'is nil' do - let(:value) { nil } - it { is_expected.to be_a_kind_of(described_class) } - end - - context 'is string' do - let(:value) { 'true' } - it { is_expected.to be_a_kind_of(described_class) } - end - - context 'is bool' do - let(:value) { true } - it { is_expected.to be_a_kind_of(described_class) } - end - - context 'is int' do - let(:value) { 1 } - it { is_expected.to be_a_kind_of(described_class) } - end - end - end -end From 1c86b31ee3ca22925bd532f69914672a264aa3e5 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Wed, 6 Jul 2022 14:33:12 -0400 Subject: [PATCH 0366/2133] Implement module to emit Telemetry events (#2127) * Add module to emit telemetry event * Handle seq_id autoincrement in emitter * Fix emitter tests * Add configuration tests * Disable telemetry in CircleCI jobs * Add test to integration apps * fixup! Add test to integration apps * Move app started call to components * Add tests for emitter * Add tests for client * Add tests for components * Modify integration tests * fixup! Modify integration tests * Use accessor for telemetry in integration tests --- .circleci/config.yml | 1 + .env | 1 + .../app/controllers/health_controller.rb | 4 +- .../apps/rails-five/docker-compose.ci.yml | 1 + .../rails-five/spec/integration/basic_spec.rb | 7 ++ .../app/controllers/health_controller.rb | 4 +- .../apps/rails-seven/docker-compose.ci.yml | 1 + .../spec/integration/basic_spec.rb | 7 ++ .../app/controllers/health_controller.rb | 4 +- .../apps/rails-six/docker-compose.ci.yml | 1 + .../rails-six/spec/integration/basic_spec.rb | 7 ++ lib/datadog/core/configuration.rb | 1 + lib/datadog/core/configuration/components.rb | 20 +++++ lib/datadog/core/telemetry/client.rb | 34 ++++++++ lib/datadog/core/telemetry/emitter.rb | 39 +++++++++ .../core/configuration/components_spec.rb | 85 +++++++++++++++++++ spec/datadog/core/telemetry/client_spec.rb | 56 ++++++++++++ spec/datadog/core/telemetry/emitter_spec.rb | 82 ++++++++++++++++++ 18 files changed, 352 insertions(+), 3 deletions(-) create mode 100644 lib/datadog/core/telemetry/client.rb create mode 100644 lib/datadog/core/telemetry/emitter.rb create mode 100644 spec/datadog/core/telemetry/client_spec.rb create mode 100644 spec/datadog/core/telemetry/emitter_spec.rb diff --git a/.circleci/config.yml b/.circleci/config.yml index 065e358f036..6d2fea7f2be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ test_containers: # If you see gem installation failing with "Killed" on CircleCI and `gem install --platform ruby grpc` reproduces the # issue when you connect to the testing container via ssh, then try lowering this file a notch. GRPC_RUBY_BUILD_PROCS: 6 + DD_INSTRUMENTATION_TELEMETRY_ENABLED: false - &container_parameters_environment - *container_base_environment - TEST_DATADOG_INTEGRATION: 1 diff --git a/.env b/.env index 94e4e67e21a..0ef5aa936d2 100644 --- a/.env +++ b/.env @@ -2,6 +2,7 @@ DD_AGENT_HOST=localhost DD_API_KEY=00000000000000000000000000000000 DD_METRIC_AGENT_PORT=8125 DD_TRACE_AGENT_PORT=8126 +DD_INSTRUMENTATION_TELEMETRY_ENABLED=false TEST_DDAGENT_VAR_RUN=/var/run/datadog TEST_DDAGENT_UNIX_SOCKET=${TEST_DDAGENT_VAR_RUN}/apm.socket TEST_DDAGENT_API_KEY=invalid_key_but_this_is_fine diff --git a/integration/apps/rails-five/app/controllers/health_controller.rb b/integration/apps/rails-five/app/controllers/health_controller.rb index 2c55f15cc4b..cc22c615e0e 100644 --- a/integration/apps/rails-five/app/controllers/health_controller.rb +++ b/integration/apps/rails-five/app/controllers/health_controller.rb @@ -13,7 +13,9 @@ def detailed_check render json: { webserver_process: $PROGRAM_NAME, profiler_available: Datadog::Profiling.start_if_enabled, - profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') } + profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, + telemetry_enabled: Datadog.configuration.telemetry.enabled, + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled } end end diff --git a/integration/apps/rails-five/docker-compose.ci.yml b/integration/apps/rails-five/docker-compose.ci.yml index dd32d8785d3..7051c6b9e80 100644 --- a/integration/apps/rails-five/docker-compose.ci.yml +++ b/integration/apps/rails-five/docker-compose.ci.yml @@ -95,6 +95,7 @@ services: - TEST_HOSTNAME=app - TEST_PORT=80 - TEST_INTEGRATION=true + - DD_INSTRUMENTATION_TELEMETRY_ENABLED=true # volumes: # - .:/app # - ../../images/include:/vendor/dd-demo diff --git a/integration/apps/rails-five/spec/integration/basic_spec.rb b/integration/apps/rails-five/spec/integration/basic_spec.rb index 639db7b8719..6cf6f163d5c 100644 --- a/integration/apps/rails-five/spec/integration/basic_spec.rb +++ b/integration/apps/rails-five/spec/integration/basic_spec.rb @@ -23,6 +23,13 @@ ) end + it 'should be sending telemetry app-started event' do + expect(json_result).to include( + telemetry_enabled: true, + telemetry_client_enabled: true + ) + end + it 'webserver sanity checking' do puts " Webserver: #{json_result.fetch(:webserver_process)}" end diff --git a/integration/apps/rails-seven/app/controllers/health_controller.rb b/integration/apps/rails-seven/app/controllers/health_controller.rb index 2c55f15cc4b..cc22c615e0e 100644 --- a/integration/apps/rails-seven/app/controllers/health_controller.rb +++ b/integration/apps/rails-seven/app/controllers/health_controller.rb @@ -13,7 +13,9 @@ def detailed_check render json: { webserver_process: $PROGRAM_NAME, profiler_available: Datadog::Profiling.start_if_enabled, - profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') } + profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, + telemetry_enabled: Datadog.configuration.telemetry.enabled, + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled } end end diff --git a/integration/apps/rails-seven/docker-compose.ci.yml b/integration/apps/rails-seven/docker-compose.ci.yml index 6a5703b9965..67ecc7e9174 100644 --- a/integration/apps/rails-seven/docker-compose.ci.yml +++ b/integration/apps/rails-seven/docker-compose.ci.yml @@ -95,6 +95,7 @@ services: - TEST_HOSTNAME=app - TEST_PORT=80 - TEST_INTEGRATION=true + - DD_INSTRUMENTATION_TELEMETRY_ENABLED=true # volumes: # - .:/app # - ../../images/include:/vendor/dd-demo diff --git a/integration/apps/rails-seven/spec/integration/basic_spec.rb b/integration/apps/rails-seven/spec/integration/basic_spec.rb index 639db7b8719..6cf6f163d5c 100644 --- a/integration/apps/rails-seven/spec/integration/basic_spec.rb +++ b/integration/apps/rails-seven/spec/integration/basic_spec.rb @@ -23,6 +23,13 @@ ) end + it 'should be sending telemetry app-started event' do + expect(json_result).to include( + telemetry_enabled: true, + telemetry_client_enabled: true + ) + end + it 'webserver sanity checking' do puts " Webserver: #{json_result.fetch(:webserver_process)}" end diff --git a/integration/apps/rails-six/app/controllers/health_controller.rb b/integration/apps/rails-six/app/controllers/health_controller.rb index 2c55f15cc4b..cc22c615e0e 100644 --- a/integration/apps/rails-six/app/controllers/health_controller.rb +++ b/integration/apps/rails-six/app/controllers/health_controller.rb @@ -13,7 +13,9 @@ def detailed_check render json: { webserver_process: $PROGRAM_NAME, profiler_available: Datadog::Profiling.start_if_enabled, - profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') } + profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, + telemetry_enabled: Datadog.configuration.telemetry.enabled, + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled } end end diff --git a/integration/apps/rails-six/docker-compose.ci.yml b/integration/apps/rails-six/docker-compose.ci.yml index 83f52bb9fd0..576b8588f9e 100644 --- a/integration/apps/rails-six/docker-compose.ci.yml +++ b/integration/apps/rails-six/docker-compose.ci.yml @@ -95,6 +95,7 @@ services: - TEST_HOSTNAME=app - TEST_PORT=80 - TEST_INTEGRATION=true + - DD_INSTRUMENTATION_TELEMETRY_ENABLED=true # volumes: # - .:/app # - ../../images/include:/vendor/dd-demo diff --git a/integration/apps/rails-six/spec/integration/basic_spec.rb b/integration/apps/rails-six/spec/integration/basic_spec.rb index 639db7b8719..6cf6f163d5c 100644 --- a/integration/apps/rails-six/spec/integration/basic_spec.rb +++ b/integration/apps/rails-six/spec/integration/basic_spec.rb @@ -23,6 +23,13 @@ ) end + it 'should be sending telemetry app-started event' do + expect(json_result).to include( + telemetry_enabled: true, + telemetry_client_enabled: true + ) + end + it 'webserver sanity checking' do puts " Webserver: #{json_result.fetch(:webserver_process)}" end diff --git a/lib/datadog/core/configuration.rb b/lib/datadog/core/configuration.rb index 0a4d9957080..55519ecb159 100644 --- a/lib/datadog/core/configuration.rb +++ b/lib/datadog/core/configuration.rb @@ -2,6 +2,7 @@ require_relative 'configuration/components' require_relative 'configuration/settings' +require_relative 'telemetry/emitter' require_relative 'logger' require_relative 'pin' diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 227e8a2f9de..ad5d6373cd6 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -5,6 +5,7 @@ require_relative '../diagnostics/health' require_relative '../logger' require_relative '../runtime/metrics' +require_relative '../telemetry/client' require_relative '../workers/runtime_metrics' require_relative '../../tracing/tracer' @@ -51,6 +52,16 @@ def build_runtime_metrics_worker(settings) Core::Workers::RuntimeMetrics.new(options) end + def build_telemetry(settings) + # Reuse a previous instance of the telemetry client if it already exists + if @telemetry + @telemetry.disable! unless settings.telemetry.enabled + @telemetry + else + Telemetry::Client.new(enabled: settings.telemetry.enabled) + end + end + def build_tracer(settings, agent_settings) # If a custom tracer has been provided, use it instead. # Ignore all other options (they should already be configured.) @@ -328,6 +339,9 @@ def build_profiler_transport(settings, agent_settings) :runtime_metrics, :tracer + # Telemetry instances persist across multiple component restarts + attr_accessor :telemetry + def initialize(settings) # Logger @logger = self.class.build_logger(settings) @@ -345,6 +359,9 @@ def initialize(settings) # Health metrics @health_metrics = self.class.build_health_metrics(settings) + + # Telemetry + @telemetry = self.class.build_telemetry(settings) end # Starts up components @@ -401,6 +418,9 @@ def shutdown!(replacement = nil) unused_statsd = (old_statsd - (old_statsd & new_statsd)) unused_statsd.each(&:close) + + # The telemetry client is stateful, thus needs to be preserved between reconfigurations + replacement.telemetry = @telemetry if replacement && @telemetry end end # rubocop:enable Metrics/ClassLength diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb new file mode 100644 index 00000000000..f6226e5ef83 --- /dev/null +++ b/lib/datadog/core/telemetry/client.rb @@ -0,0 +1,34 @@ +# typed: true + +require 'datadog/core/telemetry/emitter' +require 'datadog/core/utils/sequence' + +module Datadog + module Core + module Telemetry + # Telemetry entrypoint, coordinates sending telemetry events at various points in app lifecyle + class Client + attr_reader \ + :enabled, + :emitter + + # @param enabled [Boolean] Determines whether telemetry events should be sent to the API + # @param sequence [Datadog::Core::Utils::Sequence] Sequence object that stores and increments a counter + def initialize(enabled: true, sequence: Datadog::Core::Utils::Sequence.new(1)) + @enabled = enabled + @emitter = Emitter.new(sequence: sequence) + end + + def disable! + @enabled = false + end + + def started! + return unless @enabled + + @emitter.request('app-started') + end + end + end + end +end diff --git a/lib/datadog/core/telemetry/emitter.rb b/lib/datadog/core/telemetry/emitter.rb new file mode 100644 index 00000000000..47431c8cadc --- /dev/null +++ b/lib/datadog/core/telemetry/emitter.rb @@ -0,0 +1,39 @@ +# typed: true + +require 'datadog/core/telemetry/event' +require 'datadog/core/telemetry/http/transport' +require 'datadog/core/utils/sequence' + +module Datadog + module Core + module Telemetry + # Class that emits telemetry events + class Emitter + attr_reader \ + :sequence, + :http_transport + + # @param sequence [Datadog::Core::Utils::Sequence] Sequence object that stores and increments a counter + # @param http_transport [Datadog::Core::Telemetry::Http::Transport] Transport object that can be used to send + # telemetry requests via the agent + def initialize(sequence: Datadog::Core::Utils::Sequence.new(1), + http_transport: Datadog::Core::Telemetry::Http::Transport.new) + @sequence = sequence + @http_transport = http_transport + end + + # Retrieves and emits a TelemetryRequest object based on the request type specified + # @param request_type [String] the type of telemetry request to collect data for + def request(request_type) + begin + request = Datadog::Core::Telemetry::Event.new.telemetry_request(request_type: request_type, + seq_id: @sequence.next).to_h + @http_transport.request(request_type: request_type, payload: request.to_json) + rescue StandardError => e + Datadog.logger.info("Unable to send telemetry request for event `#{request_type}`: #{e}") + end + end + end + end + end +end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index a65a6276af1..8db73b17904 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -10,6 +10,7 @@ require 'datadog/core/diagnostics/environment_logger' require 'datadog/core/diagnostics/health' require 'datadog/core/logger' +require 'datadog/core/telemetry/client' require 'datadog/core/runtime/metrics' require 'datadog/core/workers/runtime_metrics' require 'datadog/profiling' @@ -216,6 +217,68 @@ end end + describe '::build_telemetry' do + subject(:build_telemetry) { described_class.build_telemetry(settings) } + + context 'given settings' do + shared_examples_for 'new telemetry client' do + let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } + let(:default_options) { { enabled: settings.telemetry.enabled } } + let(:options) { {} } + + before do + expect(Datadog::Core::Telemetry::Client).to receive(:new) + .with(default_options.merge(options)) + .and_return(telemetry_client) + end + + it { is_expected.to be(telemetry_client) } + end + + context 'by default' do + it_behaves_like 'new telemetry client' + end + + context 'with :enabled' do + let(:enabled) { double('enabled') } + + before do + allow(settings.telemetry) + .to receive(:enabled) + .and_return(enabled) + end + + it_behaves_like 'new telemetry client' do + let(:options) { { enabled: enabled } } + end + end + + context 'when @telemetry exists with :enabled false' do + let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } + let(:default_options) { { enabled: settings.telemetry.enabled } } + let(:options) { {} } + let(:enabled) { false } + + before do + allow(telemetry_client).to receive(:disable!) + allow(settings.telemetry).to receive(:enabled).and_return(enabled) + end + + around do |example| + described_class.instance_variable_set(:@telemetry, telemetry_client) + example.run + described_class.instance_variable_set(:@telemetry, nil) + end + + it do + expect(telemetry_client).to receive(:disable!) + + build_telemetry + end + end + end + end + describe '::build_runtime_metrics' do subject(:build_runtime_metrics) { described_class.build_runtime_metrics(settings) } @@ -1135,12 +1198,14 @@ let(:runtime_metrics) { instance_double(Datadog::Core::Runtime::Metrics, statsd: statsd) } let(:health_metrics) { instance_double(Datadog::Core::Diagnostics::Health::Metrics, statsd: statsd) } let(:statsd) { instance_double(::Datadog::Statsd) } + let(:telemetry) { instance_double(Datadog::Core::Telemetry::Client) } before do allow(replacement).to receive(:tracer).and_return(tracer) allow(replacement).to receive(:profiler).and_return(profiler) allow(replacement).to receive(:runtime_metrics).and_return(runtime_metrics_worker) allow(replacement).to receive(:health_metrics).and_return(health_metrics) + allow(replacement).to receive(:telemetry=).and_return(telemetry) end end @@ -1177,6 +1242,26 @@ end end + context 'when telemetry is defined' do + include_context 'replacement' do + let(:runtime_metrics_worker) { components.runtime_metrics } + let(:health_metrics) { components.health_metrics } + end + + let(:telemetry) { instance_double(Datadog::Core::Telemetry::Client) } + + before do + allow(components).to receive(:telemetry).and_return(telemetry) + end + + it 'returns existing telemetry instance' do + expect(components.telemetry).to be(telemetry) + expect(Datadog::Core::Telemetry::Client).to_not receive(:new) + + shutdown! + end + end + context 'when the tracer is re-used' do include_context 'replacement' do let(:tracer) { components.tracer } diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb new file mode 100644 index 00000000000..eec9c2a2b42 --- /dev/null +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -0,0 +1,56 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/client' + +RSpec.describe Datadog::Core::Telemetry::Client do + subject(:client) { described_class.new(enabled: enabled, sequence: sequence) } + let(:enabled) { true } + let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } + let(:emitter) { double(Datadog::Core::Telemetry::Emitter) } + let(:response) { double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } + + before do + allow(Datadog::Core::Telemetry::Emitter).to receive(:new).and_return(emitter) + allow(emitter).to receive(:request).and_return(response) + end + + describe '#initialize' do + context 'when no params provided' do + subject(:client) { described_class.new } + it { is_expected.to be_a_kind_of(described_class) } + it { expect(client.enabled).to be(true) } + it { expect(client.emitter).to be(emitter) } + end + + context 'when :enabled is false' do + let(:enabled) { false } + it { is_expected.to be_a_kind_of(described_class) } + it { expect(client.enabled).to be(false) } + end + end + + describe '#disable!' do + it { expect { client.disable! }.to change { client.enabled }.from(true).to(false) } + end + + describe '#started!' do + subject(:started!) { client.started! } + context 'when disabled' do + let(:enabled) { false } + it do + started! + expect(emitter).to_not have_received(:request).with('app-started') + end + end + + context 'when enabled' do + let(:enabled) { true } + it do + started! + expect(emitter).to have_received(:request).with('app-started') + end + + it { is_expected.to be(response) } + end + end +end diff --git a/spec/datadog/core/telemetry/emitter_spec.rb b/spec/datadog/core/telemetry/emitter_spec.rb new file mode 100644 index 00000000000..b1f39f5bf07 --- /dev/null +++ b/spec/datadog/core/telemetry/emitter_spec.rb @@ -0,0 +1,82 @@ +require 'spec_helper' + +require 'datadog/core/telemetry/emitter' + +RSpec.describe Datadog::Core::Telemetry::Emitter do + subject(:emitter) { described_class.new(sequence: sequence, http_transport: http_transport) } + let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } + let(:http_transport) { double(Datadog::Core::Telemetry::Http::Transport) } + let(:response) { double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } + let(:response_ok) { true } + + before do + allow(http_transport).to receive(:request).and_return(response) + allow(response).to receive(:ok?).and_return(response_ok) + end + + describe '#initialize' do + context 'when no params provided' do + subject(:emitter) { described_class.new } + it { is_expected.to be_a_kind_of(described_class) } + end + + context 'when :sequence is provided' do + let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } + it { is_expected.to be_a_kind_of(described_class) } + it { expect(emitter.sequence).to be(sequence) } + end + + context 'when :http_transport is provided' do + let(:http_transport) { double(Datadog::Core::Telemetry::Http::Transport) } + it { is_expected.to be_a_kind_of(described_class) } + it { expect(emitter.http_transport).to be(http_transport) } + end + + it 'seq_id begins with 1' do + original_seq_id = emitter.sequence.instance_variable_get(:@current) + expect(original_seq_id).to be(1) + end + end + + describe '#request' do + subject(:request) { emitter.request(request_type) } + let(:request_type) { 'app-started' } + + before do + logger = double(Datadog::Core::Logger) + allow(logger).to receive(:info) + allow(Datadog).to receive(:logger).and_return(logger) + end + + context 'when :request_type' do + context 'is invalid' do + let(:request_type) { 'app' } + it do + request + expect(Datadog.logger).to have_received(:info) do |message| + expect(message).to include('Unable to send telemetry request') + end + end + end + + context 'is app-started' do + let(:request_type) { 'app-started' } + + context 'when call is successful' do + let(:response_ok) { true } + + it 'no logs are produced' do + is_expected.to eq(response) + expect(Datadog.logger).to_not have_received(:info) + end + + it 'seq_id is incremented' do + original_seq_id = emitter.sequence.instance_variable_get(:@current) + request + expect(emitter.sequence.instance_variable_get(:@current)).to be(original_seq_id + 1) + end + end + end + end + end +end From 85e79e3d66ed9e96a5ed2405ac94792e333a757a Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Wed, 6 Jul 2022 19:31:11 -0400 Subject: [PATCH 0367/2133] Send app-closing event on shutdown (#2130) --- lib/datadog/core/configuration/components.rb | 2 ++ lib/datadog/core/telemetry/client.rb | 6 ++++++ lib/datadog/core/telemetry/event.rb | 2 ++ .../core/configuration/components_spec.rb | 1 + spec/datadog/core/telemetry/client_spec.rb | 21 +++++++++++++++++++ spec/datadog/core/telemetry/event_spec.rb | 6 ++++++ 6 files changed, 38 insertions(+) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index ad5d6373cd6..c6fabb646c1 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -421,6 +421,8 @@ def shutdown!(replacement = nil) # The telemetry client is stateful, thus needs to be preserved between reconfigurations replacement.telemetry = @telemetry if replacement && @telemetry + + @telemetry.stop! if !replacement && @telemetry end end # rubocop:enable Metrics/ClassLength diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index f6226e5ef83..0d48c93eb1d 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -28,6 +28,12 @@ def started! @emitter.request('app-started') end + + def stop! + return unless @enabled + + @emitter.request('app-closing') + end end end end diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index f705414d0ab..a875f8917c6 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -44,6 +44,8 @@ def payload(request_type) case request_type when 'app-started' app_started + when 'app-closing' + {} else raise ArgumentError, "Request type invalid, received request_type: #{@request_type}" end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 8db73b17904..b843e6acfef 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -1184,6 +1184,7 @@ .with(true, close_metrics: false) expect(components.runtime_metrics.metrics.statsd).to receive(:close) expect(components.health_metrics.statsd).to receive(:close) + expect(components.telemetry).to receive(:stop!) shutdown! end diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb index eec9c2a2b42..9ff1909ec86 100644 --- a/spec/datadog/core/telemetry/client_spec.rb +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -53,4 +53,25 @@ it { is_expected.to be(response) } end end + + describe '#stop!' do + subject(:stop!) { client.stop! } + context 'when disabled' do + let(:enabled) { false } + it do + stop! + expect(emitter).to_not have_received(:request).with('app-closing') + end + end + + context 'when enabled' do + let(:enabled) { true } + it do + stop! + expect(emitter).to have_received(:request).with('app-closing') + end + + it { is_expected.to be(response) } + end + end end diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb index 2db9a92486f..b432d35f1f2 100644 --- a/spec/datadog/core/telemetry/event_spec.rb +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -31,6 +31,12 @@ it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppStarted) } end + context 'is app-closing' do + let(:request_type) { 'app-closing' } + + it { expect(telemetry_request.payload).to eq({}) } + end + context 'is nil' do let(:request_type) { nil } it { expect { telemetry_request }.to raise_error(ArgumentError) } From c1474149d0942ea54aa74f4c9c85f52d09b3915d Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Thu, 7 Jul 2022 09:11:38 -0400 Subject: [PATCH 0368/2133] Send telemetry app-started and app-integrations-change events (#2133) * Rename AppStarted to AppEvent * Add app-integrations-change event * Pass old components to Components#initialize * Fix telemetry client tests * Add common patcher methods to rack patcher --- lib/datadog/ci/configuration/components.rb | 2 +- lib/datadog/core/configuration.rb | 2 +- lib/datadog/core/configuration/components.rb | 21 +++---- lib/datadog/core/telemetry/client.rb | 7 +++ lib/datadog/core/telemetry/event.rb | 10 +++- .../v1/{app_started.rb => app_event.rb} | 16 +++--- .../core/telemetry/v1/telemetry_request.rb | 2 +- lib/datadog/tracing/contrib/rack/patcher.rb | 8 +++ .../core/configuration/components_spec.rb | 57 ++++++++----------- spec/datadog/core/telemetry/client_spec.rb | 36 +++++++++++- spec/datadog/core/telemetry/event_spec.rb | 10 +++- ...{app_started_spec.rb => app_event_spec.rb} | 21 +++++-- .../telemetry/v1/telemetry_request_spec.rb | 11 ++-- 13 files changed, 130 insertions(+), 73 deletions(-) rename lib/datadog/core/telemetry/v1/{app_started.rb => app_event.rb} (74%) rename spec/datadog/core/telemetry/v1/{app_started_spec.rb => app_event_spec.rb} (90%) diff --git a/lib/datadog/ci/configuration/components.rb b/lib/datadog/ci/configuration/components.rb index 74bf71e3764..9be102f8e54 100644 --- a/lib/datadog/ci/configuration/components.rb +++ b/lib/datadog/ci/configuration/components.rb @@ -7,7 +7,7 @@ module CI module Configuration # Adds CI behavior to Datadog trace components module Components - def initialize(settings) + def initialize(settings, previous_components: nil) # Activate CI mode if enabled activate_ci!(settings) if settings.ci.enabled diff --git a/lib/datadog/core/configuration.rb b/lib/datadog/core/configuration.rb index 55519ecb159..4dacff9d1db 100644 --- a/lib/datadog/core/configuration.rb +++ b/lib/datadog/core/configuration.rb @@ -249,7 +249,7 @@ def build_components(settings) end def replace_components!(settings, old) - components = Components.new(settings) + components = Components.new(settings, previous_components: old) old.shutdown!(components) components.startup!(settings) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index c6fabb646c1..babc5812e97 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -52,14 +52,18 @@ def build_runtime_metrics_worker(settings) Core::Workers::RuntimeMetrics.new(options) end - def build_telemetry(settings) + def build_telemetry(settings, previous_components: nil) + unless previous_components && previous_components.telemetry + return Telemetry::Client.new(enabled: settings.telemetry.enabled) + end + # Reuse a previous instance of the telemetry client if it already exists - if @telemetry - @telemetry.disable! unless settings.telemetry.enabled - @telemetry + if settings.telemetry.enabled + previous_components.telemetry.integrations_change! else - Telemetry::Client.new(enabled: settings.telemetry.enabled) + previous_components.telemetry.disable! end + previous_components.telemetry end def build_tracer(settings, agent_settings) @@ -342,7 +346,7 @@ def build_profiler_transport(settings, agent_settings) # Telemetry instances persist across multiple component restarts attr_accessor :telemetry - def initialize(settings) + def initialize(settings, previous_components: nil) # Logger @logger = self.class.build_logger(settings) @@ -361,7 +365,7 @@ def initialize(settings) @health_metrics = self.class.build_health_metrics(settings) # Telemetry - @telemetry = self.class.build_telemetry(settings) + @telemetry = self.class.build_telemetry(settings, previous_components: previous_components) end # Starts up components @@ -419,9 +423,6 @@ def shutdown!(replacement = nil) unused_statsd = (old_statsd - (old_statsd & new_statsd)) unused_statsd.each(&:close) - # The telemetry client is stateful, thus needs to be preserved between reconfigurations - replacement.telemetry = @telemetry if replacement && @telemetry - @telemetry.stop! if !replacement && @telemetry end end diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index 0d48c93eb1d..8f250f15403 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -17,6 +17,7 @@ class Client def initialize(enabled: true, sequence: Datadog::Core::Utils::Sequence.new(1)) @enabled = enabled @emitter = Emitter.new(sequence: sequence) + started! end def disable! @@ -34,6 +35,12 @@ def stop! @emitter.request('app-closing') end + + def integrations_change! + return unless @enabled + + @emitter.request('app-integrations-change') + end end end end diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index a875f8917c6..901c78c04c3 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -1,7 +1,7 @@ # typed: true require 'datadog/core/telemetry/collector' -require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/app_event' require 'datadog/core/telemetry/v1/telemetry_request' module Datadog @@ -46,19 +46,25 @@ def payload(request_type) app_started when 'app-closing' {} + when 'app-integrations-change' + app_integrations_change else raise ArgumentError, "Request type invalid, received request_type: #{@request_type}" end end def app_started - Telemetry::V1::AppStarted.new( + Telemetry::V1::AppEvent.new( dependencies: dependencies, integrations: integrations, configuration: configurations, additional_payload: additional_payload ) end + + def app_integrations_change + Telemetry::V1::AppEvent.new(integrations: integrations) + end end end end diff --git a/lib/datadog/core/telemetry/v1/app_started.rb b/lib/datadog/core/telemetry/v1/app_event.rb similarity index 74% rename from lib/datadog/core/telemetry/v1/app_started.rb rename to lib/datadog/core/telemetry/v1/app_event.rb index ee1bbe86fcb..562a8861b06 100644 --- a/lib/datadog/core/telemetry/v1/app_started.rb +++ b/lib/datadog/core/telemetry/v1/app_event.rb @@ -2,8 +2,8 @@ module Datadog module Core module Telemetry module V1 - # Describes payload for telemetry V1 API app_started event - class AppStarted + # Describes payload for telemetry V1 API app-integrations-change event + class AppEvent include Kernel attr_reader \ @@ -26,12 +26,12 @@ def initialize(additional_payload: nil, configuration: nil, dependencies: nil, i end def to_h - { - additional_payload: map_hash(Hash(@additional_payload)), - configuration: map_hash(Hash(@configuration)), - dependencies: map_array(Array(@dependencies)), - integrations: map_array(Array(@integrations)), - } + {}.tap do |hash| + hash[:additional_payload] = map_hash(@additional_payload) if @additional_payload + hash[:configuration] = map_hash(@configuration) if @configuration + hash[:dependencies] = map_array(@dependencies) if @dependencies + hash[:integrations] = map_array(@integrations) if @integrations + end end private diff --git a/lib/datadog/core/telemetry/v1/telemetry_request.rb b/lib/datadog/core/telemetry/v1/telemetry_request.rb index 5d5dff2a1f3..332b56343eb 100644 --- a/lib/datadog/core/telemetry/v1/telemetry_request.rb +++ b/lib/datadog/core/telemetry/v1/telemetry_request.rb @@ -29,7 +29,7 @@ class TelemetryRequest # @param application [Telemetry::V1::Application] Object that contains information about the environment of the # application # @param host [Telemetry::V1::Host] Object that holds host related information - # @param payload [Telemetry::V1::AppStarted] The payload of the request, type impacted by :request_type + # @param payload [Telemetry::V1::AppEvent] The payload of the request, type impacted by :request_type # @param request_type [String] Requested API function impacting the Payload type, `app-started` # @param runtime_id [String] V4 UUID that represents a tracer session # @param seq_id [Integer] Counter that should be auto incremented every time an API call is being made diff --git a/lib/datadog/tracing/contrib/rack/patcher.rb b/lib/datadog/tracing/contrib/rack/patcher.rb index b02977c6f21..34566d624c9 100644 --- a/lib/datadog/tracing/contrib/rack/patcher.rb +++ b/lib/datadog/tracing/contrib/rack/patcher.rb @@ -104,6 +104,14 @@ def patch def get_option(option) Datadog.configuration.tracing[:rack].get_option(option) end + + def patch_successful + MiddlewarePatcher.patch_successful || MiddlewareNamePatcher.patch_successful + end + + def patch_error_result + MiddlewarePatcher.patch_error_result || MiddlewareNamePatcher.patch_error_result + end end end end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index b843e6acfef..cfd00c5229d 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -218,7 +218,9 @@ end describe '::build_telemetry' do - subject(:build_telemetry) { described_class.build_telemetry(settings) } + subject(:build_telemetry) { described_class.build_telemetry(settings, previous_components: previous_components) } + + let(:previous_components) { nil } context 'given settings' do shared_examples_for 'new telemetry client' do @@ -253,27 +255,38 @@ end end - context 'when @telemetry exists with :enabled false' do - let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } - let(:default_options) { { enabled: settings.telemetry.enabled } } + context 'when telemetry has been initialized before' do + let(:enabled) { true } let(:options) { {} } - let(:enabled) { false } + let(:default_options) { { enabled: settings.telemetry.enabled } } + let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } + let(:previous_components) { double('previous components') } before do allow(telemetry_client).to receive(:disable!) + allow(telemetry_client).to receive(:integrations_change!) allow(settings.telemetry).to receive(:enabled).and_return(enabled) + allow(previous_components).to receive(:telemetry).and_return(telemetry_client) end - around do |example| - described_class.instance_variable_set(:@telemetry, telemetry_client) - example.run - described_class.instance_variable_set(:@telemetry, nil) + context 'with :enabled true' do + let(:enabled) { true } + + it do + expect(telemetry_client).to receive(:integrations_change!) + + build_telemetry + end end - it do - expect(telemetry_client).to receive(:disable!) + context 'with :enabled false' do + let(:enabled) { false } - build_telemetry + it do + expect(telemetry_client).to receive(:disable!) + + build_telemetry + end end end end @@ -1243,26 +1256,6 @@ end end - context 'when telemetry is defined' do - include_context 'replacement' do - let(:runtime_metrics_worker) { components.runtime_metrics } - let(:health_metrics) { components.health_metrics } - end - - let(:telemetry) { instance_double(Datadog::Core::Telemetry::Client) } - - before do - allow(components).to receive(:telemetry).and_return(telemetry) - end - - it 'returns existing telemetry instance' do - expect(components.telemetry).to be(telemetry) - expect(Datadog::Core::Telemetry::Client).to_not receive(:new) - - shutdown! - end - end - context 'when the tracer is re-used' do include_context 'replacement' do let(:tracer) { components.tracer } diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb index 9ff1909ec86..136bdda04c4 100644 --- a/spec/datadog/core/telemetry/client_spec.rb +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -27,6 +27,16 @@ it { is_expected.to be_a_kind_of(described_class) } it { expect(client.enabled).to be(false) } end + + context 'when enabled' do + let(:enabled) { true } + + it do + client + + expect(emitter).to have_received(:request).with('app-started') + end + end end describe '#disable!' do @@ -35,6 +45,7 @@ describe '#started!' do subject(:started!) { client.started! } + context 'when disabled' do let(:enabled) { false } it do @@ -47,10 +58,8 @@ let(:enabled) { true } it do started! - expect(emitter).to have_received(:request).with('app-started') + is_expected.to be(response) end - - it { is_expected.to be(response) } end end @@ -74,4 +83,25 @@ it { is_expected.to be(response) } end end + + describe '#integrations_change!' do + subject(:integrations_change!) { client.integrations_change! } + context 'when disabled' do + let(:enabled) { false } + it do + integrations_change! + expect(emitter).to_not have_received(:request).with('app-integrations-change') + end + end + + context 'when enabled' do + let(:enabled) { true } + it do + integrations_change! + expect(emitter).to have_received(:request).with('app-integrations-change') + end + + it { is_expected.to be(response) } + end + end end diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb index b432d35f1f2..a04fa7ed5d9 100644 --- a/spec/datadog/core/telemetry/event_spec.rb +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -28,7 +28,7 @@ context 'is app-started' do let(:request_type) { 'app-started' } - it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppStarted) } + it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppEvent) } end context 'is app-closing' do @@ -37,6 +37,12 @@ it { expect(telemetry_request.payload).to eq({}) } end + context 'is app-integrations-change' do + let(:request_type) { 'app-integrations-change' } + + it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppEvent) } + end + context 'is nil' do let(:request_type) { nil } it { expect { telemetry_request }.to raise_error(ArgumentError) } @@ -61,7 +67,7 @@ context 'is valid' do let(:seq_id) { 2 } - it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppStarted) } + it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppEvent) } end end end diff --git a/spec/datadog/core/telemetry/v1/app_started_spec.rb b/spec/datadog/core/telemetry/v1/app_event_spec.rb similarity index 90% rename from spec/datadog/core/telemetry/v1/app_started_spec.rb rename to spec/datadog/core/telemetry/v1/app_event_spec.rb index 64d22bd0beb..95df631735a 100644 --- a/spec/datadog/core/telemetry/v1/app_started_spec.rb +++ b/spec/datadog/core/telemetry/v1/app_event_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/app_event' require 'datadog/core/telemetry/v1/dependency' require 'datadog/core/telemetry/v1/integration' -RSpec.describe Datadog::Core::Telemetry::V1::AppStarted do +RSpec.describe Datadog::Core::Telemetry::V1::AppEvent do subject(:app_started) do described_class.new( additional_payload: additional_payload, @@ -130,12 +130,21 @@ let(:configuration) { nil } let(:dependencies) { nil } let(:integrations) { nil } + + it do + is_expected.to eq({}) + end + end + + context 'when only integrations provided' do + let(:additional_payload) { nil } + let(:configuration) { nil } + let(:dependencies) { nil } + let(:integrations) { [Datadog::Core::Telemetry::V1::Integration.new(name: 'pg', enabled: true)] } + it do is_expected.to eq( - additional_payload: [], - configuration: [], - dependencies: [], - integrations: [], + integrations: [{ auto_enabled: nil, compatible: nil, enabled: true, error: nil, name: 'pg', version: nil }] ) end end diff --git a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb index 5e215453bbf..3c5d47f62b9 100644 --- a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb +++ b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'datadog/core/telemetry/v1/telemetry_request' -require 'datadog/core/telemetry/v1/app_started' +require 'datadog/core/telemetry/v1/app_event' require 'datadog/core/telemetry/v1/application' require 'datadog/core/telemetry/v1/host' require 'datadog/core/telemetry/v1/integration' @@ -31,7 +31,7 @@ let(:debug) { false } let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } let(:payload) do - Datadog::Core::Telemetry::V1::AppStarted.new( + Datadog::Core::Telemetry::V1::AppEvent.new( integrations: [Datadog::Core::Telemetry::V1::Integration.new( name: 'pg', enabled: true )] @@ -110,7 +110,7 @@ context 'is valid' do let(:payload) do - Datadog::Core::Telemetry::V1::AppStarted.new( + Datadog::Core::Telemetry::V1::AppEvent.new( integrations: [Datadog::Core::Telemetry::V1::Integration.new( name: 'pg', enabled: true )] @@ -176,7 +176,7 @@ let(:debug) { false } let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } let(:payload) do - Datadog::Core::Telemetry::V1::AppStarted.new( + Datadog::Core::Telemetry::V1::AppEvent.new( integrations: [Datadog::Core::Telemetry::V1::Integration.new( name: 'pg', enabled: true )] @@ -214,9 +214,6 @@ os_version: nil }, payload: { - additional_payload: [], - configuration: [], - dependencies: [], integrations: [{ auto_enabled: nil, compatible: nil, enabled: true, error: nil, name: 'pg', version: nil }] }, request_type: request_type, From 77a0e68a6fc4a8c9db9d8729071eba36109a6b1c Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Thu, 7 Jul 2022 20:23:43 -0400 Subject: [PATCH 0369/2133] Send telemetry app-heartbeat event (#2135) * Initialize worker to send heartbeat requests * Add tests * Change integration tests * Wrap worker.stop and worker.join in if statement --- .../app/controllers/health_controller.rb | 3 +- .../rails-five/spec/integration/basic_spec.rb | 5 +- .../app/controllers/health_controller.rb | 3 +- .../spec/integration/basic_spec.rb | 5 +- .../app/controllers/health_controller.rb | 3 +- .../rails-six/spec/integration/basic_spec.rb | 5 +- lib/datadog/core/configuration/components.rb | 1 + lib/datadog/core/telemetry/client.rb | 30 +++++++- lib/datadog/core/telemetry/event.rb | 2 +- lib/datadog/core/telemetry/heartbeat.rb | 32 ++++++++ .../core/configuration/components_spec.rb | 2 + spec/datadog/core/telemetry/client_spec.rb | 77 ++++++++++++++++++- spec/datadog/core/telemetry/event_spec.rb | 6 ++ spec/datadog/core/telemetry/heartbeat_spec.rb | 46 +++++++++++ 14 files changed, 208 insertions(+), 12 deletions(-) create mode 100644 lib/datadog/core/telemetry/heartbeat.rb create mode 100644 spec/datadog/core/telemetry/heartbeat_spec.rb diff --git a/integration/apps/rails-five/app/controllers/health_controller.rb b/integration/apps/rails-five/app/controllers/health_controller.rb index cc22c615e0e..297556fb4b6 100644 --- a/integration/apps/rails-five/app/controllers/health_controller.rb +++ b/integration/apps/rails-five/app/controllers/health_controller.rb @@ -15,7 +15,8 @@ def detailed_check profiler_available: Datadog::Profiling.start_if_enabled, profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, telemetry_enabled: Datadog.configuration.telemetry.enabled, - telemetry_client_enabled: Datadog.send(:components).telemetry.enabled + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled, + telemetry_worker_enabled: Datadog.send(:components).telemetry.worker.enabled? } end end diff --git a/integration/apps/rails-five/spec/integration/basic_spec.rb b/integration/apps/rails-five/spec/integration/basic_spec.rb index 6cf6f163d5c..1552dd978ea 100644 --- a/integration/apps/rails-five/spec/integration/basic_spec.rb +++ b/integration/apps/rails-five/spec/integration/basic_spec.rb @@ -23,10 +23,11 @@ ) end - it 'should be sending telemetry app-started event' do + it 'should be sending telemetry events' do expect(json_result).to include( telemetry_enabled: true, - telemetry_client_enabled: true + telemetry_client_enabled: true, + telemetry_worker_enabled: true ) end diff --git a/integration/apps/rails-seven/app/controllers/health_controller.rb b/integration/apps/rails-seven/app/controllers/health_controller.rb index cc22c615e0e..297556fb4b6 100644 --- a/integration/apps/rails-seven/app/controllers/health_controller.rb +++ b/integration/apps/rails-seven/app/controllers/health_controller.rb @@ -15,7 +15,8 @@ def detailed_check profiler_available: Datadog::Profiling.start_if_enabled, profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, telemetry_enabled: Datadog.configuration.telemetry.enabled, - telemetry_client_enabled: Datadog.send(:components).telemetry.enabled + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled, + telemetry_worker_enabled: Datadog.send(:components).telemetry.worker.enabled? } end end diff --git a/integration/apps/rails-seven/spec/integration/basic_spec.rb b/integration/apps/rails-seven/spec/integration/basic_spec.rb index 6cf6f163d5c..1552dd978ea 100644 --- a/integration/apps/rails-seven/spec/integration/basic_spec.rb +++ b/integration/apps/rails-seven/spec/integration/basic_spec.rb @@ -23,10 +23,11 @@ ) end - it 'should be sending telemetry app-started event' do + it 'should be sending telemetry events' do expect(json_result).to include( telemetry_enabled: true, - telemetry_client_enabled: true + telemetry_client_enabled: true, + telemetry_worker_enabled: true ) end diff --git a/integration/apps/rails-six/app/controllers/health_controller.rb b/integration/apps/rails-six/app/controllers/health_controller.rb index cc22c615e0e..297556fb4b6 100644 --- a/integration/apps/rails-six/app/controllers/health_controller.rb +++ b/integration/apps/rails-six/app/controllers/health_controller.rb @@ -15,7 +15,8 @@ def detailed_check profiler_available: Datadog::Profiling.start_if_enabled, profiler_threads: Thread.list.map(&:name).select { |it| it && it.include?('Profiling') }, telemetry_enabled: Datadog.configuration.telemetry.enabled, - telemetry_client_enabled: Datadog.send(:components).telemetry.enabled + telemetry_client_enabled: Datadog.send(:components).telemetry.enabled, + telemetry_worker_enabled: Datadog.send(:components).telemetry.worker.enabled? } end end diff --git a/integration/apps/rails-six/spec/integration/basic_spec.rb b/integration/apps/rails-six/spec/integration/basic_spec.rb index 6cf6f163d5c..1552dd978ea 100644 --- a/integration/apps/rails-six/spec/integration/basic_spec.rb +++ b/integration/apps/rails-six/spec/integration/basic_spec.rb @@ -23,10 +23,11 @@ ) end - it 'should be sending telemetry app-started event' do + it 'should be sending telemetry events' do expect(json_result).to include( telemetry_enabled: true, - telemetry_client_enabled: true + telemetry_client_enabled: true, + telemetry_worker_enabled: true ) end diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index babc5812e97..f9c47b394b9 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -59,6 +59,7 @@ def build_telemetry(settings, previous_components: nil) # Reuse a previous instance of the telemetry client if it already exists if settings.telemetry.enabled + previous_components.telemetry.reenable! previous_components.telemetry.integrations_change! else previous_components.telemetry.disable! diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index 8f250f15403..1ebf336d493 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -1,6 +1,7 @@ # typed: true require 'datadog/core/telemetry/emitter' +require 'datadog/core/telemetry/heartbeat' require 'datadog/core/utils/sequence' module Datadog @@ -10,7 +11,8 @@ module Telemetry class Client attr_reader \ :enabled, - :emitter + :emitter, + :worker # @param enabled [Boolean] Determines whether telemetry events should be sent to the API # @param sequence [Datadog::Core::Utils::Sequence] Sequence object that stores and increments a counter @@ -18,10 +20,22 @@ def initialize(enabled: true, sequence: Datadog::Core::Utils::Sequence.new(1)) @enabled = enabled @emitter = Emitter.new(sequence: sequence) started! + @worker = Telemetry::Heartbeat.new(enabled: @enabled) do + heartbeat! + end + @stopped = false + end + + def reenable! + unless @enabled + @enabled = true + @worker.enabled = true + end end def disable! @enabled = false + @worker.enabled = false end def started! @@ -31,6 +45,12 @@ def started! end def stop! + return if @stopped + + @worker.stop + @worker.join + @stopped = true + return unless @enabled @emitter.request('app-closing') @@ -41,6 +61,14 @@ def integrations_change! @emitter.request('app-integrations-change') end + + private + + def heartbeat! + return unless @enabled + + @emitter.request('app-heartbeat') + end end end end diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index 901c78c04c3..7a8c5b2e992 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -44,7 +44,7 @@ def payload(request_type) case request_type when 'app-started' app_started - when 'app-closing' + when 'app-closing', 'app-heartbeat' {} when 'app-integrations-change' app_integrations_change diff --git a/lib/datadog/core/telemetry/heartbeat.rb b/lib/datadog/core/telemetry/heartbeat.rb new file mode 100644 index 00000000000..b8d97917e01 --- /dev/null +++ b/lib/datadog/core/telemetry/heartbeat.rb @@ -0,0 +1,32 @@ +# typed: false + +require 'datadog/core/worker' +require 'datadog/core/workers/polling' + +module Datadog + module Core + module Telemetry + # Periodically (every DEFAULT_INTERVAL_SECONDS) sends a heartbeat event to the telemetry API. + class Heartbeat < Core::Worker + include Core::Workers::Polling + + DEFAULT_INTERVAL_SECONDS = 60 + + def initialize(enabled: true, interval: DEFAULT_INTERVAL_SECONDS, &block) + # Workers::Polling settings + self.enabled = enabled + # Workers::IntervalLoop settings + self.loop_base_interval = interval + super(&block) + start + end + + private + + def start + perform + end + end + end + end +end diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index cfd00c5229d..51ff3f31049 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -264,6 +264,7 @@ before do allow(telemetry_client).to receive(:disable!) + allow(telemetry_client).to receive(:reenable!) allow(telemetry_client).to receive(:integrations_change!) allow(settings.telemetry).to receive(:enabled).and_return(enabled) allow(previous_components).to receive(:telemetry).and_return(telemetry_client) @@ -273,6 +274,7 @@ let(:enabled) { true } it do + expect(telemetry_client).to receive(:reenable!) expect(telemetry_client).to receive(:integrations_change!) build_telemetry diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb index 136bdda04c4..d5375902457 100644 --- a/spec/datadog/core/telemetry/client_spec.rb +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -15,6 +15,11 @@ end describe '#initialize' do + after do + client.worker.stop(true) + client.worker.join + end + context 'when no params provided' do subject(:client) { described_class.new } it { is_expected.to be_a_kind_of(described_class) } @@ -26,6 +31,7 @@ let(:enabled) { false } it { is_expected.to be_a_kind_of(described_class) } it { expect(client.enabled).to be(false) } + it { expect(client.worker.enabled?).to be(false) } end context 'when enabled' do @@ -33,19 +39,55 @@ it do client - expect(emitter).to have_received(:request).with('app-started') + expect(client.worker.enabled?).to be(true) end end end describe '#disable!' do + after do + client.worker.stop(true) + client.worker.join + end + it { expect { client.disable! }.to change { client.enabled }.from(true).to(false) } + it { expect { client.disable! }.to change { client.worker.enabled? }.from(true).to(false) } + end + + describe '#reenable!' do + after do + client.worker.stop(true) + client.worker.join + end + + context 'when already enabled' do + it do + expect(client.enabled).to be(true) + expect(client.worker.enabled?).to be(true) + + client.reenable! + + expect(client.enabled).to be(true) + expect(client.worker.enabled?).to be(true) + end + end + + context 'when disabled' do + let(:enabled) { false } + it { expect { client.reenable! }.to change { client.enabled }.from(false).to(true) } + it { expect { client.reenable! }.to change { client.worker.enabled? }.from(false).to(true) } + end end describe '#started!' do subject(:started!) { client.started! } + after do + client.worker.stop(true) + client.worker.join + end + context 'when disabled' do let(:enabled) { false } it do @@ -65,10 +107,21 @@ describe '#stop!' do subject(:stop!) { client.stop! } + let(:worker) { instance_double(Datadog::Core::Telemetry::Heartbeat) } + + before do + allow(Datadog::Core::Telemetry::Heartbeat).to receive(:new).and_return(worker) + allow(worker).to receive(:start) + allow(worker).to receive(:stop) + allow(worker).to receive(:join) + end + context 'when disabled' do let(:enabled) { false } it do stop! + expect(client.worker).to have_received(:stop) + expect(client.worker).to have_received(:join) expect(emitter).to_not have_received(:request).with('app-closing') end end @@ -77,15 +130,37 @@ let(:enabled) { true } it do stop! + expect(client.worker).to have_received(:stop) expect(emitter).to have_received(:request).with('app-closing') end it { is_expected.to be(response) } + + context 'when stop! has been called already' do + let(:stopped_client) { client.instance_variable_set(:@stopped, true) } + + before do + allow(described_class).to receive(:new).and_return(stopped_client) + end + + it do + stop! + + expect(client.worker).to_not have_received(:stop) + expect(emitter).to_not have_received(:request).with('app-closing') + end + end end end describe '#integrations_change!' do subject(:integrations_change!) { client.integrations_change! } + + after do + client.worker.stop(true) + client.worker.join + end + context 'when disabled' do let(:enabled) { false } it do diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb index a04fa7ed5d9..15e10df10f3 100644 --- a/spec/datadog/core/telemetry/event_spec.rb +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -37,6 +37,12 @@ it { expect(telemetry_request.payload).to eq({}) } end + context 'is app-heartbeat' do + let(:request_type) { 'app-heartbeat' } + + it { expect(telemetry_request.payload).to eq({}) } + end + context 'is app-integrations-change' do let(:request_type) { 'app-integrations-change' } diff --git a/spec/datadog/core/telemetry/heartbeat_spec.rb b/spec/datadog/core/telemetry/heartbeat_spec.rb new file mode 100644 index 00000000000..5d2cce3d2d0 --- /dev/null +++ b/spec/datadog/core/telemetry/heartbeat_spec.rb @@ -0,0 +1,46 @@ +# typed: false + +require 'spec_helper' + +require 'datadog/core/telemetry/heartbeat' + +RSpec.describe Datadog::Core::Telemetry::Heartbeat do + subject(:heartbeat) { described_class.new(enabled: enabled, interval: interval, &block) } + + let(:enabled) { true } + let(:interval) { 60 } + let(:block) { proc {} } + + after do + heartbeat.stop(true) + heartbeat.join + end + + describe '.new' do + context 'when using default settings' do + subject(:heartbeat) { described_class.new(&block) } + it do + is_expected.to have_attributes( + enabled?: true, + loop_base_interval: 60, # seconds + task: block + ) + end + end + + context 'when enabled' do + let(:enabled) { true } + + it do + heartbeat + + try_wait_until { heartbeat.running? } + expect(heartbeat).to have_attributes( + run_async?: true, + running?: true, + started?: true + ) + end + end + end +end From f18a2fc57591d567b1e937501f80c4697415093c Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Fri, 8 Jul 2022 13:00:56 -0400 Subject: [PATCH 0370/2133] Add benchmark test for configure and shutdown (#2139) --- spec/ddtrace/benchmark/telemetry_spec.rb | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 spec/ddtrace/benchmark/telemetry_spec.rb diff --git a/spec/ddtrace/benchmark/telemetry_spec.rb b/spec/ddtrace/benchmark/telemetry_spec.rb new file mode 100644 index 00000000000..0e4b0611cbc --- /dev/null +++ b/spec/ddtrace/benchmark/telemetry_spec.rb @@ -0,0 +1,54 @@ +# typed: ignore + +require 'spec_helper' + +require 'benchmark' +require 'ddtrace' + +RSpec.describe 'Telemetry Benchmark' do + let(:enabled) { 'true' } + + around do |example| + ClimateControl.modify(Datadog::Core::Telemetry::Ext::ENV_ENABLED => enabled) do + example.run + end + end + + before do + skip('Benchmark results not currently captured in CI') if ENV.key?('CI') + + # Create double to swallow log output + logger = double(Datadog::Core::Logger) + allow(logger).to receive(:debug) + allow(logger).to receive(:info) + allow(logger).to receive(:warn) + allow(logger).to receive(:error) + allow(Datadog).to receive(:logger).and_return(logger) + end + + include Benchmark + + context 'telemetry disabled' do + let(:enabled) { 'false' } + + it do + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#configure') { Datadog.configure {} } + x.report('#integration_change') { Datadog.configure { |c| c.tracing.instrument :rake } } + x.report('#close') { Datadog::Tracing.shutdown! } + end + end + end + + context 'telemetry enabled' do + let(:enabled) { 'true' } + + it do + Benchmark.benchmark(Benchmark::CAPTION, 30, Benchmark::FORMAT) do |x| + x.report('#configure') { Datadog.configure {} } + x.report('#integration_change') { Datadog.configure { |c| c.tracing.instrument :rake } } + x.report('#close') { Datadog::Tracing.shutdown! } + end + end + end +end From 91fc558ca95bea8031283d099841c5f5abf6622a Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Mon, 11 Jul 2022 08:57:39 -0400 Subject: [PATCH 0371/2133] Add unsupported flag for telemetry (#2141) * Change error logs to debug level * Capture 404 errors and disable telemetry * Set log to info to debug ci error * Return connection errors as InternalErrorResponse * fixup! Return connection errors as InternalErrorResponse --- lib/datadog/core/telemetry/client.rb | 18 +++++-- lib/datadog/core/telemetry/emitter.rb | 2 +- .../core/telemetry/http/adapters/net.rb | 19 +++++--- spec/datadog/core/telemetry/client_spec.rb | 47 +++++++++++++++++++ spec/datadog/core/telemetry/emitter_spec.rb | 6 +-- .../core/telemetry/http/adapters/net_spec.rb | 15 ++++-- 6 files changed, 88 insertions(+), 19 deletions(-) diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index 1ebf336d493..1d17eedad52 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -10,8 +10,9 @@ module Telemetry # Telemetry entrypoint, coordinates sending telemetry events at various points in app lifecyle class Client attr_reader \ - :enabled, :emitter, + :enabled, + :unsupported, :worker # @param enabled [Boolean] Determines whether telemetry events should be sent to the API @@ -19,15 +20,17 @@ class Client def initialize(enabled: true, sequence: Datadog::Core::Utils::Sequence.new(1)) @enabled = enabled @emitter = Emitter.new(sequence: sequence) + @stopped = false + @unsupported = false + started! @worker = Telemetry::Heartbeat.new(enabled: @enabled) do heartbeat! end - @stopped = false end def reenable! - unless @enabled + unless @enabled || @unsupported @enabled = true @worker.enabled = true end @@ -41,7 +44,14 @@ def disable! def started! return unless @enabled - @emitter.request('app-started') + res = @emitter.request('app-started') + + if res.not_found? # Telemetry is only supported by agent versions 7.34 and up + Datadog.logger.debug('Agent does not support telemetry; disabling future telemetry events.') + @enabled = false + @unsupported = true # Prevent telemetry from getting re-enabled + end + res end def stop! diff --git a/lib/datadog/core/telemetry/emitter.rb b/lib/datadog/core/telemetry/emitter.rb index 47431c8cadc..14dfdbe4a22 100644 --- a/lib/datadog/core/telemetry/emitter.rb +++ b/lib/datadog/core/telemetry/emitter.rb @@ -30,7 +30,7 @@ def request(request_type) seq_id: @sequence.next).to_h @http_transport.request(request_type: request_type, payload: request.to_json) rescue StandardError => e - Datadog.logger.info("Unable to send telemetry request for event `#{request_type}`: #{e}") + Datadog.logger.debug("Unable to send telemetry request for event `#{request_type}`: #{e}") end end end diff --git a/lib/datadog/core/telemetry/http/adapters/net.rb b/lib/datadog/core/telemetry/http/adapters/net.rb index e48b9b70a71..bddbda91d3d 100644 --- a/lib/datadog/core/telemetry/http/adapters/net.rb +++ b/lib/datadog/core/telemetry/http/adapters/net.rb @@ -34,14 +34,19 @@ def open(&block) end def post(env) - post = ::Net::HTTP::Post.new(env.path, env.headers) - post.body = env.body - - http_response = open do |http| - http.request(post) + begin + post = ::Net::HTTP::Post.new(env.path, env.headers) + post.body = env.body + + http_response = open do |http| + http.request(post) + end + + Response.new(http_response) + rescue StandardError => e + Datadog.logger.debug("Unable to send telemetry event to agent: #{e}") + Telemetry::Http::InternalErrorResponse.new(e) end - - Response.new(http_response) end # Data structure for an HTTP Response diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb index d5375902457..6dc1ccfed41 100644 --- a/spec/datadog/core/telemetry/client_spec.rb +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -8,10 +8,12 @@ let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } let(:emitter) { double(Datadog::Core::Telemetry::Emitter) } let(:response) { double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } + let(:not_found) { false } before do allow(Datadog::Core::Telemetry::Emitter).to receive(:new).and_return(emitter) allow(emitter).to receive(:request).and_return(response) + allow(response).to receive(:not_found?).and_return(not_found) end describe '#initialize' do @@ -42,6 +44,24 @@ expect(emitter).to have_received(:request).with('app-started') expect(client.worker.enabled?).to be(true) end + + context 'when response returns 404' do + let(:not_found) { true } + + before do + logger = double(Datadog::Core::Logger) + allow(logger).to receive(:debug) + allow(Datadog).to receive(:logger).and_return(logger) + end + + it do + expect(client.enabled).to be(false) + expect(client.unsupported).to be(true) + expect(Datadog.logger).to have_received(:debug) do |message| + expect(message).to eq('Agent does not support telemetry; disabling future telemetry events.') + end + end + end end end @@ -77,6 +97,23 @@ let(:enabled) { false } it { expect { client.reenable! }.to change { client.enabled }.from(false).to(true) } it { expect { client.reenable! }.to change { client.worker.enabled? }.from(false).to(true) } + + context 'when unsupported' do + let(:unsupported_client) { client.instance_variable_set(:@unsupported, true) } + before do + allow(described_class).to receive(:new).and_return(unsupported_client) + end + + it do + expect(client.enabled).to be(false) + expect(client.worker.enabled?).to be(false) + + client.reenable! + + expect(client.enabled).to be(false) + expect(client.worker.enabled?).to be(false) + end + end end end @@ -98,6 +135,16 @@ context 'when enabled' do let(:enabled) { true } + + it do + started! + is_expected.to be(response) + end + end + + context 'when internal error returned by emitter' do + let(:response) { Datadog::Core::Telemetry::Http::InternalErrorResponse.new('error') } + it do started! is_expected.to be(response) diff --git a/spec/datadog/core/telemetry/emitter_spec.rb b/spec/datadog/core/telemetry/emitter_spec.rb index b1f39f5bf07..a02ded72e03 100644 --- a/spec/datadog/core/telemetry/emitter_spec.rb +++ b/spec/datadog/core/telemetry/emitter_spec.rb @@ -44,7 +44,7 @@ before do logger = double(Datadog::Core::Logger) - allow(logger).to receive(:info) + allow(logger).to receive(:debug) allow(Datadog).to receive(:logger).and_return(logger) end @@ -53,7 +53,7 @@ let(:request_type) { 'app' } it do request - expect(Datadog.logger).to have_received(:info) do |message| + expect(Datadog.logger).to have_received(:debug) do |message| expect(message).to include('Unable to send telemetry request') end end @@ -67,7 +67,7 @@ it 'no logs are produced' do is_expected.to eq(response) - expect(Datadog.logger).to_not have_received(:info) + expect(Datadog.logger).to_not have_received(:debug) end it 'seq_id is incremented' do diff --git a/spec/datadog/core/telemetry/http/adapters/net_spec.rb b/spec/datadog/core/telemetry/http/adapters/net_spec.rb index f741c849522..e912a9cf3e0 100644 --- a/spec/datadog/core/telemetry/http/adapters/net_spec.rb +++ b/spec/datadog/core/telemetry/http/adapters/net_spec.rb @@ -99,11 +99,18 @@ let(:http_response) { double('http_response') } - before { expect(http_connection).to receive(:request).and_return(http_response) } + context 'when request goes through' do + before { expect(http_connection).to receive(:request).and_return(http_response) } - it 'produces a response' do - is_expected.to be_a_kind_of(described_class::Response) - expect(post.http_response).to be(http_response) + it 'produces a response' do + is_expected.to be_a_kind_of(described_class::Response) + expect(post.http_response).to be(http_response) + end + end + + context 'when error in connecting to agent' do + before { expect(http_connection).to receive(:request).and_raise(StandardError) } + it { expect(post).to be_a_kind_of(Datadog::Core::Telemetry::Http::InternalErrorResponse) } end end end From 1fd9d67676762d925a43c6d9544630c302d4e2e6 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Wed, 3 Aug 2022 17:52:17 -0400 Subject: [PATCH 0372/2133] Clean-up telemetry implementation (#2176) * Add reset! method to sequence util * Create numeric sequence util * Use sequence in emitter class * fixup! Use sequence in emitter class * Call telemetry started! separately * Remove previous_components from components init * Separate emit closing and shutdown * Reset emitter sequence on fork * fixup! Separate emit closing and shutdown * Add fork policy to heartbeat worker * Add mutex to sequence class * Prevent emitting events if in forked process * Use symbol for request type * Move call to emit app-started to configuration * Move call to emit integrations-change to extensions * Add tests for forked? check in client * Remove re-enable function in client * Remove mutex from sequence numeric * Use sequence class rather than sequence numeric --- lib/datadog/ci/configuration/components.rb | 2 +- lib/datadog/core/configuration.rb | 6 +- lib/datadog/core/configuration/components.rb | 26 +--- lib/datadog/core/telemetry/client.rb | 46 +++--- lib/datadog/core/telemetry/emitter.rb | 23 ++- lib/datadog/core/telemetry/event.rb | 6 +- lib/datadog/core/telemetry/heartbeat.rb | 5 + lib/datadog/core/utils/sequence.rb | 5 + lib/datadog/tracing/contrib/extensions.rb | 2 + .../ci/configuration/components_spec.rb | 6 +- .../core/configuration/components_spec.rb | 90 ++++------- spec/datadog/core/configuration_spec.rb | 9 ++ spec/datadog/core/telemetry/client_spec.rb | 146 ++++++++++-------- spec/datadog/core/telemetry/emitter_spec.rb | 36 +++-- spec/datadog/core/telemetry/event_spec.rb | 10 +- .../telemetry/v1/telemetry_request_spec.rb | 6 +- spec/datadog/core/utils/sequence_spec.rb | 36 +++++ .../tracing/contrib/extensions_spec.rb | 5 + 18 files changed, 252 insertions(+), 213 deletions(-) diff --git a/lib/datadog/ci/configuration/components.rb b/lib/datadog/ci/configuration/components.rb index 9be102f8e54..74bf71e3764 100644 --- a/lib/datadog/ci/configuration/components.rb +++ b/lib/datadog/ci/configuration/components.rb @@ -7,7 +7,7 @@ module CI module Configuration # Adds CI behavior to Datadog trace components module Components - def initialize(settings, previous_components: nil) + def initialize(settings) # Activate CI mode if enabled activate_ci!(settings) if settings.ci.enabled diff --git a/lib/datadog/core/configuration.rb b/lib/datadog/core/configuration.rb index 4dacff9d1db..87242c2e5c1 100644 --- a/lib/datadog/core/configuration.rb +++ b/lib/datadog/core/configuration.rb @@ -90,7 +90,9 @@ def configure if components? replace_components!(configuration, @components) else - build_components(configuration) + components = build_components(configuration) + components.telemetry.started! + components end ) end @@ -249,7 +251,7 @@ def build_components(settings) end def replace_components!(settings, old) - components = Components.new(settings, previous_components: old) + components = Components.new(settings) old.shutdown!(components) components.startup!(settings) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index f9c47b394b9..76d8b502a07 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -52,19 +52,8 @@ def build_runtime_metrics_worker(settings) Core::Workers::RuntimeMetrics.new(options) end - def build_telemetry(settings, previous_components: nil) - unless previous_components && previous_components.telemetry - return Telemetry::Client.new(enabled: settings.telemetry.enabled) - end - - # Reuse a previous instance of the telemetry client if it already exists - if settings.telemetry.enabled - previous_components.telemetry.reenable! - previous_components.telemetry.integrations_change! - else - previous_components.telemetry.disable! - end - previous_components.telemetry + def build_telemetry(settings) + Telemetry::Client.new(enabled: settings.telemetry.enabled) end def build_tracer(settings, agent_settings) @@ -342,12 +331,10 @@ def build_profiler_transport(settings, agent_settings) :logger, :profiler, :runtime_metrics, + :telemetry, :tracer - # Telemetry instances persist across multiple component restarts - attr_accessor :telemetry - - def initialize(settings, previous_components: nil) + def initialize(settings) # Logger @logger = self.class.build_logger(settings) @@ -366,7 +353,7 @@ def initialize(settings, previous_components: nil) @health_metrics = self.class.build_health_metrics(settings) # Telemetry - @telemetry = self.class.build_telemetry(settings, previous_components: previous_components) + @telemetry = self.class.build_telemetry(settings) end # Starts up components @@ -424,7 +411,8 @@ def shutdown!(replacement = nil) unused_statsd = (old_statsd - (old_statsd & new_statsd)) unused_statsd.each(&:close) - @telemetry.stop! if !replacement && @telemetry + telemetry.stop! + telemetry.emit_closing! unless replacement end end # rubocop:enable Metrics/ClassLength diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index 1d17eedad52..d694e9e0804 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -2,7 +2,7 @@ require 'datadog/core/telemetry/emitter' require 'datadog/core/telemetry/heartbeat' -require 'datadog/core/utils/sequence' +require 'datadog/core/utils/forking' module Datadog module Core @@ -15,69 +15,63 @@ class Client :unsupported, :worker + include Core::Utils::Forking + # @param enabled [Boolean] Determines whether telemetry events should be sent to the API - # @param sequence [Datadog::Core::Utils::Sequence] Sequence object that stores and increments a counter - def initialize(enabled: true, sequence: Datadog::Core::Utils::Sequence.new(1)) + def initialize(enabled: true) @enabled = enabled - @emitter = Emitter.new(sequence: sequence) + @emitter = Emitter.new @stopped = false @unsupported = false - - started! @worker = Telemetry::Heartbeat.new(enabled: @enabled) do heartbeat! end end - def reenable! - unless @enabled || @unsupported - @enabled = true - @worker.enabled = true - end - end - def disable! @enabled = false @worker.enabled = false end def started! - return unless @enabled + return if !@enabled || forked? - res = @emitter.request('app-started') + res = @emitter.request(:'app-started') if res.not_found? # Telemetry is only supported by agent versions 7.34 and up Datadog.logger.debug('Agent does not support telemetry; disabling future telemetry events.') - @enabled = false + disable! @unsupported = true # Prevent telemetry from getting re-enabled end + res end + def emit_closing! + return if !@enabled || forked? + + @emitter.request(:'app-closing') + end + def stop! return if @stopped - @worker.stop - @worker.join + @worker.stop(true, 0) @stopped = true - - return unless @enabled - - @emitter.request('app-closing') end def integrations_change! - return unless @enabled + return if !@enabled || forked? - @emitter.request('app-integrations-change') + @emitter.request(:'app-integrations-change') end private def heartbeat! - return unless @enabled + return if !@enabled || forked? - @emitter.request('app-heartbeat') + @emitter.request(:'app-heartbeat') end end end diff --git a/lib/datadog/core/telemetry/emitter.rb b/lib/datadog/core/telemetry/emitter.rb index 14dfdbe4a22..3f68df63016 100644 --- a/lib/datadog/core/telemetry/emitter.rb +++ b/lib/datadog/core/telemetry/emitter.rb @@ -3,22 +3,21 @@ require 'datadog/core/telemetry/event' require 'datadog/core/telemetry/http/transport' require 'datadog/core/utils/sequence' +require 'datadog/core/utils/forking' module Datadog module Core module Telemetry # Class that emits telemetry events class Emitter - attr_reader \ - :sequence, - :http_transport + attr_reader :http_transport + + extend Core::Utils::Forking # @param sequence [Datadog::Core::Utils::Sequence] Sequence object that stores and increments a counter # @param http_transport [Datadog::Core::Telemetry::Http::Transport] Transport object that can be used to send # telemetry requests via the agent - def initialize(sequence: Datadog::Core::Utils::Sequence.new(1), - http_transport: Datadog::Core::Telemetry::Http::Transport.new) - @sequence = sequence + def initialize(http_transport: Datadog::Core::Telemetry::Http::Transport.new) @http_transport = http_transport end @@ -27,12 +26,20 @@ def initialize(sequence: Datadog::Core::Utils::Sequence.new(1), def request(request_type) begin request = Datadog::Core::Telemetry::Event.new.telemetry_request(request_type: request_type, - seq_id: @sequence.next).to_h - @http_transport.request(request_type: request_type, payload: request.to_json) + seq_id: self.class.sequence.next).to_h + @http_transport.request(request_type: request_type.to_s, payload: request.to_json) rescue StandardError => e Datadog.logger.debug("Unable to send telemetry request for event `#{request_type}`: #{e}") + Telemetry::Http::InternalErrorResponse.new(e) end end + + # Initializes a Sequence object to track seq_id if not already initialized; else returns stored + # Sequence object + def self.sequence + after_fork! { @sequence = Datadog::Core::Utils::Sequence.new(1) } + @sequence ||= Datadog::Core::Utils::Sequence.new(1) + end end end end diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index 7a8c5b2e992..a840dc371dd 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -42,11 +42,11 @@ def telemetry_request(request_type:, seq_id:) def payload(request_type) case request_type - when 'app-started' + when :'app-started' app_started - when 'app-closing', 'app-heartbeat' + when :'app-closing', :'app-heartbeat' {} - when 'app-integrations-change' + when :'app-integrations-change' app_integrations_change else raise ArgumentError, "Request type invalid, received request_type: #{@request_type}" diff --git a/lib/datadog/core/telemetry/heartbeat.rb b/lib/datadog/core/telemetry/heartbeat.rb index b8d97917e01..6e7d7263713 100644 --- a/lib/datadog/core/telemetry/heartbeat.rb +++ b/lib/datadog/core/telemetry/heartbeat.rb @@ -17,10 +17,15 @@ def initialize(enabled: true, interval: DEFAULT_INTERVAL_SECONDS, &block) self.enabled = enabled # Workers::IntervalLoop settings self.loop_base_interval = interval + self.fork_policy = Core::Workers::Async::Thread::FORK_POLICY_STOP super(&block) start end + def loop_wait_before_first_iteration? + true + end + private def start diff --git a/lib/datadog/core/utils/sequence.rb b/lib/datadog/core/utils/sequence.rb index 9ace455fc4a..54bc73825e9 100644 --- a/lib/datadog/core/utils/sequence.rb +++ b/lib/datadog/core/utils/sequence.rb @@ -6,6 +6,7 @@ module Utils # Generates values from a consistent sequence class Sequence def initialize(seed = 0, &block) + @seed = seed @current = seed @next_item = block end @@ -15,6 +16,10 @@ def next @current += 1 next_item end + + def reset! + @current = @seed + end end end end diff --git a/lib/datadog/tracing/contrib/extensions.rb b/lib/datadog/tracing/contrib/extensions.rb index c04e7647d0e..773e7858961 100644 --- a/lib/datadog/tracing/contrib/extensions.rb +++ b/lib/datadog/tracing/contrib/extensions.rb @@ -97,6 +97,8 @@ def configure(&block) Datadog.logger.warn("Unable to patch #{patch_results[:name]} (#{desc})") end + components.telemetry.integrations_change! if configuration.integrations_pending_activation + configuration.integrations_pending_activation.clear end diff --git a/spec/datadog/ci/configuration/components_spec.rb b/spec/datadog/ci/configuration/components_spec.rb index c11dec4dcee..5c8b3f91af2 100644 --- a/spec/datadog/ci/configuration/components_spec.rb +++ b/spec/datadog/ci/configuration/components_spec.rb @@ -34,7 +34,11 @@ end end - after { components.shutdown! } + after do + components.telemetry.worker.stop(true) + components.telemetry.worker.join + components.shutdown! + end describe '::new' do context 'when #ci' do diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 51ff3f31049..570dc3a5dc2 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -82,6 +82,11 @@ .and_return(health_metrics) end + after do + components.telemetry.worker.stop(true) + components.telemetry.worker.join + end + it do expect(components.logger).to be logger expect(components.tracer).to be tracer @@ -218,78 +223,24 @@ end describe '::build_telemetry' do - subject(:build_telemetry) { described_class.build_telemetry(settings, previous_components: previous_components) } - - let(:previous_components) { nil } + subject(:build_telemetry) { described_class.build_telemetry(settings) } context 'given settings' do - shared_examples_for 'new telemetry client' do - let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } - let(:default_options) { { enabled: settings.telemetry.enabled } } - let(:options) { {} } + let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } + let(:default_options) { { enabled: enabled } } + let(:enabled) { true } - before do - expect(Datadog::Core::Telemetry::Client).to receive(:new) - .with(default_options.merge(options)) - .and_return(telemetry_client) - end - - it { is_expected.to be(telemetry_client) } + before do + expect(Datadog::Core::Telemetry::Client).to receive(:new).with(default_options).and_return(telemetry_client) + allow(settings.telemetry).to receive(:enabled).and_return(enabled) end - context 'by default' do - it_behaves_like 'new telemetry client' - end + it { is_expected.to be(telemetry_client) } context 'with :enabled' do let(:enabled) { double('enabled') } - before do - allow(settings.telemetry) - .to receive(:enabled) - .and_return(enabled) - end - - it_behaves_like 'new telemetry client' do - let(:options) { { enabled: enabled } } - end - end - - context 'when telemetry has been initialized before' do - let(:enabled) { true } - let(:options) { {} } - let(:default_options) { { enabled: settings.telemetry.enabled } } - let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } - let(:previous_components) { double('previous components') } - - before do - allow(telemetry_client).to receive(:disable!) - allow(telemetry_client).to receive(:reenable!) - allow(telemetry_client).to receive(:integrations_change!) - allow(settings.telemetry).to receive(:enabled).and_return(enabled) - allow(previous_components).to receive(:telemetry).and_return(telemetry_client) - end - - context 'with :enabled true' do - let(:enabled) { true } - - it do - expect(telemetry_client).to receive(:reenable!) - expect(telemetry_client).to receive(:integrations_change!) - - build_telemetry - end - end - - context 'with :enabled false' do - let(:enabled) { false } - - it do - expect(telemetry_client).to receive(:disable!) - - build_telemetry - end - end + it { is_expected.to be(telemetry_client) } end end end @@ -1104,6 +1055,11 @@ describe '#startup!' do subject(:startup!) { components.startup!(settings) } + after do + components.telemetry.worker.terminate + components.telemetry.worker.join + end + context 'when profiling' do context 'is unsupported' do before do @@ -1189,6 +1145,11 @@ describe '#shutdown!' do subject(:shutdown!) { components.shutdown!(replacement) } + after do + components.telemetry.worker.terminate + components.telemetry.worker.join + end + context 'given no replacement' do let(:replacement) { nil } @@ -1199,6 +1160,7 @@ .with(true, close_metrics: false) expect(components.runtime_metrics.metrics.statsd).to receive(:close) expect(components.health_metrics.statsd).to receive(:close) + expect(components.telemetry).to receive(:emit_closing!) expect(components.telemetry).to receive(:stop!) shutdown! @@ -1221,7 +1183,7 @@ allow(replacement).to receive(:profiler).and_return(profiler) allow(replacement).to receive(:runtime_metrics).and_return(runtime_metrics_worker) allow(replacement).to receive(:health_metrics).and_return(health_metrics) - allow(replacement).to receive(:telemetry=).and_return(telemetry) + allow(replacement).to receive(:telemetry).and_return(telemetry) end end diff --git a/spec/datadog/core/configuration_spec.rb b/spec/datadog/core/configuration_spec.rb index 557b17ec593..b777df85dd0 100644 --- a/spec/datadog/core/configuration_spec.rb +++ b/spec/datadog/core/configuration_spec.rb @@ -10,6 +10,14 @@ RSpec.describe Datadog::Core::Configuration do let(:default_log_level) { ::Logger::INFO } + let(:telemetry_client) { instance_double(Datadog::Core::Telemetry::Client) } + + before do + allow(telemetry_client).to receive(:started!) + allow(telemetry_client).to receive(:stop!) + allow(telemetry_client).to receive(:emit_closing!) + allow(Datadog::Core::Telemetry::Client).to receive(:new).and_return(telemetry_client) + end context 'when extended by a class' do subject(:test_class) { stub_const('TestClass', Class.new { extend Datadog::Core::Configuration }) } @@ -73,6 +81,7 @@ .with(test_class.configuration) expect(new_components).to_not have_received(:shutdown!) + expect(telemetry_client).to have_received(:started!) end end end diff --git a/spec/datadog/core/telemetry/client_spec.rb b/spec/datadog/core/telemetry/client_spec.rb index 6dc1ccfed41..d211b05fa7a 100644 --- a/spec/datadog/core/telemetry/client_spec.rb +++ b/spec/datadog/core/telemetry/client_spec.rb @@ -3,9 +3,8 @@ require 'datadog/core/telemetry/client' RSpec.describe Datadog::Core::Telemetry::Client do - subject(:client) { described_class.new(enabled: enabled, sequence: sequence) } + subject(:client) { described_class.new(enabled: enabled) } let(:enabled) { true } - let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } let(:emitter) { double(Datadog::Core::Telemetry::Emitter) } let(:response) { double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } let(:not_found) { false } @@ -39,29 +38,9 @@ context 'when enabled' do let(:enabled) { true } - it do - client - expect(emitter).to have_received(:request).with('app-started') - expect(client.worker.enabled?).to be(true) - end - - context 'when response returns 404' do - let(:not_found) { true } - - before do - logger = double(Datadog::Core::Logger) - allow(logger).to receive(:debug) - allow(Datadog).to receive(:logger).and_return(logger) - end - - it do - expect(client.enabled).to be(false) - expect(client.unsupported).to be(true) - expect(Datadog.logger).to have_received(:debug) do |message| - expect(message).to eq('Agent does not support telemetry; disabling future telemetry events.') - end - end - end + it { is_expected.to be_a_kind_of(described_class) } + it { expect(client.enabled).to be(true) } + it { expect(client.worker.enabled?).to be(true) } end end @@ -75,50 +54,74 @@ it { expect { client.disable! }.to change { client.worker.enabled? }.from(true).to(false) } end - describe '#reenable!' do + describe '#started!' do + subject(:started!) { client.started! } + after do client.worker.stop(true) client.worker.join end - context 'when already enabled' do + context 'when disabled' do + let(:enabled) { false } it do - expect(client.enabled).to be(true) - expect(client.worker.enabled?).to be(true) + started! + expect(emitter).to_not have_received(:request).with(:'app-started') + end + end - client.reenable! + context 'when enabled' do + let(:enabled) { true } - expect(client.enabled).to be(true) - expect(client.worker.enabled?).to be(true) + it do + started! + is_expected.to be(response) end end - context 'when disabled' do - let(:enabled) { false } - it { expect { client.reenable! }.to change { client.enabled }.from(false).to(true) } - it { expect { client.reenable! }.to change { client.worker.enabled? }.from(false).to(true) } + context 'when internal error returned by emitter' do + let(:response) { Datadog::Core::Telemetry::Http::InternalErrorResponse.new('error') } - context 'when unsupported' do - let(:unsupported_client) { client.instance_variable_set(:@unsupported, true) } - before do - allow(described_class).to receive(:new).and_return(unsupported_client) - end + it do + started! + is_expected.to be(response) + end + end - it do - expect(client.enabled).to be(false) - expect(client.worker.enabled?).to be(false) + context 'when response returns 404' do + let(:not_found) { true } + + before do + logger = double(Datadog::Core::Logger) + allow(logger).to receive(:debug).with(any_args) + allow(Datadog).to receive(:logger).and_return(logger) + end + + it do + started! + expect(client.enabled).to be(false) + expect(client.unsupported).to be(true) + expect(Datadog.logger).to have_received(:debug).with( + 'Agent does not support telemetry; disabling future telemetry events.' + ) + end + end - client.reenable! + context 'when in fork' do + before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) } - expect(client.enabled).to be(false) - expect(client.worker.enabled?).to be(false) + it do + client + expect_in_fork do + client.started! + expect(emitter).to_not receive(:request).with(:'app-started') end end end end - describe '#started!' do - subject(:started!) { client.started! } + describe '#emit_closing!' do + subject(:emit_closing!) { client.emit_closing! } after do client.worker.stop(true) @@ -128,26 +131,30 @@ context 'when disabled' do let(:enabled) { false } it do - started! - expect(emitter).to_not have_received(:request).with('app-started') + emit_closing! + expect(emitter).to_not have_received(:request).with(:'app-closing') end end context 'when enabled' do let(:enabled) { true } - it do - started! - is_expected.to be(response) + emit_closing! + expect(emitter).to have_received(:request).with(:'app-closing') end + + it { is_expected.to be(response) } end - context 'when internal error returned by emitter' do - let(:response) { Datadog::Core::Telemetry::Http::InternalErrorResponse.new('error') } + context 'when in fork' do + before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) } it do - started! - is_expected.to be(response) + client + expect_in_fork do + client.started! + expect(emitter).to_not receive(:request).with(:'app-closing') + end end end end @@ -160,7 +167,6 @@ allow(Datadog::Core::Telemetry::Heartbeat).to receive(:new).and_return(worker) allow(worker).to receive(:start) allow(worker).to receive(:stop) - allow(worker).to receive(:join) end context 'when disabled' do @@ -168,8 +174,6 @@ it do stop! expect(client.worker).to have_received(:stop) - expect(client.worker).to have_received(:join) - expect(emitter).to_not have_received(:request).with('app-closing') end end @@ -178,11 +182,8 @@ it do stop! expect(client.worker).to have_received(:stop) - expect(emitter).to have_received(:request).with('app-closing') end - it { is_expected.to be(response) } - context 'when stop! has been called already' do let(:stopped_client) { client.instance_variable_set(:@stopped, true) } @@ -194,7 +195,6 @@ stop! expect(client.worker).to_not have_received(:stop) - expect(emitter).to_not have_received(:request).with('app-closing') end end end @@ -212,7 +212,7 @@ let(:enabled) { false } it do integrations_change! - expect(emitter).to_not have_received(:request).with('app-integrations-change') + expect(emitter).to_not have_received(:request).with(:'app-integrations-change') end end @@ -220,10 +220,22 @@ let(:enabled) { true } it do integrations_change! - expect(emitter).to have_received(:request).with('app-integrations-change') + expect(emitter).to have_received(:request).with(:'app-integrations-change') end it { is_expected.to be(response) } end + + context 'when in fork' do + before { skip 'Fork not supported on current platform' unless Process.respond_to?(:fork) } + + it do + client + expect_in_fork do + client.started! + expect(emitter).to_not receive(:request).with(:'app-integrations-change') + end + end + end end end diff --git a/spec/datadog/core/telemetry/emitter_spec.rb b/spec/datadog/core/telemetry/emitter_spec.rb index a02ded72e03..37d5dd0c76b 100644 --- a/spec/datadog/core/telemetry/emitter_spec.rb +++ b/spec/datadog/core/telemetry/emitter_spec.rb @@ -3,15 +3,17 @@ require 'datadog/core/telemetry/emitter' RSpec.describe Datadog::Core::Telemetry::Emitter do - subject(:emitter) { described_class.new(sequence: sequence, http_transport: http_transport) } - let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } + subject(:emitter) { described_class.new(http_transport: http_transport) } let(:http_transport) { double(Datadog::Core::Telemetry::Http::Transport) } let(:response) { double(Datadog::Core::Telemetry::Http::Adapters::Net::Response) } let(:response_ok) { true } before do allow(http_transport).to receive(:request).and_return(response) - allow(response).to receive(:ok?).and_return(response_ok) + end + + after do + emitter.class.sequence.reset! end describe '#initialize' do @@ -20,12 +22,6 @@ it { is_expected.to be_a_kind_of(described_class) } end - context 'when :sequence is provided' do - let(:sequence) { Datadog::Core::Utils::Sequence.new(1) } - it { is_expected.to be_a_kind_of(described_class) } - it { expect(emitter.sequence).to be(sequence) } - end - context 'when :http_transport is provided' do let(:http_transport) { double(Datadog::Core::Telemetry::Http::Transport) } it { is_expected.to be_a_kind_of(described_class) } @@ -33,14 +29,14 @@ end it 'seq_id begins with 1' do - original_seq_id = emitter.sequence.instance_variable_get(:@current) + original_seq_id = emitter.class.sequence.instance_variable_get(:@current) expect(original_seq_id).to be(1) end end describe '#request' do subject(:request) { emitter.request(request_type) } - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } before do logger = double(Datadog::Core::Logger) @@ -60,7 +56,7 @@ end context 'is app-started' do - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } context 'when call is successful' do let(:response_ok) { true } @@ -71,12 +67,24 @@ end it 'seq_id is incremented' do - original_seq_id = emitter.sequence.instance_variable_get(:@current) + original_seq_id = emitter.class.sequence.instance_variable_get(:@current) request - expect(emitter.sequence.instance_variable_get(:@current)).to be(original_seq_id + 1) + expect(emitter.class.sequence.instance_variable_get(:@current)).to be(original_seq_id + 1) end end end end end + + describe 'when initialized multiple times' do + let(:http_transport) { double(Datadog::Core::Telemetry::Http::Transport) } + + context 'sequence is stored' do + it do + emitter_first = described_class.new(http_transport: http_transport) + emitter_second = described_class.new(http_transport: http_transport) + expect(emitter_first.class.sequence).to be(emitter_second.class.sequence) + end + end + end end diff --git a/spec/datadog/core/telemetry/event_spec.rb b/spec/datadog/core/telemetry/event_spec.rb index 15e10df10f3..a84b187c684 100644 --- a/spec/datadog/core/telemetry/event_spec.rb +++ b/spec/datadog/core/telemetry/event_spec.rb @@ -16,7 +16,7 @@ describe '#telemetry_request' do subject(:telemetry_request) { event.telemetry_request(request_type: request_type, seq_id: seq_id) } - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } let(:seq_id) { 1 } it { is_expected.to be_a_kind_of(Datadog::Core::Telemetry::V1::TelemetryRequest) } @@ -26,25 +26,25 @@ context 'when :request_type' do context 'is app-started' do - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppEvent) } end context 'is app-closing' do - let(:request_type) { 'app-closing' } + let(:request_type) { :'app-closing' } it { expect(telemetry_request.payload).to eq({}) } end context 'is app-heartbeat' do - let(:request_type) { 'app-heartbeat' } + let(:request_type) { :'app-heartbeat' } it { expect(telemetry_request.payload).to eq({}) } end context 'is app-integrations-change' do - let(:request_type) { 'app-integrations-change' } + let(:request_type) { :'app-integrations-change' } it { expect(telemetry_request.payload).to be_a_kind_of(Datadog::Core::Telemetry::V1::AppEvent) } end diff --git a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb index 3c5d47f62b9..517c79c2e72 100644 --- a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb +++ b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb @@ -37,7 +37,7 @@ )] ) end - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } let(:dummy_runtime_id) { 'dummy_runtime_id' } let(:seq_id) { 42 } let(:dummy_session_id) { 'dummy_session_id' } @@ -127,7 +127,7 @@ end context 'is valid string' do - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } it { is_expected.to be_a_kind_of(described_class) } end end @@ -182,7 +182,7 @@ )] ) end - let(:request_type) { 'app-started' } + let(:request_type) { :'app-started' } let(:dummy_runtime_id) { 'dummy_runtime_id' } let(:seq_id) { 42 } let(:dummy_session_id) { 'dummy_session_id' } diff --git a/spec/datadog/core/utils/sequence_spec.rb b/spec/datadog/core/utils/sequence_spec.rb index 53577abd4ca..d58af803205 100644 --- a/spec/datadog/core/utils/sequence_spec.rb +++ b/spec/datadog/core/utils/sequence_spec.rb @@ -40,4 +40,40 @@ end end end + + describe '#reset!' do + context 'for a sequence' do + context 'with default settings' do + let(:sequence) { described_class.new } + + it 'produces an integer sequence' do + expect(sequence.next).to eq 0 + sequence.reset! + expect(sequence.next).to eq 0 + end + end + + context 'with a seed' do + let(:sequence) { described_class.new(seed) } + let(:seed) { 10 } + + it 'produces an integer sequence starting at the seed' do + expect(sequence.next).to eq 10 + sequence.reset! + expect(sequence.next).to eq 10 + end + end + + context 'with a block' do + let(:sequence) { described_class.new(&block) } + let(:block) { ->(i) { i.to_s } } + + it 'returns the block value for each iteration' do + expect(sequence.next).to eq '0' + sequence.reset! + expect(sequence.next).to eq '0' + end + end + end + end end diff --git a/spec/datadog/tracing/contrib/extensions_spec.rb b/spec/datadog/tracing/contrib/extensions_spec.rb index fdce5015553..904b2796cb3 100644 --- a/spec/datadog/tracing/contrib/extensions_spec.rb +++ b/spec/datadog/tracing/contrib/extensions_spec.rb @@ -46,6 +46,11 @@ expect(integration).to receive(:patch).and_call_original configure end + + it 'sends a telemetry integrations change event' do + expect_any_instance_of(Datadog::Core::Telemetry::Client).to receive(:integrations_change!) + configure + end end end end From ab1ec6862df1883e6ed522b09b830c27d6099147 Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Thu, 4 Aug 2022 11:15:35 -0400 Subject: [PATCH 0373/2133] Use require_relative and proper line breaks for telemetry (#2204) * Change telemetry imports to use require_relative * Correct method argument line break linting issues --- lib/datadog/core/telemetry/client.rb | 6 ++--- lib/datadog/core/telemetry/collector.rb | 18 +++++++------- lib/datadog/core/telemetry/emitter.rb | 14 ++++++----- lib/datadog/core/telemetry/event.rb | 6 ++--- lib/datadog/core/telemetry/heartbeat.rb | 4 ++-- .../core/telemetry/http/adapters/net.rb | 2 +- lib/datadog/core/telemetry/http/transport.rb | 8 +++---- lib/datadog/core/telemetry/v1/application.rb | 14 +++++++---- lib/datadog/core/telemetry/v1/host.rb | 6 +++-- .../core/telemetry/v1/telemetry_request.rb | 18 ++++++++++---- .../telemetry/v1/telemetry_request_spec.rb | 24 ++++++++++++++----- 11 files changed, 76 insertions(+), 44 deletions(-) diff --git a/lib/datadog/core/telemetry/client.rb b/lib/datadog/core/telemetry/client.rb index d694e9e0804..6de670ed6df 100644 --- a/lib/datadog/core/telemetry/client.rb +++ b/lib/datadog/core/telemetry/client.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/telemetry/emitter' -require 'datadog/core/telemetry/heartbeat' -require 'datadog/core/utils/forking' +require_relative 'emitter' +require_relative 'heartbeat' +require_relative '../utils/forking' module Datadog module Core diff --git a/lib/datadog/core/telemetry/collector.rb b/lib/datadog/core/telemetry/collector.rb index fb2d92ab97e..f450ced4b0e 100644 --- a/lib/datadog/core/telemetry/collector.rb +++ b/lib/datadog/core/telemetry/collector.rb @@ -4,15 +4,15 @@ require 'etc' -require 'datadog/core/configuration/agent_settings_resolver' -require 'datadog/core/environment/ext' -require 'datadog/core/environment/platform' -require 'datadog/core/telemetry/v1/application' -require 'datadog/core/telemetry/v1/dependency' -require 'datadog/core/telemetry/v1/host' -require 'datadog/core/telemetry/v1/integration' -require 'datadog/core/telemetry/v1/product' -require 'ddtrace/transport/ext' +require_relative '../configuration/agent_settings_resolver' +require_relative '../environment/ext' +require_relative '../environment/platform' +require_relative 'v1/application' +require_relative 'v1/dependency' +require_relative 'v1/host' +require_relative 'v1/integration' +require_relative 'v1/product' +require_relative '../../../ddtrace/transport/ext' module Datadog module Core diff --git a/lib/datadog/core/telemetry/emitter.rb b/lib/datadog/core/telemetry/emitter.rb index 3f68df63016..16ce37b938a 100644 --- a/lib/datadog/core/telemetry/emitter.rb +++ b/lib/datadog/core/telemetry/emitter.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/telemetry/event' -require 'datadog/core/telemetry/http/transport' -require 'datadog/core/utils/sequence' -require 'datadog/core/utils/forking' +require_relative 'event' +require_relative 'http/transport' +require_relative '../utils/sequence' +require_relative '../utils/forking' module Datadog module Core @@ -25,8 +25,10 @@ def initialize(http_transport: Datadog::Core::Telemetry::Http::Transport.new) # @param request_type [String] the type of telemetry request to collect data for def request(request_type) begin - request = Datadog::Core::Telemetry::Event.new.telemetry_request(request_type: request_type, - seq_id: self.class.sequence.next).to_h + request = Datadog::Core::Telemetry::Event.new.telemetry_request( + request_type: request_type, + seq_id: self.class.sequence.next + ).to_h @http_transport.request(request_type: request_type.to_s, payload: request.to_json) rescue StandardError => e Datadog.logger.debug("Unable to send telemetry request for event `#{request_type}`: #{e}") diff --git a/lib/datadog/core/telemetry/event.rb b/lib/datadog/core/telemetry/event.rb index a840dc371dd..044515275dd 100644 --- a/lib/datadog/core/telemetry/event.rb +++ b/lib/datadog/core/telemetry/event.rb @@ -1,8 +1,8 @@ # typed: true -require 'datadog/core/telemetry/collector' -require 'datadog/core/telemetry/v1/app_event' -require 'datadog/core/telemetry/v1/telemetry_request' +require_relative 'collector' +require_relative 'v1/app_event' +require_relative 'v1/telemetry_request' module Datadog module Core diff --git a/lib/datadog/core/telemetry/heartbeat.rb b/lib/datadog/core/telemetry/heartbeat.rb index 6e7d7263713..f61e51ee433 100644 --- a/lib/datadog/core/telemetry/heartbeat.rb +++ b/lib/datadog/core/telemetry/heartbeat.rb @@ -1,7 +1,7 @@ # typed: false -require 'datadog/core/worker' -require 'datadog/core/workers/polling' +require_relative '../worker' +require_relative '../workers/polling' module Datadog module Core diff --git a/lib/datadog/core/telemetry/http/adapters/net.rb b/lib/datadog/core/telemetry/http/adapters/net.rb index bddbda91d3d..e060f1de43d 100644 --- a/lib/datadog/core/telemetry/http/adapters/net.rb +++ b/lib/datadog/core/telemetry/http/adapters/net.rb @@ -1,6 +1,6 @@ # typed: true -require 'datadog/core/telemetry/http/response' +require_relative '../response' module Datadog module Core diff --git a/lib/datadog/core/telemetry/http/transport.rb b/lib/datadog/core/telemetry/http/transport.rb index e9161c012c1..d2dadeb9ee9 100644 --- a/lib/datadog/core/telemetry/http/transport.rb +++ b/lib/datadog/core/telemetry/http/transport.rb @@ -1,9 +1,9 @@ # typed: true -require 'datadog/core/configuration/settings' -require 'datadog/core/telemetry/http/env' -require 'datadog/core/telemetry/http/ext' -require 'datadog/core/telemetry/http/adapters/net' +require_relative '../../configuration/settings' +require_relative 'env' +require_relative 'ext' +require_relative 'adapters/net' module Datadog module Core diff --git a/lib/datadog/core/telemetry/v1/application.rb b/lib/datadog/core/telemetry/v1/application.rb index f5f77499152..48760edb082 100644 --- a/lib/datadog/core/telemetry/v1/application.rb +++ b/lib/datadog/core/telemetry/v1/application.rb @@ -31,10 +31,16 @@ class Application # @param service_name [String] Service’s name (DD_SERVICE) # @param service_version [String] Service’s version (DD_VERSION) # @param tracer_version [String] Version of the used tracer - def initialize(language_name:, language_version:, service_name:, tracer_version:, env: nil, products: nil, - runtime_name: nil, runtime_patches: nil, runtime_version: nil, service_version: nil) - validate(language_name: language_name, language_version: language_version, service_name: service_name, - tracer_version: tracer_version) + def initialize( + language_name:, language_version:, service_name:, tracer_version:, env: nil, products: nil, + runtime_name: nil, runtime_patches: nil, runtime_version: nil, service_version: nil + ) + validate( + language_name: language_name, + language_version: language_version, + service_name: service_name, + tracer_version: tracer_version + ) @env = env @language_name = language_name @language_version = language_version diff --git a/lib/datadog/core/telemetry/v1/host.rb b/lib/datadog/core/telemetry/v1/host.rb index 720a96d5389..8a5d7db661d 100644 --- a/lib/datadog/core/telemetry/v1/host.rb +++ b/lib/datadog/core/telemetry/v1/host.rb @@ -20,8 +20,10 @@ class Host # @param kernel_version [String] uname -v # @param os [String] uname -o # @param os_version [String] Version of OS running - def initialize(container_id: nil, hostname: nil, kernel_name: nil, kernel_release: nil, kernel_version: nil, - os_version: nil, os: nil) + def initialize( + container_id: nil, hostname: nil, kernel_name: nil, kernel_release: nil, kernel_version: nil, + os_version: nil, os: nil + ) @container_id = container_id @hostname = hostname @kernel_name = kernel_name diff --git a/lib/datadog/core/telemetry/v1/telemetry_request.rb b/lib/datadog/core/telemetry/v1/telemetry_request.rb index 332b56343eb..6df6e1bce3c 100644 --- a/lib/datadog/core/telemetry/v1/telemetry_request.rb +++ b/lib/datadog/core/telemetry/v1/telemetry_request.rb @@ -37,10 +37,20 @@ class TelemetryRequest # @param debug [Boolean] Flag that enables payload debug mode # @param session_id [String] V4 UUID that represents the session of the top level tracer process, often same\ # as runtime_id - def initialize(api_version:, application:, host:, payload:, request_type:, runtime_id:, seq_id:, tracer_time:, - debug: nil, session_id: nil) - validate(api_version: api_version, application: application, host: host, payload: payload, - request_type: request_type, runtime_id: runtime_id, seq_id: seq_id, tracer_time: tracer_time) + def initialize( + api_version:, application:, host:, payload:, request_type:, runtime_id:, seq_id:, tracer_time:, + debug: nil, session_id: nil + ) + validate( + api_version: api_version, + application: application, + host: host, + payload: payload, + request_type: request_type, + runtime_id: runtime_id, + seq_id: seq_id, + tracer_time: tracer_time + ) @api_version = api_version @application = application @debug = debug diff --git a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb index 517c79c2e72..76d8ce4be78 100644 --- a/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb +++ b/spec/datadog/core/telemetry/v1/telemetry_request_spec.rb @@ -25,8 +25,12 @@ let(:api_version) { 'v1' } let(:application) do - Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', - service_name: 'myapp', tracer_version: '1.0') + Datadog::Core::Telemetry::V1::Application.new( + language_name: 'ruby', + language_version: '3.0', + service_name: 'myapp', + tracer_version: '1.0' + ) end let(:debug) { false } let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } @@ -95,8 +99,12 @@ context 'is valid' do let(:application) do - Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', - service_name: 'myapp', tracer_version: '1.0') + Datadog::Core::Telemetry::V1::Application.new( + language_name: 'ruby', + language_version: '3.0', + service_name: 'myapp', + tracer_version: '1.0' + ) end it { is_expected.to be_a_kind_of(described_class) } end @@ -170,8 +178,12 @@ let(:api_version) { 'v1' } let(:application) do - Datadog::Core::Telemetry::V1::Application.new(language_name: 'ruby', language_version: '3.0', - service_name: 'myapp', tracer_version: '1.0') + Datadog::Core::Telemetry::V1::Application.new( + language_name: 'ruby', + language_version: '3.0', + service_name: 'myapp', + tracer_version: '1.0' + ) end let(:debug) { false } let(:host) { Datadog::Core::Telemetry::V1::Host.new(container_id: 'd39b145254d1f9c337fdd2be132f6') } From df5fd3967406ca2b5fc099c30e764f8a2c9324a5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 4 Aug 2022 12:07:51 +0200 Subject: [PATCH 0374/2133] Added: 1.3.0 to CHANGELOG.md --- CHANGELOG.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa325d588c..feaafe058b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,34 @@ ## [Unreleased] +## [1.2.0] - 2022-08-04 + +Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v1.3.0 + +Git diff: https://github.com/DataDog/dd-trace-rb/compare/v1.2.0...v1.3.0 + +### Added + +* Top-level span being tagged to avoid duplicate computation ([#2138][]) + +### Changed + +* ActiveSupport: Optionally disable tracing with Rails ([@marcotc][]) +* Rack: Resource overwritten by nested application ([#2180][]) +* Rake: Explicit task instrumentation to prevent memory bloat ([#2174][]) +* Sidekiq and DelayedJob: Add spans to improve tracing ([2170][]) +* Drop Profiling support for Ruby 2.1 ([#2140][]) +* Migrate `libddprof` dependency to `libdatadog` ([#2061][]) + +### Fixed + +* Fix OpenTracing propagation with TraceDigest ([#2201][]) +* Fix SpanFilter dropping descendant spans ([#2074][]) +* Redis: Fix Empty pipelined span being dropped ([#757][]) ([@sponomarev][]) +* Fix profiler not restarting on `Process.daemon` ([#2150][]) +* Fix setting service from Rails configuration ([#2118][]) ([@agrobbin][]) +* Some document and development improvement ([@marocchino][]) ([@yukimurasawa][]) + ## [1.2.0] - 2022-07-11 Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v1.2.0 @@ -2354,6 +2382,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [#753]: https://github.com/DataDog/dd-trace-rb/issues/753 [#754]: https://github.com/DataDog/dd-trace-rb/issues/754 [#756]: https://github.com/DataDog/dd-trace-rb/issues/756 +[#757]: https://github.com/DataDog/dd-trace-rb/issues/757 [#760]: https://github.com/DataDog/dd-trace-rb/issues/760 [#762]: https://github.com/DataDog/dd-trace-rb/issues/762 [#765]: https://github.com/DataDog/dd-trace-rb/issues/765 @@ -2892,9 +2921,11 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [#2028]: https://github.com/DataDog/dd-trace-rb/issues/2028 [#2054]: https://github.com/DataDog/dd-trace-rb/issues/2054 [#2059]: https://github.com/DataDog/dd-trace-rb/issues/2059 +[#2061]: https://github.com/DataDog/dd-trace-rb/issues/2061 [#2066]: https://github.com/DataDog/dd-trace-rb/issues/2066 [#2069]: https://github.com/DataDog/dd-trace-rb/issues/2069 [#2070]: https://github.com/DataDog/dd-trace-rb/issues/2070 +[#2074]: https://github.com/DataDog/dd-trace-rb/issues/2074 [#2076]: https://github.com/DataDog/dd-trace-rb/issues/2076 [#2079]: https://github.com/DataDog/dd-trace-rb/issues/2079 [#2082]: https://github.com/DataDog/dd-trace-rb/issues/2082 @@ -2902,8 +2933,19 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [#2097]: https://github.com/DataDog/dd-trace-rb/issues/2097 [#2110]: https://github.com/DataDog/dd-trace-rb/issues/2110 [#2113]: https://github.com/DataDog/dd-trace-rb/issues/2113 +[#2118]: https://github.com/DataDog/dd-trace-rb/issues/2118 [#2125]: https://github.com/DataDog/dd-trace-rb/issues/2125 [#2134]: https://github.com/DataDog/dd-trace-rb/issues/2134 +[#2138]: https://github.com/DataDog/dd-trace-rb/issues/2138 +[#2140]: https://github.com/DataDog/dd-trace-rb/issues/2140 +[#2150]: https://github.com/DataDog/dd-trace-rb/issues/2150 +[#2158]: https://github.com/DataDog/dd-trace-rb/issues/2158 +[#2162]: https://github.com/DataDog/dd-trace-rb/issues/2162 +[#2163]: https://github.com/DataDog/dd-trace-rb/issues/2163 +[#2173]: https://github.com/DataDog/dd-trace-rb/issues/2173 +[#2174]: https://github.com/DataDog/dd-trace-rb/issues/2174 +[#2180]: https://github.com/DataDog/dd-trace-rb/issues/2180 +[#2201]: https://github.com/DataDog/dd-trace-rb/issues/2201 [@AdrianLC]: https://github.com/AdrianLC [@Azure7111]: https://github.com/Azure7111 [@BabyGroot]: https://github.com/BabyGroot @@ -2996,6 +3038,8 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@link04]: https://github.com/link04 [@lloeki]: https://github.com/lloeki [@mantrala]: https://github.com/mantrala +[@marcotc]: https://github.com/marcotc +[@marocchino]: https://github.com/marocchino [@masato-hi]: https://github.com/masato-hi [@matchbookmac]: https://github.com/matchbookmac [@mberlanda]: https://github.com/mberlanda @@ -3027,6 +3071,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@sinsoku]: https://github.com/sinsoku [@skcc321]: https://github.com/skcc321 [@soulcutter]: https://github.com/soulcutter +[@sponomarev]: https://github.com/sponomarev [@stefanahman]: https://github.com/stefanahman [@steveh]: https://github.com/steveh [@stormsilver]: https://github.com/stormsilver @@ -3041,4 +3086,5 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@vramaiah]: https://github.com/vramaiah [@walterking]: https://github.com/walterking [@y-yagi]: https://github.com/y-yagi +[@yukimurasawa]: https://github.com/yukimurasawa [@zachmccormick]: https://github.com/zachmccormick \ No newline at end of file From c291775ae32a0bd38573039233e1e88d9a80d0c6 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 4 Aug 2022 15:10:49 +0200 Subject: [PATCH 0375/2133] Bumping version 1.2.0 to 1.3.0 --- lib/ddtrace/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ddtrace/version.rb b/lib/ddtrace/version.rb index f448f20ce2c..1395548fd34 100644 --- a/lib/ddtrace/version.rb +++ b/lib/ddtrace/version.rb @@ -3,7 +3,7 @@ module DDTrace module VERSION MAJOR = 1 - MINOR = 2 + MINOR = 3 PATCH = 0 PRE = nil From 4879c761ea5c57687034e52fc5a2d880bac2c0d3 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 4 Aug 2022 20:38:04 +0200 Subject: [PATCH 0376/2133] Updated: gemfiles for 1.3.0 --- gemfiles/ruby_2.1.10_contrib.gemfile.lock | 8 ++++---- gemfiles/ruby_2.1.10_core_old.gemfile.lock | 10 +++++----- .../ruby_2.1.10_rails32_mysql2.gemfile.lock | 8 ++++---- .../ruby_2.1.10_rails32_postgres.gemfile.lock | 10 +++++----- ...y_2.1.10_rails32_postgres_redis.gemfile.lock | 10 +++++----- ...2.1.10_rails32_postgres_sidekiq.gemfile.lock | 10 +++++----- gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock | 8 ++++---- .../ruby_2.1.10_rails4_postgres.gemfile.lock | 12 ++++++------ ...by_2.1.10_rails4_postgres_redis.gemfile.lock | 8 ++++---- ...y_2.1.10_rails4_semantic_logger.gemfile.lock | 10 +++++----- gemfiles/ruby_2.2.10_contrib.gemfile.lock | 6 +++--- gemfiles/ruby_2.2.10_core_old.gemfile.lock | 8 ++++---- .../ruby_2.2.10_rails32_mysql2.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails32_postgres.gemfile.lock | 8 ++++---- ...y_2.2.10_rails32_postgres_redis.gemfile.lock | 8 ++++---- ...2.2.10_rails32_postgres_sidekiq.gemfile.lock | 8 ++++---- gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock | 6 +++--- .../ruby_2.2.10_rails4_postgres.gemfile.lock | 6 +++--- ...by_2.2.10_rails4_postgres_redis.gemfile.lock | 6 +++--- ..._2.2.10_rails4_postgres_sidekiq.gemfile.lock | 6 +++--- ...y_2.2.10_rails4_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock | 8 ++++---- .../ruby_2.2.10_rails5_postgres.gemfile.lock | 6 +++--- ...by_2.2.10_rails5_postgres_redis.gemfile.lock | 8 ++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 6 +++--- ..._2.2.10_rails5_postgres_sidekiq.gemfile.lock | 10 +++++----- ...y_2.2.10_rails5_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_contrib.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_contrib_old.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_core_old.gemfile.lock | 8 ++++---- gemfiles/ruby_2.3.8_cucumber3.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_cucumber4.gemfile.lock | 8 ++++---- gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails32_postgres.gemfile.lock | 8 ++++---- ...by_2.3.8_rails32_postgres_redis.gemfile.lock | 8 ++++---- ..._2.3.8_rails32_postgres_sidekiq.gemfile.lock | 8 ++++---- gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails4_postgres.gemfile.lock | 6 +++--- ...uby_2.3.8_rails4_postgres_redis.gemfile.lock | 6 +++--- ...y_2.3.8_rails4_postgres_sidekiq.gemfile.lock | 6 +++--- ...by_2.3.8_rails4_semantic_logger.gemfile.lock | 8 ++++---- gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock | 6 +++--- .../ruby_2.3.8_rails5_postgres.gemfile.lock | 6 +++--- ...uby_2.3.8_rails5_postgres_redis.gemfile.lock | 8 ++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 6 +++--- ...y_2.3.8_rails5_postgres_sidekiq.gemfile.lock | 10 +++++----- ...by_2.3.8_rails5_semantic_logger.gemfile.lock | 6 +++--- gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock | 10 +++++----- gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock | 6 +++--- gemfiles/ruby_2.4.10_contrib.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.4.10_contrib_old.gemfile.lock | 9 ++++++--- gemfiles/ruby_2.4.10_core_old.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.4.10_cucumber3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.4.10_cucumber4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.4.10_rails5_postgres.gemfile.lock | 11 +++++++---- ...by_2.4.10_rails5_postgres_redis.gemfile.lock | 11 +++++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ..._2.4.10_rails5_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...y_2.4.10_rails5_semantic_logger.gemfile.lock | 11 +++++++---- .../ruby_2.4.10_resque2_redis3.gemfile.lock | 11 +++++++---- .../ruby_2.4.10_resque2_redis4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_contrib.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_contrib_old.gemfile.lock | 9 ++++++--- gemfiles/ruby_2.5.9_core_old.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_cucumber3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_cucumber4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_cucumber5.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.5.9_rails5_postgres.gemfile.lock | 11 +++++++---- ...uby_2.5.9_rails5_postgres_redis.gemfile.lock | 11 +++++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.5.9_rails5_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.5.9_rails5_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.5.9_rails61_postgres.gemfile.lock | 11 +++++++---- ...by_2.5.9_rails61_postgres_redis.gemfile.lock | 11 +++++++---- ..._2.5.9_rails61_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...y_2.5.9_rails61_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.5.9_rails6_postgres.gemfile.lock | 11 +++++++---- ...uby_2.5.9_rails6_postgres_redis.gemfile.lock | 11 +++++++---- ...s6_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.5.9_rails6_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.5.9_rails6_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_contrib.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_contrib_old.gemfile.lock | 9 ++++++--- gemfiles/ruby_2.6.7_core_old.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_cucumber3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_cucumber4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_cucumber5.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.6.7_rails5_postgres.gemfile.lock | 11 +++++++---- ...uby_2.6.7_rails5_postgres_redis.gemfile.lock | 11 +++++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.6.7_rails5_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.6.7_rails5_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.6.7_rails61_postgres.gemfile.lock | 11 +++++++---- ...by_2.6.7_rails61_postgres_redis.gemfile.lock | 11 +++++++---- ..._2.6.7_rails61_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...y_2.6.7_rails61_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.6.7_rails6_postgres.gemfile.lock | 11 +++++++---- ...uby_2.6.7_rails6_postgres_redis.gemfile.lock | 11 +++++++---- ...s6_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.6.7_rails6_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.6.7_rails6_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_contrib.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_contrib_old.gemfile.lock | 9 ++++++--- gemfiles/ruby_2.7.3_core_old.gemfile.lock | 13 ++++++++----- gemfiles/ruby_2.7.3_cucumber3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_cucumber4.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_cucumber5.gemfile.lock | 13 ++++++++----- gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.7.3_rails5_postgres.gemfile.lock | 13 ++++++++----- ...uby_2.7.3_rails5_postgres_redis.gemfile.lock | 11 +++++++---- ...s5_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.7.3_rails5_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.7.3_rails5_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.7.3_rails61_postgres.gemfile.lock | 11 +++++++---- ...by_2.7.3_rails61_postgres_redis.gemfile.lock | 11 +++++++---- ..._2.7.3_rails61_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...y_2.7.3_rails61_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock | 11 +++++++---- .../ruby_2.7.3_rails6_postgres.gemfile.lock | 11 +++++++---- ...uby_2.7.3_rails6_postgres_redis.gemfile.lock | 11 +++++++---- ...s6_postgres_redis_activesupport.gemfile.lock | 11 +++++++---- ...y_2.7.3_rails6_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...by_2.7.3_rails6_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock | 11 +++++++---- gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.0.3_contrib.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_contrib_old.gemfile.lock | 15 ++++++++++++++- gemfiles/ruby_3.0.3_core_old.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_cucumber3.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_cucumber4.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_cucumber5.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock | 17 +++++++++++++++-- .../ruby_3.0.3_rails61_postgres.gemfile.lock | 17 +++++++++++++++-- ...by_3.0.3_rails61_postgres_redis.gemfile.lock | 17 +++++++++++++++-- ..._3.0.3_rails61_postgres_sidekiq.gemfile.lock | 17 +++++++++++++++-- ...y_3.0.3_rails61_semantic_logger.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock | 17 +++++++++++++++-- gemfiles/ruby_3.1.1_contrib.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_contrib_old.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.1.1_core_old.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_cucumber3.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_cucumber4.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_cucumber5.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock | 13 ++++++++----- .../ruby_3.1.1_rails61_postgres.gemfile.lock | 13 ++++++++----- ...by_3.1.1_rails61_postgres_redis.gemfile.lock | 13 ++++++++----- ..._3.1.1_rails61_postgres_sidekiq.gemfile.lock | 13 ++++++++----- ...y_3.1.1_rails61_semantic_logger.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock | 13 ++++++++----- gemfiles/ruby_3.2.0_contrib.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_contrib_old.gemfile.lock | 9 ++++++--- gemfiles/ruby_3.2.0_core_old.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_cucumber3.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_cucumber4.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_cucumber5.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock | 11 +++++++---- .../ruby_3.2.0_rails61_postgres.gemfile.lock | 11 +++++++---- ...by_3.2.0_rails61_postgres_redis.gemfile.lock | 11 +++++++---- ..._3.2.0_rails61_postgres_sidekiq.gemfile.lock | 11 +++++++---- ...y_3.2.0_rails61_semantic_logger.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock | 11 +++++++---- gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock | 11 +++++++---- 176 files changed, 1186 insertions(+), 675 deletions(-) diff --git a/gemfiles/ruby_2.1.10_contrib.gemfile.lock b/gemfiles/ruby_2.1.10_contrib.gemfile.lock index c162031d784..d974e654ef7 100644 --- a/gemfiles/ruby_2.1.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.1.10_contrib.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -126,7 +126,7 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) makara (0.4.1) diff --git a/gemfiles/ruby_2.1.10_core_old.gemfile.lock b/gemfiles/ruby_2.1.10_core_old.gemfile.lock index f63670d89dd..70a8978d40e 100644 --- a/gemfiles/ruby_2.1.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.1.10_core_old.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -37,8 +37,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.12) method_source (1.0.0) diff --git a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock index 9bad605be25..a699fe7eb38 100644 --- a/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -74,7 +74,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock index 382968081a0..43a22399d43 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -70,8 +70,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock index 4f6c4c94dbf..2cc4a498b59 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -70,8 +70,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock index ffb1d7bdb5a..3ae91cccb47 100644 --- a/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -71,8 +71,8 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock index 5ad026f6c1b..71b88dbf34e 100644 --- a/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -78,7 +78,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock index 2c7fb458b1b..b7100fda494 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -71,15 +71,15 @@ GEM ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) - google-protobuf (3.6.1-x86_64-linux) + google-protobuf (3.6.1) hashdiff (1.0.1) i18n (0.9.5) concurrent-ruby (~> 1.0) json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock index 83ee7d86b96..df820176e45 100644 --- a/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -78,7 +78,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock index 0a2da601b61..ed7fff4cc5c 100644 --- a/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock @@ -1,11 +1,11 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) - msgpack (< 1.4) + msgpack GEM remote: https://rubygems.org/ @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) diff --git a/gemfiles/ruby_2.2.10_contrib.gemfile.lock b/gemfiles/ruby_2.2.10_contrib.gemfile.lock index 13631c2279c..c7ec53737fc 100644 --- a/gemfiles/ruby_2.2.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.2.10_contrib.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1268,7 +1268,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_core_old.gemfile.lock b/gemfiles/ruby_2.2.10_core_old.gemfile.lock index 1767d955e90..003c8eff5e6 100644 --- a/gemfiles/ruby_2.2.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.2.10_core_old.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,8 +37,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.12) method_source (1.0.0) diff --git a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock index a7dd63b9995..0da61e47cfa 100644 --- a/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -74,7 +74,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock index 891e0bd15e3..ee91252156c 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -70,8 +70,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock index 6260e2c3f5c..d389cfbf8ba 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -70,8 +70,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock index 98e0eb2624b..27059e79f14 100644 --- a/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,8 +71,8 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock index 014272b6d95..128db489127 100644 --- a/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock index b38f41dd38d..18e84cedfc1 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock index aedfbb747d6..b6d76ed7d84 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock index 85a7e14b799..857111df6c8 100644 --- a/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -79,7 +79,7 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock index 69e17f1fff0..57280eba5c6 100644 --- a/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,8 +78,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) diff --git a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock index d284b57fbab..b0f6428c36f 100644 --- a/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,8 +85,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock index 6dfbf031e17..37dfe2f1b19 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock index 202deac9816..aa041c16ddf 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,8 +85,8 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock index d778378b80f..ed8bd03b180 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock index 8e5b8335e74..dfeafc61481 100644 --- a/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -79,15 +79,15 @@ GEM ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) - google-protobuf (3.6.1-x86_64-linux) + google-protobuf (3.6.1) hashdiff (1.0.1) i18n (1.5.1) concurrent-ruby (~> 1.0) json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock index a4f356c1dcf..9c7d66d0173 100644 --- a/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.5.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) diff --git a/gemfiles/ruby_2.3.8_contrib.gemfile.lock b/gemfiles/ruby_2.3.8_contrib.gemfile.lock index 88ae2e6f756..e15018b741d 100644 --- a/gemfiles/ruby_2.3.8_contrib.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1364,7 +1364,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock index 702b142d070..92fa547a2cc 100644 --- a/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,7 +49,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) diff --git a/gemfiles/ruby_2.3.8_core_old.gemfile.lock b/gemfiles/ruby_2.3.8_core_old.gemfile.lock index 605d4b369f5..ca11b5b04bd 100644 --- a/gemfiles/ruby_2.3.8_core_old.gemfile.lock +++ b/gemfiles/ruby_2.3.8_core_old.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,8 +37,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) diff --git a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock index ab2ead66aca..96e13fe7b0f 100644 --- a/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -55,7 +55,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) diff --git a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock index 2f023a8db76..6e1db6bb0c8 100644 --- a/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -75,8 +75,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) diff --git a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock index 64b324b45ae..098cbe1d938 100644 --- a/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -74,7 +74,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock index 2b44c529472..d39eb8b4bc8 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -70,8 +70,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock index 64b744a6db7..db6caabb7b8 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -70,8 +70,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock index 5768020588f..b3f3da2f198 100644 --- a/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -71,8 +71,8 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) mail (2.5.5) mime-types (~> 1.16) diff --git a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock index e6c41429566..ae2b865bec1 100644 --- a/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock index 25cb11b55aa..6e42918dc95 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock index 56ff949008b..2d011252ee3 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,7 +78,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock index e36f3319c31..1068fbe59a5 100644 --- a/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -79,7 +79,7 @@ GEM json (1.8.6) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock index c04eb4a2dcf..28ae43ffd2b 100644 --- a/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -78,8 +78,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) diff --git a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock index ebbe7a9d5a8..febb6775d16 100644 --- a/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock index b81b8f14ea2..1af92f94247 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock index daa1c52d767..1a575896f72 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,8 +85,8 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock index 09270c61f57..21bc82e1626 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) diff --git a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock index 0eb720101e5..2f0e3638abc 100644 --- a/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -79,15 +79,15 @@ GEM ffi (1.15.5) globalid (0.4.2) activesupport (>= 4.2.0) - google-protobuf (3.19.1-x86_64-linux) + google-protobuf (3.19.1) hashdiff (1.0.1) i18n (1.10.0) concurrent-ruby (~> 1.0) json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) diff --git a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock index 5170983f601..be73a2d9986 100644 --- a/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -85,7 +85,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) diff --git a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock index 8abcfb0d960..4df06baa39e 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -32,13 +32,13 @@ GEM docile (1.3.5) dogstatsd-ruby (5.4.0) ffi (1.15.5) - google-protobuf (3.19.1-x86_64-linux) + google-protobuf (3.19.1) hashdiff (1.0.1) json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) diff --git a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock index c5a179ebfe4..6861de545fd 100644 --- a/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -37,7 +37,7 @@ GEM json (2.6.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) diff --git a/gemfiles/ruby_2.4.10_contrib.gemfile.lock b/gemfiles/ruby_2.4.10_contrib.gemfile.lock index f0d10d8d8ee..61f7d36c1d0 100644 --- a/gemfiles/ruby_2.4.10_contrib.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1430,7 +1430,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -1458,7 +1458,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1580,6 +1580,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1728,6 +1730,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) diff --git a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock index 8253f55d456..7bad32c522b 100644 --- a/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -52,7 +52,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) @@ -116,6 +116,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -180,6 +182,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_core_old.gemfile.lock b/gemfiles/ruby_2.4.10_core_old.gemfile.lock index 0b2a0e2aa36..42013bba1c8 100644 --- a/gemfiles/ruby_2.4.10_core_old.gemfile.lock +++ b/gemfiles/ruby_2.4.10_core_old.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,12 +39,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.20.1) @@ -97,6 +97,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -157,6 +159,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock index 02733d741de..1d9dbff3341 100644 --- a/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -57,12 +57,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -117,6 +117,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -178,6 +180,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock index c510110b379..01cd17c627e 100644 --- a/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -77,14 +77,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -143,6 +143,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -209,6 +211,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock index 1ee657618e1..d893f868a3d 100644 --- a/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,7 +87,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.10.10) @@ -192,6 +192,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -268,6 +270,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock index cf0c1a57c2c..c313dcd7ec6 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,7 +87,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -192,6 +192,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -268,6 +270,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock index d70bf21d617..de14fbd47ff 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,7 +87,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -193,6 +193,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -270,6 +272,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock index 2370120ccac..6911b3227e4 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,7 +87,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -106,7 +106,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -209,6 +209,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -287,6 +289,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock index 1c74d551084..5fe46034653 100644 --- a/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,7 +88,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -107,7 +107,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -196,6 +196,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -278,6 +280,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock index 654b3e61efc..5002aa47bb2 100644 --- a/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,7 +87,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -101,7 +101,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.4.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -189,6 +189,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -267,6 +269,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock index 77cc70ee292..e38c4927036 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,13 +39,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -113,6 +113,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -184,6 +186,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock index 86315b53794..12399dec6bd 100644 --- a/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock @@ -1,9 +1,9 @@ PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -39,13 +39,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -113,6 +113,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.10.2) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -184,6 +186,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_contrib.gemfile.lock b/gemfiles/ruby_2.5.9_contrib.gemfile.lock index b4c10971e8a..9c6586dc222 100644 --- a/gemfiles/ruby_2.5.9_contrib.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1436,7 +1436,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -1459,7 +1459,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1569,6 +1569,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1710,6 +1712,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) diff --git a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock index 33c7e365455..7a854d2ef80 100644 --- a/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -63,7 +63,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) @@ -127,6 +127,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -190,6 +192,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_core_old.gemfile.lock b/gemfiles/ruby_2.5.9_core_old.gemfile.lock index 832bb078ba4..9c0fb6133d7 100644 --- a/gemfiles/ruby_2.5.9_core_old.gemfile.lock +++ b/gemfiles/ruby_2.5.9_core_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,12 +49,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -107,6 +107,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -165,6 +167,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock index e1b70f7d418..9a315a01466 100644 --- a/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -67,12 +67,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -127,6 +127,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -186,6 +188,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock index 48f6eb767eb..2e4c574087e 100644 --- a/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -154,6 +154,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock index 30e64272bf8..5003deb79d8 100644 --- a/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -154,6 +154,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock index bc4e3bc5952..744f06be32b 100644 --- a/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -202,6 +202,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -278,6 +280,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock index 530b076b51f..951164afe77 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -202,6 +202,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -278,6 +280,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock index bc453afbc3e..5bbe981ec62 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -203,6 +203,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -280,6 +282,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock index c94639382d0..56dbf4d3494 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -115,7 +115,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -219,6 +219,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -297,6 +299,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock index 8d0f4e8c16d..1469b9bac42 100644 --- a/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -204,6 +204,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -285,6 +287,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock index 26fd604bd1f..5e8ffebd2af 100644 --- a/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -97,7 +97,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -110,7 +110,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -199,6 +199,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -277,6 +279,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock index cddfcc111c2..5a2fd8d764d 100644 --- a/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -114,7 +114,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -297,6 +299,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock index 4252e0f4649..6b195b11f61 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -114,7 +114,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -297,6 +299,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock index ed2058447f9..797857dd53a 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -114,7 +114,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -132,7 +132,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -222,6 +222,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -299,6 +301,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock index 745cc492bf7..a2c8aeedac5 100644 --- a/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -223,6 +223,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -303,6 +305,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock index 58b8802e985..a85b1dc6f48 100644 --- a/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -114,7 +114,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -127,7 +127,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -218,6 +218,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -296,6 +298,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock index 3733498e25a..039c2bc4306 100644 --- a/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,7 +110,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) @@ -217,6 +217,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -294,6 +296,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock index db5b376d03a..08f28959cc5 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,7 +110,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -217,6 +217,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -294,6 +296,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock index e1a7df107b5..55a2841c014 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,7 +110,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -218,6 +218,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -296,6 +298,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock index 1e2560359fb..1eecf8291e6 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,7 +110,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -234,6 +234,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -313,6 +315,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock index d9fae274eed..5a3d65e37ad 100644 --- a/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -219,6 +219,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -301,6 +303,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock index 7c892753029..abeeceb018d 100644 --- a/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -110,7 +110,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -123,7 +123,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.12.5-x86_64-linux) racc (~> 1.4) @@ -214,6 +214,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -293,6 +295,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock index fe7e7d43761..23891126a41 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,13 +49,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -122,6 +122,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -189,6 +191,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock index 5bf97abbad1..bda1996b59d 100644 --- a/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,13 +49,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -122,6 +122,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -189,6 +191,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_contrib.gemfile.lock b/gemfiles/ruby_2.6.7_contrib.gemfile.lock index 4b9c59bdfe6..acddb20e529 100644 --- a/gemfiles/ruby_2.6.7_contrib.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1437,7 +1437,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -1460,7 +1460,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1571,6 +1571,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1711,6 +1713,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) diff --git a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock index 8953dfb3014..e05ef09a224 100644 --- a/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -64,7 +64,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -192,6 +194,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_core_old.gemfile.lock b/gemfiles/ruby_2.6.7_core_old.gemfile.lock index a3384bb1627..5f747e3f47c 100644 --- a/gemfiles/ruby_2.6.7_core_old.gemfile.lock +++ b/gemfiles/ruby_2.6.7_core_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,12 +50,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -109,6 +109,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -167,6 +169,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock index 3c3eb6ae92a..b29355ffbf8 100644 --- a/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,12 +68,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -188,6 +190,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock index 26df44d8c8e..52d5d1ae869 100644 --- a/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -89,14 +89,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -156,6 +156,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -221,6 +223,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock index 5ddd89445e4..f1ca532331d 100644 --- a/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -89,14 +89,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -156,6 +156,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -221,6 +223,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock index 94e80923572..f74b4ac59ce 100644 --- a/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -204,6 +204,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -279,6 +281,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock index 1daea2682f5..7c5b7dfcf0c 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -204,6 +204,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -279,6 +281,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock index ee7ab7198aa..875c4f8f728 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -205,6 +205,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -281,6 +283,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock index 26b1f41f462..288da9e9f02 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -116,7 +116,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -298,6 +300,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock index 83f1e731b1a..d244d6b93a2 100644 --- a/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -117,7 +117,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -206,6 +206,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -286,6 +288,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock index 10d1bdec1c4..7598ba65cbd 100644 --- a/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -111,7 +111,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -201,6 +201,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -278,6 +280,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock index b8a12efb7c1..60d2a02afbd 100644 --- a/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -223,6 +223,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -298,6 +300,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock index 6bc078d0653..91d0a46bcb6 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -223,6 +223,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -298,6 +300,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock index 449c05d05bd..758f230bc61 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -133,7 +133,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -224,6 +224,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -300,6 +302,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock index 563360d98e0..01a62019bdb 100644 --- a/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -116,7 +116,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -134,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -225,6 +225,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -304,6 +306,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock index cd42fdf7074..b0d6b99ebe6 100644 --- a/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -128,7 +128,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -220,6 +220,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -297,6 +299,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock index ffcbefe1482..fd8218e61a2 100644 --- a/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) @@ -219,6 +219,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -295,6 +297,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock index 79a85a228a5..1fedab25ba6 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -219,6 +219,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -295,6 +297,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock index 7c0f3262f3d..1458989e9e5 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -220,6 +220,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -297,6 +299,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock index 2fea08a5dff..94f18f5f5a2 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -129,7 +129,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -236,6 +236,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -314,6 +316,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock index 73297fe1681..e571b6355a1 100644 --- a/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -112,7 +112,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -302,6 +304,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock index 6c27207d7f5..d3b9b14d6c7 100644 --- a/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -124,7 +124,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3-x86_64-linux) racc (~> 1.4) @@ -216,6 +216,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -294,6 +296,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock index 64fc10a82ba..4b1506d6402 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock index 595e2411bad..e808c2ab890 100644 --- a/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_contrib.gemfile.lock b/gemfiles/ruby_2.7.3_contrib.gemfile.lock index 77e9e0453a8..e118006d4fb 100644 --- a/gemfiles/ruby_2.7.3_contrib.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1437,7 +1437,7 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) king_konf (1.0.0) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -1460,7 +1460,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1573,6 +1573,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1709,6 +1711,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) diff --git a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock index 55cd897472e..75030a3aebc 100644 --- a/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -64,7 +64,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -192,6 +194,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_core_old.gemfile.lock b/gemfiles/ruby_2.7.3_core_old.gemfile.lock index 338c34dfea4..59e514b05ca 100644 --- a/gemfiles/ruby_2.7.3_core_old.gemfile.lock +++ b/gemfiles/ruby_2.7.3_core_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,12 +50,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -109,6 +109,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -167,6 +169,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock index f99e0ff9062..81ffa8a8fd4 100644 --- a/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,12 +68,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -188,6 +190,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock index c6bd0e8072f..dd4328151cd 100644 --- a/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -155,6 +155,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock index 1982cd7aa1b..32b7871e28a 100644 --- a/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -155,6 +155,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock index 4667a83d526..7fe569eef0a 100644 --- a/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -206,6 +206,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -280,6 +282,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock index 569c768d24d..05ddc10cc60 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,8 +98,8 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) - libddwaf (1.3.0.2.0-x86_64-linux) + libdatadog (0.7.0.1.0) + libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -206,6 +206,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -280,6 +282,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock index c271f500370..fa57a5fd4cb 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -207,6 +207,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -282,6 +284,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock index d9da4519453..80d315f060b 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -117,7 +117,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -223,6 +223,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -299,6 +301,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock index e555e56e983..07a92cca8c9 100644 --- a/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -99,7 +99,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -118,7 +118,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -208,6 +208,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -287,6 +289,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock index 2a3b5e2edd9..0ca716a8065 100644 --- a/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -98,7 +98,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) loofah (2.15.0) @@ -112,7 +112,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -203,6 +203,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -279,6 +281,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock index ec4adbe6203..c479f09cf6c 100644 --- a/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -225,6 +225,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -299,6 +301,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock index b4f69db8a87..28611695185 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -225,6 +225,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -299,6 +301,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock index d922653bc7b..3e5fc7b0644 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -226,6 +226,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -301,6 +303,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock index b779cdd1b05..7d35a520a89 100644 --- a/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -116,7 +116,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -135,7 +135,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -227,6 +227,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -305,6 +307,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock index 1563bcd44c6..565ac4cbac0 100644 --- a/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -129,7 +129,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -222,6 +222,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -298,6 +300,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock index d6cb76f0085..3ee4174e014 100644 --- a/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) lograge (0.11.2) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) nio4r (2.5.8) nokogiri (1.13.3) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -296,6 +298,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock index 846a8d1ca62..0db5e0688e5 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -221,6 +221,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -296,6 +298,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock index b93a8a87198..53b0cf7d163 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -222,6 +222,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -298,6 +300,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock index 9825ccfc619..4f246fb0cb4 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -130,7 +130,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -238,6 +238,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -315,6 +317,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock index 0cfb0274bc1..75535fbda93 100644 --- a/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -112,7 +112,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -131,7 +131,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -223,6 +223,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -303,6 +305,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock index 7d2d06a8bbb..86420923e3b 100644 --- a/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -111,7 +111,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -125,7 +125,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) nio4r (2.5.8) nokogiri (1.13.3) mini_portile2 (~> 2.8.0) @@ -218,6 +218,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -295,6 +297,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock index 0ccbbe7388d..5dfaaa096c1 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0) + libdatadog (0.7.0.1.0) libddwaf (1.3.0.2.0) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock index dd9d38ec9d7..33b409cccee 100644 --- a/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.0.3_contrib.gemfile.lock b/gemfiles/ruby_3.0.3_contrib.gemfile.lock index 6665c4e159f..e4826081a6a 100644 --- a/gemfiles/ruby_3.0.3_contrib.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -1448,8 +1448,11 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -1468,7 +1471,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1625,9 +1628,17 @@ GEM rake (~> 12.3) serverengine (~> 2.1.0) thor + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) sorted_set (1.0.3) rbtree set (~> 1.0) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sqlite3 (1.4.2) statsd-ruby (1.5.0) sucker_punch (3.0.1) @@ -1733,6 +1744,8 @@ DEPENDENCIES simplecov! sinatra sneakers (>= 2.12.0) + sorbet (= 0.5.9672) + spoom (~> 1.1) sqlite3 (>= 1.4.2) sucker_punch typhoeus diff --git a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock index 2fcef09b249..262f96e42d6 100644 --- a/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_contrib_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -66,8 +66,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) msgpack (1.5.1) @@ -141,6 +144,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -192,6 +203,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_core_old.gemfile.lock b/gemfiles/ruby_3.0.3_core_old.gemfile.lock index 945d84028de..91c351f6191 100644 --- a/gemfiles/ruby_3.0.3_core_old.gemfile.lock +++ b/gemfiles/ruby_3.0.3_core_old.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -52,11 +52,14 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -121,6 +124,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -168,6 +179,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock index b68192becc2..f6440bc8a40 100644 --- a/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -70,11 +70,14 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -141,6 +144,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) thor (1.2.1) unicode-display_width (2.1.0) warning (1.2.1) @@ -189,6 +200,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock index c99af402c0a..648336c45c7 100644 --- a/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -90,13 +90,16 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -167,6 +170,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sys-uname (1.2.2) ffi (~> 1.1) thor (1.2.1) @@ -220,6 +231,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock index 1388e33e22d..4d982b00125 100644 --- a/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.0.3_cucumber5.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -90,13 +90,16 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -167,6 +170,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sys-uname (1.2.2) ffi (~> 1.1) thor (1.2.1) @@ -220,6 +231,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock index 7e1ea8fab1f..6c7e0b9b8ba 100644 --- a/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_mysql2.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -119,8 +119,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -136,7 +139,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) net-protocol (0.1.2) io-wait @@ -246,6 +249,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -311,6 +322,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock index 88de1df8462..5f889f0496b 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -119,8 +119,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -136,7 +139,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -246,6 +249,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -311,6 +322,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock index 78c93f0b0f1..d7ec9c96221 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_redis.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -119,8 +119,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -136,7 +139,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -247,6 +250,14 @@ GEM ruby-progressbar (1.11.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -313,6 +324,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock index 385d688371f..11ff277ecd8 100644 --- a/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_postgres_sidekiq.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -120,8 +120,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -137,7 +140,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -258,6 +261,14 @@ GEM redis (>= 4.2.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -325,6 +336,8 @@ DEPENDENCIES ruby-prof (~> 1.4) sidekiq (>= 6.1.2) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock index efaa6e46c86..9d536b80ff6 100644 --- a/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.0.3_rails61_semantic_logger.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -119,8 +119,11 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) loofah (2.15.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -131,7 +134,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -245,6 +248,14 @@ GEM concurrent-ruby (~> 1.0) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -310,6 +321,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) sprockets (< 4) warning (~> 1) webmock (>= 3.10.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock index f8f808a9b97..f36dc40cceb 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis3.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -52,12 +52,15 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -142,6 +145,14 @@ GEM rack (~> 2.2) rack-protection (= 2.2.0) tilt (~> 2.0) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) thor (1.2.1) tilt (2.0.10) unicode-display_width (2.1.0) @@ -192,6 +203,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock index ff512b90c49..b112f0710a3 100644 --- a/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.0.3_resque2_redis4.gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) @@ -52,12 +52,15 @@ GEM json-schema (2.8.1) addressable (>= 2.4) libdatadog (0.7.0.1.0-aarch64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-aarch64-linux) ffi (~> 1.0) + libddwaf (1.3.0.2.0-x86_64-linux) + ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -142,6 +145,14 @@ GEM rack (~> 2.2) rack-protection (= 2.2.0) tilt (~> 2.0) + sorbet (0.5.9672) + sorbet-static (= 0.5.9672) + sorbet-runtime (0.5.10263) + sorbet-static (0.5.9672-x86_64-linux) + spoom (1.1.11) + sorbet (>= 0.5.9204) + sorbet-runtime (>= 0.5.9204) + thor (>= 0.19.2) thor (1.2.1) tilt (2.0.10) unicode-display_width (2.1.0) @@ -192,6 +203,8 @@ DEPENDENCIES rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) simplecov! + sorbet (= 0.5.9672) + spoom (~> 1.1) warning (~> 1) webmock (>= 3.10.0) webrick (>= 1.7.0) diff --git a/gemfiles/ruby_3.1.1_contrib.gemfile.lock b/gemfiles/ruby_3.1.1_contrib.gemfile.lock index b4ee57044da..1dc631ba73f 100644 --- a/gemfiles/ruby_3.1.1_contrib.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1443,7 +1443,7 @@ GEM json-schema (2.8.1) addressable (>= 2.4) jsonapi-renderer (0.2.2) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -1464,7 +1464,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1575,6 +1575,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1720,6 +1722,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) @@ -1742,4 +1745,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock index 60d764c8e1a..ad019334dbe 100644 --- a/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_contrib_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -64,7 +64,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -203,4 +206,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_core_old.gemfile.lock b/gemfiles/ruby_3.1.1_core_old.gemfile.lock index cbdd9b924a2..6d83ccf4a22 100644 --- a/gemfiles/ruby_3.1.1_core_old.gemfile.lock +++ b/gemfiles/ruby_3.1.1_core_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,12 +50,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -109,6 +109,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -167,6 +169,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -179,4 +182,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock index 8140d9360ba..4b38d341e45 100644 --- a/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -68,12 +68,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -129,6 +129,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -188,6 +190,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -200,4 +203,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock index 234e436cc54..002de99c8fc 100644 --- a/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -155,6 +155,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -231,4 +234,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock index 3ba58082d83..2b150197bdf 100644 --- a/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.1.1_cucumber5.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -88,14 +88,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -155,6 +155,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -219,6 +221,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -231,4 +234,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock index 2cd2fc9488d..21e0b5b5797 100644 --- a/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -117,7 +117,7 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) mysql2 (0.5.3) net-protocol (0.1.2) io-wait @@ -232,6 +232,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -308,6 +310,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -321,4 +324,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock index 622a4692a96..c9db453950f 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -117,7 +117,7 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -232,6 +232,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -308,6 +310,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -321,4 +324,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock index 22de865ba0c..f50e1fe329d 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -117,7 +117,7 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -135,7 +135,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -233,6 +233,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -310,6 +312,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -323,4 +326,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock index 01cdf8b4c18..16541e7058a 100644 --- a/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -118,7 +118,7 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.11.2) @@ -136,7 +136,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -238,6 +238,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -321,6 +323,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -335,4 +338,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock index faf5b1749d6..0cf92f957d9 100644 --- a/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.1.1_rails61_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -117,7 +117,7 @@ GEM io-wait (0.2.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.15.0) @@ -130,7 +130,7 @@ GEM method_source (1.0.0) mini_mime (1.1.2) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.2) io-wait timeout @@ -229,6 +229,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -307,6 +309,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -320,4 +323,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock index 37867cf9456..60028a83c6d 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -203,4 +206,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock index 25922167f57..9d08830112f 100644 --- a/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.1.1_resque2_redis4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -50,13 +50,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -124,6 +124,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.16.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -191,6 +193,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) @@ -203,4 +206,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.7 + 2.3.18 diff --git a/gemfiles/ruby_3.2.0_contrib.gemfile.lock b/gemfiles/ruby_3.2.0_contrib.gemfile.lock index 3da795fea0d..d9ef5f4639a 100644 --- a/gemfiles/ruby_3.2.0_contrib.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -1445,7 +1445,7 @@ GEM json-schema (2.8.1) addressable (>= 2.4) jsonapi-renderer (0.2.2) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.16.0) @@ -1467,7 +1467,7 @@ GEM mongo (2.14.1) bson (>= 4.8.2, < 5.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) multipart-post (2.1.1) @@ -1574,6 +1574,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -1717,6 +1719,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-kafka (>= 0.7.10) diff --git a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock index 0ee7fc59aa8..50664a6b71b 100644 --- a/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_contrib_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -63,7 +63,7 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) @@ -125,6 +125,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -186,6 +188,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_core_old.gemfile.lock b/gemfiles/ruby_3.2.0_core_old.gemfile.lock index 47eea2208e0..321cf81f71b 100644 --- a/gemfiles/ruby_3.2.0_core_old.gemfile.lock +++ b/gemfiles/ruby_3.2.0_core_old.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,12 +49,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) opentracing (0.5.0) os (1.1.4) parallel (1.22.1) @@ -105,6 +105,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -162,6 +164,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock index 6c0c3a4bad1..a8f3373f131 100644 --- a/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -67,12 +67,12 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_test (0.1.2) opentracing (0.5.0) @@ -125,6 +125,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -183,6 +185,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock index d4ebe9f3dff..dfee81a1dd4 100644 --- a/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,14 +87,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -151,6 +151,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -214,6 +216,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock index 6bca31d7802..52d5492f831 100644 --- a/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock +++ b/gemfiles/ruby_3.2.0_cucumber5.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -87,14 +87,14 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) middleware (0.1.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) multi_test (0.1.2) opentracing (0.5.0) os (1.1.4) @@ -151,6 +151,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -214,6 +216,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock index 9ec3a51f47a..e6b7ce188e3 100644 --- a/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_mysql2.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.12.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -227,6 +227,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -301,6 +303,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock index 8e9dd330fb8..db5981eea03 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.12.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -228,6 +228,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -303,6 +305,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock index c96e895cc0b..8967784cac4 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_redis.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.12.0) @@ -134,7 +134,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -229,6 +229,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -305,6 +307,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock index 4af0dd6862e..1be9343c48e 100644 --- a/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_postgres_sidekiq.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -116,7 +116,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) lograge (0.12.0) @@ -135,7 +135,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -234,6 +234,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -316,6 +318,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock index 866d53d425f..f69c8ff4ec2 100644 --- a/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock +++ b/gemfiles/ruby_3.2.0_rails61_semantic_logger.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -115,7 +115,7 @@ GEM concurrent-ruby (~> 1.0) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) loofah (2.16.0) @@ -129,7 +129,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - msgpack (1.5.3) + msgpack (1.5.4) net-protocol (0.1.3) timeout net-smtp (0.3.1) @@ -225,6 +225,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -302,6 +304,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock index 88ee7aaf927..2652eb6bd90 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis3.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,13 +49,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -120,6 +120,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -186,6 +188,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) diff --git a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock index 45968a44ab8..b589c1322ba 100644 --- a/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock +++ b/gemfiles/ruby_3.2.0_resque2_redis4.gemfile.lock @@ -11,9 +11,9 @@ GIT PATH remote: .. specs: - ddtrace (1.2.0) + ddtrace (1.3.0) debase-ruby_core_source (= 0.10.16) - libddprof (~> 0.6.0.1.0) + libdatadog (~> 0.7.0.1.0) libddwaf (~> 1.3.0.2.0) msgpack @@ -49,13 +49,13 @@ GEM hashdiff (1.0.1) json-schema (2.8.1) addressable (>= 2.4) - libddprof (0.6.0.1.0-x86_64-linux) + libdatadog (0.7.0.1.0-x86_64-linux) libddwaf (1.3.0.2.0-x86_64-linux) ffi (~> 1.0) memory_profiler (0.9.14) method_source (1.0.0) mono_logger (1.1.1) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -120,6 +120,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-packaging (0.5.1) + rubocop (>= 0.89, < 2.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -186,6 +188,7 @@ DEPENDENCIES rspec_junit_formatter (>= 0.5.1) rspec_n (~> 1.3) rubocop (~> 1.10) + rubocop-packaging (~> 0.5) rubocop-performance (~> 1.9) rubocop-rspec (~> 2.2) ruby-prof (~> 1.4) From f083746a6ef534a069f110441ccab2b026b9781e Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 4 Aug 2022 21:39:11 +0200 Subject: [PATCH 0377/2133] Fix changelog link --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index feaafe058b2..82a513bf6a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased] -## [1.2.0] - 2022-08-04 +## [1.3.0] - 2022-08-04 Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v1.3.0 @@ -17,7 +17,7 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v1.2.0...v1.3.0 * ActiveSupport: Optionally disable tracing with Rails ([@marcotc][]) * Rack: Resource overwritten by nested application ([#2180][]) * Rake: Explicit task instrumentation to prevent memory bloat ([#2174][]) -* Sidekiq and DelayedJob: Add spans to improve tracing ([2170][]) +* Sidekiq and DelayedJob: Add spans to improve tracing ([#2170][]) * Drop Profiling support for Ruby 2.1 ([#2140][]) * Migrate `libddprof` dependency to `libdatadog` ([#2061][]) @@ -3087,4 +3087,4 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 [@walterking]: https://github.com/walterking [@y-yagi]: https://github.com/y-yagi [@yukimurasawa]: https://github.com/yukimurasawa -[@zachmccormick]: https://github.com/zachmccormick \ No newline at end of file +[@zachmccormick]: https://github.com/zachmccormick From b323a0c9a55948f23632e42a684477c5846a87a2 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 11:39:38 +0100 Subject: [PATCH 0378/2133] Make enforce_... methods a bit more API-friendly Having them return the object OR raise an exception makes these methods usable in-line in an assignment. --- .../collectors_cpu_and_wall_time.c | 7 +++---- .../collectors_cpu_and_wall_time.h | 2 +- ext/ddtrace_profiling_native_extension/stack_recorder.c | 3 ++- ext/ddtrace_profiling_native_extension/stack_recorder.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 4486222c0d2..04d5776e8d8 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -153,8 +153,6 @@ static VALUE _native_new(VALUE klass) { } static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames) { - enforce_recorder_instance(recorder_instance); - struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(collector_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); @@ -164,7 +162,7 @@ static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE collector_inst // Update this when modifying state struct state->sampling_buffer = sampling_buffer_new(max_frames_requested); // hash_map_per_thread_context is already initialized, nothing to do here - state->recorder_instance = recorder_instance; + state->recorder_instance = enforce_recorder_instance(recorder_instance); return Qtrue; } @@ -384,6 +382,7 @@ static long thread_id_for(VALUE thread) { return FIXNUM_P(object_id) ? FIX2LONG(object_id) : -1; } -void enforce_cpu_and_wall_time_collector_instance(VALUE object) { +VALUE enforce_cpu_and_wall_time_collector_instance(VALUE object) { Check_TypedStruct(object, &cpu_and_wall_time_collector_typed_data); + return object; } diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h index 7f700848059..7066a3cb838 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.h @@ -3,4 +3,4 @@ #include VALUE cpu_and_wall_time_collector_sample(VALUE self_instance); -void enforce_cpu_and_wall_time_collector_instance(VALUE object); +VALUE enforce_cpu_and_wall_time_collector_instance(VALUE object); diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/ddtrace_profiling_native_extension/stack_recorder.c index 0c2bc1e143d..03ffeaa0600 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.c +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.c @@ -324,8 +324,9 @@ static void *call_serialize_without_gvl(void *call_args) { return NULL; // Unused } -void enforce_recorder_instance(VALUE object) { +VALUE enforce_recorder_instance(VALUE object) { Check_TypedStruct(object, &stack_recorder_typed_data); + return object; } static struct active_slot_pair sampler_lock_active_profile(struct stack_recorder_state *state) { diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.h b/ext/ddtrace_profiling_native_extension/stack_recorder.h index cad66904ebf..e0ee3a646c7 100644 --- a/ext/ddtrace_profiling_native_extension/stack_recorder.h +++ b/ext/ddtrace_profiling_native_extension/stack_recorder.h @@ -34,4 +34,4 @@ static const ddprof_ffi_ValueType enabled_value_types[] = { #define ENABLED_VALUE_TYPES_COUNT (sizeof(enabled_value_types) / sizeof(ddprof_ffi_ValueType)) void record_sample(VALUE recorder_instance, ddprof_ffi_Sample sample); -void enforce_recorder_instance(VALUE object); +VALUE enforce_recorder_instance(VALUE object); From c6ea57eba7e252701c08c7f88df3189716d780e7 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 11:41:18 +0100 Subject: [PATCH 0379/2133] Return result in `try_wait_until` helper This makes it easier to use in specs such as: ```ruby result = try_wait_until { some_method } expect(result).to include :foo ``` --- spec/support/synchronization_helpers.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/support/synchronization_helpers.rb b/spec/support/synchronization_helpers.rb index 847cefc7c69..d3770bb572e 100644 --- a/spec/support/synchronization_helpers.rb +++ b/spec/support/synchronization_helpers.rb @@ -54,12 +54,13 @@ def expect_in_thread(&block) # Defaults to 5 second timeout def try_wait_until(attempts: 50, backoff: 0.1) loop do - break if yield(attempts) + result = yield(attempts) + return result if result sleep(backoff) attempts -= 1 - raise StandardError, 'Wait time exhausted!' if attempts <= 0 + raise('Wait time exhausted!') if attempts <= 0 end end From 351ba64276c1dc37a5244ff6d0764300ecd1a710 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 11:43:07 +0100 Subject: [PATCH 0380/2133] Document a few more assumptions around the sample operation --- .../collectors_cpu_and_wall_time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c index 04d5776e8d8..12423fa4ef8 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time.c @@ -178,6 +178,8 @@ static VALUE _native_sample(DDTRACE_UNUSED VALUE _self, VALUE collector_instance // // Assumption 1: This function is called in a thread that is holding the Global VM Lock. Caller is responsible for enforcing this. // Assumption 2: This function is allowed to raise exceptions. Caller is responsible for handling them, if needed. +// Assumption 3: This function IS NOT called from a signal handler. This function is not async-signal-safe. +// Assumption 4: This function IS NOT called in a reentrant way. VALUE cpu_and_wall_time_collector_sample(VALUE self_instance) { struct cpu_and_wall_time_collector_state *state; TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_collector_state, &cpu_and_wall_time_collector_typed_data, state); From 28d20ca2131b3ff0cc61e272a4756c1c9eaf5337 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 11:51:24 +0100 Subject: [PATCH 0381/2133] [PROF-5859] Introduce `CpuAndWallTimeWorker` to trigger profiling samples The `CpuAndWallTimeWorker` component takes care of automatically triggering the `CpuAndWallTime` collector. In a single sentence, this component a) runs in a background thread, b) periodically uses a unix signal (SIGPROF) to interrupt a running Ruby thread, and c) gets the interrupted Ruby thread to call the `CpuAndWallTime` collector to take a sample. And thus we achieve periodic sampling of Ruby threads. The `CpuAndWallTimeWorker` was the last big missing piece for the new Ruby profiler, and we can now turn it on and actually get samples. The inner workings of the `CpuAndWallTimeWorker` are non-trivial, and hopefully the design description included, as well as the specs will help in documenting what it does and how it does it. Finally, I would consider this component as not being complete yet, and I'll call the current state "alpha". In particular, it's missing at least: * Handling of forks (there's some work, but I'm not convinced it's enough) * Validation / specs that show it's Ractor-safe * Dynamic sampling rate/pacing mechanism * Sending signals to specific threads, not to the whole process, to reduce bias and improve CPU profiling I have notes for all of these things, and will continue working on them until we're confident on the implementation and on our validation, and can start asking customers to test it out. --- docs/ProfilingDevelopment.md | 47 +-- .../collectors_cpu_and_wall_time_worker.c | 391 ++++++++++++++++++ .../profiling.c | 2 + lib/datadog/profiling.rb | 1 + .../collectors/cpu_and_wall_time_worker.rb | 74 ++++ .../cpu_and_wall_time_worker_spec.rb | 137 ++++++ 6 files changed, 629 insertions(+), 23 deletions(-) create mode 100644 ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c create mode 100644 lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb create mode 100644 spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index c9fd3766dfc..9af25e30918 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -16,6 +16,7 @@ Components below live inside <../lib/datadog/profiling>: * `Collectors::CodeProvenance`: Collects library metadata to power grouping and categorization of stack traces (e.g. to help distinguish user code, from libraries, from the standard library, etc). * `Collectors::CpuAndWallTime`: Collects samples of living Ruby threads, recording elapsed CPU and Wall-clock time, and tagging them with thread id and thread name. Relies on the `Collectors::Stack` for the actual stack sampling. +* `Collectors::CpuAndWallTimeWorker`: Triggers the periodic execution of `Collectors::CpuAndWallTime`. * `Collectors::Stack`: Used to gather a stack trace from a given Ruby thread. Stores its output on a `StackRecorder`. * (Deprecated) `Encoding::Profile::Protobuf`: Encodes gathered data into the pprof format. @@ -82,29 +83,29 @@ flow: The profiler is undergoing a lot of refactoring. After this work is done, this is how we expect it will be wired up: ```asciiflow - +------------------------+ - | Profiler | - +-+--------------------+-+ - | | - v v -+---------+--------------+ +-+---------+ -| Collectors::CpuAndWall | | Scheduler | -+---------+--------------+ +-+-------+-+ - | | | - v | v -+---------+---------+ | +----+----------+ -| Collectors::Stack | | | HttpTransport | -+---------+---------+ | +---------------+ - | | - v v - +-------+-------+ +--+-------+ - | StackRecorder |<--------| Exporter | - +---------------+ +--+-------+ - | - v - +--------------+--+ - | Code Provenance | - +-----------------+ + +----------------------------------+ + | Profiler | + +-+------------------------------+-+ + | | + v v ++---------+------------------------+ +-+---------+ +| Collectors::CpuAndWallTimeWorker | | Scheduler | ++---------+------------------------+ +-+-------+-+ + | | | + | | v + | | +----+----------+ + | | | HttpTransport | + | | +---------------+ + | | + v v + +-------+-------+ +--+-------+ + | StackRecorder |<------------------| Exporter | + +---------------+ +--+-------+ + | + v + +--------------+-------------+ + | Collectors::CodeProvenance | + +----------------------------+ ``` ## Run-time execution diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c new file mode 100644 index 00000000000..297f297a5cb --- /dev/null +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c @@ -0,0 +1,391 @@ +#include +#include +#include +#include +#include +#include +#include "helpers.h" +#include "ruby_helpers.h" +#include "collectors_cpu_and_wall_time.h" +#include "private_vm_api_access.h" + +// Used to trigger the periodic execution of Collectors::CpuAndWallTime, which implements all of the sampling logic +// itself; this class only implements the "doing it periodically" part. +// +// This file implements the native bits of the Datadog::Profiling::Collectors::CpuAndWallTimeWorker class + +// --- +// Here be dragons: This component is quite fiddly and probably one of the more complex in the profiler as it deals with +// multiple threads, signal handlers, global state, etc. +// +// ## Design notes for this class: +// +// ### Constraints +// +// Currently, sampling Ruby threads requires calling Ruby VM APIs that are only safe to call while holding on to the +// global VM lock (and are not async-signal safe -- cannot be called from a signal handler). +// +// @ivoanjo: As a note, I don't we should think of this constraint as set in stone. Since can reach into the Ruby +// internals, we may be able to figure out a way of overcoming it. But it's definitely going to be hard so for now +// we're considering it as a given. +// +// ### Flow for triggering samples +// +// The flow for triggering samples is as follows: +// +// 1. Inside the `run_sampling_trigger_loop` function (running in the `CpuAndWallTimeWorker` background thread), +// a `SIGPROF` signal gets sent to the current process. +// +// 2. The `handle_sampling_signal` signal handler function gets called to handle the `SIGPROF` signal. +// +// Which thread the signal handler function gets called on by the operating system is quite important. We need to perform +// an operation -- calling the `rb_postponed_job_register_one` API -- that can only be called from the thread that +// is holding on to the global VM lock. So this is the thread we're "hoping" our signal lands on. +// +// The signal never lands on the `CpuAndWallTimeWorker` background thread because we explicitly block it off from that +// thread in `block_sigprof_signal_handler_from_running_in_current_thread`. +// +// If the signal lands on a thread that is not holding onto the global VM lock, we can't proceed to the next step, +// and we need to restart the sampling flow from step 1. (There's still quite a few improvements we can make here, +// but this is the current state of the implementation). +// +// 3. Inside `handle_sampling_signal`, if it's getting executed by the Ruby thread that is holding the global VM lock, +// we can call `rb_postponed_job_register_one` to ask the Ruby VM to call our `sample_from_postponed_job` function +// "as soon as it can". +// +// 4. The Ruby VM calls our `sample_from_postponed_job` from a thread holding the global VM lock. A sample is recorded by +// calling `cpu_and_wall_time_collector_sample`. +// +// --- + +// Contains state for a single CpuAndWallTimeWorker instance +struct cpu_and_wall_time_worker_state { + // Important: This is not atomic nor is it guaranteed to replace memory barriers and the like. Aka this works for + // telling the sampling trigger loop to stop, but if we ever need to communicate more, we should move to actual + // atomic operations. stdatomic.h seems a nice thing to reach out for. + volatile bool should_run; + + VALUE cpu_and_wall_time_collector_instance; + // When something goes wrong during sampling, we record the Ruby exception here, so that it can be "re-raised" on + // the CpuAndWallTimeWorker thread + VALUE failure_exception; +}; + +static VALUE _native_new(VALUE klass); +static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE self_instance, VALUE cpu_and_wall_time_collector_instance); +static void cpu_and_wall_time_worker_typed_data_mark(void *state_ptr); +static VALUE _native_sampling_loop(VALUE self, VALUE instance); +static VALUE _native_stop(DDTRACE_UNUSED VALUE _self, VALUE self_instance); +static void install_sigprof_signal_handler(void (*signal_handler_function)(int, siginfo_t *, void *)); +static void remove_sigprof_signal_handler(void); +static void block_sigprof_signal_handler_from_running_in_current_thread(void); +static void handle_sampling_signal(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED siginfo_t *_info, DDTRACE_UNUSED void *_ucontext); +static void *run_sampling_trigger_loop(void *state_ptr); +static void interrupt_sampling_trigger_loop(void *state_ptr); +static void sample_from_postponed_job(DDTRACE_UNUSED void *_unused); +static VALUE handle_sampling_failure(VALUE self_instance, VALUE exception); +static VALUE _native_current_sigprof_signal_handler(DDTRACE_UNUSED VALUE self); +static VALUE release_gvl_and_run_sampling_trigger_loop(VALUE instance); +static VALUE _native_is_running(DDTRACE_UNUSED VALUE self, VALUE instance); +static void testing_signal_handler(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED siginfo_t *_info, DDTRACE_UNUSED void *_ucontext); +static VALUE _native_install_testing_signal_handler(DDTRACE_UNUSED VALUE self); +static VALUE _native_remove_testing_signal_handler(DDTRACE_UNUSED VALUE self); + +// Global state -- be very careful when accessing or modifying it + +// Note: Global state must only be mutated while holding the global VM lock (we piggy back on it to ensure correctness). +// The active_sampler_instance needs to be global because we access it from the signal handler. +static VALUE active_sampler_instance = Qnil; +// ...We also store active_sampler_owner_thread to be able to tell who the active_sampler_instance belongs to (and also +// to detect when it is outdated) +static VALUE active_sampler_owner_thread = Qnil; + +void collectors_cpu_and_wall_time_worker_init(VALUE profiling_module) { + rb_global_variable(&active_sampler_instance); + rb_global_variable(&active_sampler_owner_thread); + + VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); + VALUE collectors_cpu_and_wall_time_worker_class = rb_define_class_under(collectors_module, "CpuAndWallTimeWorker", rb_cObject); + // Hosts methods used for testing the native code using RSpec + VALUE testing_module = rb_define_module_under(collectors_cpu_and_wall_time_worker_class, "Testing"); + + // Instances of the CpuAndWallTimeWorker class are "TypedData" objects. + // "TypedData" objects are special objects in the Ruby VM that can wrap C structs. + // In this case, it wraps the cpu_and_wall_time_worker_state. + // + // Because Ruby doesn't know how to initialize native-level structs, we MUST override the allocation function for objects + // of this class so that we can manage this part. Not overriding or disabling the allocation function is a common + // gotcha for "TypedData" objects that can very easily lead to VM crashes, see for instance + // https://bugs.ruby-lang.org/issues/18007 for a discussion around this. + rb_define_alloc_func(collectors_cpu_and_wall_time_worker_class, _native_new); + + rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_initialize", _native_initialize, 2); + rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_sampling_loop", _native_sampling_loop, 1); + rb_define_singleton_method(collectors_cpu_and_wall_time_worker_class, "_native_stop", _native_stop, 1); + rb_define_singleton_method(testing_module, "_native_current_sigprof_signal_handler", _native_current_sigprof_signal_handler, 0); + rb_define_singleton_method(testing_module, "_native_is_running?", _native_is_running, 1); + rb_define_singleton_method(testing_module, "_native_install_testing_signal_handler", _native_install_testing_signal_handler, 0); + rb_define_singleton_method(testing_module, "_native_remove_testing_signal_handler", _native_remove_testing_signal_handler, 0); +} + +// This structure is used to define a Ruby object that stores a pointer to a struct cpu_and_wall_time_worker_state +// See also https://github.com/ruby/ruby/blob/master/doc/extension.rdoc for how this works +static const rb_data_type_t cpu_and_wall_time_worker_typed_data = { + .wrap_struct_name = "Datadog::Profiling::Collectors::CpuAndWallTimeWorker", + .function = { + .dmark = cpu_and_wall_time_worker_typed_data_mark, + .dfree = RUBY_DEFAULT_FREE, + .dsize = NULL, // We don't track profile memory usage (although it'd be cool if we did!) + //.dcompact = NULL, // FIXME: Add support for compaction + }, + .flags = RUBY_TYPED_FREE_IMMEDIATELY +}; + +static VALUE _native_new(VALUE klass) { + struct cpu_and_wall_time_worker_state *state = ruby_xcalloc(1, sizeof(struct cpu_and_wall_time_worker_state)); + + state->should_run = false; + state->cpu_and_wall_time_collector_instance = Qnil; + state->failure_exception = Qnil; + + return TypedData_Wrap_Struct(klass, &cpu_and_wall_time_worker_typed_data, state); +} + +static VALUE _native_initialize(DDTRACE_UNUSED VALUE _self, VALUE self_instance, VALUE cpu_and_wall_time_collector_instance) { + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + state->cpu_and_wall_time_collector_instance = enforce_cpu_and_wall_time_collector_instance(cpu_and_wall_time_collector_instance); + + return Qtrue; +} + +// Since our state contains references to Ruby objects, we need to tell the Ruby GC about them +static void cpu_and_wall_time_worker_typed_data_mark(void *state_ptr) { + struct cpu_and_wall_time_worker_state *state = (struct cpu_and_wall_time_worker_state *) state_ptr; + + rb_gc_mark(state->cpu_and_wall_time_collector_instance); + rb_gc_mark(state->failure_exception); +} + +// Called in a background thread created in CpuAndWallTimeWorker#start +static VALUE _native_sampling_loop(DDTRACE_UNUSED VALUE _self, VALUE instance) { + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + if (active_sampler_owner_thread != Qnil && is_thread_alive(active_sampler_owner_thread)) { + rb_raise( + rb_eRuntimeError, + "Could not start CpuAndWallTimeWorker: There's already another instance of CpuAndWallTimeWorker active in a different thread" + ); + } + + // This write to a global is thread-safe BECAUSE we're still holding on to the global VM lock at this point + active_sampler_instance = instance; + active_sampler_owner_thread = rb_thread_current(); + + state->should_run = true; + + block_sigprof_signal_handler_from_running_in_current_thread(); // We want to interrupt the thread with the global VM lock, never this one + + install_sigprof_signal_handler(handle_sampling_signal); + + // Release GVL, get to the actual work! + int exception_state; + rb_protect(release_gvl_and_run_sampling_trigger_loop, instance, &exception_state); + + // The sample trigger loop finished (either cleanly or with an error); let's clean up + + remove_sigprof_signal_handler(); + active_sampler_instance = Qnil; + active_sampler_owner_thread = Qnil; + + // Ensure that instance is not garbage collected while the native sampling loop is running; this is probably not needed, but just in case + RB_GC_GUARD(instance); + + if (exception_state) rb_jump_tag(exception_state); // Re-raise any exception that happened + + return Qnil; +} + +static VALUE _native_stop(DDTRACE_UNUSED VALUE _self, VALUE self_instance) { + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + state->should_run = false; + + return Qtrue; +} + +static void install_sigprof_signal_handler(void (*signal_handler_function)(int, siginfo_t *, void *)) { + struct sigaction existing_signal_handler_config = {.sa_sigaction = NULL}; + struct sigaction signal_handler_config = { + .sa_flags = SA_RESTART | SA_SIGINFO, + .sa_sigaction = signal_handler_function + }; + sigemptyset(&signal_handler_config.sa_mask); + + if (sigaction(SIGPROF, &signal_handler_config, &existing_signal_handler_config) != 0) { + rb_sys_fail("Could not start CpuAndWallTimeWorker: Could not install signal handler"); + } + + // In some corner cases (e.g. after a fork), our signal handler may still be around, and that's ok + if (existing_signal_handler_config.sa_sigaction == handle_sampling_signal) return; + + if (existing_signal_handler_config.sa_handler != NULL || existing_signal_handler_config.sa_sigaction != NULL) { + // A previous signal handler already existed. Currently we don't support this situation, so let's just back out + // of the installation. + + if (sigaction(SIGPROF, &existing_signal_handler_config, NULL) != 0) { + rb_sys_fail( + "Could not start CpuAndWallTimeWorker: Could not re-install pre-existing SIGPROF signal handler. " \ + "This may break the component had installed it." + ); + } + + rb_raise(rb_eRuntimeError, "Could not start CpuAndWallTimeWorker: There's a pre-existing SIGPROF signal handler"); + } +} + +static void remove_sigprof_signal_handler(void) { + struct sigaction signal_handler_config = { + .sa_handler = SIG_DFL, // Reset back to default + .sa_flags = SA_RESTART // TODO: Unclear if this is actually needed/does anything at all + }; + sigemptyset(&signal_handler_config.sa_mask); + + if (sigaction(SIGPROF, &signal_handler_config, NULL) != 0) rb_sys_fail("Failure while removing the signal handler"); +} + +static void block_sigprof_signal_handler_from_running_in_current_thread(void) { + sigset_t signals_to_block; + sigemptyset(&signals_to_block); + sigaddset(&signals_to_block, SIGPROF); + pthread_sigmask(SIG_BLOCK, &signals_to_block, NULL); +} + +static void handle_sampling_signal(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED siginfo_t *_info, DDTRACE_UNUSED void *_ucontext) { + if (!ruby_native_thread_p() || !ruby_thread_has_gvl_p()) { + return; // Not safe to enqueue a sample from this thread + } + + // We implicitly assume there can be no concurrent nor nested calls to handle_sampling_signal because + // a) we get triggered using SIGPROF, and the docs state second SIGPROF will not interrupt an existing one + // b) we validate we are in the thread that has the global VM lock; if a different thread gets a signal, it will return early + // because it will not have the global VM lock + // TODO: Validate that this does not impact Ractors + + // Note: rb_postponed_job_register_one ensures that if there's a previous sample_from_postponed_job queued for execution + // then we will not queue a second one. It does this by doing a linear scan on the existing jobs; in the future we + // may want to implement that check ourselves. + + // TODO: Do something with result (potentially update tracking counters?) + /*int result =*/ rb_postponed_job_register_one(0, sample_from_postponed_job, NULL); +} + +// The actual sampling trigger loop always runs **without** the global vm lock. +static void *run_sampling_trigger_loop(void *state_ptr) { + struct cpu_and_wall_time_worker_state *state = (struct cpu_and_wall_time_worker_state *) state_ptr; + + struct timespec time_between_signals = {.tv_nsec = 10 * 1000 * 1000 /* 10ms */}; + + while (state->should_run) { + // TODO: This is still a placeholder for a more complex mechanism. In particular: + // * We want to signal a particular thread or threads, not the process in general + // * We want to track if a signal landed on the thread holding the global VM lock and do something about it + // * We want to do more than having a fixed sampling rate + + kill(getpid(), SIGPROF); + nanosleep(&time_between_signals, NULL); + } + + return NULL; // Unused +} + +// This is called by the Ruby VM when it wants to shut down the background thread +static void interrupt_sampling_trigger_loop(void *state_ptr) { + struct cpu_and_wall_time_worker_state *state = (struct cpu_and_wall_time_worker_state *) state_ptr; + + state->should_run = false; +} + +static void sample_from_postponed_job(DDTRACE_UNUSED void *_unused) { + VALUE instance = active_sampler_instance; // Read from global variable + + // This can potentially happen if the CpuAndWallTimeWorker was stopped while the postponed job was waiting to be executed; nothing to do + if (instance == Qnil) return; + + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + // Trigger sampling using the Collectors::CpuAndWallTime; rescue against any exceptions that happen during sampling + VALUE (*function_to_call_safely)(VALUE) = cpu_and_wall_time_collector_sample; + VALUE function_to_call_safely_arg = state->cpu_and_wall_time_collector_instance; + VALUE (*exception_handler_function)(VALUE, VALUE) = handle_sampling_failure; + VALUE exception_handler_function_arg = instance; + rb_rescue2( + function_to_call_safely, + function_to_call_safely_arg, + exception_handler_function, + exception_handler_function_arg, + rb_eException, // rb_eException is the base class of all Ruby exceptions + 0 // Required by API to be the last argument + ); +} + +static VALUE handle_sampling_failure(VALUE self_instance, VALUE exception) { + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(self_instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + state->should_run = false; + state->failure_exception = exception; + + return Qnil; +} + +static VALUE _native_current_sigprof_signal_handler(DDTRACE_UNUSED VALUE self) { + struct sigaction existing_signal_handler_config = {.sa_sigaction = NULL}; + if (sigaction(SIGPROF, NULL, &existing_signal_handler_config) != 0) { + rb_sys_fail("Failed to probe existing handler"); + } + + if (existing_signal_handler_config.sa_sigaction == handle_sampling_signal) { + return ID2SYM(rb_intern("profiling")); + } else if (existing_signal_handler_config.sa_sigaction != NULL) { + return ID2SYM(rb_intern("other")); + } else { + return Qnil; + } +} + +static VALUE release_gvl_and_run_sampling_trigger_loop(VALUE instance) { + struct cpu_and_wall_time_worker_state *state; + TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); + + rb_thread_call_without_gvl(run_sampling_trigger_loop, state, interrupt_sampling_trigger_loop, state); + + // If we stopped sampling due to an exception, re-raise it (now in the worker thread) + if (state->failure_exception != Qnil) rb_exc_raise(state->failure_exception); + + return Qnil; +} + +static VALUE _native_is_running(DDTRACE_UNUSED VALUE self, VALUE instance) { + return \ + (active_sampler_owner_thread != Qnil && is_thread_alive(active_sampler_owner_thread) && active_sampler_instance == instance) ? + Qtrue : Qfalse; +} + +static void testing_signal_handler(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED siginfo_t *_info, DDTRACE_UNUSED void *_ucontext) { + /* Does nothing on purpose */ +} + +static VALUE _native_install_testing_signal_handler(DDTRACE_UNUSED VALUE self) { + install_sigprof_signal_handler(testing_signal_handler); + return Qtrue; +} + +static VALUE _native_remove_testing_signal_handler(DDTRACE_UNUSED VALUE self) { + remove_sigprof_signal_handler(); + return Qtrue; +} diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/ddtrace_profiling_native_extension/profiling.c index 36549f6ed57..05341241614 100644 --- a/ext/ddtrace_profiling_native_extension/profiling.c +++ b/ext/ddtrace_profiling_native_extension/profiling.c @@ -5,6 +5,7 @@ // Each class/module here is implemented in their separate file void collectors_cpu_and_wall_time_init(VALUE profiling_module); +void collectors_cpu_and_wall_time_worker_init(VALUE profiling_module); void collectors_stack_init(VALUE profiling_module); void http_transport_init(VALUE profiling_module); void stack_recorder_init(VALUE profiling_module); @@ -22,6 +23,7 @@ void DDTRACE_EXPORT Init_ddtrace_profiling_native_extension(void) { rb_define_singleton_method(native_extension_module, "clock_id_for", clock_id_for, 1); // from clock_id.h collectors_cpu_and_wall_time_init(profiling_module); + collectors_cpu_and_wall_time_worker_init(profiling_module); collectors_stack_init(profiling_module); http_transport_init(profiling_module); stack_recorder_init(profiling_module); diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index a22af587dfa..10a6b298ca1 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -148,6 +148,7 @@ def self.start_if_enabled require_relative 'profiling/ext/forking' require_relative 'profiling/collectors/code_provenance' require_relative 'profiling/collectors/cpu_and_wall_time' + require_relative 'profiling/collectors/cpu_and_wall_time_worker' require_relative 'profiling/collectors/old_stack' require_relative 'profiling/collectors/stack' require_relative 'profiling/stack_recorder' diff --git a/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb b/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb new file mode 100644 index 00000000000..41854df4290 --- /dev/null +++ b/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb @@ -0,0 +1,74 @@ +# typed: false + +module Datadog + module Profiling + module Collectors + # Used to trigger the periodic execution of Collectors::CpuAndWallTime, which implements all of the sampling logic + # itself; this class only implements the "doing it periodically" part. + # Almost all of this class is implemented as native code. + # + # Methods prefixed with _native_ are implemented in `collectors_cpu_and_wall_time_worker.c` + class CpuAndWallTimeWorker + private + + attr_accessor :failure_exception + + public + + def initialize( + recorder:, + max_frames:, + cpu_and_wall_time_collector: CpuAndWallTime.new(recorder: recorder, max_frames: max_frames) + ) + self.class._native_initialize(self, cpu_and_wall_time_collector) + @worker_thread = nil + @failure_exception = nil + @start_stop_mutex = Mutex.new + end + + def start + @start_stop_mutex.synchronize do + return if @worker_thread + + Datadog.logger.debug { "Starting thread for: #{self}" } + @worker_thread = Thread.new do + begin + Thread.current.name = self.class.name unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3') + + self.class._native_sampling_loop(self) + + Datadog.logger.debug('CpuAndWallTimeWorker thread stopping cleanly') + rescue Exception => e # rubocop:disable Lint/RescueException + @failure_exception = e + Datadog.logger.warn( + "Worker thread error. Cause: #{e.class.name} #{e.message} Location: #{Array(e.backtrace).first}" + ) + end + end + end + + true + end + + # TODO: Provided only for compatibility with the API for Collectors::OldStack used in the Profiler class. + # Can be removed once we remove OldStack. + def enabled=(_); end + + def stop(*_) + @start_stop_mutex.synchronize do + Datadog.logger.debug('Requesting CpuAndWallTimeWorker thread shut down') + + return unless @worker_thread + + @worker_thread.kill + self.class._native_stop(self) + + @worker_thread.join + @worker_thread = nil + @failure_exception = nil + end + end + end + end + end +end diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb new file mode 100644 index 00000000000..7985a264ce3 --- /dev/null +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb @@ -0,0 +1,137 @@ +# typed: ignore + +require 'datadog/profiling/spec_helper' + +RSpec.describe Datadog::Profiling::Collectors::CpuAndWallTimeWorker do + before { skip_if_profiling_not_supported(self) } + + let(:recorder) { Datadog::Profiling::StackRecorder.new } + + subject(:cpu_and_wall_time_worker) { described_class.new(recorder: recorder, max_frames: 400) } + + describe '#start' do + subject(:start) do + cpu_and_wall_time_worker.start + wait_until_running + end + + after do + cpu_and_wall_time_worker.stop + end + + it 'creates a new thread' do + skip 'Spec not compatible with Ruby 2.2' if RUBY_VERSION.start_with?('2.2.') + + start + + expect(Thread.list.map(&:name)).to include(described_class.name) + end + + it 'does not create a second thread if start is called again' do + start + + expect(Thread).to_not receive(:new) + + cpu_and_wall_time_worker.start + end + + it 'does not allow other instances of the CpuAndWallTimeWorker to start' do + start + + allow(Datadog.logger).to receive(:warn) + + another_instance = described_class.new(recorder: Datadog::Profiling::StackRecorder.new, max_frames: 400) + another_instance.start + + exception = try_wait_until(backoff: 0.01) { another_instance.send(:failure_exception) } + + expect(exception.message).to include 'another instance' + end + + it 'installs the profiling SIGPROF signal handler' do + start + + expect(described_class::Testing._native_current_sigprof_signal_handler).to be :profiling + end + + context 'when a previous signal handler existed' do + before do + described_class::Testing._native_install_testing_signal_handler + expect(described_class::Testing._native_current_sigprof_signal_handler).to be :other + + allow(Datadog.logger).to receive(:warn) + end + + after do + described_class::Testing._native_remove_testing_signal_handler + end + + it 'does not start the sampling loop' do + cpu_and_wall_time_worker.start + + exception = try_wait_until(backoff: 0.01) { cpu_and_wall_time_worker.send(:failure_exception) } + + expect(exception.message).to include 'pre-existing SIGPROF' + end + + it 'leaves the existing signal handler in place' do + cpu_and_wall_time_worker.start + + try_wait_until(backoff: 0.01) { cpu_and_wall_time_worker.send(:failure_exception) } + + expect(described_class::Testing._native_current_sigprof_signal_handler).to be :other + end + end + + it 'triggers sampling and records the results' do + start + + all_samples = try_wait_until do + serialization_result = recorder.serialize + raise 'Unexpected: Serialization failed' unless serialization_result + + samples = samples_from_pprof(serialization_result.last) + samples if samples.any? + end + + current_thread_sample = all_samples.find do |it| + it.fetch(:labels).fetch(:'thread id') == Thread.current.object_id.to_s + end + + expect(current_thread_sample).to_not be nil + end + end + + describe '#stop' do + subject(:stop) { cpu_and_wall_time_worker.stop } + + before do + cpu_and_wall_time_worker.start + wait_until_running + end + + it 'shuts down the background thread' do + skip 'Spec not compatible with Ruby 2.2' if RUBY_VERSION.start_with?('2.2.') + + stop + + expect(Thread.list.map(&:name)).to_not include(described_class.name) + end + + it 'removes the profiling sigprof signal handler' do + stop + + expect(described_class::Testing._native_current_sigprof_signal_handler).to be nil + end + end + + describe '#enabled=' do + it 'does nothing (provided only for API compatibility)' do + cpu_and_wall_time_worker.enabled = true + end + end + + def wait_until_running + try_wait_until(backoff: 0.01) { described_class::Testing._native_is_running?(cpu_and_wall_time_worker) } + end +end From 76c1dab6339d72b558516d63fe65afc11c3d1dd5 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 12:04:49 +0100 Subject: [PATCH 0382/2133] Fix "warning: toplevel constant Mutex referenced by Thread::Mutex" --- lib/datadog/profiling/stack_recorder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/profiling/stack_recorder.rb b/lib/datadog/profiling/stack_recorder.rb index ea8eac4e83d..42b965759f8 100644 --- a/lib/datadog/profiling/stack_recorder.rb +++ b/lib/datadog/profiling/stack_recorder.rb @@ -13,7 +13,7 @@ def initialize # This isn't something we expect to happen normally, but because it would break the assumptions of the # C-level mutexes (that there is a single serializer thread), we add it here as an extra safeguard against it # accidentally happening. - @no_concurrent_synchronize_mutex = Thread::Mutex.new + @no_concurrent_synchronize_mutex = Mutex.new end def serialize From af67dbeb90e5a38ed08ce878cee5c390ec592eb4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 12:07:31 +0100 Subject: [PATCH 0383/2133] Add missing require to make Ruby 2.1 happy Sigh supporting Ruby 2.1 continues to be a drag on our resources... --- .../profiling/collectors/cpu_and_wall_time_worker_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb index 7985a264ce3..464f5f2b045 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb @@ -1,6 +1,7 @@ # typed: ignore require 'datadog/profiling/spec_helper' +require 'datadog/profiling/collectors/cpu_and_wall_time_worker' RSpec.describe Datadog::Profiling::Collectors::CpuAndWallTimeWorker do before { skip_if_profiling_not_supported(self) } From a15854a1313a24cd72d1f1c3606ddd72614cb0e8 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 14:01:02 +0100 Subject: [PATCH 0384/2133] Make CpuAndWallTimeWorker compile on 2.2, but mark it as not working We're missing the `ruby_thread_has_gvl_p()` function on Ruby 2.2 (it exists, but it's not public). I don't want to block progress on other things on Ruby 2.2 support so for now I'll mark it as `pending` and will come back for it later. --- ext/ddtrace_profiling_native_extension/extconf.rb | 2 ++ .../private_vm_api_access.c | 9 +++++++++ .../collectors/cpu_and_wall_time_worker_spec.rb | 6 ++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/ddtrace_profiling_native_extension/extconf.rb index d10a966e667..eeabfd39b39 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/ddtrace_profiling_native_extension/extconf.rb @@ -144,6 +144,8 @@ def add_compiler_flag(flag) $defs << '-DUSE_LEGACY_RB_PROFILE_FRAMES' # ... you couldn't name threads $defs << '-DNO_THREAD_NAMES' + # ...the ruby_thread_has_gvl_p function was not exposed to users outside of the VM + $defs << '-DNO_THREAD_HAS_GVL' end # If we got here, libdatadog is available and loaded diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c index 996647c3cbb..dbc18b05975 100644 --- a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +++ b/ext/ddtrace_profiling_native_extension/private_vm_api_access.c @@ -681,3 +681,12 @@ int ddtrace_rb_profile_frames(VALUE thread, int start, int limit, VALUE *buff, i } #endif // USE_LEGACY_RB_PROFILE_FRAMES + +#ifdef NO_THREAD_HAS_GVL +int ruby_thread_has_gvl_p(void) { + // TODO: The CpuAndWallTimeWorker needs this function, but Ruby 2.2 doesn't expose it... For now this placeholder + // will enable the profiling native extension to continue to compile on Ruby 2.2, but the CpuAndWallTimeWorker will + // not work properly on 2.2. Will be addressed later. + return 0; +} +#endif // NO_THREAD_HAS_GVL diff --git a/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb index 464f5f2b045..a7724097f32 100644 --- a/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb +++ b/spec/datadog/profiling/collectors/cpu_and_wall_time_worker_spec.rb @@ -85,6 +85,8 @@ end it 'triggers sampling and records the results' do + pending 'Currently broken on Ruby 2.2 due to missing ruby_thread_has_gvl_p API' if RUBY_VERSION.start_with?('2.2.') + start all_samples = try_wait_until do @@ -112,10 +114,10 @@ end it 'shuts down the background thread' do - skip 'Spec not compatible with Ruby 2.2' if RUBY_VERSION.start_with?('2.2.') - stop + skip 'Spec not compatible with Ruby 2.2' if RUBY_VERSION.start_with?('2.2.') + expect(Thread.list.map(&:name)).to_not include(described_class.name) end From a9db125fe12a1d9e11734fb1ead171d43fe81c31 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 5 Aug 2022 14:41:48 +0100 Subject: [PATCH 0385/2133] [PROF-5860] Allow new CPU Profiling 2.0 **alpha** profiler to be enabled The new Ruby profiler, aka "CPU Profiling 2.0", is considered to be alpha state. We do not recommend turning it on. But! We actually can turn it on now -- by using `DD_PROFILING_FORCE_ENABLE_NEW=true`. The rest of the pieces have been put into place in previous PRs. --- lib/datadog/core/configuration/components.rb | 20 ++++--- lib/datadog/core/configuration/settings.rb | 10 ++++ .../core/configuration/components_spec.rb | 54 ++++++++++++++++++- .../core/configuration/settings_spec.rb | 35 ++++++++++++ 4 files changed, 111 insertions(+), 8 deletions(-) diff --git a/lib/datadog/core/configuration/components.rb b/lib/datadog/core/configuration/components.rb index 76d8b502a07..a54ff786c8b 100644 --- a/lib/datadog/core/configuration/components.rb +++ b/lib/datadog/core/configuration/components.rb @@ -240,13 +240,21 @@ def build_profiler(settings, agent_settings, tracer) # NOTE: Please update the Initialization section of ProfilingDevelopment.md with any changes to this method - trace_identifiers_helper = Profiling::TraceIdentifiers::Helper.new( - tracer: tracer, - endpoint_collection_enabled: settings.profiling.advanced.endpoint.collection.enabled - ) + if settings.profiling.advanced.force_enable_new_profiler + recorder = Datadog::Profiling::StackRecorder.new + collector = Datadog::Profiling::Collectors::CpuAndWallTimeWorker.new( + recorder: recorder, + max_frames: settings.profiling.advanced.max_frames + ) + else + trace_identifiers_helper = Profiling::TraceIdentifiers::Helper.new( + tracer: tracer, + endpoint_collection_enabled: settings.profiling.advanced.endpoint.collection.enabled + ) - recorder = build_profiler_old_recorder(settings) - collector = build_profiler_oldstack_collector(settings, recorder, trace_identifiers_helper) + recorder = build_profiler_old_recorder(settings) + collector = build_profiler_oldstack_collector(settings, recorder, trace_identifiers_helper) + end exporter = build_profiler_exporter(settings, recorder) transport = build_profiler_transport(settings, agent_settings) diff --git a/lib/datadog/core/configuration/settings.rb b/lib/datadog/core/configuration/settings.rb index b293c0780eb..62da6292549 100644 --- a/lib/datadog/core/configuration/settings.rb +++ b/lib/datadog/core/configuration/settings.rb @@ -241,6 +241,16 @@ def initialize(*_) o.default { env_to_bool('DD_PROFILING_LEGACY_TRANSPORT_ENABLED', false) } o.lazy end + + # Forces enabling the new profiler. We do not yet recommend turning on this option. + # + # Note that setting this to "false" (or not setting it) will not prevent the new profiler from + # being automatically used in the future. + # This option will be deprecated for removal once the new profiler gets enabled by default for all customers. + option :force_enable_new_profiler do |o| + o.default { env_to_bool('DD_PROFILING_FORCE_ENABLE_NEW', false) } + o.lazy + end end # @public_api diff --git a/spec/datadog/core/configuration/components_spec.rb b/spec/datadog/core/configuration/components_spec.rb index 570dc3a5dc2..8c0d85cd8f9 100644 --- a/spec/datadog/core/configuration/components_spec.rb +++ b/spec/datadog/core/configuration/components_spec.rb @@ -929,7 +929,7 @@ context 'with :enabled false' do before do - allow(settings.profiling).to receive(:enabled).and_return(false) + settings.profiling.enabled = false end it 'does not build a profiler' do @@ -939,7 +939,7 @@ context 'with :enabled true' do before do - allow(settings.profiling).to receive(:enabled).and_return(true) + settings.profiling.enabled = true allow(profiler_setup_task).to receive(:run) end @@ -970,6 +970,56 @@ build_profiler end + it 'sets up the Exporter with the OldRecorder' do + expect(Datadog::Profiling::Exporter) + .to receive(:new).with(hash_including(pprof_recorder: instance_of(Datadog::Profiling::OldRecorder))) + + build_profiler + end + + context 'when force_enable_new_profiler is enabled' do + before do + settings.profiling.advanced.force_enable_new_profiler = true + end + + it 'does not initialize the OldStack collector' do + expect(Datadog::Profiling::Collectors::OldStack).to_not receive(:new) + + build_profiler + end + + it 'does not initialize the OldRecorder' do + expect(Datadog::Profiling::OldRecorder).to_not receive(:new) + + build_profiler + end + + it 'initializes a CpuAndWallTimeWorker collector' do + expect(Datadog::Profiling::Collectors::CpuAndWallTimeWorker).to receive(:new).with( + recorder: instance_of(Datadog::Profiling::StackRecorder), + max_frames: settings.profiling.advanced.max_frames, + ) + + build_profiler + end + + it 'sets up the Profiler with the CpuAndWallTimeWorker collector' do + expect(Datadog::Profiling::Profiler).to receive(:new).with( + [instance_of(Datadog::Profiling::Collectors::CpuAndWallTimeWorker)], + anything, + ) + + build_profiler + end + + it 'sets up the Exporter with the StackRecorder' do + expect(Datadog::Profiling::Exporter) + .to receive(:new).with(hash_including(pprof_recorder: instance_of(Datadog::Profiling::StackRecorder))) + + build_profiler + end + end + it 'runs the setup task to set up any needed extensions for profiling' do expect(profiler_setup_task).to receive(:run) diff --git a/spec/datadog/core/configuration/settings_spec.rb b/spec/datadog/core/configuration/settings_spec.rb index de93af010bf..5630c682e07 100644 --- a/spec/datadog/core/configuration/settings_spec.rb +++ b/spec/datadog/core/configuration/settings_spec.rb @@ -430,6 +430,41 @@ .to(false) end end + + describe '#force_enable_new_profiler' do + subject(:force_enable_new_profiler) { settings.profiling.advanced.force_enable_new_profiler } + + context 'when DD_PROFILING_FORCE_ENABLE_NEW' do + around do |example| + ClimateControl.modify('DD_PROFILING_FORCE_ENABLE_NEW' => environment) do + example.run + end + end + + context 'is not defined' do + let(:environment) { nil } + + it { is_expected.to be false } + end + + { 'true' => true, 'false' => false }.each do |string, value| + context "is defined as #{string}" do + let(:environment) { string } + + it { is_expected.to be value } + end + end + end + end + + describe '#force_enable_new_profiler=' do + it 'updates the #force_enable_new_profiler setting' do + expect { settings.profiling.advanced.force_enable_new_profiler = true } + .to change { settings.profiling.advanced.force_enable_new_profiler } + .from(false) + .to(true) + end + end end describe '#upload' do From 48539354f6c1fa22be33053377124e6f9cab6f5e Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 5 Aug 2022 15:22:32 -0700 Subject: [PATCH 0386/2133] CI:Test time limit with thread dump report --- spec/spec_helper.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e3cca9e1b1c..4e726eaf573 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -241,5 +241,32 @@ def initialize(*args, &block) Thread.prepend(DatadogThreadDebugger) +# Enforce test time limit, to allow us to debug why some test runs get stuck in CI +if ENV.key?('CI') + require 'spec/support/thread_helpers' + + ThreadHelpers.with_leaky_thread_creation('Deadline thread') do + Thread.new do + sleep_time = 30 * 60 # 30 minutes + sleep(sleep_time) + + warn "Test too longer than #{sleep_time}s to finish, aborting test run." + warn 'Stack trace of all running threads:' + + Thread.list.select { |t| t.alive? && t != Thread.current }.each_with_index.map do |t, idx| + backtrace = t.backtrace + backtrace = '(Not available)' if backtrace.nil? || backtrace.empty? + + warn "#{idx}: #{t} (#{t.class.name})", + 'Thread Backtrace:', + backtrace.map { |l| "\t#{l}" }.join("\n"), + "\n" + end + + Kernel.exit(1) + end + end +end + # Helper matchers RSpec::Matchers.define_negated_matcher :not_be, :be From cdba548d87a45b54f07233afe40847199ad787ad Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:12:49 -0400 Subject: [PATCH 0387/2133] Remove binding.pry statement (#2211) --- spec/datadog/tracing/contrib/sidekiq/support/helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb index a08bcda07f7..ddfedf82148 100644 --- a/spec/datadog/tracing/contrib/sidekiq/support/helper.rb +++ b/spec/datadog/tracing/contrib/sidekiq/support/helper.rb @@ -99,7 +99,6 @@ def run_sidekiq_server require 'sidekiq/cli' configure_sidekiq - # binding.pry cli = Sidekiq::CLI.instance cli.parse(['--require', app_tempfile.path]) # boot the "app" From a468c29ed46606d70210d19835698813c0036df0 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Mon, 8 Aug 2022 18:39:07 +0700 Subject: [PATCH 0388/2133] chore: Add 'grpc.client.deadline' tag to track gRPC client's deadline value (#2200) * chore: Add 'grpc.client.deadline' tag to track gRPC client's deadline value * chore: exclude TimeSpec from gRPC for client interceptor * chore: fix linter * chore: simplify the check condition * chore: use iso8601 format for deadline --- .../tracing/contrib/grpc/datadog_interceptor/client.rb | 9 +++++++++ lib/datadog/tracing/contrib/grpc/ext.rb | 1 + .../contrib/grpc/datadog_interceptor/client_spec.rb | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb index 6c0a2f57750..017e8f56781 100644 --- a/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +++ b/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb @@ -44,6 +44,9 @@ def annotate!(trace, span, metadata, call) host, _port = find_host_port(call) span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, host) if host + deadline = find_deadline(call) + span.set_tag(Ext::TAG_CLIENT_DEADLINE, deadline) if deadline + # Set analytics sample rate Contrib::Analytics.set_sample_rate(span, analytics_sample_rate) if analytics_enabled? @@ -60,6 +63,12 @@ def format_resource(proto_method) .join('.') end + def find_deadline(call) + return unless call.respond_to?(:deadline) && call.deadline.is_a?(Time) + + call.deadline.utc.iso8601(3) + end + def find_host_port(call) return unless call diff --git a/lib/datadog/tracing/contrib/grpc/ext.rb b/lib/datadog/tracing/contrib/grpc/ext.rb index cec7ac4d8bb..839e1d41f5e 100644 --- a/lib/datadog/tracing/contrib/grpc/ext.rb +++ b/lib/datadog/tracing/contrib/grpc/ext.rb @@ -13,6 +13,7 @@ module Ext DEFAULT_PEER_SERVICE_NAME = 'grpc'.freeze SPAN_CLIENT = 'grpc.client'.freeze SPAN_SERVICE = 'grpc.service'.freeze + TAG_CLIENT_DEADLINE = 'grpc.client.deadline'.freeze TAG_COMPONENT = 'grpc'.freeze TAG_OPERATION_CLIENT = 'client'.freeze TAG_OPERATION_SERVICE = 'service'.freeze diff --git a/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb b/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb index c80a6ff6b17..aab0a567e78 100644 --- a/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb +++ b/spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb @@ -31,9 +31,10 @@ end context 'using client-specific configurations' do + let(:deadline) { Time.utc(2022, 1, 2, 3, 4, 5, 678901) } let(:keywords) do { request: instance_double(Object), - call: instance_double('GRPC::ActiveCall', peer: peer), + call: instance_double('GRPC::ActiveCall', peer: peer, deadline: deadline), method: 'MyService.Endpoint', metadata: { some: 'datum' } } end @@ -60,6 +61,9 @@ span = fetch_spans.last expect(span.service).to eq 'cepsr' expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_PEER_SERVICE)).to eq('cepsr') + expect( + span.get_tag(Datadog::Tracing::Contrib::GRPC::Ext::TAG_CLIENT_DEADLINE) + ).to eq '2022-01-02T03:04:05.678Z' end end @@ -68,6 +72,7 @@ specify { expect(span.span_type).to eq 'http' } specify { expect(span.service).to eq 'rspec' } specify { expect(span.resource).to eq 'myservice.endpoint' } + specify { expect(span.get_tag('grpc.client.deadline')).to be_nil } specify { expect(span.get_tag('error.stack')).to be_nil } specify { expect(span.get_tag('some')).to eq 'datum' } From 79b9138cee3e6cf0832fcbe6ad208f55b3e34e84 Mon Sep 17 00:00:00 2001 From: TonyCTHsu Date: Mon, 8 Aug 2022 14:48:51 +0200 Subject: [PATCH 0389/2133] Fix sidekiq broken version (#2213) --- integration/apps/rack/Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/apps/rack/Gemfile b/integration/apps/rack/Gemfile index d7278acbab2..12644c93912 100644 --- a/integration/apps/rack/Gemfile +++ b/integration/apps/rack/Gemfile @@ -13,7 +13,8 @@ end if RUBY_VERSION < '2.2' gem 'sidekiq', '< 5' # 5.0.3 checks for older Rubies and breaks, but does not declare it on the gemspec :( else - gem 'sidekiq' + # `6.5.3` and `6.5.2` contain broken dependency, https://github.com/mperham/sidekiq/issues/5456 + gem 'sidekiq', ['!= 6.5.2', '!= 6.5.3'] end gem 'resque' gem 'rake' From 788e3a48b6ce1d48dc00b6e4b6d2e775e7880088 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 8 Aug 2022 14:50:29 +0100 Subject: [PATCH 0390/2133] Simplify check for "have we landed in the right thread" On closer look at the Ruby VM sources, `ruby_thread_has_gvl_p()` is a superset of `ruby_native_thread_p()`, as both of them rely on calling `ruby_thread_from_native()`. Reference: * https://github.com/ruby/ruby/blob/a24c607e30b5a74ef53e9a2c1e630dea46151a84/thread.c#L5394-L5396 * https://github.com/ruby/ruby/blob/a24c607e30b5a74ef53e9a2c1e630dea46151a84/thread.c#L1782_L1786 Thus, we can simplify this overall check by using only `ruby_thread_has_gvp_p()`. --- .../collectors_cpu_and_wall_time_worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c index 297f297a5cb..9410daabaee 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c @@ -265,7 +265,7 @@ static void block_sigprof_signal_handler_from_running_in_current_thread(void) { } static void handle_sampling_signal(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED siginfo_t *_info, DDTRACE_UNUSED void *_ucontext) { - if (!ruby_native_thread_p() || !ruby_thread_has_gvl_p()) { + if (!ruby_thread_has_gvl_p()) { return; // Not safe to enqueue a sample from this thread } From 14a33bea358d78ae238c74583f82d5dc6498b77f Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Mon, 8 Aug 2022 16:44:41 -0700 Subject: [PATCH 0391/2133] Add benchmarks --- .../tracing/benchmark/microbenchmark_spec.rb | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/spec/datadog/tracing/benchmark/microbenchmark_spec.rb b/spec/datadog/tracing/benchmark/microbenchmark_spec.rb index 54e4772ede0..394ad6a6520 100644 --- a/spec/datadog/tracing/benchmark/microbenchmark_spec.rb +++ b/spec/datadog/tracing/benchmark/microbenchmark_spec.rb @@ -101,4 +101,78 @@ def subject(i) end end end + + describe 'single span sampling' do + before do + Datadog.configure do |c| + c.tracing.writer = FauxWriter.new(call_original: false) + end + end + + let(:name) { 'span'.freeze } + let(:tracer) { Datadog::Tracing.send(:tracer) } + let(:steps) { [1, 10, 100] } + + def subject(i) + trace(1, i) + end + + describe 'kept traces' do + include_examples 'benchmark' + + def trace(i, total) + tracer.trace(name) do |_, trace| + trace.keep! if i == 1 + trace(i + 1, total) unless i == total + end + end + end + + describe 'rejected traces' do + include_examples 'benchmark' + + def trace(i, total) + tracer.trace(name) do |_, trace| + trace.reject! if i == 1 + trace(i + 1, total) unless i == total + end + end + + describe 'with spans kept by single span sampling' do + before do + Datadog.configure do |c| + c.tracing.sampling.span_rules = json_rules + end + end + + let(:json_rules) { [rule].to_json } + let(:rule) do + { + name: name, + sample_rate: 1.0, + } + end + + include_examples 'benchmark' + end + + describe 'with spans also rejected by single span sampling' do + before do + Datadog.configure do |c| + c.tracing.sampling.span_rules = json_rules + end + end + + let(:json_rules) { [rule].to_json } + let(:rule) do + { + name: name, + sample_rate: 0.0, + } + end + + include_examples 'benchmark' + end + end + end end From 10e7eb6916516f685254fd248322213a5ea0a4d4 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Tue, 9 Aug 2022 09:50:27 +0100 Subject: [PATCH 0392/2133] Update ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c Co-authored-by: Marco Costa --- .../collectors_cpu_and_wall_time_worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c index 9410daabaee..54cd5417835 100644 --- a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +++ b/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c @@ -25,7 +25,7 @@ // Currently, sampling Ruby threads requires calling Ruby VM APIs that are only safe to call while holding on to the // global VM lock (and are not async-signal safe -- cannot be called from a signal handler). // -// @ivoanjo: As a note, I don't we should think of this constraint as set in stone. Since can reach into the Ruby +// @ivoanjo: As a note, I don't think we should think of this constraint as set in stone. Since can reach into the Ruby // internals, we may be able to figure out a way of overcoming it. But it's definitely going to be hard so for now // we're considering it as a given. // From 35686f67c7f0e78c1d656f794677f1598fcaea9d Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 9 Aug 2022 11:07:43 -0700 Subject: [PATCH 0393/2133] Expand on RateSampler future dev comment --- lib/datadog/tracing/sampling/rate_sampler.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/datadog/tracing/sampling/rate_sampler.rb b/lib/datadog/tracing/sampling/rate_sampler.rb index 1577a20d603..0cb2ed8a93a 100644 --- a/lib/datadog/tracing/sampling/rate_sampler.rb +++ b/lib/datadog/tracing/sampling/rate_sampler.rb @@ -22,7 +22,14 @@ class RateSampler < Sampler # sampled. # # DEV-2.0: Allow for `sample_rate` zero (drop all) to be allowed. This eases - # DEV-2.0: usage for many consumers of the {RateSampler} class. + # DEV-2.0: usage for all internal users of the {RateSampler} class: both + # DEV-2.0: RuleSampler and Single Span Sampling leverage the RateSampler, but want + # DEV-2.0: `sample_rate` zero to mean "drop all". They work around this by hard- + # DEV-2.0: setting the `sample_rate` to zero like so: + # DEV-2.0: ``` + # DEV-2.0: sampler = RateSampler.new + # DEV-2.0: sampler.sample_rate = sample_rate + # DEV-2.0: ``` def initialize(sample_rate = 1.0) super() From 98ef0fa7ebbd9136c76f2f56a5e3cd9bf9d27e1b Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Tue, 9 Aug 2022 13:09:56 -0700 Subject: [PATCH 0394/2133] Action:Upgrade ruby/setup-ruby action version --- .github/workflows/test-head.yaml | 2 +- .github/workflows/test-macos.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-head.yaml b/.github/workflows/test-head.yaml index 2eead883014..4805a20af8b 100644 --- a/.github/workflows/test-head.yaml +++ b/.github/workflows/test-head.yaml @@ -17,7 +17,7 @@ jobs: # want the former only. relax the constraint to allow any version for # head rubies - run: sed -i~ -e '/spec\.required_ruby_version/d' ddtrace.gemspec - - uses: ruby/setup-ruby@77ca66ce2792fb05b8b204a203328e12593a64f3 # v1.72.1 + - uses: ruby/setup-ruby@6148f408d35df04b0189be5e64c1458377b8ae13 # v1.114.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically diff --git a/.github/workflows/test-macos.yaml b/.github/workflows/test-macos.yaml index 231db32f823..ba093d015e8 100644 --- a/.github/workflows/test-macos.yaml +++ b/.github/workflows/test-macos.yaml @@ -18,7 +18,7 @@ jobs: # head rubies - if: ${{ matrix.ruby == 'head' }} run: sed -i~ -e '/spec\.required_ruby_version/d' ddtrace.gemspec - - uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf # v1.86.0 + - uses: ruby/setup-ruby@6148f408d35df04b0189be5e64c1458377b8ae13 # v1.114.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically From 4a765ffd6598f5b07f9fdf57da6ea9efd7ee8e40 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 11 Aug 2022 11:03:01 +0200 Subject: [PATCH 0395/2133] Skip nested rack/sinatra middleware instrumentation --- integration/apps/sinatra2-classic/app/acme.rb | 2 +- .../apps/sinatra2-classic/docker-compose.yml | 3 + integration/apps/sinatra2-modular/Gemfile | 2 + integration/apps/sinatra2-modular/app/acme.rb | 3 +- .../apps/sinatra2-modular/app/basic.rb | 6 +- .../apps/sinatra2-modular/app/parent.rb | 7 + integration/apps/sinatra2-modular/config.ru | 3 +- .../apps/sinatra2-modular/docker-compose.yml | 5 +- .../tracing/contrib/rack/middlewares.rb | 2 + lib/datadog/tracing/contrib/sinatra/env.rb | 9 - lib/datadog/tracing/contrib/sinatra/ext.rb | 1 - .../tracing/contrib/sinatra/patcher.rb | 4 +- lib/datadog/tracing/contrib/sinatra/tracer.rb | 101 ++------ .../contrib/sinatra/tracer_middleware.rb | 22 +- .../tracing/contrib/sinatra/tracer_spec.rb | 232 +++--------------- 15 files changed, 101 insertions(+), 301 deletions(-) create mode 100644 integration/apps/sinatra2-modular/app/parent.rb diff --git a/integration/apps/sinatra2-classic/app/acme.rb b/integration/apps/sinatra2-classic/app/acme.rb index 3e5a8d889ab..4bdf73a9327 100644 --- a/integration/apps/sinatra2-classic/app/acme.rb +++ b/integration/apps/sinatra2-classic/app/acme.rb @@ -1,6 +1,6 @@ require 'sinatra' require 'ddtrace' - +require 'pry' Datadog.configure do |c| c.service = 'acme-sinatra2-classic' c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug') diff --git a/integration/apps/sinatra2-classic/docker-compose.yml b/integration/apps/sinatra2-classic/docker-compose.yml index 4cec8a71488..6008979c547 100644 --- a/integration/apps/sinatra2-classic/docker-compose.yml +++ b/integration/apps/sinatra2-classic/docker-compose.yml @@ -25,8 +25,11 @@ services: # - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a # Enable building the profiling native extension - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + # - DD_TRACE_DEBUG=true expose: - "80" + # ports: + # - "80:80" stdin_open: true tty: true volumes: diff --git a/integration/apps/sinatra2-modular/Gemfile b/integration/apps/sinatra2-modular/Gemfile index 2752a28be96..60de92de37d 100644 --- a/integration/apps/sinatra2-modular/Gemfile +++ b/integration/apps/sinatra2-modular/Gemfile @@ -7,6 +7,8 @@ gem 'unicorn' gem 'sinatra' gem 'sinatra-router' +gem 'request_store' + gem 'dogstatsd-ruby' # Choose correct specs for 'ddtrace' demo environment gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace') diff --git a/integration/apps/sinatra2-modular/app/acme.rb b/integration/apps/sinatra2-modular/app/acme.rb index 68546b99cbf..887c03cf776 100644 --- a/integration/apps/sinatra2-modular/app/acme.rb +++ b/integration/apps/sinatra2-modular/app/acme.rb @@ -1,6 +1,7 @@ require 'sinatra/base' require 'sinatra/router' require 'ddtrace' +require 'pry' # require 'ddtrace/auto_instrument' Datadog.configure do |c| @@ -28,8 +29,6 @@ require_relative './health' class Acme < Sinatra::Base - # register Datadog::Tracing::Contrib::Sinatra::Tracer - # # Use Sinatra App as middleware # use Health # use Basic diff --git a/integration/apps/sinatra2-modular/app/basic.rb b/integration/apps/sinatra2-modular/app/basic.rb index ea6f09af75b..fa4cadc1722 100644 --- a/integration/apps/sinatra2-modular/app/basic.rb +++ b/integration/apps/sinatra2-modular/app/basic.rb @@ -1,9 +1,9 @@ require 'sinatra/base' require 'ddtrace' +require_relative 'parent' -class Basic < Sinatra::Base - # register Datadog::Tracing::Contrib::Sinatra::Tracer - +# Inherit from another app the verified middleware/extension inheritance +class Basic < Parent get '/basic/default' do 200 end diff --git a/integration/apps/sinatra2-modular/app/parent.rb b/integration/apps/sinatra2-modular/app/parent.rb new file mode 100644 index 00000000000..0bf77024f62 --- /dev/null +++ b/integration/apps/sinatra2-modular/app/parent.rb @@ -0,0 +1,7 @@ +require 'sinatra/base' +require 'ddtrace' +require 'request_store' + +class Parent < Sinatra::Base + use ::RequestStore::Middleware +end diff --git a/integration/apps/sinatra2-modular/config.ru b/integration/apps/sinatra2-modular/config.ru index ff2ebeeeceb..e1910d43bc2 100644 --- a/integration/apps/sinatra2-modular/config.ru +++ b/integration/apps/sinatra2-modular/config.ru @@ -1,6 +1,5 @@ require 'ddtrace' require_relative 'app/acme' - -use Datadog::Tracing::Contrib::Rack::TraceMiddleware +require_relative 'app/basic' run Acme diff --git a/integration/apps/sinatra2-modular/docker-compose.yml b/integration/apps/sinatra2-modular/docker-compose.yml index 6385da8d934..bf737177bb0 100644 --- a/integration/apps/sinatra2-modular/docker-compose.yml +++ b/integration/apps/sinatra2-modular/docker-compose.yml @@ -24,9 +24,12 @@ services: # - DD_DEMO_ENV_GEM_GIT_DDTRACE=https://github.com/DataDog/dd-trace-rb.git # - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a # Enable building the profiling native extension - # - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + - DD_DEMO_ENV_BUILD_PROFILING_EXTENSION=true + # - DD_TRACE_DEBUG=true expose: - "80" + # ports: + # - "80:80" stdin_open: true tty: true volumes: diff --git a/lib/datadog/tracing/contrib/rack/middlewares.rb b/lib/datadog/tracing/contrib/rack/middlewares.rb index 80eb5248865..5bed7b44d6e 100644 --- a/lib/datadog/tracing/contrib/rack/middlewares.rb +++ b/lib/datadog/tracing/contrib/rack/middlewares.rb @@ -61,6 +61,8 @@ def call(env) Tracing.continue_trace!(trace_digest) end + return @app.call(env) if previous_request_span + # Create a root Span to keep track of frontend web servers # (i.e. Apache, nginx) if the header is properly set frontend_span = compute_queue_time(env) if previous_request_span.nil? diff --git a/lib/datadog/tracing/contrib/sinatra/env.rb b/lib/datadog/tracing/contrib/sinatra/env.rb index cb54e7ac88e..dc4878963d9 100644 --- a/lib/datadog/tracing/contrib/sinatra/env.rb +++ b/lib/datadog/tracing/contrib/sinatra/env.rb @@ -50,15 +50,6 @@ def middleware_traced?(env) def set_middleware_traced(env, bool) env[Ext::RACK_ENV_MIDDLEWARE_TRACED] = bool end - - # The start time of the top-most Sinatra middleware. - def middleware_start_time(env) - env[Ext::RACK_ENV_MIDDLEWARE_START_TIME] - end - - def set_middleware_start_time(env, time = Time.now.utc) - env[Ext::RACK_ENV_MIDDLEWARE_START_TIME] = time - end end end end diff --git a/lib/datadog/tracing/contrib/sinatra/ext.rb b/lib/datadog/tracing/contrib/sinatra/ext.rb index 9eac22acbca..b179f605af7 100644 --- a/lib/datadog/tracing/contrib/sinatra/ext.rb +++ b/lib/datadog/tracing/contrib/sinatra/ext.rb @@ -11,7 +11,6 @@ module Ext ENV_ANALYTICS_ENABLED = 'DD_TRACE_SINATRA_ANALYTICS_ENABLED'.freeze ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SINATRA_ANALYTICS_SAMPLE_RATE'.freeze RACK_ENV_REQUEST_SPAN = 'datadog.sinatra_request_span'.freeze - RACK_ENV_MIDDLEWARE_START_TIME = 'datadog.sinatra_middleware_start_time'.freeze RACK_ENV_MIDDLEWARE_TRACED = 'datadog.sinatra_middleware_traced'.freeze SPAN_RENDER_TEMPLATE = 'sinatra.render_template'.freeze SPAN_REQUEST = 'sinatra.request'.freeze diff --git a/lib/datadog/tracing/contrib/sinatra/patcher.rb b/lib/datadog/tracing/contrib/sinatra/patcher.rb index 96927a8ebfa..a9bb0bcbc60 100644 --- a/lib/datadog/tracing/contrib/sinatra/patcher.rb +++ b/lib/datadog/tracing/contrib/sinatra/patcher.rb @@ -4,6 +4,7 @@ require_relative '../patcher' require_relative '../rack/middlewares' require_relative 'framework' +require_relative 'tracer' module Datadog module Tracing @@ -50,7 +51,6 @@ def target_version end def patch - require_relative 'tracer' register_tracer patch_default_middlewares @@ -58,7 +58,7 @@ def patch end def register_tracer - ::Sinatra.send(:register, Contrib::Sinatra::Tracer) + ::Sinatra::Base.register(Contrib::Sinatra::Tracer) ::Sinatra::Base.prepend(Sinatra::Tracer::Base) end diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index dfde326dc7a..dbcb14205bd 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -17,68 +17,14 @@ module Sinatra # Datadog::Tracing::Contrib::Sinatra::Tracer is a Sinatra extension which traces # requests. module Tracer - def route(verb, action, *) - # Keep track of the route name when the app is instantiated for an - # incoming request. - condition do - # If the option to prepend script names is enabled, then - # prepend the script name from the request onto the action. - # - # DEV: env['sinatra.route'] already exists with very similar information, - # DEV: but doesn't account for our `resource_script_names` logic. - # - @datadog_route = if Datadog.configuration.tracing[:sinatra][:resource_script_names] - "#{request.script_name}#{action}" - else - action - end - end - - super - end - def self.registered(app) app.use TracerMiddleware, app_instance: app - - app.after do - next unless Tracing.enabled? - - span = Sinatra::Env.datadog_span(env, app) - - # TODO: `route` should *only* be populated if @datadog_route is defined. - # TODO: If @datadog_route is not defined, then this Sinatra app is not responsible - # TODO: for handling this request. - # TODO: - # TODO: This change would be BREAKING for any Sinatra app (classic or modular), - # TODO: as it affects the `resource` value for requests not handled by the Sinatra app. - # TODO: Currently we use "#{method} #{path}" in such aces, but `path` is the raw, - # TODO: high-cardinality HTTP path, and can contain PII. - # TODO: - # TODO: The value we should use as the `resource` when the Sinatra app is not - # TODO: responsible for the request is a tricky subject. - # TODO: The best option is a value that clearly communicates that this app did not - # TODO: handle this request. It's important to keep in mind that an unhandled request - # TODO: by this Sinatra app might still be handled by another Rack middleware (which can - # TODO: be a Sinatra app itself) or it might just 404 if not handled at all. - # TODO: - # TODO: A possible value for `resource` could set a high level description, e.g. - # TODO: `request.request_method`, given we don't have the response object available yet. - route = if defined?(@datadog_route) - @datadog_route - else - # Fallback in case no routes have matched - request.path - end - - span.resource = "#{request.request_method} #{route}" - span.set_tag(Ext::TAG_ROUTE_PATH, route) - end end # Method overrides for Sinatra::Base module Base - MISSING_REQUEST_SPAN_ONLY_ONCE = Core::Utils::OnlyOnce.new - private_constant :MISSING_REQUEST_SPAN_ONLY_ONCE + # MISSING_REQUEST_SPAN_ONLY_ONCE = Core::Utils::OnlyOnce.new + # private_constant :MISSING_REQUEST_SPAN_ONLY_ONCE def render(engine, data, *) return super unless Tracing.enabled? @@ -102,19 +48,33 @@ def render(engine, data, *) # Invoked when a matching route is found. # This method yields directly to user code. - # rubocop:disable Metrics/MethodLength def route_eval configuration = Datadog.configuration.tracing[:sinatra] return super unless Tracing.enabled? + verb, path = env['sinatra.route'].split(' ', 2) + + datadog_route = if Datadog.configuration.tracing[:sinatra][:resource_script_names] + # TODO: This should be the default + "#{verb} #{request.script_name}#{path}" + else + env['sinatra.route'] + end + Tracing.trace( Ext::SPAN_ROUTE, service: configuration[:service_name], span_type: Tracing::Metadata::Ext::HTTP::TYPE_INBOUND, - resource: "#{request.request_method} #{@datadog_route}", + resource: datadog_route, ) do |span, trace| span.set_tag(Ext::TAG_APP_NAME, settings.name || settings.superclass.name) - span.set_tag(Ext::TAG_ROUTE_PATH, @datadog_route) + + if Datadog.configuration.tracing[:sinatra][:resource_script_names] + span.set_tag(Ext::TAG_ROUTE_PATH, request.path) + else + span.set_tag(Ext::TAG_ROUTE_PATH, request.path_info) + end + if request.script_name && !request.script_name.empty? span.set_tag(Ext::TAG_SCRIPT_NAME, request.script_name) end @@ -124,32 +84,15 @@ def route_eval trace.resource = span.resource - sinatra_request_span = - if self.class <= ::Sinatra::Application # Classic style (top-level) application - Sinatra::Env.datadog_span(env, ::Sinatra::Application) - else - Sinatra::Env.datadog_span(env, self.class) - end - if sinatra_request_span - sinatra_request_span.resource = span.resource - else - MISSING_REQUEST_SPAN_ONLY_ONCE.run do - Datadog.logger.warn do - 'Sinatra integration is misconfigured, reported traces will be missing request metadata ' \ - 'such as path and HTTP status code. ' \ - 'Did you forget to add `register Datadog::Tracing::Contrib::Sinatra::Tracer` to your ' \ - '`Sinatra::Base` subclass? ' \ - 'See for more details.' - end - end - end + sinatra_request_span = Sinatra::Env.datadog_span(env, ::Sinatra::Base) + + sinatra_request_span.resource = span.resource Contrib::Analytics.set_measured(span) super end end - # rubocop:enable Metrics/MethodLength end end end diff --git a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb index 868145b5851..f4852571ae5 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb @@ -28,6 +28,9 @@ def call(env) original_trace = Propagation::HTTP.extract(env) Tracing.continue_trace!(original_trace) end + prev_span = Sinatra::Env.datadog_span(env, @app_instance) + + return @app.call(env) if prev_span Tracing.trace( Ext::SPAN_REQUEST, @@ -51,14 +54,20 @@ def call(env) span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST) request = ::Sinatra::Request.new(env) + span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_URL, request.path) span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD, request.request_method) + + if Datadog.configuration.tracing[:sinatra][:resource_script_names] + span.set_tag(Ext::TAG_ROUTE_PATH, request.path) + else + span.set_tag(Ext::TAG_ROUTE_PATH, request.path_info) + end + if request.script_name && !request.script_name.empty? span.set_tag(Ext::TAG_SCRIPT_NAME, request.script_name) end - span.set_tag(Ext::TAG_APP_NAME, @app_instance.settings.name) - # If this app handled the request, then Contrib::Sinatra::Tracer OR Contrib::Sinatra::Base set the # resource; if no resource was set, let's use a fallback span.resource = env['REQUEST_METHOD'] if span.resource.nil? @@ -79,7 +88,10 @@ def call(env) end if (headers = response[1]) - Sinatra::Headers.response_header_tags(headers, configuration[:headers][:response]).each do |name, value| + Sinatra::Headers.response_header_tags( + headers, + configuration[:headers][:response] + ).each do |name, value| span.set_tag(name, value) if span.get_tag(name).nil? end end @@ -111,10 +123,6 @@ def analytics_sample_rate def configuration Datadog.configuration.tracing[:sinatra] end - - def header_to_rack_header(name) - "HTTP_#{name.to_s.upcase.gsub(/[-\s]/, '_')}" - end end end end diff --git a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb index 6efe346568a..68120b03cf3 100644 --- a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb @@ -52,18 +52,6 @@ erb :msg, locals: { msg: 'hello' } end - get '/erb_manual_injection' do - headers['Cache-Control'] = 'max-age=0' - - erb :msg_manual_injection, locals: { msg: 'hello' } - end - - get '/erb_manual_injection_no_env' do - headers['Cache-Control'] = 'max-age=0' - - erb :msg_manual_injection_no_env, locals: { msg: 'hello' } - end - get '/erb_literal' do erb '<%= msg %>', locals: { msg: 'hello' } end @@ -76,27 +64,9 @@ let(:app) { sinatra_app } - let(:sorted_spans) do - chain = lambda do |start| - loop.with_object([start]) do |_, o| - # root reached (default) - break o if o.last.parent_id == 0 - - parent = spans.find { |span| span.span_id == o.last.parent_id } - - # root reached (distributed tracing) - break o if parent.nil? - - o << parent - end - end - sort = ->(list) { list.sort_by { |e| chain.call(e).count } } - sort.call(spans) - end - - let(:span) { sorted_spans.reverse.find { |x| x.name == Datadog::Tracing::Contrib::Sinatra::Ext::SPAN_REQUEST } } - let(:route_span) { sorted_spans.find { |x| x.name == Datadog::Tracing::Contrib::Sinatra::Ext::SPAN_ROUTE } } - let(:rack_span) { sorted_spans.reverse.find { |x| x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } } + let(:span) { spans.find { |x| x.name == Datadog::Tracing::Contrib::Sinatra::Ext::SPAN_REQUEST } } + let(:route_span) { spans.find { |x| x.name == Datadog::Tracing::Contrib::Sinatra::Ext::SPAN_ROUTE } } + let(:rack_span) { spans.find { |x| x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } } before do Datadog.configure do |c| @@ -112,28 +82,20 @@ end shared_examples 'sinatra examples' do |opts = {}| - let(:nested_span_count) { defined?(mount_nested_app) && mount_nested_app ? 2 : 0 } - context 'when configured' do context 'with default settings' do context 'and a simple request is made' do subject(:response) { get url } - # let(:top_span) { defined?(super) ? super() : rack_span } - - context 'on matching app' do - before { skip if opts[:matching_app] == false } + it do + is_expected.to be_ok - let(:route_parent) { defined?(mount_nested_app) && mount_nested_app ? nested_span : span } + expect(trace.resource).to eq(resource) + expect(rack_span.resource).to eq(resource) - it do - is_expected.to be_ok + expect(span).to be_request_span parent: rack_span, http_tags: true - expect(trace.resource).to eq('GET /') - expect(span).to be_request_span parent: rack_span, http_tags: true - expect(route_span).to be_request_span parent: route_parent - expect(rack_span.resource).to eq('GET /') - end + expect(route_span).to be_route_span parent: span, app_name: opts[:app_name] end it_behaves_like 'analytics for integration', ignore_global_flag: false do @@ -161,6 +123,7 @@ it do is_expected.to be_ok + expect(span.resource).to eq('GET /') expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/') end @@ -169,38 +132,13 @@ context 'and a request to a wildcard route is made' do subject(:response) { get '/wildcard/1/2/3' } - let(:matching_app?) { span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME) == top_app_name } - context 'with matching app' do - before do - subject - skip unless matching_app? - end - it do - is_expected.to be_ok + expect(response).to be_ok expect(span.resource).to eq('GET /wildcard/*') expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/wildcard/1/2/3') - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq('/wildcard/*') - end - end - - context 'with non-matching app' do - before do - subject - skip if matching_app? - end - - # TODO: replace with suggested solution below (or other alternative) - it '[TODO:legacy] sets high-cardinality path as resource for non-matching app' do - is_expected.to be_ok - expect(span.resource).to eq('GET /wildcard/1/2/3') - end - - xit '[TODO:BREAKING:suggested] sets resource for non-matching app' do - is_expected.to be_ok - expect(span.resource).to eq('GET') + # expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq('/wildcard/*') end end end @@ -212,7 +150,7 @@ let(:request_span) { spans.find { |s| route_span.parent_id == s.span_id } } let(:route_span) { spans.find { |s| template_parent_span.parent_id == s.span_id } } let(:template_parent_span) { spans.find { |s| template_child_span.parent_id == s.span_id } } - let(:template_child_span) { sorted_spans.find { |s| s.get_tag('sinatra.template_name') == 'layout' } } + let(:template_child_span) { spans.find { |s| s.get_tag('sinatra.template_name') == 'layout' } } before do expect(response).to be_ok @@ -263,13 +201,13 @@ context 'and a request to a literal template route is made' do subject(:response) { get '/erb_literal' } - let(:rack_span) { sorted_spans[0] } - let(:template_parent_span) { sorted_spans[-2] } - let(:template_child_span) { sorted_spans[-1] } + let(:rack_span) { spans.find { |x| x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } } + let(:template_parent_span) { spans.find { |s| template_child_span.parent_id == s.span_id } } + let(:template_child_span) { spans.find { |s| s.get_tag('sinatra.template_name') == 'layout' } } before do expect(response).to be_ok - expect(spans).to have(5 + nested_span_count).items + expect(spans).to have(5).items end describe 'the sinatra.request span' do @@ -329,7 +267,7 @@ it do is_expected.to be_server_error - expect(spans).to have(3 + nested_span_count).items + expect(spans).to have(3).items expect(span).to_not have_error_type expect(span).to_not have_error_message expect(span.status).to eq(1) @@ -341,7 +279,7 @@ it do is_expected.to be_server_error - expect(spans).to have(3 + nested_span_count).items + expect(spans).to have(3).items expect(span).to have_error_type('RuntimeError') expect(span).to have_error_message('test error') expect(span.status).to eq(1) @@ -354,16 +292,17 @@ it do is_expected.to be_not_found expect(trace).to_not be nil - expect(spans).to have(2 + nested_span_count).items + expect(spans).to have(2).items - expect(trace.resource).to eq('GET /not_a_route') + expect(trace.resource).to eq('GET') expect(span.service).to eq(tracer.default_service) - expect(span.resource).to eq('GET /not_a_route') + expect(span.resource).to eq('GET') expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_METHOD)).to eq('GET') expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/not_a_route') - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME)).to eq(app_name) + expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq('/not_a_route') + expect(span.span_type).to eq(Datadog::Tracing::Metadata::Ext::HTTP::TYPE_INBOUND) expect(span).to_not have_error expect(span.parent_id).to be(rack_span.span_id) @@ -372,7 +311,7 @@ expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)) .to eq('request') - expect(rack_span.resource).to eq('GET /not_a_route') + expect(rack_span.resource).to eq('GET') end end @@ -515,20 +454,14 @@ end end - let(:app_name) { 'Sinatra::Application' } - let(:top_app_name) { app_name } - - include_examples 'sinatra examples' + include_examples 'sinatra examples', app_name: 'Sinatra::Application' end context 'with modular app' do let(:sinatra_app) do - mount_nested_app = self.mount_nested_app stub_const( 'NestedApp', Class.new(Sinatra::Base) do - register Datadog::Tracing::Contrib::Sinatra::Tracer - get '/nested' do headers['X-Request-ID'] = 'test id' 'nested ok' @@ -540,139 +473,50 @@ stub_const( 'App', Class.new(Sinatra::Base) do - register Datadog::Tracing::Contrib::Sinatra::Tracer - use NestedApp if mount_nested_app + use NestedApp instance_exec(&sinatra_routes) end ) end - let(:app_name) { top_app_name } - let(:top_app_name) { 'App' } - let(:mount_nested_app) { false } - - include_examples 'sinatra examples' - context 'with nested app' do - let(:mount_nested_app) { true } - let(:top_span) do - spans.find do |x| - x.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME) == top_app_name - end + let(:span) do + spans.find { |x| x.name == Datadog::Tracing::Contrib::Sinatra::Ext::SPAN_REQUEST } end - let(:top_rack_span) do - spans.find do |x| - x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST && x.span_id == top_span.parent_id - end - end - let(:nested_span) do - spans.find do |x| - x.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME) == nested_app_name - end - end - let(:nested_rack_span) do - spans.find do |x| - x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST && x.span_id == nested_span.parent_id - end + + let(:rack_span) do + spans.find { |x| x.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST } end - let(:nested_app_name) { 'NestedApp' } context 'making request to top level app' do - let(:span) { top_span } - let(:rack_span) { top_rack_span } - - include_examples 'sinatra examples' + include_examples 'sinatra examples', app_name: 'App' include_examples 'header tags' include_examples 'distributed tracing' end context 'making request to nested app' do - let(:app_name) { nested_app_name } let(:url) { '/nested' } + # TODO: change description context 'asserting the parent span' do - let(:app_name) { top_app_name } - let(:span) { top_span } - let(:rack_span) { top_rack_span } - - include_examples 'sinatra examples', matching_app: false + include_examples 'sinatra examples', app_name: 'NestedApp' include_examples 'header tags' include_examples 'distributed tracing' end - - context 'matching the nested span' do - let(:span) { nested_span } - let(:rack_span) { nested_rack_span } - - context 'with rack' do - it 'creates spans for intermediate Sinatra apps' do - is_expected.to be_ok - expect(trace).to_not be nil - expect(spans).to have(5).items - - expect(trace.resource).to eq(resource) - - expect(top_span).to be_request_span resource: 'GET', - app_name: top_app_name, - matching_app: false, - parent: top_rack_span - expect(top_rack_span).not_to be_nil - expect(top_rack_span).to be_root_span - expect(top_rack_span.resource).to eq('GET') - expect(span).to be_request_span parent: nested_rack_span - expect(nested_rack_span).not_to be_nil - expect(nested_rack_span.parent_id).to eq(top_span.span_id) - expect(route_span).to be_route_span parent: span - expect(nested_rack_span.resource).to eq(resource) - end - end - end - end - end - - context 'when modular app does not register the Datadog::Tracing::Contrib::Sinatra::Tracer middleware' do - include_context 'tracer logging' - - let(:sinatra_app) do - sinatra_routes = self.sinatra_routes - stub_const( - 'App', - Class.new(Sinatra::Base) do - instance_exec(&sinatra_routes) - end - ) - end - - subject(:response) { get url } - - before do - Datadog::Tracing::Contrib::Sinatra::Tracer::Base - .const_get('MISSING_REQUEST_SPAN_ONLY_ONCE').send(:reset_ran_once_state_for_tests) - end - - it { is_expected.to be_ok } - - it 'logs a warning' do - # NOTE: We actually need to check that the request finished ok, as sinatra may otherwise "swallow" an RSpec - # exception and thus the test will appear to pass because the RSpec exception doesn't propagate out - is_expected.to be_ok - - expect(log_buffer.string).to match(/WARN.*Sinatra integration is misconfigured/) end end end RSpec::Matchers.define :be_request_span do |opts = {}| match(notify_expectation_failures: true) do |span| - app_name = opts[:app_name] || self.app_name + # app_name = opts[:app_name] || self.app_name expect(span.service).to eq(tracer.default_service) expect(span.resource).to eq(opts[:resource] || resource) expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_METHOD)).to eq(http_method) if opts[:http_tags] expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq(url) if opts[:http_tags] expect(span.get_tag('http.response.headers.content-type')).to eq('text/html;charset=utf-8') if opts[:http_tags] - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME)).to eq(app_name) - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq(url) if app_name == self.app_name + # expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq(url) if app_name == self.app_name expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_SCRIPT_NAME)).to be_nil expect(span.span_type).to eq(Datadog::Tracing::Metadata::Ext::HTTP::TYPE_INBOUND) @@ -702,7 +546,7 @@ match(notify_expectation_failures: true) do |span| expect(span.service).to eq(tracer.default_service) expect(span.resource).to eq(resource) - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME)).to eq(app_name) + expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_APP_NAME)).to eq(opts[:app_name]) expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq(url) expect(span.span_type).to eq(Datadog::Tracing::Metadata::Ext::HTTP::TYPE_INBOUND) expect(span).to_not have_error From 4d57dac4df0c13abbe52fe682dc6c795e1c40c79 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 12 Aug 2022 10:20:28 +0200 Subject: [PATCH 0396/2133] Refactor --- integration/apps/sinatra2-modular/config.ru | 1 - lib/datadog/tracing/contrib/sinatra/env.rb | 21 ++++--------------- lib/datadog/tracing/contrib/sinatra/ext.rb | 3 +-- lib/datadog/tracing/contrib/sinatra/tracer.rb | 2 +- .../contrib/sinatra/tracer_middleware.rb | 5 ++--- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/integration/apps/sinatra2-modular/config.ru b/integration/apps/sinatra2-modular/config.ru index e1910d43bc2..f64a4d13059 100644 --- a/integration/apps/sinatra2-modular/config.ru +++ b/integration/apps/sinatra2-modular/config.ru @@ -1,5 +1,4 @@ require 'ddtrace' require_relative 'app/acme' -require_relative 'app/basic' run Acme diff --git a/lib/datadog/tracing/contrib/sinatra/env.rb b/lib/datadog/tracing/contrib/sinatra/env.rb index dc4878963d9..353d16233ce 100644 --- a/lib/datadog/tracing/contrib/sinatra/env.rb +++ b/lib/datadog/tracing/contrib/sinatra/env.rb @@ -13,14 +13,12 @@ module Sinatra module Env module_function - def datadog_span(env, app) - request_span = env[Ext::RACK_ENV_REQUEST_SPAN] - request_span && request_span[app] + def datadog_span(env) + env[Ext::RACK_ENV_SINATRA_REQUEST_SPAN] end - def set_datadog_span(env, app, span) - hash = (env[Ext::RACK_ENV_REQUEST_SPAN] ||= {}) - hash[app] = span + def set_datadog_span(env, span) + env[Ext::RACK_ENV_SINATRA_REQUEST_SPAN] = span end def request_header_tags(env, headers) @@ -39,17 +37,6 @@ def request_header_tags(env, headers) def header_to_rack_header(name) "HTTP_#{name.to_s.upcase.gsub(/[-\s]/, '_')}" end - - # Was a Sinatra already traced in this request? - # We don't want to create spans for intermediate Sinatra - # middlewares that don't match the request at hand. - def middleware_traced?(env) - env[Ext::RACK_ENV_MIDDLEWARE_TRACED] - end - - def set_middleware_traced(env, bool) - env[Ext::RACK_ENV_MIDDLEWARE_TRACED] = bool - end end end end diff --git a/lib/datadog/tracing/contrib/sinatra/ext.rb b/lib/datadog/tracing/contrib/sinatra/ext.rb index b179f605af7..bf5d2b6f518 100644 --- a/lib/datadog/tracing/contrib/sinatra/ext.rb +++ b/lib/datadog/tracing/contrib/sinatra/ext.rb @@ -10,8 +10,7 @@ module Ext ENV_ENABLED = 'DD_TRACE_SINATRA_ENABLED'.freeze ENV_ANALYTICS_ENABLED = 'DD_TRACE_SINATRA_ANALYTICS_ENABLED'.freeze ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SINATRA_ANALYTICS_SAMPLE_RATE'.freeze - RACK_ENV_REQUEST_SPAN = 'datadog.sinatra_request_span'.freeze - RACK_ENV_MIDDLEWARE_TRACED = 'datadog.sinatra_middleware_traced'.freeze + RACK_ENV_SINATRA_REQUEST_SPAN = 'datadog.sinatra_request_span'.freeze SPAN_RENDER_TEMPLATE = 'sinatra.render_template'.freeze SPAN_REQUEST = 'sinatra.request'.freeze SPAN_ROUTE = 'sinatra.route'.freeze diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index dbcb14205bd..d924058758d 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -84,7 +84,7 @@ def route_eval trace.resource = span.resource - sinatra_request_span = Sinatra::Env.datadog_span(env, ::Sinatra::Base) + sinatra_request_span = Sinatra::Env.datadog_span(env) sinatra_request_span.resource = span.resource diff --git a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb index f4852571ae5..5ee5cc6d677 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb @@ -28,9 +28,8 @@ def call(env) original_trace = Propagation::HTTP.extract(env) Tracing.continue_trace!(original_trace) end - prev_span = Sinatra::Env.datadog_span(env, @app_instance) - return @app.call(env) if prev_span + return @app.call(env) if Sinatra::Env.datadog_span(env) Tracing.trace( Ext::SPAN_REQUEST, @@ -42,7 +41,7 @@ def call(env) # the nil signals that there's no good one yet and is also seen by profiler, when sampling the resource span.resource = nil - Sinatra::Env.set_datadog_span(env, @app_instance, span) + Sinatra::Env.set_datadog_span(env, span) response = @app.call(env) ensure From 1d88b01afb6524a85c4db52f22eeebfb8476c5f5 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 12 Aug 2022 10:44:12 +0200 Subject: [PATCH 0397/2133] Remove unuse comment --- lib/datadog/tracing/contrib/sinatra/tracer.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index d924058758d..7642f30e135 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -23,9 +23,6 @@ def self.registered(app) # Method overrides for Sinatra::Base module Base - # MISSING_REQUEST_SPAN_ONLY_ONCE = Core::Utils::OnlyOnce.new - # private_constant :MISSING_REQUEST_SPAN_ONLY_ONCE - def render(engine, data, *) return super unless Tracing.enabled? From 504c0b1ac4b09db9eea47ef1af06679f42a12c0c Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 12 Aug 2022 12:48:55 +0200 Subject: [PATCH 0398/2133] Skip sinatra.request route_path is none app matched --- lib/datadog/tracing/contrib/sinatra/env.rb | 11 +++++++++++ lib/datadog/tracing/contrib/sinatra/tracer.rb | 18 +++--------------- .../contrib/sinatra/tracer_middleware.rb | 8 +++----- .../tracing/contrib/sinatra/multi_app_spec.rb | 1 + .../tracing/contrib/sinatra/tracer_spec.rb | 15 +++++++-------- 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/lib/datadog/tracing/contrib/sinatra/env.rb b/lib/datadog/tracing/contrib/sinatra/env.rb index 353d16233ce..d4ae19f666d 100644 --- a/lib/datadog/tracing/contrib/sinatra/env.rb +++ b/lib/datadog/tracing/contrib/sinatra/env.rb @@ -37,6 +37,17 @@ def request_header_tags(env, headers) def header_to_rack_header(name) "HTTP_#{name.to_s.upcase.gsub(/[-\s]/, '_')}" end + + def route_path(env, use_script_names: Datadog.configuration.tracing[:sinatra][:resource_script_names]) + return unless env['sinatra.route'] + + _, path = env['sinatra.route'].split(' ', 2) + if use_script_names + env[::Rack::SCRIPT_NAME].to_s + path + else + path + end + end end end end diff --git a/lib/datadog/tracing/contrib/sinatra/tracer.rb b/lib/datadog/tracing/contrib/sinatra/tracer.rb index 7642f30e135..b22b134db72 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer.rb @@ -49,28 +49,16 @@ def route_eval configuration = Datadog.configuration.tracing[:sinatra] return super unless Tracing.enabled? - verb, path = env['sinatra.route'].split(' ', 2) - - datadog_route = if Datadog.configuration.tracing[:sinatra][:resource_script_names] - # TODO: This should be the default - "#{verb} #{request.script_name}#{path}" - else - env['sinatra.route'] - end + datadog_route = Sinatra::Env.route_path(env) Tracing.trace( Ext::SPAN_ROUTE, service: configuration[:service_name], span_type: Tracing::Metadata::Ext::HTTP::TYPE_INBOUND, - resource: datadog_route, + resource: "#{request.request_method} #{datadog_route}", ) do |span, trace| span.set_tag(Ext::TAG_APP_NAME, settings.name || settings.superclass.name) - - if Datadog.configuration.tracing[:sinatra][:resource_script_names] - span.set_tag(Ext::TAG_ROUTE_PATH, request.path) - else - span.set_tag(Ext::TAG_ROUTE_PATH, request.path_info) - end + span.set_tag(Ext::TAG_ROUTE_PATH, datadog_route) if request.script_name && !request.script_name.empty? span.set_tag(Ext::TAG_SCRIPT_NAME, request.script_name) diff --git a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb index 5ee5cc6d677..aa59f48d30f 100644 --- a/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +++ b/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb @@ -57,11 +57,9 @@ def call(env) span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_URL, request.path) span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD, request.request_method) - if Datadog.configuration.tracing[:sinatra][:resource_script_names] - span.set_tag(Ext::TAG_ROUTE_PATH, request.path) - else - span.set_tag(Ext::TAG_ROUTE_PATH, request.path_info) - end + datadog_route = Sinatra::Env.route_path(env) + + span.set_tag(Ext::TAG_ROUTE_PATH, datadog_route) if datadog_route if request.script_name && !request.script_name.empty? span.set_tag(Ext::TAG_SCRIPT_NAME, request.script_name) diff --git a/spec/datadog/tracing/contrib/sinatra/multi_app_spec.rb b/spec/datadog/tracing/contrib/sinatra/multi_app_spec.rb index e6067ae822b..ab214329a75 100644 --- a/spec/datadog/tracing/contrib/sinatra/multi_app_spec.rb +++ b/spec/datadog/tracing/contrib/sinatra/multi_app_spec.rb @@ -137,6 +137,7 @@ it do is_expected.to be_ok + expect(spans).to have(3).items spans.each do |span| if span.name == Datadog::Tracing::Contrib::Rack::Ext::SPAN_REQUEST diff --git a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb index 68120b03cf3..c1cca14c1be 100644 --- a/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb +++ b/spec/datadog/tracing/contrib/sinatra/tracer_spec.rb @@ -93,7 +93,7 @@ expect(trace.resource).to eq(resource) expect(rack_span.resource).to eq(resource) - expect(span).to be_request_span parent: rack_span, http_tags: true + expect(span).to be_request_span parent: rack_span expect(route_span).to be_route_span parent: span, app_name: opts[:app_name] end @@ -301,7 +301,7 @@ expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_METHOD)).to eq('GET') expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq('/not_a_route') - expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq('/not_a_route') + expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to be_nil expect(span.span_type).to eq(Datadog::Tracing::Metadata::Ext::HTTP::TYPE_INBOUND) expect(span).to_not have_error @@ -510,13 +510,12 @@ RSpec::Matchers.define :be_request_span do |opts = {}| match(notify_expectation_failures: true) do |span| - # app_name = opts[:app_name] || self.app_name expect(span.service).to eq(tracer.default_service) - expect(span.resource).to eq(opts[:resource] || resource) - expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_METHOD)).to eq(http_method) if opts[:http_tags] - expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq(url) if opts[:http_tags] - expect(span.get_tag('http.response.headers.content-type')).to eq('text/html;charset=utf-8') if opts[:http_tags] - # expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq(url) if app_name == self.app_name + expect(span.resource).to eq(resource) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_METHOD)).to eq(http_method) + expect(span.get_tag(Datadog::Tracing::Metadata::Ext::HTTP::TAG_URL)).to eq(url) + expect(span.get_tag('http.response.headers.content-type')).to eq('text/html;charset=utf-8') + expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_ROUTE_PATH)).to eq(url) expect(span.get_tag(Datadog::Tracing::Contrib::Sinatra::Ext::TAG_SCRIPT_NAME)).to be_nil expect(span.span_type).to eq(Datadog::Tracing::Metadata::Ext::HTTP::TYPE_INBOUND) From 6ec77d6420c1b4f1bfb544d426c82751848da744 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 12 Aug 2022 13:15:13 +0200 Subject: [PATCH 0399/2133] Fix loading tracer --- lib/datadog/tracing/contrib/sinatra/patcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/contrib/sinatra/patcher.rb b/lib/datadog/tracing/contrib/sinatra/patcher.rb index a9bb0bcbc60..559f4c1b200 100644 --- a/lib/datadog/tracing/contrib/sinatra/patcher.rb +++ b/lib/datadog/tracing/contrib/sinatra/patcher.rb @@ -4,7 +4,6 @@ require_relative '../patcher' require_relative '../rack/middlewares' require_relative 'framework' -require_relative 'tracer' module Datadog module Tracing @@ -51,6 +50,7 @@ def target_version end def patch + require_relative 'tracer' register_tracer patch_default_middlewares From 25fd552be875eff8eb45fee952b38641075ac6ad Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Fri, 12 Aug 2022 14:05:45 +0200 Subject: [PATCH 0400/2133] Change documentation --- docs/GettingStarted.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 6825ac30e08..2679705de03 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1908,7 +1908,7 @@ end The Sinatra integration traces requests and template rendering. -To start using the tracing client, make sure you import `ddtrace` and `use :sinatra` after either `sinatra` or `sinatra/base`, and before you define your application/routes: +To start using the tracing client, make sure you import `ddtrace` and `instrument :sinatra` after either `sinatra` or `sinatra/base`, and before you define your application/routes: #### Classic application @@ -1936,16 +1936,12 @@ Datadog.configure do |c| end class NestedApp < Sinatra::Base - register Datadog::Tracing::Contrib::Sinatra::Tracer - get '/nested' do 'Hello from nested app!' end end class App < Sinatra::Base - register Datadog::Tracing::Contrib::Sinatra::Tracer - use NestedApp get '/' do @@ -1954,8 +1950,6 @@ class App < Sinatra::Base end ``` -Ensure you register `Datadog::Tracing::Contrib::Sinatra::Tracer` as a middleware before you mount your nested applications. - #### Instrumentation options `options` are the following keyword arguments: From 6b69c6b85e6f742244dccb4c558d268b50e7af14 Mon Sep 17 00:00:00 2001 From: Evan Zacks Date: Fri, 12 Aug 2022 13:22:50 -0700 Subject: [PATCH 0401/2133] fix namespace typos in docs Datadog::SpanOperation -> Datadog::Tracing::SpanOperation Datadog::TraceOperation -> Datadog::Tracing::TraceOperation --- docs/GettingStarted.md | 2 +- docs/UpgradeGuide.md | 4 ++-- spec/datadog/tracing/trace_operation_spec.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 6825ac30e08..9beede2e5a8 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -406,7 +406,7 @@ def db_query(start, finish, query) end ``` -Calling `Datadog::Tracing.trace` without a block will cause the function to return a `Datadog::SpanOperation` that is started, but not finished. You can then modify this span however you wish, then close it `finish`. +Calling `Datadog::Tracing.trace` without a block will cause the function to return a `Datadog::Tracing::SpanOperation` that is started, but not finished. You can then modify this span however you wish, then close it `finish`. *You must not leave any unfinished spans.* If any spans are left open when the trace completes, the trace will be discarded. You can [activate debug mode](#tracer-settings) to check for warnings if you suspect this might be happening. diff --git a/docs/UpgradeGuide.md b/docs/UpgradeGuide.md index 3d305771b50..9a63d5643de 100644 --- a/docs/UpgradeGuide.md +++ b/docs/UpgradeGuide.md @@ -363,7 +363,7 @@ Direct usage of `Datadog::Context` has been removed. Previously, it was used to Manual tracing is now done through the [public API](https://www.rubydoc.info/gems/ddtrace/). -Whereas in 0.x, the block would provide a `Datadog::Span` as `span`, in 1.0, the block provides a `Datadog::SpanOperation` as `span` and `Datadog::TraceOperation` as `trace`. +Whereas in 0.x, the block would provide a `Datadog::Span` as `span`, in 1.0, the block provides a `Datadog::Tracing::SpanOperation` as `span` and `Datadog::Tracing::TraceOperation` as `trace`. ```ruby ### Old 0.x ### @@ -723,7 +723,7 @@ end | Tracing API | Removed | `Pipeline.before_flush` | Use `Datadog::Tracing.before_flush` instead. | | Tracing API | Removed | `SpanOperation#context` | Use `Datadog::Tracing.active_trace` instead. | | Tracing API | Removed | `SpanOperation#parent`/`SpanOperation#parent=` | Not supported. | -| Tracing API | Removed | `SpanOperation#sampled` | Use `Datadog::TraceOperation#sampled?` instead. | +| Tracing API | Removed | `SpanOperation#sampled` | Use `Datadog::Tracing::TraceOperation#sampled?` instead. | | Tracing API | Removed | `Tracer#active_correlation.to_log_format` | Use `Datadog::Tracing.log_correlation` instead. | | Tracing API | Removed | `Tracer#active_correlation` | Use `Datadog::Tracing.correlation` instead. | | Tracing API | Removed | `Tracer#active_root_span` | Use `Datadog::Tracing.active_trace` instead. | diff --git a/spec/datadog/tracing/trace_operation_spec.rb b/spec/datadog/tracing/trace_operation_spec.rb index 2fb71306a74..3e575ff71e9 100644 --- a/spec/datadog/tracing/trace_operation_spec.rb +++ b/spec/datadog/tracing/trace_operation_spec.rb @@ -1009,7 +1009,7 @@ it_behaves_like 'a span with default events' end - context 'as Datadog::SpanOperation::Events' do + context 'as Datadog::Tracing::SpanOperation::Events' do let(:events) { Datadog::Tracing::SpanOperation::Events.new } it_behaves_like 'a span with default events' do @@ -1027,7 +1027,7 @@ it_behaves_like 'a span with default events' end - context 'as Datadog::SpanOperation::Events' do + context 'as Datadog::Tracing::SpanOperation::Events' do it_behaves_like 'a span with default events' do let(:on_error) { proc { |*args| callback_spy.call(*args) } } let(:callback_spy) { spy('callback spy') } From f21bfcec57dcdcdb69209786e2e64417554a7ce6 Mon Sep 17 00:00:00 2001 From: TonyCTHsu Date: Tue, 16 Aug 2022 22:58:12 +0200 Subject: [PATCH 0402/2133] Fix CI instrumentation configuration (#2219) * Failing spec * Change `default_configuration` to `new_configuration` --- lib/datadog/ci/contrib/cucumber/integration.rb | 2 +- lib/datadog/ci/contrib/rspec/integration.rb | 2 +- spec/datadog/ci/contrib/cucumber/formatter_spec.rb | 5 ++--- spec/datadog/ci/contrib/rspec/instrumentation_spec.rb | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/datadog/ci/contrib/cucumber/integration.rb b/lib/datadog/ci/contrib/cucumber/integration.rb index 14322eec807..8bf515ab59e 100644 --- a/lib/datadog/ci/contrib/cucumber/integration.rb +++ b/lib/datadog/ci/contrib/cucumber/integration.rb @@ -35,7 +35,7 @@ def auto_instrument? false end - def default_configuration + def new_configuration Configuration::Settings.new end diff --git a/lib/datadog/ci/contrib/rspec/integration.rb b/lib/datadog/ci/contrib/rspec/integration.rb index 5a396cb2d0c..40efd116512 100644 --- a/lib/datadog/ci/contrib/rspec/integration.rb +++ b/lib/datadog/ci/contrib/rspec/integration.rb @@ -36,7 +36,7 @@ def auto_instrument? false end - def default_configuration + def new_configuration Configuration::Settings.new end diff --git a/spec/datadog/ci/contrib/cucumber/formatter_spec.rb b/spec/datadog/ci/contrib/cucumber/formatter_spec.rb index 3eee4b1afe1..91fa09da33b 100644 --- a/spec/datadog/ci/contrib/cucumber/formatter_spec.rb +++ b/spec/datadog/ci/contrib/cucumber/formatter_spec.rb @@ -13,7 +13,6 @@ include_context 'CI mode activated' - let(:configuration_options) { {} } # Cucumber runtime setup let(:existing_runtime) { Cucumber::Runtime.new(runtime_options) } let(:runtime_options) { {} } @@ -27,7 +26,7 @@ before do Datadog.configure do |c| - c.ci.instrument :cucumber, configuration_options + c.ci.instrument :cucumber, service_name: 'jalapenos' end end @@ -47,7 +46,7 @@ def do_execute step_span = spans.find { |s| s.resource == 'datadog' } expect(scenario_span.resource).to eq('cucumber scenario') - expect(scenario_span.service).to eq(Datadog::CI::Contrib::Cucumber::Ext::SERVICE_NAME) + expect(scenario_span.service).to eq('jalapenos') expect(scenario_span.span_type).to eq(Datadog::CI::Ext::AppTypes::TYPE_TEST) expect(scenario_span.name).to eq(Datadog::CI::Contrib::Cucumber::Ext::OPERATION_NAME) expect(step_span.resource).to eq('datadog') diff --git a/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb b/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb index 6e90ae76a5e..aaae17c7a13 100644 --- a/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb +++ b/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb @@ -11,11 +11,9 @@ RSpec.describe 'RSpec hooks' do include_context 'CI mode activated' - let(:configuration_options) { {} } - before do Datadog.configure do |c| - c.ci.instrument :rspec, configuration_options + c.ci.instrument :rspec, service_name: 'lspec' end end @@ -43,6 +41,7 @@ def with_new_rspec_environment expect(span.span_type).to eq(Datadog::CI::Ext::AppTypes::TYPE_TEST) expect(span.name).to eq(Datadog::CI::Contrib::RSpec::Ext::OPERATION_NAME) expect(span.resource).to eq('some test foo') + expect(span.service).to eq('lspec') expect(span.get_tag(Datadog::CI::Ext::Test::TAG_NAME)).to eq('some test foo') expect(span.get_tag(Datadog::CI::Ext::Test::TAG_SUITE)).to eq(spec.file_path) expect(span.get_tag(Datadog::CI::Ext::Test::TAG_SPAN_KIND)).to eq(Datadog::CI::Ext::AppTypes::TYPE_TEST) From a02ec0d21e7442cb115815be68e0c241fbd3fa6e Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 17 Aug 2022 15:22:22 +0200 Subject: [PATCH 0403/2133] Tweak the upgrade guide banner in README/Getting Started to mention 1.x instead of 1.0.0 **What does this PR do?**: Tweak the language of the note we added at the top of the README.md and GettingStarted.md documents to refer to the 1.x series, and not just to 1.0.0. **Motivation**: It seemed a bit weird/confusing to me that the wording was presenting 1.0.0 as if it was the latest release, whereas customers should be on 1.3.0 (or whatever comes after). **How to test the change?**: This does not affect code, so looking at the diff and the GitHub markdown preview is enough. --- README.md | 2 +- docs/GettingStarted.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5fe70bfea3..b7c36dc8ef4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -***Version 1.0.0 has recently been released. Check out our [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#from-0x-to-10) for more details.*** +**We've recently released the 1.x version series. If you're upgrading from a 0.x version, check out our [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#from-0x-to-10).** # Datadog Trace Client diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 6825ac30e08..374b7a40866 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -1,4 +1,4 @@ -***Version 1.0.0 has been released. Check out our [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#from-0x-to-10) for more details.*** +**We've recently released the 1.x version series. If you're upgrading from a 0.x version, check out our [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#from-0x-to-10).** # Datadog Ruby Trace Client From ed28ca452805fb23b2a5539beeda4ed544af8639 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 17 Aug 2022 16:29:34 +0200 Subject: [PATCH 0404/2133] Fix flaky profiling spec The `template` double used in this test was missing the `debug_statistics` method which was used only for debug logging. This caused the following error if debug logging was enabled: ``` $ DD_TRACE_DEBUG=true bundle exec rspec ./spec/datadog/profiling/encoding/profile_spec.rb Failures: 1) Datadog::Profiling::Encoding::Profile::Protobuf.encode returns a pprof-encoded profile Failure/Error: "events: #{event_count} (#{events_sampled}#{template.debug_statistics})" # received unexpected message :debug_statistics with (no args) # ./lib/datadog/profiling/encoding/profile.rb:33:in `block in encode' # ./lib/datadog/core/logger.rb:33:in `block in add' # ./lib/datadog/core/logger.rb:32:in `add' # ./lib/datadog/profiling/encoding/profile.rb:23:in `encode' # ./spec/datadog/profiling/encoding/profile_spec.rb:12:in `block (3 levels) in ' # ./spec/datadog/profiling/encoding/profile_spec.rb:51:in `block (3 levels) in ' ``` By default, the tests run with debug logging disabled, which means this should not be triggered but clearly there are some specs that enable debug logging and forget to reset it, as this issue was triggered in CI () with Ruby 2.4 when running `bundle exec appraisal ruby-2.4.10-core-old rake spec:main` with seed `52138`. To avoid this issue at all, I've just made sure the spec still passes with debug logging enabled. --- spec/datadog/profiling/encoding/profile_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/datadog/profiling/encoding/profile_spec.rb b/spec/datadog/profiling/encoding/profile_spec.rb index d11a09147c5..fa8422390e4 100644 --- a/spec/datadog/profiling/encoding/profile_spec.rb +++ b/spec/datadog/profiling/encoding/profile_spec.rb @@ -23,7 +23,7 @@ let(:events) { double('events') } let(:event_count) { nil } - let(:template) { instance_double(Datadog::Profiling::Pprof::Template) } + let(:template) { instance_double(Datadog::Profiling::Pprof::Template, debug_statistics: 'template_debug_statistics') } let(:profile) { instance_double(Perftools::Profiles::Profile) } let(:payload) { instance_double(Datadog::Profiling::Pprof::Payload) } let(:start_time) { Time.utc(2020) } @@ -45,6 +45,8 @@ .with(start: start_time, finish: finish_time) .and_return(payload) .ordered + + allow(Datadog.logger).to receive(:debug) end it 'returns a pprof-encoded profile' do @@ -54,8 +56,6 @@ describe 'debug logging' do let(:event_count) { 42 } - let(:template) { instance_double(Datadog::Profiling::Pprof::Template, debug_statistics: 'template_debug_statistics') } - it 'debug logs profile information' do expect(Datadog.logger).to receive(:debug) do |&message_block| message = message_block.call From 518aace7932f8684f8a45c70020711efee7e3107 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 18 Aug 2022 10:40:38 +0200 Subject: [PATCH 0405/2133] Add link to public docs about tracer telemetry --- docs/GettingStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 6825ac30e08..b68c84f367b 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -2032,7 +2032,7 @@ end | `tags` | `DD_TAGS` | `nil` | Custom tags in value pairs separated by `,` (e.g. `layer:api,team:intake`) These tags are set on all traces. See [Environment and tags](#environment-and-tags) for more details. | | `time_now_provider` | | `->{ Time.now }` | Changes how time is retrieved. See [Setting the time provider](#Setting the time provider) for more details. | | `version` | `DD_VERSION` | `nil` | Your application version (e.g. `2.5`, `202003181415`, `1.3-alpha`, etc.) This value is set as a tag on all traces. | -| `telemetry.enabled` | `DD_INSTRUMENTATION_TELEMETRY_ENABLED` | `true` | Allows you to opt-out of sending telemetry data to Datadog. | +| `telemetry.enabled` | `DD_INSTRUMENTATION_TELEMETRY_ENABLED` | `true` | Allows you to opt-out of sending telemetry data to Datadog. See [Telemetry collection](https://docs.datadoghq.com/tracing/configure_data_security/#telemetry-collection) for more details. | | **Tracing** | | | | | `tracing.analytics.enabled` | `DD_TRACE_ANALYTICS_ENABLED` | `nil` | Enables or disables trace analytics. See [Sampling](#sampling) for more details. | | `tracing.distributed_tracing.propagation_extract_style` | `DD_PROPAGATION_STYLE_EXTRACT` | `['Datadog','B3','B3 single header']` | Distributed tracing header formats to extract. See [Distributed Tracing](#distributed-tracing) for more details. | From 5d64a7efe8d0c82f919cabcd96bebc748279f1e0 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 18 Aug 2022 11:22:16 +0200 Subject: [PATCH 0406/2133] CI:Test time limit with thread dump report (missing commit) --- spec/spec_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4e726eaf573..fb6ceb8ffdb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -257,10 +257,12 @@ def initialize(*args, &block) backtrace = t.backtrace backtrace = '(Not available)' if backtrace.nil? || backtrace.empty? - warn "#{idx}: #{t} (#{t.class.name})", - 'Thread Backtrace:', - backtrace.map { |l| "\t#{l}" }.join("\n"), - "\n" + msg = "#{idx}: #{t} (#{t.class.name})", + 'Thread Backtrace:', + backtrace.map { |l| "\t#{l}" }.join("\n"), + "\n" + + warn(msg) rescue puts(msg) end Kernel.exit(1) From e77879e704dd540ec5823b19fe730ba47dd7b0f1 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Thu, 18 Aug 2022 12:18:26 +0200 Subject: [PATCH 0407/2133] Revert "Fix sidekiq broken version (#2213)" This reverts commit 79b9138cee3e6cf0832fcbe6ad208f55b3e34e84. --- integration/apps/rack/Gemfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/integration/apps/rack/Gemfile b/integration/apps/rack/Gemfile index 12644c93912..d7278acbab2 100644 --- a/integration/apps/rack/Gemfile +++ b/integration/apps/rack/Gemfile @@ -13,8 +13,7 @@ end if RUBY_VERSION < '2.2' gem 'sidekiq', '< 5' # 5.0.3 checks for older Rubies and breaks, but does not declare it on the gemspec :( else - # `6.5.3` and `6.5.2` contain broken dependency, https://github.com/mperham/sidekiq/issues/5456 - gem 'sidekiq', ['!= 6.5.2', '!= 6.5.3'] + gem 'sidekiq' end gem 'resque' gem 'rake' From 6cf676817a5c070256b89955efbf898918d9ac26 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 18 Aug 2022 14:51:12 +0200 Subject: [PATCH 0408/2133] Fix fallback case found in CI failure --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fb6ceb8ffdb..3e440d9c412 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -255,7 +255,7 @@ def initialize(*args, &block) Thread.list.select { |t| t.alive? && t != Thread.current }.each_with_index.map do |t, idx| backtrace = t.backtrace - backtrace = '(Not available)' if backtrace.nil? || backtrace.empty? + backtrace = ['(Not available)'] if backtrace.nil? || backtrace.empty? msg = "#{idx}: #{t} (#{t.class.name})", 'Thread Backtrace:', From 6adf7f7dab49c684be4bb41b4191908ef133100a Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 19 Aug 2022 15:14:17 +0200 Subject: [PATCH 0409/2133] Bump minimum libdatadog version allowed **What does this PR do?**: Bump the minimum libdatadog version allowed to 0.7.0.1.1 (the latest available version). **Motivation**: "Force" the latest libdatadog version to be used, for customers that are upgrading from an older version of ddtrace to a newer one. **How to test the change?**: Validate that profiling still works fine, and that libdatadog 0.7.0.1.1 is used when installing profiler. --- ddtrace.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace.gemspec b/ddtrace.gemspec index 24d501a1b36..8b867c3bba4 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -67,7 +67,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'libddwaf', '~> 1.3.0.2.0' # Used by profiling (and possibly others in the future) - spec.add_dependency 'libdatadog', '~> 0.7.0.1.0' + spec.add_dependency 'libdatadog', '~> 0.7.0.1.1' spec.extensions = ['ext/ddtrace_profiling_native_extension/extconf.rb', 'ext/ddtrace_profiling_loader/extconf.rb'] end From 64b6eaecf5a8d4fac999a430394dd514e60dce94 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 8 Aug 2022 19:34:15 +0200 Subject: [PATCH 0410/2133] hanami new --- integration/apps/hanami/.env.development | 4 + integration/apps/hanami/.env.test | 4 + integration/apps/hanami/.hanamirc | 3 + integration/apps/hanami/.rspec | 2 + integration/apps/hanami/Gemfile | 30 ++ integration/apps/hanami/README.md | 33 ++ integration/apps/hanami/Rakefile | 9 + .../apps/hanami/apps/acme/application.rb | 313 ++++++++++++++++++ .../apps/hanami/apps/acme/assets/favicon.ico | Bin 0 -> 15086 bytes .../hanami/apps/acme/assets/images/.gitkeep | 0 .../apps/acme/assets/javascripts/.gitkeep | 0 .../apps/acme/assets/stylesheets/.gitkeep | 0 .../apps/hanami/apps/acme/config/routes.rb | 5 + .../hanami/apps/acme/controllers/.gitkeep | 0 .../apps/acme/templates/application.html.erb | 10 + .../apps/acme/views/application_layout.rb | 7 + integration/apps/hanami/config.ru | 3 + integration/apps/hanami/config/boot.rb | 2 + integration/apps/hanami/config/environment.rb | 49 +++ .../apps/hanami/config/initializers/.gitkeep | 0 .../apps/hanami/db/migrations/.gitkeep | 0 integration/apps/hanami/db/schema.sql | 0 integration/apps/hanami/lib/hanami.rb | 2 + .../apps/hanami/lib/hanami/entities/.gitkeep | 0 .../apps/hanami/lib/hanami/mailers/.gitkeep | 0 .../lib/hanami/mailers/templates/.gitkeep | 0 .../hanami/lib/hanami/repositories/.gitkeep | 0 integration/apps/hanami/public/.gitkeep | 0 .../apps/hanami/public/assets/favicon.ico | Bin 0 -> 15086 bytes .../hanami/spec/acme/controllers/.gitkeep | 0 .../apps/hanami/spec/acme/features/.gitkeep | 0 .../acme/views/application_layout_spec.rb | 10 + .../apps/hanami/spec/features_helper.rb | 12 + .../apps/hanami/spec/hanami/entities/.gitkeep | 0 .../apps/hanami/spec/hanami/mailers/.gitkeep | 0 .../hanami/spec/hanami/repositories/.gitkeep | 0 integration/apps/hanami/spec/spec_helper.rb | 103 ++++++ integration/apps/hanami/spec/support/.gitkeep | 0 .../apps/hanami/spec/support/capybara.rb | 8 + 39 files changed, 609 insertions(+) create mode 100644 integration/apps/hanami/.env.development create mode 100644 integration/apps/hanami/.env.test create mode 100644 integration/apps/hanami/.hanamirc create mode 100644 integration/apps/hanami/.rspec create mode 100644 integration/apps/hanami/Gemfile create mode 100644 integration/apps/hanami/README.md create mode 100644 integration/apps/hanami/Rakefile create mode 100644 integration/apps/hanami/apps/acme/application.rb create mode 100644 integration/apps/hanami/apps/acme/assets/favicon.ico create mode 100644 integration/apps/hanami/apps/acme/assets/images/.gitkeep create mode 100644 integration/apps/hanami/apps/acme/assets/javascripts/.gitkeep create mode 100644 integration/apps/hanami/apps/acme/assets/stylesheets/.gitkeep create mode 100644 integration/apps/hanami/apps/acme/config/routes.rb create mode 100644 integration/apps/hanami/apps/acme/controllers/.gitkeep create mode 100644 integration/apps/hanami/apps/acme/templates/application.html.erb create mode 100644 integration/apps/hanami/apps/acme/views/application_layout.rb create mode 100644 integration/apps/hanami/config.ru create mode 100644 integration/apps/hanami/config/boot.rb create mode 100644 integration/apps/hanami/config/environment.rb create mode 100644 integration/apps/hanami/config/initializers/.gitkeep create mode 100644 integration/apps/hanami/db/migrations/.gitkeep create mode 100644 integration/apps/hanami/db/schema.sql create mode 100644 integration/apps/hanami/lib/hanami.rb create mode 100644 integration/apps/hanami/lib/hanami/entities/.gitkeep create mode 100644 integration/apps/hanami/lib/hanami/mailers/.gitkeep create mode 100644 integration/apps/hanami/lib/hanami/mailers/templates/.gitkeep create mode 100644 integration/apps/hanami/lib/hanami/repositories/.gitkeep create mode 100644 integration/apps/hanami/public/.gitkeep create mode 100644 integration/apps/hanami/public/assets/favicon.ico create mode 100644 integration/apps/hanami/spec/acme/controllers/.gitkeep create mode 100644 integration/apps/hanami/spec/acme/features/.gitkeep create mode 100644 integration/apps/hanami/spec/acme/views/application_layout_spec.rb create mode 100644 integration/apps/hanami/spec/features_helper.rb create mode 100644 integration/apps/hanami/spec/hanami/entities/.gitkeep create mode 100644 integration/apps/hanami/spec/hanami/mailers/.gitkeep create mode 100644 integration/apps/hanami/spec/hanami/repositories/.gitkeep create mode 100644 integration/apps/hanami/spec/spec_helper.rb create mode 100644 integration/apps/hanami/spec/support/.gitkeep create mode 100644 integration/apps/hanami/spec/support/capybara.rb diff --git a/integration/apps/hanami/.env.development b/integration/apps/hanami/.env.development new file mode 100644 index 00000000000..f378726064b --- /dev/null +++ b/integration/apps/hanami/.env.development @@ -0,0 +1,4 @@ +# Define ENV variables for development environment +DATABASE_URL="sqlite://db/hanami_development.sqlite" +SERVE_STATIC_ASSETS="true" +ACME_SESSIONS_SECRET="c401c2fa0e3dcc5aeed06f553e6d638ada569eda5ccd383b5b2197993da1f245" diff --git a/integration/apps/hanami/.env.test b/integration/apps/hanami/.env.test new file mode 100644 index 00000000000..6e90e0ebe7c --- /dev/null +++ b/integration/apps/hanami/.env.test @@ -0,0 +1,4 @@ +# Define ENV variables for test environment +DATABASE_URL="sqlite://db/hanami_test.sqlite" +SERVE_STATIC_ASSETS="true" +ACME_SESSIONS_SECRET="506e6296c42c0c708e537c420f9d73cf08176fa639957b351f42b6b0c9988f18" diff --git a/integration/apps/hanami/.hanamirc b/integration/apps/hanami/.hanamirc new file mode 100644 index 00000000000..8b11d07e8a4 --- /dev/null +++ b/integration/apps/hanami/.hanamirc @@ -0,0 +1,3 @@ +project=hanami +test=rspec +template=erb diff --git a/integration/apps/hanami/.rspec b/integration/apps/hanami/.rspec new file mode 100644 index 00000000000..83e16f80447 --- /dev/null +++ b/integration/apps/hanami/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/integration/apps/hanami/Gemfile b/integration/apps/hanami/Gemfile new file mode 100644 index 00000000000..826b77941c5 --- /dev/null +++ b/integration/apps/hanami/Gemfile @@ -0,0 +1,30 @@ +source 'https://rubygems.org' + +gem 'rake' +gem 'hanami', '~> 1.3' +gem 'hanami-model', '~> 1.3' +gem 'dry-container', '~> 0.8.0' + +gem 'sqlite3' +gem 'puma' +gem 'ddtrace' + +group :development do + # Code reloading + # See: https://guides.hanamirb.org/projects/code-reloading + gem 'shotgun', platforms: :ruby + gem 'hanami-webconsole' +end + +group :test, :development do + gem 'dotenv', '~> 2.4' +end + +group :test do + gem 'rspec' + # gem 'capybara' +end + +group :production do + # gem 'puma' +end diff --git a/integration/apps/hanami/README.md b/integration/apps/hanami/README.md new file mode 100644 index 00000000000..51a9ce2886d --- /dev/null +++ b/integration/apps/hanami/README.md @@ -0,0 +1,33 @@ +# Hanami + +Welcome to your new Hanami project! + +## Setup + +How to run tests: + +``` +% bundle exec rake +``` + +How to run the development console: + +``` +% bundle exec hanami console +``` + +How to run the development server: + +``` +% bundle exec hanami server +``` + +How to prepare (create and migrate) DB for `development` and `test` environments: + +``` +% bundle exec hanami db prepare + +% HANAMI_ENV=test bundle exec hanami db prepare +``` + +Explore Hanami [guides](https://guides.hanamirb.org/), [API docs](http://docs.hanamirb.org/1.3.5/), or jump in [chat](http://chat.hanamirb.org) for help. Enjoy! 🌸 diff --git a/integration/apps/hanami/Rakefile b/integration/apps/hanami/Rakefile new file mode 100644 index 00000000000..5000dfa18f7 --- /dev/null +++ b/integration/apps/hanami/Rakefile @@ -0,0 +1,9 @@ +require 'rake' +require 'hanami/rake_tasks' + +begin + require 'rspec/core/rake_task' + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError +end diff --git a/integration/apps/hanami/apps/acme/application.rb b/integration/apps/hanami/apps/acme/application.rb new file mode 100644 index 00000000000..a7301f3d39c --- /dev/null +++ b/integration/apps/hanami/apps/acme/application.rb @@ -0,0 +1,313 @@ +require 'hanami/helpers' +require 'hanami/assets' + +module Acme + class Application < Hanami::Application + configure do + ## + # BASIC + # + + # Define the root path of this application. + # All paths specified in this configuration are relative to path below. + # + root __dir__ + + # Relative load paths where this application will recursively load the + # code. + # + # When you add new directories, remember to add them here. + # + load_paths << [ + 'controllers', + 'views' + ] + + # Handle exceptions with HTTP statuses (true) or don't catch them (false). + # Defaults to true. + # See: http://www.rubydoc.info/gems/hanami-controller/#Exceptions_management + # + # handle_exceptions true + + ## + # HTTP + # + + # Routes definitions for this application + # See: http://www.rubydoc.info/gems/hanami-router#Usage + # + routes 'config/routes' + + # URI scheme used by the routing system to generate absolute URLs + # Defaults to "http" + # + # scheme 'https' + + # URI host used by the routing system to generate absolute URLs + # Defaults to "localhost" + # + # host 'example.org' + + # URI port used by the routing system to generate absolute URLs + # Argument: An object coercible to integer, defaults to 80 if the scheme + # is http and 443 if it's https + # + # This should only be configured if app listens to non-standard ports + # + # port 443 + + # Enable cookies + # Argument: boolean to toggle the feature + # A Hash with options + # + # Options: + # :domain - The domain (String - nil by default, not required) + # :path - Restrict cookies to a relative URI + # (String - nil by default) + # :max_age - Cookies expiration expressed in seconds + # (Integer - nil by default) + # :secure - Restrict cookies to secure connections + # (Boolean - Automatically true when using HTTPS) + # See #scheme and #ssl? + # :httponly - Prevent JavaScript access (Boolean - true by default) + # + # cookies true + # or + # cookies max_age: 300 + + # Enable sessions + # Argument: Symbol the Rack session adapter + # A Hash with options + # + # See: http://www.rubydoc.info/gems/rack/Rack/Session/Cookie + # + # sessions :cookie, secret: ENV['ACME_SESSIONS_SECRET'] + + # Configure Rack middleware for this application + # + # middleware.use Rack::Protection + + # Default format for the requests that don't specify an HTTP_ACCEPT header + # Argument: A symbol representation of a mime type, defaults to :html + # + # default_request_format :html + + # Default format for responses that don't consider the request format + # Argument: A symbol representation of a mime type, defaults to :html + # + # default_response_format :html + + ## + # TEMPLATES + # + + # The layout to be used by all views + # + layout :application # It will load Acme::Views::ApplicationLayout + + # The relative path to templates + # + templates 'templates' + + ## + # ASSETS + # + assets do + # JavaScript compressor + # + # Supported engines: + # + # * :builtin + # * :uglifier + # * :yui + # * :closure + # + # See: https://guides.hanamirb.org/assets/compressors + # + # In order to skip JavaScript compression comment the following line + javascript_compressor :builtin + + # Stylesheet compressor + # + # Supported engines: + # + # * :builtin + # * :yui + # * :sass + # + # See: https://guides.hanamirb.org/assets/compressors + # + # In order to skip stylesheet compression comment the following line + stylesheet_compressor :builtin + + # Specify sources for assets + # + sources << [ + 'assets' + ] + end + + ## + # SECURITY + # + + # X-Frame-Options is a HTTP header supported by modern browsers. + # It determines if a web page can or cannot be included via and + #