Class: Datadog::Profiling::Tasks::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/ddtrace/profiling/tasks/setup.rb

Overview

Takes care of loading our extensions/monkey patches to handle fork() and CPU profiling.

Constant Summary collapse

ACTIVATE_EXTENSIONS_ONLY_ONCE =
Datadog::Utils::OnlyOnce.new

Instance Method Summary collapse

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ddtrace/profiling/tasks/setup.rb', line 15

def run
  ACTIVATE_EXTENSIONS_ONLY_ONCE.run do
    begin
      activate_forking_extensions
      activate_cpu_extensions
      setup_at_fork_hooks
    rescue StandardError, ScriptError => e
      Datadog.logger.warn do
        "Profiler extensions unavailable. Cause: #{e.message} Location: #{Array(e.backtrace).first}"
      end
    end
  end
end