From bcee292e296133981e96bce98963cbee5f32a5d3 Mon Sep 17 00:00:00 2001 From: David Elner Date: Mon, 26 Feb 2024 17:16:53 -0500 Subject: [PATCH] Changed: Profiling 'ddtrace' references to 'datadog' (except C code) --- .github/labeler.yml | 2 +- LICENSE-3rdparty.csv | 2 +- Rakefile | 8 +++---- bin/{ddtracerb => ddprofrb} | 2 +- datadog.gemspec | 4 ++-- docs/GettingStarted.md | 2 +- docs/ProfilingDevelopment.md | 2 +- .../.clang-format | 0 .../datadog_profiling_loader.c} | 2 +- .../extconf.rb | 6 ++--- .../.clang-format | 0 .../NativeExtensionDesign.md | 0 .../clock_id.h | 0 .../clock_id_from_pthread.c | 0 .../clock_id_noop.c | 0 .../collectors_cpu_and_wall_time_worker.c | 0 .../collectors_discrete_dynamic_sampler.c | 0 .../collectors_discrete_dynamic_sampler.h | 0 .../collectors_dynamic_sampling_rate.c | 0 .../collectors_dynamic_sampling_rate.h | 0 .../collectors_gc_profiling_helper.c | 0 .../collectors_gc_profiling_helper.h | 0 .../collectors_idle_sampling_helper.c | 0 .../collectors_idle_sampling_helper.h | 0 .../collectors_stack.c | 0 .../collectors_stack.h | 0 .../collectors_thread_context.c | 0 .../collectors_thread_context.h | 0 .../extconf.rb | 22 +++++++++---------- .../heap_recorder.c | 0 .../heap_recorder.h | 0 .../helpers.h | 0 .../http_transport.c | 0 .../libdatadog_helpers.c | 0 .../libdatadog_helpers.h | 0 .../native_extension_helpers.rb | 14 ++++++------ .../private_vm_api_access.c | 0 .../private_vm_api_access.h | 0 .../profiling.c | 0 .../ruby_helpers.c | 0 .../ruby_helpers.h | 0 .../setup_signal_handler.c | 0 .../setup_signal_handler.h | 0 .../stack_recorder.c | 0 .../stack_recorder.h | 0 .../time_helpers.c | 0 .../time_helpers.h | 0 integration/apps/hanami/bin/run | 8 +++---- integration/apps/opentelemetry/bin/run | 2 +- integration/apps/rack/bin/resque | 2 +- integration/apps/rack/bin/run | 10 ++++----- integration/apps/rack/bin/sidekiq | 2 +- integration/apps/rails-five/bin/run | 8 +++---- integration/apps/rails-seven/bin/run | 8 +++---- integration/apps/rails-six/bin/run | 8 +++---- integration/apps/rspec/bin/run | 2 +- integration/apps/sinatra2-classic/bin/run | 8 +++---- integration/apps/sinatra2-modular/bin/run | 8 +++---- lib/datadog/profiling.rb | 2 +- .../profiling/load_native_extension.rb | 10 ++++----- lib/datadog/profiling/native_extension.rb | 2 +- lib/datadog/profiling/tasks/exec.rb | 4 ++-- lib/datadog/profiling/tasks/help.rb | 6 ++--- .../tracing/contrib/faraday/connection.rb | 2 +- .../tracing/contrib/faraday/patcher.rb | 4 ++-- .../tracing/contrib/faraday/rack_builder.rb | 2 +- .../native_extension_helpers_spec.rb | 2 +- spec/datadog/profiling/tasks/exec_spec.rb | 4 ++-- spec/datadog/profiling/tasks/help_spec.rb | 2 +- spec/datadog/profiling_spec.rb | 2 +- .../contrib/faraday/middleware_spec.rb | 2 +- 71 files changed, 88 insertions(+), 88 deletions(-) rename bin/{ddtracerb => ddprofrb} (84%) rename ext/{ddtrace_profiling_loader => datadog_profiling_loader}/.clang-format (100%) rename ext/{ddtrace_profiling_loader/ddtrace_profiling_loader.c => datadog_profiling_loader/datadog_profiling_loader.c} (98%) rename ext/{ddtrace_profiling_loader => datadog_profiling_loader}/extconf.rb (92%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/.clang-format (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/NativeExtensionDesign.md (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/clock_id.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/clock_id_from_pthread.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/clock_id_noop.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_cpu_and_wall_time_worker.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_discrete_dynamic_sampler.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_discrete_dynamic_sampler.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_dynamic_sampling_rate.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_dynamic_sampling_rate.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_gc_profiling_helper.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_gc_profiling_helper.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_idle_sampling_helper.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_idle_sampling_helper.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_stack.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_stack.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_thread_context.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/collectors_thread_context.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/extconf.rb (95%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/heap_recorder.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/heap_recorder.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/helpers.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/http_transport.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/libdatadog_helpers.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/libdatadog_helpers.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/native_extension_helpers.rb (97%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/private_vm_api_access.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/private_vm_api_access.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/profiling.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/ruby_helpers.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/ruby_helpers.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/setup_signal_handler.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/setup_signal_handler.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/stack_recorder.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/stack_recorder.h (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/time_helpers.c (100%) rename ext/{ddtrace_profiling_native_extension => datadog_profiling_native_extension}/time_helpers.h (100%) diff --git a/.github/labeler.yml b/.github/labeler.yml index d00e7658595..0682e28f7bd 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -14,7 +14,7 @@ dev/testing: # Changes to Profiling profiling: - - any: [ '{lib/datadog/profiling/**,ext/ddtrace_profiling_loader/**,ext/ddtrace_profiling_native_extension/**}' ] + - any: [ '{lib/datadog/profiling/**,ext/datadog_profiling_loader/**,ext/datadog_profiling_native_extension/**}' ] # Changes to CI-App ci-app: diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index a4267600c7a..598fa8fb2e0 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -1,6 +1,6 @@ "Component","Origin","License","Copyright" "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." -"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." +"ext/datadog_profiling_native_extension/private_vm_api_access","https://github.com/ruby/ruby","BSD-2-Clause","Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved." "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" "lib/datadog/tracing/contrib/utils/quantization/http.rb","https://github.com/ruby/uri","BSD-2-Clause","Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved." diff --git a/Rakefile b/Rakefile index b265f4afe47..f413a248f04 100644 --- a/Rakefile +++ b/Rakefile @@ -636,12 +636,12 @@ namespace :changelog do end NATIVE_EXTS = [ - Rake::ExtensionTask.new("ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}") do |ext| - ext.ext_dir = 'ext/ddtrace_profiling_native_extension' + Rake::ExtensionTask.new("datadog_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}") do |ext| + ext.ext_dir = 'ext/datadog_profiling_native_extension' end, - Rake::ExtensionTask.new("ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}") do |ext| - ext.ext_dir = 'ext/ddtrace_profiling_loader' + Rake::ExtensionTask.new("datadog_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}") do |ext| + ext.ext_dir = 'ext/datadog_profiling_loader' end ].freeze diff --git a/bin/ddtracerb b/bin/ddprofrb similarity index 84% rename from bin/ddtracerb rename to bin/ddprofrb index aa9e8d2402f..511b33067ec 100755 --- a/bin/ddtracerb +++ b/bin/ddprofrb @@ -10,6 +10,6 @@ when 'exec' when 'help', '--help' Datadog::Profiling::Tasks::Help.new.run else - puts "Command '#{command}' is not valid for ddtrace." + puts "Command '#{command}' is not valid for ddprofrb." Datadog::Profiling::Tasks::Help.new.run end diff --git a/datadog.gemspec b/datadog.gemspec index c561708f81a..a53727d9ec0 100644 --- a/datadog.gemspec +++ b/datadog.gemspec @@ -44,7 +44,7 @@ Gem::Specification.new do |spec| .reject { |fn| fn.end_with?('.so', '.bundle') } # Exclude local profiler binary artifacts .reject { |fn| fn.end_with?('skipped_reason.txt') } # Generated by profiler; should never be distributed - spec.executables = ['ddtracerb'] + spec.executables = ['ddprofrb'] spec.require_paths = ['lib'] # Used to serialize traces to send them to the Datadog Agent. @@ -71,5 +71,5 @@ Gem::Specification.new do |spec| # When updating the version here, please also update the version in `native_extension_helpers.rb` (and yes we have a test for it) spec.add_dependency 'libdatadog', '~> 6.0.0.1.0' - spec.extensions = ['ext/ddtrace_profiling_native_extension/extconf.rb', 'ext/ddtrace_profiling_loader/extconf.rb'] + spec.extensions = ['ext/datadog_profiling_native_extension/extconf.rb', 'ext/datadog_profiling_loader/extconf.rb'] end diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index cc4f19961e8..8b43f4a2efe 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -751,7 +751,7 @@ 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(:datadog, **options) builder.adapter Faraday.default_adapter end diff --git a/docs/ProfilingDevelopment.md b/docs/ProfilingDevelopment.md index 234967e9219..c12c8b80734 100644 --- a/docs/ProfilingDevelopment.md +++ b/docs/ProfilingDevelopment.md @@ -32,7 +32,7 @@ with ongoing tracing information, if any. Relies on the `Collectors::Stack` for ## Initialization -When started via `ddtracerb exec` (together with `DD_PROFILING_ENABLED=true`), initialization goes through the following +When started via `ddprofrb exec` (together with `DD_PROFILING_ENABLED=true`), initialization goes through the following flow: 1. <../lib/datadog/profiling/preload.rb> triggers the creation of the profiler instance by calling the method `Datadog::Profiling.start_if_enabled` diff --git a/ext/ddtrace_profiling_loader/.clang-format b/ext/datadog_profiling_loader/.clang-format similarity index 100% rename from ext/ddtrace_profiling_loader/.clang-format rename to ext/datadog_profiling_loader/.clang-format diff --git a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c b/ext/datadog_profiling_loader/datadog_profiling_loader.c similarity index 98% rename from ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c rename to ext/datadog_profiling_loader/datadog_profiling_loader.c index d49256a44e1..93e2a2232e3 100644 --- a/ext/ddtrace_profiling_loader/ddtrace_profiling_loader.c +++ b/ext/datadog_profiling_loader/datadog_profiling_loader.c @@ -14,7 +14,7 @@ // up other's symbols (`RTLD_DEEPBIND`). // // But Ruby's extension loading mechanism is not configurable -- there's no way to tell it to use different flags when -// calling `dlopen`. To get around this, this file (ddtrace_profiling_loader.c) introduces another extension +// calling `dlopen`. To get around this, this file (datadog_profiling_loader.c) introduces another extension // (profiling loader) which has only a single responsibility: mimic Ruby's extension loading mechanism, but when calling // `dlopen` use a different set of flags. // This idea was shamelessly stolen from @lloeki's work in https://github.com/rubyjs/mini_racer/pull/179, big thanks! diff --git a/ext/ddtrace_profiling_loader/extconf.rb b/ext/datadog_profiling_loader/extconf.rb similarity index 92% rename from ext/ddtrace_profiling_loader/extconf.rb rename to ext/datadog_profiling_loader/extconf.rb index c94f2433924..469df2711e4 100644 --- a/ext/ddtrace_profiling_loader/extconf.rb +++ b/ext/datadog_profiling_loader/extconf.rb @@ -3,7 +3,7 @@ if RUBY_ENGINE != 'ruby' || Gem.win_platform? $stderr.puts( - 'WARN: Skipping build of ddtrace profiling loader. See ddtrace profiling native extension note for details.' + 'WARN: Skipping build of datadog profiling loader. See datadog profiling native extension note for details.' ) File.write('Makefile', 'all install clean: # dummy makefile that does nothing') @@ -28,7 +28,7 @@ def add_compiler_flag(flag) # Older gcc releases may not default to C99 and we need to ask for this. This is also used: # * by upstream Ruby -- search for gnu99 in the codebase -# * by msgpack, another ddtrace dependency +# * by msgpack, another datadog dependency # (https://github.com/msgpack/msgpack-ruby/blob/18ce08f6d612fe973843c366ac9a0b74c4e50599/ext/msgpack/extconf.rb#L8) add_compiler_flag '-std=gnu99' @@ -64,7 +64,7 @@ def add_compiler_flag(flag) # 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. # When requiring, we need to use the exact same string, including the version and the platform. -EXTENSION_NAME = "ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze +EXTENSION_NAME = "datadog_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze create_makefile(EXTENSION_NAME) diff --git a/ext/ddtrace_profiling_native_extension/.clang-format b/ext/datadog_profiling_native_extension/.clang-format similarity index 100% rename from ext/ddtrace_profiling_native_extension/.clang-format rename to ext/datadog_profiling_native_extension/.clang-format diff --git a/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md b/ext/datadog_profiling_native_extension/NativeExtensionDesign.md similarity index 100% rename from ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md rename to ext/datadog_profiling_native_extension/NativeExtensionDesign.md diff --git a/ext/ddtrace_profiling_native_extension/clock_id.h b/ext/datadog_profiling_native_extension/clock_id.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/clock_id.h rename to ext/datadog_profiling_native_extension/clock_id.h diff --git a/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c b/ext/datadog_profiling_native_extension/clock_id_from_pthread.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c rename to ext/datadog_profiling_native_extension/clock_id_from_pthread.c diff --git a/ext/ddtrace_profiling_native_extension/clock_id_noop.c b/ext/datadog_profiling_native_extension/clock_id_noop.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/clock_id_noop.c rename to ext/datadog_profiling_native_extension/clock_id_noop.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c b/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c rename to ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.c b/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.c rename to ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.h b/ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.h rename to ext/datadog_profiling_native_extension/collectors_discrete_dynamic_sampler.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c b/ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c rename to ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h b/ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h rename to ext/datadog_profiling_native_extension/collectors_dynamic_sampling_rate.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c b/ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c rename to ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h b/ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h rename to ext/datadog_profiling_native_extension/collectors_gc_profiling_helper.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.c b/ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.c rename to ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.h b/ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.h rename to ext/datadog_profiling_native_extension/collectors_idle_sampling_helper.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.c b/ext/datadog_profiling_native_extension/collectors_stack.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_stack.c rename to ext/datadog_profiling_native_extension/collectors_stack.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_stack.h b/ext/datadog_profiling_native_extension/collectors_stack.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_stack.h rename to ext/datadog_profiling_native_extension/collectors_stack.h diff --git a/ext/ddtrace_profiling_native_extension/collectors_thread_context.c b/ext/datadog_profiling_native_extension/collectors_thread_context.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_thread_context.c rename to ext/datadog_profiling_native_extension/collectors_thread_context.c diff --git a/ext/ddtrace_profiling_native_extension/collectors_thread_context.h b/ext/datadog_profiling_native_extension/collectors_thread_context.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/collectors_thread_context.h rename to ext/datadog_profiling_native_extension/collectors_thread_context.h diff --git a/ext/ddtrace_profiling_native_extension/extconf.rb b/ext/datadog_profiling_native_extension/extconf.rb similarity index 95% rename from ext/ddtrace_profiling_native_extension/extconf.rb rename to ext/datadog_profiling_native_extension/extconf.rb index 14047d7089b..4f297a680aa 100644 --- a/ext/ddtrace_profiling_native_extension/extconf.rb +++ b/ext/datadog_profiling_native_extension/extconf.rb @@ -26,7 +26,7 @@ def skip_building_extension!(reason) if fail_install_if_missing_extension require 'mkmf' Logging.message( - '[ddtrace] Failure cause: ' \ + '[datadog] Failure cause: ' \ "#{Datadog::Profiling::NativeExtensionHelpers::Supported.render_skipped_reason_file(**reason)}\n" ) else @@ -43,19 +43,19 @@ def skip_building_extension!(reason) $stderr.puts( %( +------------------------------------------------------------------------------+ -| ** Preparing to build the ddtrace profiling native extension... ** | +| ** Preparing to build the datadog 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! | +| not be available, but all other datadog 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! | +| Thanks for using datadog! You rock! | +------------------------------------------------------------------------------+ ) @@ -65,9 +65,9 @@ def skip_building_extension!(reason) # that may fail on an environment not properly setup for building Ruby extensions. require 'mkmf' -Logging.message("[ddtrace] Using compiler:\n") +Logging.message("[datadog] Using compiler:\n") xsystem("#{CONFIG['CC']} -v") -Logging.message("[ddtrace] End of compiler information\n") +Logging.message("[datadog] End of compiler information\n") # mkmf on modern Rubies actually has an append_cflags that does something similar # (see https://github.com/ruby/ruby/pull/5760), but as usual we need a bit more boilerplate to deal with legacy Rubies @@ -85,7 +85,7 @@ def add_compiler_flag(flag) # Older gcc releases may not default to C99 and we need to ask for this. This is also used: # * by upstream Ruby -- search for gnu99 in the codebase -# * by msgpack, another ddtrace dependency +# * by msgpack, another datadog dependency # (https://github.com/msgpack/msgpack-ruby/blob/18ce08f6d612fe973843c366ac9a0b74c4e50599/ext/msgpack/extconf.rb#L8) add_compiler_flag '-std=gnu99' @@ -205,11 +205,11 @@ def add_compiler_flag(flag) # 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") +Logging.message("[datadog] PKG_CONFIG_PATH set to #{ENV['PKG_CONFIG_PATH'].inspect}\n") $stderr.puts("Using libdatadog #{Libdatadog::VERSION} from #{Libdatadog.pkgconfig_folder}") unless pkg_config('datadog_profiling_with_rpath') - Logging.message("[ddtrace] Ruby detected the pkg-config command is #{$PKGCONFIG.inspect}\n") + Logging.message("[datadog] Ruby detected the pkg-config command is #{$PKGCONFIG.inspect}\n") skip_building_extension!( if Datadog::Profiling::NativeExtensionHelpers::Supported.pkg_config_missing? @@ -231,13 +231,13 @@ def add_compiler_flag(flag) $LDFLAGS += \ ' -Wl,-rpath,$$$\\\\{ORIGIN\\}/' \ "#{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("[datadog] 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. # When requiring, we need to use the exact same string, including the version and the platform. -EXTENSION_NAME = "ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze +EXTENSION_NAME = "datadog_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}".freeze if Datadog::Profiling::NativeExtensionHelpers::CAN_USE_MJIT_HEADER mjit_header_file_name = "rb_mjit_min_header-#{RUBY_VERSION}.h" diff --git a/ext/ddtrace_profiling_native_extension/heap_recorder.c b/ext/datadog_profiling_native_extension/heap_recorder.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/heap_recorder.c rename to ext/datadog_profiling_native_extension/heap_recorder.c diff --git a/ext/ddtrace_profiling_native_extension/heap_recorder.h b/ext/datadog_profiling_native_extension/heap_recorder.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/heap_recorder.h rename to ext/datadog_profiling_native_extension/heap_recorder.h diff --git a/ext/ddtrace_profiling_native_extension/helpers.h b/ext/datadog_profiling_native_extension/helpers.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/helpers.h rename to ext/datadog_profiling_native_extension/helpers.h diff --git a/ext/ddtrace_profiling_native_extension/http_transport.c b/ext/datadog_profiling_native_extension/http_transport.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/http_transport.c rename to ext/datadog_profiling_native_extension/http_transport.c diff --git a/ext/ddtrace_profiling_native_extension/libdatadog_helpers.c b/ext/datadog_profiling_native_extension/libdatadog_helpers.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/libdatadog_helpers.c rename to ext/datadog_profiling_native_extension/libdatadog_helpers.c diff --git a/ext/ddtrace_profiling_native_extension/libdatadog_helpers.h b/ext/datadog_profiling_native_extension/libdatadog_helpers.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/libdatadog_helpers.h rename to ext/datadog_profiling_native_extension/libdatadog_helpers.h diff --git a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb b/ext/datadog_profiling_native_extension/native_extension_helpers.rb similarity index 97% rename from ext/ddtrace_profiling_native_extension/native_extension_helpers.rb rename to ext/datadog_profiling_native_extension/native_extension_helpers.rb index c8df9c23051..46930473751 100644 --- a/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +++ b/ext/datadog_profiling_native_extension/native_extension_helpers.rb @@ -21,7 +21,7 @@ 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 + # Used as an workaround for a limitation with how dynamic linking works in environments where datadog and # 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 @@ -29,12 +29,12 @@ def self.fail_install_if_missing_extension? # 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`. + # Linux: e.g. `readelf -d datadog_profiling_native_extension.2.7.3_x86_64-linux.so`. # - # In older versions of ddtrace, we only set as runpath an absolute path to libdatadog. + # In older versions of datadog, we only set as runpath an absolute path to libdatadog. # (This gets set automatically by the call # to `pkg_config('datadog_profiling_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. + # moved from the folder it was present at datadog 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 @@ -107,7 +107,7 @@ def self.failure_banner_for(reason:, suggested:, fail_install:) else [ 'The Datadog Continuous Profiler will not be available,', - 'but all other ddtrace features will work fine!', + 'but all other datadog features will work fine!', ] end @@ -213,7 +213,7 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global private_class_method def self.on_truffleruby? truffleruby_not_supported = explain_issue( - 'TruffleRuby is not supported by the ddtrace gem.', + 'TruffleRuby is not supported by the datadog gem.', suggested: GET_IN_TOUCH, ) @@ -221,7 +221,7 @@ def self.pkg_config_missing?(command: $PKGCONFIG) # rubocop:disable Style/Global end # See https://docs.datadoghq.com/tracing/setup_overview/setup/ruby/#microsoft-windows-support for current - # state of Windows support in ddtrace. + # state of Windows support in datadog. private_class_method def self.on_windows? windows_not_supported = explain_issue( 'Microsoft Windows is not supported by the Datadog Continuous Profiler.', diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.c b/ext/datadog_profiling_native_extension/private_vm_api_access.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/private_vm_api_access.c rename to ext/datadog_profiling_native_extension/private_vm_api_access.c diff --git a/ext/ddtrace_profiling_native_extension/private_vm_api_access.h b/ext/datadog_profiling_native_extension/private_vm_api_access.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/private_vm_api_access.h rename to ext/datadog_profiling_native_extension/private_vm_api_access.h diff --git a/ext/ddtrace_profiling_native_extension/profiling.c b/ext/datadog_profiling_native_extension/profiling.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/profiling.c rename to ext/datadog_profiling_native_extension/profiling.c diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.c b/ext/datadog_profiling_native_extension/ruby_helpers.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/ruby_helpers.c rename to ext/datadog_profiling_native_extension/ruby_helpers.c diff --git a/ext/ddtrace_profiling_native_extension/ruby_helpers.h b/ext/datadog_profiling_native_extension/ruby_helpers.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/ruby_helpers.h rename to ext/datadog_profiling_native_extension/ruby_helpers.h diff --git a/ext/ddtrace_profiling_native_extension/setup_signal_handler.c b/ext/datadog_profiling_native_extension/setup_signal_handler.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/setup_signal_handler.c rename to ext/datadog_profiling_native_extension/setup_signal_handler.c diff --git a/ext/ddtrace_profiling_native_extension/setup_signal_handler.h b/ext/datadog_profiling_native_extension/setup_signal_handler.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/setup_signal_handler.h rename to ext/datadog_profiling_native_extension/setup_signal_handler.h diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.c b/ext/datadog_profiling_native_extension/stack_recorder.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/stack_recorder.c rename to ext/datadog_profiling_native_extension/stack_recorder.c diff --git a/ext/ddtrace_profiling_native_extension/stack_recorder.h b/ext/datadog_profiling_native_extension/stack_recorder.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/stack_recorder.h rename to ext/datadog_profiling_native_extension/stack_recorder.h diff --git a/ext/ddtrace_profiling_native_extension/time_helpers.c b/ext/datadog_profiling_native_extension/time_helpers.c similarity index 100% rename from ext/ddtrace_profiling_native_extension/time_helpers.c rename to ext/datadog_profiling_native_extension/time_helpers.c diff --git a/ext/ddtrace_profiling_native_extension/time_helpers.h b/ext/datadog_profiling_native_extension/time_helpers.h similarity index 100% rename from ext/ddtrace_profiling_native_extension/time_helpers.h rename to ext/datadog_profiling_native_extension/time_helpers.h diff --git a/integration/apps/hanami/bin/run b/integration/apps/hanami/bin/run index bfdd18c2a1a..d17b526043e 100755 --- a/integration/apps/hanami/bin/run +++ b/integration/apps/hanami/bin/run @@ -7,13 +7,13 @@ 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/opentelemetry/bin/run b/integration/apps/opentelemetry/bin/run index 007be985b49..49679a3aaf5 100755 --- a/integration/apps/opentelemetry/bin/run +++ b/integration/apps/opentelemetry/bin/run @@ -3,7 +3,7 @@ # Start application process puts "\n== Starting application process ==" -profiling = Datadog::DemoEnv.feature?('profiling') ? 'DD_PROFILING_ENABLED=true ddtracerb exec ' : '' +profiling = Datadog::DemoEnv.feature?('profiling') ? 'DD_PROFILING_ENABLED=true ddprofrb exec ' : '' process = (ARGV[0] || Datadog::DemoEnv.process) command = case process when 'main' diff --git a/integration/apps/rack/bin/resque b/integration/apps/rack/bin/resque index eb57bd131d6..4607f3ada34 100755 --- a/integration/apps/rack/bin/resque +++ b/integration/apps/rack/bin/resque @@ -2,7 +2,7 @@ puts "\n== Starting resque process ==" -command = "QUEUE=resque_testing bundle exec ddtracerb exec rake resque:work" +command = "QUEUE=resque_testing bundle exec ddprofrb exec rake resque:work" puts "Run: #{command}" Kernel.exec(command) diff --git a/integration/apps/rack/bin/run b/integration/apps/rack/bin/run index ad65136ea2e..891c4ded8cb 100755 --- a/integration/apps/rack/bin/run +++ b/integration/apps/rack/bin/run @@ -7,15 +7,15 @@ 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when 'passenger' - "bundle exec ddtracerb exec passenger start --port 80 -R /app/config.ru" + "bundle exec ddprofrb exec passenger start --port 80 -R /app/config.ru" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/rack/bin/sidekiq b/integration/apps/rack/bin/sidekiq index be651aa87db..fbd66390cda 100755 --- a/integration/apps/rack/bin/sidekiq +++ b/integration/apps/rack/bin/sidekiq @@ -2,7 +2,7 @@ puts "\n== Starting sidekiq process ==" -command = "bundle exec ddtracerb exec sidekiq -r ./app/sidekiq_background_job.rb" +command = "bundle exec ddprofrb exec sidekiq -r ./app/sidekiq_background_job.rb" puts "Run: #{command}" Kernel.exec(command) diff --git a/integration/apps/rails-five/bin/run b/integration/apps/rails-five/bin/run index c5642d7d204..c0c594994c7 100755 --- a/integration/apps/rails-five/bin/run +++ b/integration/apps/rails-five/bin/run @@ -8,13 +8,13 @@ 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" + "bundle exec ddprofrb exec puma -C /app/config/puma.rb" when 'unicorn' - "bundle exec ddtracerb exec unicorn -c /app/config/unicorn.rb" + "bundle exec ddprofrb exec unicorn -c /app/config/unicorn.rb" when 'console' - "bundle exec ddtracerb exec rails c" + "bundle exec ddprofrb exec rails c" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/rails-seven/bin/run b/integration/apps/rails-seven/bin/run index c5642d7d204..c0c594994c7 100755 --- a/integration/apps/rails-seven/bin/run +++ b/integration/apps/rails-seven/bin/run @@ -8,13 +8,13 @@ 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" + "bundle exec ddprofrb exec puma -C /app/config/puma.rb" when 'unicorn' - "bundle exec ddtracerb exec unicorn -c /app/config/unicorn.rb" + "bundle exec ddprofrb exec unicorn -c /app/config/unicorn.rb" when 'console' - "bundle exec ddtracerb exec rails c" + "bundle exec ddprofrb exec rails c" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/rails-six/bin/run b/integration/apps/rails-six/bin/run index c5642d7d204..c0c594994c7 100755 --- a/integration/apps/rails-six/bin/run +++ b/integration/apps/rails-six/bin/run @@ -8,13 +8,13 @@ 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" + "bundle exec ddprofrb exec puma -C /app/config/puma.rb" when 'unicorn' - "bundle exec ddtracerb exec unicorn -c /app/config/unicorn.rb" + "bundle exec ddprofrb exec unicorn -c /app/config/unicorn.rb" when 'console' - "bundle exec ddtracerb exec rails c" + "bundle exec ddprofrb exec rails c" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/rspec/bin/run b/integration/apps/rspec/bin/run index 19f7d7428b8..0a399654a7c 100755 --- a/integration/apps/rspec/bin/run +++ b/integration/apps/rspec/bin/run @@ -3,7 +3,7 @@ # Start application process puts "\n== Starting application process ==" -profiling = Datadog::DemoEnv.feature?('profiling') ? 'DD_PROFILING_ENABLED=true ddtracerb exec ' : '' +profiling = Datadog::DemoEnv.feature?('profiling') ? 'DD_PROFILING_ENABLED=true ddprofrb exec ' : '' process = (ARGV[0] || Datadog::DemoEnv.process) command = case process when 'rspec' diff --git a/integration/apps/sinatra2-classic/bin/run b/integration/apps/sinatra2-classic/bin/run index bfdd18c2a1a..d17b526043e 100755 --- a/integration/apps/sinatra2-classic/bin/run +++ b/integration/apps/sinatra2-classic/bin/run @@ -7,13 +7,13 @@ 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/integration/apps/sinatra2-modular/bin/run b/integration/apps/sinatra2-modular/bin/run index bfdd18c2a1a..d17b526043e 100755 --- a/integration/apps/sinatra2-modular/bin/run +++ b/integration/apps/sinatra2-modular/bin/run @@ -7,13 +7,13 @@ 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb 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" + "bundle exec ddprofrb exec rackup -s webrick -o 0.0.0.0 -p 80 /app/config.ru" when 'irb' - "bundle exec ddtracerb exec irb" + "bundle exec ddprofrb exec irb" when nil, '' abort("\n== ERROR: Must specify a application process! ==") else diff --git a/lib/datadog/profiling.rb b/lib/datadog/profiling.rb index 41a1b25a860..8493ec43da4 100644 --- a/lib/datadog/profiling.rb +++ b/lib/datadog/profiling.rb @@ -79,7 +79,7 @@ def self.allocation_count # rubocop:disable Lint/NestedMethodDefinition (On purp private_class_method def self.try_reading_skipped_reason_file(file_api = File) # This file, if it exists, is recorded by extconf.rb during compilation of the native extension - skipped_reason_file = "#{__dir__}/../../ext/ddtrace_profiling_native_extension/skipped_reason.txt" + skipped_reason_file = "#{__dir__}/../../ext/datadog_profiling_native_extension/skipped_reason.txt" begin return unless file_api.exist?(skipped_reason_file) diff --git a/lib/datadog/profiling/load_native_extension.rb b/lib/datadog/profiling/load_native_extension.rb index d9655acb121..cfda56ff192 100644 --- a/lib/datadog/profiling/load_native_extension.rb +++ b/lib/datadog/profiling/load_native_extension.rb @@ -2,24 +2,24 @@ # This file is used to load the profiling native extension. It works in two steps: # -# 1. Load the ddtrace_profiling_loader extension. This extension will be used to load the actual extension, but in -# a special way that avoids exposing native-level code symbols. See `ddtrace_profiling_loader.c` for more details. +# 1. Load the datadog_profiling_loader extension. This extension will be used to load the actual extension, but in +# a special way that avoids exposing native-level code symbols. See `datadog_profiling_loader.c` for more details. # -# 2. Use the Datadog::Profiling::Loader exposed by the ddtrace_profiling_loader extension to load the actual +# 2. Use the Datadog::Profiling::Loader exposed by the datadog_profiling_loader extension to load the actual # profiling native extension. # # All code on this file is on-purpose at the top-level; this makes it so this file is executed only once, # the first time it gets required, to avoid any issues with the native extension being initialized more than once. begin - require "ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}" + require "datadog_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}" rescue LoadError => e raise LoadError, 'Failed to load the profiling loader extension. To fix this, please remove and then reinstall datadog ' \ "(Details: #{e.message})" end -extension_name = "ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}" +extension_name = "datadog_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}" full_file_path = "#{__dir__}/../../#{extension_name}.#{RbConfig::CONFIG['DLEXT']}" init_function_name = "Init_#{extension_name.split('.').first}" diff --git a/lib/datadog/profiling/native_extension.rb b/lib/datadog/profiling/native_extension.rb index 203c4f83904..43c21a7ae9e 100644 --- a/lib/datadog/profiling/native_extension.rb +++ b/lib/datadog/profiling/native_extension.rb @@ -3,7 +3,7 @@ module Datadog module Profiling # This module contains classes and methods which are implemented using native code in the - # ext/ddtrace_profiling_native_extension folder, as well as some Ruby-level utilities that don't make sense to + # ext/datadog_profiling_native_extension folder, as well as some Ruby-level utilities that don't make sense to # write using C module NativeExtension private_class_method def self.working? diff --git a/lib/datadog/profiling/tasks/exec.rb b/lib/datadog/profiling/tasks/exec.rb index 6502d431292..d8cdc74a13f 100644 --- a/lib/datadog/profiling/tasks/exec.rb +++ b/lib/datadog/profiling/tasks/exec.rb @@ -38,10 +38,10 @@ def set_rubyopt! def exec_with_error_handling(args) Kernel.exec(*args) rescue Errno::ENOENT => e - Kernel.warn "ddtracerb exec failed: #{e.class.name} #{e.message} (command was '#{args.join(' ')}')" + Kernel.warn "ddprofrb exec failed: #{e.class.name} #{e.message} (command was '#{args.join(' ')}')" Kernel.exit 127 rescue Errno::EACCES, Errno::ENOEXEC => e - Kernel.warn "ddtracerb exec failed: #{e.class.name} #{e.message} (command was '#{args.join(' ')}')" + Kernel.warn "ddprofrb exec failed: #{e.class.name} #{e.message} (command was '#{args.join(' ')}')" Kernel.exit 126 end end diff --git a/lib/datadog/profiling/tasks/help.rb b/lib/datadog/profiling/tasks/help.rb index 495f4bc3b64..887835b27a9 100644 --- a/lib/datadog/profiling/tasks/help.rb +++ b/lib/datadog/profiling/tasks/help.rb @@ -3,12 +3,12 @@ module Datadog module Profiling module Tasks - # Prints help message for usage of `ddtrace` + # Prints help message for usage of `ddprofrb` class Help def run puts %( - Usage: ddtracerb [command] [arguments] - exec [command]: Executes command with tracing & profiling preloaded. + Usage: ddprofrb [command] [arguments] + exec [command]: Executes command with profiling preloaded. help: Prints this help message. ) end diff --git a/lib/datadog/tracing/contrib/faraday/connection.rb b/lib/datadog/tracing/contrib/faraday/connection.rb index 12c4ca2117c..1b3fbd470be 100644 --- a/lib/datadog/tracing/contrib/faraday/connection.rb +++ b/lib/datadog/tracing/contrib/faraday/connection.rb @@ -12,7 +12,7 @@ module Faraday module Connection def initialize(*args, &block) super.tap do - use(:ddtrace) unless builder.handlers.any? { |h| h.klass == Middleware } + use(:datadog) unless builder.handlers.any? { |h| h.klass == Middleware } end end end diff --git a/lib/datadog/tracing/contrib/faraday/patcher.rb b/lib/datadog/tracing/contrib/faraday/patcher.rb index f69c501640f..8af9722366b 100644 --- a/lib/datadog/tracing/contrib/faraday/patcher.rb +++ b/lib/datadog/tracing/contrib/faraday/patcher.rb @@ -27,13 +27,13 @@ def patch end def register_middleware! - ::Faraday::Middleware.register_middleware(ddtrace: Middleware) + ::Faraday::Middleware.register_middleware(datadog: Middleware) end def add_default_middleware! if target_version >= Gem::Version.new('1.0.0') # Patch the default connection (e.g. +Faraday.get+) - ::Faraday.default_connection.use(:ddtrace) + ::Faraday.default_connection.use(:datadog) # Patch new connection instances (e.g. +Faraday.new+) ::Faraday::Connection.prepend(Connection) diff --git a/lib/datadog/tracing/contrib/faraday/rack_builder.rb b/lib/datadog/tracing/contrib/faraday/rack_builder.rb index 22a0b8686fd..134e8e2168d 100644 --- a/lib/datadog/tracing/contrib/faraday/rack_builder.rb +++ b/lib/datadog/tracing/contrib/faraday/rack_builder.rb @@ -11,7 +11,7 @@ module Faraday # https://github.com/lostisland/faraday/commit/77d7546d6d626b91086f427c56bc2cdd951353b3 module RackBuilder def adapter(*args) - use(:ddtrace) unless @handlers.any? { |h| h.klass == Middleware } + use(:datadog) unless @handlers.any? { |h| h.klass == Middleware } super end diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index a8c94c4b598..186ca7bb64a 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -1,4 +1,4 @@ -require 'ext/ddtrace_profiling_native_extension/native_extension_helpers' +require 'ext/datadog_profiling_native_extension/native_extension_helpers' require 'libdatadog' require 'datadog/profiling/spec_helper' diff --git a/spec/datadog/profiling/tasks/exec_spec.rb b/spec/datadog/profiling/tasks/exec_spec.rb index c59f51212bb..15985e72272 100644 --- a/spec/datadog/profiling/tasks/exec_spec.rb +++ b/spec/datadog/profiling/tasks/exec_spec.rb @@ -84,7 +84,7 @@ it 'logs an error message' do expect(Kernel).to receive(:warn) do |message| - expect(message).to include('ddtracerb exec failed') + expect(message).to include('ddprofrb exec failed') end run @@ -106,7 +106,7 @@ it 'logs an error message' do expect(Kernel).to receive(:warn) do |message| - expect(message).to include('ddtracerb exec failed') + expect(message).to include('ddprofrb exec failed') end run diff --git a/spec/datadog/profiling/tasks/help_spec.rb b/spec/datadog/profiling/tasks/help_spec.rb index d8303a9aa64..6cf88b336ab 100644 --- a/spec/datadog/profiling/tasks/help_spec.rb +++ b/spec/datadog/profiling/tasks/help_spec.rb @@ -7,7 +7,7 @@ describe '#run' do it 'prints a help message to stdout' do expect($stdout).to receive(:puts) do |message| - expect(message).to include('Usage: ddtrace') + expect(message).to include('Usage: ddprofrb') end task.run diff --git a/spec/datadog/profiling_spec.rb b/spec/datadog/profiling_spec.rb index 4d94520925c..0ea48cbcf08 100644 --- a/spec/datadog/profiling_spec.rb +++ b/spec/datadog/profiling_spec.rb @@ -209,7 +209,7 @@ let(:read) { '' } it 'tries to read the skipped_reason.txt file in the native extension folder' do - expected_path = File.expand_path('../../ext/ddtrace_profiling_native_extension/skipped_reason.txt', __dir__) + expected_path = File.expand_path('../../ext/datadog_profiling_native_extension/skipped_reason.txt', __dir__) expect(file_api).to receive(:exist?) do |path| expect(File.expand_path(path)).to eq expected_path diff --git a/spec/datadog/tracing/contrib/faraday/middleware_spec.rb b/spec/datadog/tracing/contrib/faraday/middleware_spec.rb index 86ad6a3ae62..f3b9c4a3a53 100644 --- a/spec/datadog/tracing/contrib/faraday/middleware_spec.rb +++ b/spec/datadog/tracing/contrib/faraday/middleware_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Faraday middleware' do let(:client) do ::Faraday.new('http://example.com') do |builder| - builder.use(:ddtrace, middleware_options) if use_middleware + builder.use(:datadog, middleware_options) if use_middleware builder.adapter(:test) do |stub| stub.get('/success') { |_| [200, response_headers, 'OK'] } stub.post('/failure') { |_| [500, {}, 'Boom!'] }