module BuilderApm class Engine < ::Rails::Engine isolate_namespace BuilderApm initializer 'builder_apm.start' do |app| BuilderApm::Controllers::Instrumenter.new.start if BuilderApm.configuration.enable_controller_profiler BuilderApm::Models::Instrumenter.start if BuilderApm.configuration.enable_active_record_profiler BuilderApm::Methods::Instrumenter.new.start if BuilderApm.configuration.enable_methods_profiler end config.after_initialize do Rails.application.routes.append do mount BuilderApm::Engine => '/builder_apm' end end end end