Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petethepig committed Sep 7, 2022
1 parent 67400c9 commit 85a5746
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyroscope_ffi/ruby/lib/pyroscope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ module Utils
attach_function :thread_id, [], :uint64
end

class Engine < Rails::Engine
config.after_initialize do
next unless ::Pyroscope.current_config && ::Pyroscope.current_config.autoinstrument_rails
if defined?(::Rails::Engine)
class Engine < ::Rails::Engine
config.after_initialize do
next unless ::Pyroscope.current_config && ::Pyroscope.current_config.autoinstrument_rails

::Pyroscope.initialize_rails_hooks
::Pyroscope.initialize_rails_hooks
end
end
end

Expand Down

0 comments on commit 85a5746

Please sign in to comment.